|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.Plugin
org.eclipse.ui.plugin.AbstractUIPlugin
de.cau.cs.kieler.sim.kiem.KiemPlugin
public class KiemPlugin
This activator class controls the life cycle of the KiemPlugin. It also provides the access to the one and only instance of this class and hence a way to access the execution thread. For the execution thread it allows to access the KiemView for updating or refreshing the table or the step information text field.
Field Summary | |
---|---|
static int |
AIMED_STEP_DURATION_DEFAULT
The Constant AIMED_STEP_DURATION_DEFAULT. |
static String |
AIMED_STEP_DURATION_ID
The identifier for the aimed step duration. |
static int |
AIMED_STEP_DURATION_MAX
The Constant AIMED_STEP_DURATION_MAX. |
static int |
AIMED_STEP_DURATION_MIN
The Constant AIMED_STEP_DURATION_MIN. |
static boolean |
DEBUG
The Constant DEBUG. |
static String |
PLUGIN_ID
The Constant PLUGIN_ID. |
static int |
SLEEPTIME
The Constant SLEEPTIME for a sync method spinlock. |
static String |
TIMEOUT_ID
The identifier for the timeout. |
Fields inherited from class org.eclipse.core.runtime.Plugin |
---|
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME |
Constructor Summary | |
---|---|
KiemPlugin()
The constructor if the KIEM plug-in. |
Method Summary | |
---|---|
DataComponentWrapper |
addTodataComponentWrapperList(AbstractDataComponent component)
Add a DataComponent instance to the dataComponentWrapperList . |
void |
cancelInitialization()
Cancel the initialization. |
void |
checkForSingleEnabledMaster(boolean silent)
Check for single enabled master. |
void |
checkForSingleEnabledMaster(boolean silent,
DataComponentWrapper dataComponentWrapper)
Check the current selection (enabled DataComponentWrappers) for a just a single enabled master. |
void |
clearDataComponentWrapperList()
Safely clear DataComponentWrapperList and call DataComponent destructors. |
void |
doSave(IProgressMonitor monitor,
Shell parentShellParam)
Do save method that can be called from outside (e.g., a user interface view). |
void |
doSaveAs(Shell parentShellParam)
Do save as method that can be called from outside (e.g., a user interface view). |
String |
getActiveProjectName()
Gets the file name (without possible extension) of the currently opened file, if any, or "noname" otherwise. |
int |
getAimedStepDuration()
Gets the currently set aimed step duration. |
Boolean |
getBooleanValueFromProviders(String propertyId)
Get a new property value from one of the configuration providers. |
IPath |
getCurrentFile()
Gets the current file. |
DataComponentWrapper |
getCurrentMaster()
Gets the current master. |
List<DataComponentWrapper> |
getDataComponentWrapperList()
Returns the current DataComponentWrapper-List that is held by the KIEM plug-in directly. |
static KiemPlugin |
getDefault()
Returns the shared instance of the KIEM plug-in. |
List<DataComponentWrapper> |
getDefaultComponentWrapperList()
Returns the default ComponentWrapperList. |
EventManager |
getEventManager()
Gets the single EventManager that handles notification of DataComponents when KiemEvents occur. |
Execution |
getExecution()
Gets the execution. |
InitializeExecution |
getInitializeExecution()
Gets the initialize execution. |
Integer |
getIntegerValueFromProviders(String propertyId)
Get a new property value from one of the configuration providers. |
String |
getPropertyValueFromProviders(String propertyId)
Get a new property value from one of the configuration providers. |
List<AbstractDataComponent> |
getRegisteredDataComponentList()
This initializes the DataComponentList with all registered and loaded plug-ins that extend the following two extension points: - JSONObjectDataComponent - JSONStringDataComponent If a DataComponent is registered but cannot be instantiated because of an error this will result in a warning only so that all other fully functional DataComponents are still loaded. |
static void |
handleComponentError(AbstractDataComponent dataComponent,
Exception exception)
This method handles errors or warnings within the execution of DataComponents. |
boolean |
initExecution()
Initializes the Execution. |
boolean |
isDirty()
Checks whether dirty flag is true. |
boolean |
isInitializingExecution()
Checks whether the execution is currently initializing. |
void |
notifyConfigurationProviders(String propertyId,
String value)
Notify all configuration providers that a property in the currently loaded configuration has changed. |
void |
openFile(IEditorInput editorInput)
Opens an Execution File (*.execution) and tries to update the dataComponentWrapperList according to this file. |
void |
openFile(IPath executionFile,
boolean readOnly)
Opens an Execution File (*.execution) and tries to update the dataComponentWrapperList according to this file. |
void |
openFile(IPath executionFile,
String pluginID,
boolean readOnly)
Opens an Execution File (*.execution) and tries to update the dataComponentWrapperList according to this file. |
int |
promptToSaveOnClose(Shell parentShellParam)
Prompt to save on close if the current file was modified (is dirty). |
void |
setAimedStepDuration(int aimedStepDurationi)
Sets the aimed step duration. |
void |
setCurrentFile(IPath currentFileParam)
Sets the current file. |
void |
setDirty(boolean isDirtyParam)
Sets the dirty flag. |
void |
setExecution(Execution executionParam)
Sets the execution. |
void |
setShell(Shell parentShellParam)
Sets the parent shell that KIEM shoudl use to display user dialogs. |
void |
showError(String textMessage,
String pluginID,
Exception exception,
boolean silent)
Shows an error dialog using the StatusAdapter. |
void |
showWarning(String textMessage,
String pluginID,
Exception exception,
boolean silent)
Shows a warning dialog using the StatusAdapter. |
void |
start(org.osgi.framework.BundleContext context)
|
void |
stop(org.osgi.framework.BundleContext context)
|
void |
updateEventManager()
Update event manager's DataComponentWrapper list. |
void |
updateViewAsync()
Updates the view of the KiemView table asynchronously. |
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 |
---|
public static final boolean DEBUG
public static final int AIMED_STEP_DURATION_DEFAULT
public static final int AIMED_STEP_DURATION_MIN
public static final int AIMED_STEP_DURATION_MAX
public static final String PLUGIN_ID
public static final String AIMED_STEP_DURATION_ID
public static final String TIMEOUT_ID
public static final int SLEEPTIME
Constructor Detail |
---|
public KiemPlugin()
getDefaultComponentWrapperList()
). The execution is null by default. The KIEMViewInstance is set, in the constructor of the.
KiemView
Method Detail |
---|
public void setShell(Shell parentShellParam)
parentShellParam
- the new shellpublic void updateEventManager()
public Execution getExecution()
public void setExecution(Execution executionParam)
executionParam
- the execution parampublic void start(org.osgi.framework.BundleContext context) throws Exception
start
in interface org.osgi.framework.BundleActivator
start
in class AbstractUIPlugin
Exception
public void stop(org.osgi.framework.BundleContext context) throws Exception
stop
in interface org.osgi.framework.BundleActivator
stop
in class AbstractUIPlugin
Exception
public static KiemPlugin getDefault()
public void openFile(IPath executionFile, String pluginID, boolean readOnly) throws IOException
executionFile
- the execution file to openpluginID
- the id of the plugin where the file is locatedreadOnly
- the readonly flag indicates that the file is locked for writing
IOException
- if the file was not foundpublic void openFile(IEditorInput editorInput) throws IOException
editorInput
- the file editor input to open
IOException
public void openFile(IPath executionFile, boolean readOnly) throws IOException
executionFile
- the execution file to openreadOnly
- the readonly flag indicates that the file is locked for writing
IOException
- if the file was not foundpublic String getActiveProjectName()
public void setCurrentFile(IPath currentFileParam)
currentFileParam
- the new currently opened filepublic int promptToSaveOnClose(Shell parentShellParam)
parentShellParam
- the parent shell
public IPath getCurrentFile()
public DataComponentWrapper getCurrentMaster()
public void checkForSingleEnabledMaster(boolean silent)
checkForSingleEnabledMaster(boolean, DataComponentWrapper)
.
silent
- if true, the warning dialog will be suppressedpublic void checkForSingleEnabledMaster(boolean silent, DataComponentWrapper dataComponentWrapper)
silent
- if true, the warning dialog will be suppresseddataComponentWrapper
- the DataComponentWrapper that is allowed to be the master or nullpublic void notifyConfigurationProviders(String propertyId, String value)
propertyId
- the id of the property.value
- the value of the property.public String getPropertyValueFromProviders(String propertyId)
propertyId
- the id of the property to look for
public Integer getIntegerValueFromProviders(String propertyId)
propertyId
- the id of the property to look for
public Boolean getBooleanValueFromProviders(String propertyId)
propertyId
- the id of the property to look for
public void updateViewAsync()
public int getAimedStepDuration()
public void setAimedStepDuration(int aimedStepDurationi)
aimedStepDurationi
- the new aimed step durationpublic List<AbstractDataComponent> getRegisteredDataComponentList()
JSONObjectDataComponent
JSONStringDataComponent
public void doSave(IProgressMonitor monitor, Shell parentShellParam)
monitor
- the monitorparentShellParam
- the parent shellpublic void doSaveAs(Shell parentShellParam)
parentShellParam
- the parent shell to open the save dialog inpublic boolean isDirty()
public void setDirty(boolean isDirtyParam)
isDirtyParam
- the new dirtypublic void cancelInitialization()
public boolean isInitializingExecution()
public InitializeExecution getInitializeExecution()
public boolean initExecution()
execution
is not null.
public DataComponentWrapper addTodataComponentWrapperList(AbstractDataComponent component)
dataComponentWrapperList
. This will clone the
DataComponent and add an executable extension. It then creates a new DataComponentWrapper
instance that encapsulates the just created DataComponent (and offers additional information
and methods). The latter will be added then to the DataComponentList.
component
- the component
public List<DataComponentWrapper> getDefaultComponentWrapperList()
JSONObjectDataComponent
JSONStringDataComponent
public void clearDataComponentWrapperList()
public List<DataComponentWrapper> getDataComponentWrapperList()
JSONObjectDataComponent
JSONStringDataComponent
public static void handleComponentError(AbstractDataComponent dataComponent, Exception exception)
KiemExecutionException
KiemExecutionException
Execution.errorTerminate()
method. But there is
no guarantee that they really stop. The links to these threads will be cut down, so that
there is the possibility of zombie threads.
dataComponent
- the DataComponent that caused the error or warningexception
- the Exception if any, or nullpublic EventManager getEventManager()
public void showWarning(String textMessage, String pluginID, Exception exception, boolean silent)
textMessage
- the text messagepluginID
- the plug-in idexception
- the exceptionsilent
- the silent tag indicates that only logging occurs, no message dialog is displayedpublic void showError(String textMessage, String pluginID, Exception exception, boolean silent)
textMessage
- the optional text messagepluginID
- the plug-in idexception
- the exception if any, null otherwisesilent
- the silent tag indicates that only logging occurs, no message dialog is displayed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |