IBM Rational Performance Tester SDK

com.ibm.rational.common.test.editor.framework
Class TestEditorPlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by com.ibm.rational.common.test.editor.framework.TestEditorPlugin
All Implemented Interfaces:
com.ibm.rational.common.test.editor.framework.kernel.interfaces.ILoggingConstants, com.ibm.rational.common.test.editor.framework.preferences.CBPreferenceConstants, ILTPlugin, com.ibm.rational.test.lt.core.logging.ILTSubComponent, EventListener, org.eclipse.hyades.test.ui.navigator.IProxyRefreshListener, IPropertyChangeListener, org.osgi.framework.BundleActivator

public class TestEditorPlugin
extends AbstractUIPlugin
implements com.ibm.rational.common.test.editor.framework.kernel.interfaces.ILoggingConstants, ILTPlugin, com.ibm.rational.common.test.editor.framework.preferences.CBPreferenceConstants, IPropertyChangeListener, org.eclipse.hyades.test.ui.navigator.IProxyRefreshListener

The main UI plug-in class.


Field Summary
static String ms_ACTIVE_EDITOR_TYPE
           
static String ms_RPT_COMMAND_CONTEXT_ID
           
static String PLUGIN_ID
           
static String PREF_FORCEWRAP_THRESHOLD
           
static String PREF_PREVIEW_LINKED
           
static String PREF_SEARCH_DECORATOR_COLOR
           
static String PREF_SEARCH_DECORATOR_TEXT
           
static String PREF_SEARCH_SAVE_TEXT
           
static String PREF_SEARCH_SAVE_TYPES
           
static String PREF_USE_ERROR_COLOR
           
static String PREF_USE_SEARCH_DECORATOR
           
static int RQM_EDITOR_MODE
           
static int USER_EDITOR_MODE
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Fields inherited from interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ILoggingConstants
RPCA0100W, RPCA0101W, RPCA0102W, RPCA0103W, RPCA0104W, RPCA0105E, RPCA0106E, RPCA0107E, RPCA0108E, RPCA0109E, RPCA0110E, RPCA1001E, RPCA1001W, RPCA1002E
 
Fields inherited from interface com.ibm.rational.common.test.editor.framework.preferences.CBPreferenceConstants
FG_DOCUMENTATION, FG_REGEX_GROUP, FG_REGEX_MATCH, PCN_DISABLED_COLOR_BG, PCN_DISABLED_COLOR_FG, PCN_DISABLED_PREFIX, PCN_DISPLAY_NESTED_COMMENTS, PCN_INFO_COLOR, PCN_INFO_COLOR_USED, PCN_RANGE_EVEN_BG, PCN_RANGE_ODD_BG, PCN_SEARCH_MATCH_BG, PCN_SEARCH_MATCH_FG
 
Constructor Summary
TestEditorPlugin()
           
 
Method Summary
 void addDependencyBuilder(com.ibm.rational.test.lt.core.utils.DelayedDependencyBuilder builder)
           
 void addDependencyBuilder(com.ibm.rational.test.lt.core.utils.DelayedDependencyBuilder builder, Thread th)
           
 void addEditorListener(IEditorStateListener listener)
          Adds specified IEditorStateListener to list of listeners.
static void cacheSyncPointName(String name)
           
 void end()
           
static IStatus errorStatus(String msg, Throwable t)
           
 boolean fireEditorEvent(int event_type, TestEditor editor)
          Notifies listeners of changes in the state of TestEditor.
 CommonEditorExtension getActiveEditor()
          TestEditorPlugin keeps track of which TestEditor is active (editor window has keyboard focus).
static Color getColor(String key)
          Extract color from color registry
static ColorRegistry getColorRegistry()
           
static TestEditorPlugin getDefault()
          Returns the shared instance.
 IDialogSettings getDialogSettingsSection(String name, IDialogSettings parent)
          DialogSections are used to store state information.
static TestEditor getEditorFor(CBActionElement element)
          Returns an editor that has the model to which the argument element belongs.
static int getEditorMode()
          Returns the mode of the editor (user or RQM).
static IDialogSettings getEditorState(TestEditor testEditor)
           
static Job getFindDuplicateIDsJob()
           
static String getID()
          Returns this plugin's id.
 TestEditorImages getImageManager()
           
static TestEditorPlugin getInstance()
          Returns the shared instance.
 PDLogger getLogger()
           
 ResourceBundle getNonTranslatableResourceBundle()
           
static TestEditor[] getOpenEditors()
           
static PluginHelper getPluginHelper()
           
static org.eclipse.hyades.test.core.util.ResourceBundleManager getResourceBundleManager()
           
static String getString(String key)
          Returns a string from Test Editor plugin.properties file
static String getString(String key, String arg)
          Returns a string from Test Editor plugin.properties file
static String getString(String key, String[] args)
          Returns a string from Test Editor plugin.properties file
static String[] getSyncPointsNames()
           
 com.ibm.rational.common.test.editor.framework.extensions.TestInformationProvider getTestInfoProvider(String providerId)
           
 ResourceBundle getTranslatableResourceBundle()
           
static IWorkspace getWorkspace()
          Returns the workspace instance.
 void logDebug(String msg)
           
 void logError(String msg)
           
 void logError(String msg, Throwable t)
           
 void logError(Throwable t)
           
 void logWarning(String msg)
           
 void propertyChange(PropertyChangeEvent event)
           
static long recallLastModifiedDate(String path)
          Deprecated.  
 void removeEditorListener(IEditorStateListener listener)
          Removes specified IEditorStateListener from list of listeners.
static void removeSyncPointName(String name)
           
 void runErrorCheckingJob(TestEditor editor)
          Schedules an Error Checking Job for the editor.
 void saveDialogSettings()
           
static void saveEditorState(TestEditor testEditor)
           
 void setActiveEditor(CommonEditorExtension activeEditor)
          TestEditorPlugin keeps track of which TestEditor is active (editor window has keyboard focus).
static int setEditorMode(int mode)
           
static void setLastModifiedDate(String path, long date)
          Deprecated.  
 void start()
           
 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, 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
 
Methods inherited from interface com.ibm.rational.test.lt.core.logging.ILTPlugin
getBundle
 

Field Detail

PLUGIN_ID

public static final String PLUGIN_ID
See Also:
Constant Field Values

ms_ACTIVE_EDITOR_TYPE

public static String ms_ACTIVE_EDITOR_TYPE

ms_RPT_COMMAND_CONTEXT_ID

public static String ms_RPT_COMMAND_CONTEXT_ID

USER_EDITOR_MODE

public static final int USER_EDITOR_MODE
See Also:
Constant Field Values

RQM_EDITOR_MODE

public static final int RQM_EDITOR_MODE
See Also:
Constant Field Values

PREF_PREVIEW_LINKED

public static final String PREF_PREVIEW_LINKED
See Also:
Constant Field Values

PREF_USE_ERROR_COLOR

public static final String PREF_USE_ERROR_COLOR
See Also:
Constant Field Values

PREF_SEARCH_DECORATOR_COLOR

public static final String PREF_SEARCH_DECORATOR_COLOR
See Also:
Constant Field Values

PREF_SEARCH_DECORATOR_TEXT

public static final String PREF_SEARCH_DECORATOR_TEXT
See Also:
Constant Field Values

PREF_USE_SEARCH_DECORATOR

public static final String PREF_USE_SEARCH_DECORATOR
See Also:
Constant Field Values

PREF_SEARCH_SAVE_TYPES

public static final String PREF_SEARCH_SAVE_TYPES
See Also:
Constant Field Values

PREF_SEARCH_SAVE_TEXT

public static final String PREF_SEARCH_SAVE_TEXT
See Also:
Constant Field Values

PREF_FORCEWRAP_THRESHOLD

public static final String PREF_FORCEWRAP_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

TestEditorPlugin

public TestEditorPlugin()
Method Detail

getDefault

public static TestEditorPlugin getDefault()
Returns the shared instance.


getInstance

public static TestEditorPlugin getInstance()
Returns the shared instance.


getWorkspace

public static IWorkspace getWorkspace()
Returns the workspace instance.


getResourceBundleManager

public static org.eclipse.hyades.test.core.util.ResourceBundleManager getResourceBundleManager()

getString

public static String getString(String key)
                        throws NullPointerException,
                               MissingResourceException
Returns a string from Test Editor plugin.properties file

Throws:
NullPointerException
MissingResourceException

getString

public static String getString(String key,
                               String arg)
                        throws NullPointerException,
                               MissingResourceException
Returns a string from Test Editor plugin.properties file

Throws:
NullPointerException
MissingResourceException

getString

public static String getString(String key,
                               String[] args)
                        throws NullPointerException,
                               MissingResourceException
Returns a string from Test Editor plugin.properties file

Throws:
NullPointerException
MissingResourceException

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

getID

public static String getID()
Returns this plugin's id.

Returns:
String

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
See Also:
Plugin.shutdown()

saveEditorState

public static void saveEditorState(TestEditor testEditor)

saveDialogSettings

public void saveDialogSettings()
Overrides:
saveDialogSettings in class AbstractUIPlugin

getEditorState

public static IDialogSettings getEditorState(TestEditor testEditor)

getPluginHelper

public static PluginHelper getPluginHelper()

getLogger

public PDLogger getLogger()
Returns:
Returns the m_logger.

getTranslatableResourceBundle

public ResourceBundle getTranslatableResourceBundle()
Specified by:
getTranslatableResourceBundle in interface com.ibm.rational.test.lt.core.logging.ILTSubComponent

getNonTranslatableResourceBundle

public ResourceBundle getNonTranslatableResourceBundle()
Specified by:
getNonTranslatableResourceBundle in interface com.ibm.rational.test.lt.core.logging.ILTSubComponent

recallLastModifiedDate

public static long recallLastModifiedDate(String path)
Deprecated. 

Parameters:
path -

setLastModifiedDate

public static void setLastModifiedDate(String path,
                                       long date)
Deprecated. 

Parameters:
path -

getActiveEditor

public CommonEditorExtension getActiveEditor()
TestEditorPlugin keeps track of which TestEditor is active (editor window has keyboard focus).

Returns:
CommonEditorExtension current editor, or null.
See Also:
CommonEditorExtension

setActiveEditor

public void setActiveEditor(CommonEditorExtension activeEditor)
TestEditorPlugin keeps track of which TestEditor is active (editor window has keyboard focus).

Parameters:
activeEditor - CommonEditorExtension
See Also:
TestEditorPlugin.getActiveEditor(), CommonEditorExtension

addEditorListener

public void addEditorListener(IEditorStateListener listener)
Adds specified IEditorStateListener to list of listeners.

Parameters:
listener -

removeEditorListener

public void removeEditorListener(IEditorStateListener listener)
Removes specified IEditorStateListener from list of listeners.

Parameters:
listener -

fireEditorEvent

public boolean fireEditorEvent(int event_type,
                               TestEditor editor)
Notifies listeners of changes in the state of TestEditor.

Parameters:
event_type - String
editor - TestEditor that has caused a change.
Returns:
boolean. Current implementation always returns true.
See Also:
IEditorStateListener, TestEditorPlugin.addEditorListener(IEditorStateListener), TestEditorPlugin.removeEditorListener(IEditorStateListener)

getOpenEditors

public static TestEditor[] getOpenEditors()
Returns:
TestEditor[] Array of all currently opened TestEditors. Caller should not assume any particular type of editor, rather, an instanceof should be used to look for objects of interest.

getEditorFor

public static TestEditor getEditorFor(CBActionElement element)
Returns an editor that has the model to which the argument element belongs.

Parameters:
element - CBActionElement
Returns:
TestEditor or null.

getDialogSettingsSection

public IDialogSettings getDialogSettingsSection(String name,
                                                IDialogSettings parent)
DialogSections are used to store state information.

Parameters:
name - String name of the DialogSection to return. If name subsection is not found in parent, it is created.
parent - IDialogSettings parent dialog section, or null. If parent is null, the @link AbstractUIPlugin#getDialogSettings() is called. Its return value is used as a parent.
Returns:
IDialogSettings

getImageManager

public TestEditorImages getImageManager()
Returns:
Returns the img.

runErrorCheckingJob

public void runErrorCheckingJob(TestEditor editor)
Schedules an Error Checking Job for the editor.

Parameters:
editor -

cacheSyncPointName

public static void cacheSyncPointName(String name)

removeSyncPointName

public static void removeSyncPointName(String name)

getSyncPointsNames

public static String[] getSyncPointsNames()

propertyChange

public void propertyChange(PropertyChangeEvent event)
Specified by:
propertyChange in interface IPropertyChangeListener

getTestInfoProvider

public com.ibm.rational.common.test.editor.framework.extensions.TestInformationProvider getTestInfoProvider(String providerId)

addDependencyBuilder

public void addDependencyBuilder(com.ibm.rational.test.lt.core.utils.DelayedDependencyBuilder builder)

addDependencyBuilder

public void addDependencyBuilder(com.ibm.rational.test.lt.core.utils.DelayedDependencyBuilder builder,
                                 Thread th)
Parameters:
builder -
th -

getFindDuplicateIDsJob

public static Job getFindDuplicateIDsJob()

setEditorMode

public static int setEditorMode(int mode)

getEditorMode

public static int getEditorMode()
Returns the mode of the editor (user or RQM).

Returns:
The editors mode.

getColorRegistry

public static ColorRegistry getColorRegistry()
Returns:
JFaceResources.getColorRegistry()

getColor

public static Color getColor(String key)
Extract color from color registry

Parameters:
key - String color name.
Returns:
Color
See Also:
LoadTestEditorPlugin#getColorRegistry()

end

public void end()
Specified by:
end in interface org.eclipse.hyades.test.ui.navigator.IProxyRefreshListener

start

public void start()
Specified by:
start in interface org.eclipse.hyades.test.ui.navigator.IProxyRefreshListener

errorStatus

public static IStatus errorStatus(String msg,
                                  Throwable t)

logError

public void logError(String msg)

logError

public void logError(String msg,
                     Throwable t)

logError

public void logError(Throwable t)

logDebug

public void logDebug(String msg)

logWarning

public void logWarning(String msg)

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.