de.cau.cs.kieler.sim.validator
Class ValidatorPlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by de.cau.cs.kieler.sim.validator.ValidatorPlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class ValidatorPlugin
extends AbstractUIPlugin

The activator class controls the plug-in life cycle.

Rating red

Field Summary
static String PLUGIN_ID
          The Constant PLUGIN_ID.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
ValidatorPlugin()
          The constructor of the validator plugin.
 
Method Summary
static boolean existsInputFileWithExtension(String extension, int fileIndex)
          Exists input file with extension.
static ValidatorPlugin getDefault()
          Returns the shared instance.
static org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor getEditor(String kiemEditorProperty)
          Gets the editor.
static String getEditorProperty()
          Gets the reditorProperty.
static org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor getInputEditor()
           
static String getInputModel()
          Gets the input model.
static EObject getInputModelEObject(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor diagramEditor)
          Gets the input model e object.
static ResourceSet getInputResourceSet()
          Gets the input resource set.
static boolean getTrainingModeProperty()
          Gets the training mode property.
static boolean isAsked()
          Checks whether asked is true.
static InputStream openInputFile(String fileString)
          Open input file.
static InputStream openInputFileWithExtension(String extension, int fileIndex)
          Open input file with extension.
static OutputStream openOutputFile(String fileString)
          Open output file.
static OutputStream openOutputFileWithExtension(String extension)
           
static KiemProperty[] provideProperties()
          Provide properties.
static void setAsked(boolean askedParam)
          Sets the asked.
static void setEditorProperty(String editorPropertyParam)
          Sets the editor property.
static void setTrainingModeProperty(boolean trainingModeParam)
          Sets the training mode property.
static JSONObject sort(JSONObject jSONObject)
          Sort.
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final String PLUGIN_ID
The Constant PLUGIN_ID.

See Also:
Constant Field Values
Constructor Detail

ValidatorPlugin

public ValidatorPlugin()
The constructor of the validator plugin.

Method Detail

isAsked

public static boolean isAsked()
Checks whether asked is true.

Returns:
true, if is asked

setAsked

public static void setAsked(boolean askedParam)
Sets the asked.

Parameters:
askedParam - the new asked

getEditorProperty

public static String getEditorProperty()
Gets the reditorProperty.

Returns:
the editor property

setEditorProperty

public static void setEditorProperty(String editorPropertyParam)
Sets the editor property.

Parameters:
editorPropertyParam - the new editor property

getTrainingModeProperty

public static boolean getTrainingModeProperty()
Gets the training mode property.

Returns:
the training mode property

setTrainingModeProperty

public static void setTrainingModeProperty(boolean trainingModeParam)
Sets the training mode property.

Parameters:
trainingModeParam - the new training mode property

start

public void start(org.osgi.framework.BundleContext context)
           throws Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class AbstractUIPlugin
Throws:
Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class AbstractUIPlugin
Throws:
Exception

getDefault

public static ValidatorPlugin getDefault()
Returns the shared instance.

Returns:
the shared instance

provideProperties

public static KiemProperty[] provideProperties()
Provide properties.

Returns:
the kiem property[]

getInputEditor

public static org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor getInputEditor()

getInputModel

public static String getInputModel()
Gets the input model.

Returns:
the input model

getInputModelEObject

public static EObject getInputModelEObject(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor diagramEditor)
Gets the input model e object.

Parameters:
diagramEditor - the diagram editor
Returns:
the input model e object

getInputResourceSet

public static ResourceSet getInputResourceSet()
Gets the input resource set.

Returns:
the input resource set

getEditor

public static org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor getEditor(String kiemEditorProperty)
Gets the editor.

Parameters:
kiemEditorProperty - the kiem editor property
Returns:
the editor

openInputFile

public static InputStream openInputFile(String fileString)
                                 throws IOException
Open input file.

Parameters:
fileString - the file string
Returns:
the input stream
Throws:
IOException - Signals that an I/O exception has occurred.

openOutputFile

public static OutputStream openOutputFile(String fileString)
                                   throws IOException
Open output file.

Parameters:
fileString - the file string
Returns:
the output stream
Throws:
IOException - Signals that an I/O exception has occurred.

openOutputFileWithExtension

public static OutputStream openOutputFileWithExtension(String extension)

existsInputFileWithExtension

public static boolean existsInputFileWithExtension(String extension,
                                                   int fileIndex)
Exists input file with extension.

Parameters:
extension - the extension
fileIndex - the file index
Returns:
true, if successful

openInputFileWithExtension

public static InputStream openInputFileWithExtension(String extension,
                                                     int fileIndex)
Open input file with extension.

Parameters:
extension - the extension
fileIndex - the file index
Returns:
the input stream

sort

public static JSONObject sort(JSONObject jSONObject)
Sort.

Parameters:
jSONObject - the j son object
Returns:
the jSON object