| net.refractions.udig.internal.ui.UiPlugin
UiPlugin | public class UiPlugin extends AbstractUIPlugin (Code) | | The main plugin class to be used in the desktop.
|
Constructor Summary | |
public | UiPlugin() The constructor. |
Method Summary | |
synchronized ImageDescriptor | create(String id) Creates an image descriptor for later use. | public static UiPlugin | getDefault() Returns the shared instance. | public Images | getImages() Images instance for use with ImageConstants. | public MenuBuilder | getMenuFactory() | public OperationMenuFactory | getOperationMenuFactory() | public static Preferences | getUserPreferences() Gets preferences that are user specific. | public String | getVersion() | public static boolean | isDebugging(String trace) Performs the Platform.getDebugOption true check on the provided trace
Note: ProjectUIPlugin.getDefault().isDebugging() must also be on. | public static void | log(String message2, Throwable e) Writes an info log in the plugin's log. | public static Object | lookupConfigurationObject(Class interfaceClass, IPreferenceStore store, String pluginID, String prefConstant, String xpid, String idField, String classField) Looks a configuration object using the preference store and extension
points to locate the class and instantiate it. | public void | start(BundleContext context) | public void | stop(BundleContext context) | public static void | trace(String traceID, Class caller, String message, Throwable e) Messages that only engage if getDefault().isDebugging() and the trace option traceID is true.
Available trace options can be found in the Trace class. | public static void | trace(Class caller, String message, Throwable e) Adds the name of the caller class to the message. |
DROP_ACTIONS_ID | final public static String DROP_ACTIONS_ID(Code) | | |
DROP_TRANSFERS_ID | final public static String DROP_TRANSFERS_ID(Code) | | |
ICONS_PATH | final public static String ICONS_PATH(Code) | | Icons path (value "icons/")
|
MAPPINGS_FILENAME | final public static String MAPPINGS_FILENAME(Code) | | |
UiPlugin | public UiPlugin()(Code) | | The constructor.
|
create | synchronized ImageDescriptor create(String id)(Code) | | Creates an image descriptor for later use.
|
getDefault | public static UiPlugin getDefault()(Code) | | Returns the shared instance.
|
getImages | public Images getImages()(Code) | | Images instance for use with ImageConstants.
Images for use with ImageConstants. |
getMenuFactory | public MenuBuilder getMenuFactory()(Code) | | Get the MenuFactory which will create the menus for this plugin
The MenuFactory singleton |
getUserPreferences | public static Preferences getUserPreferences()(Code) | | Gets preferences that are user specific. You don't have to worry about the preferences
changes interfering with preferences of another user's workspace.
preferences that are user specific throws: CoreException - throws: IOException - |
isDebugging | public static boolean isDebugging(String trace)(Code) | | Performs the Platform.getDebugOption true check on the provided trace
Note: ProjectUIPlugin.getDefault().isDebugging() must also be on.
- Trace.RENDER - trace rendering progress
Parameters: trace - currently only RENDER is defined |
log | public static void log(String message2, Throwable e)(Code) | | Writes an info log in the plugin's log.
This should be used for user level messages.
|
lookupConfigurationObject | public static Object lookupConfigurationObject(Class interfaceClass, IPreferenceStore store, String pluginID, String prefConstant, String xpid, String idField, String classField)(Code) | | Looks a configuration object using the preference store and extension
points to locate the class and instantiate it. If there is a problem,
null is returned and the caller is expect to supply a default value of
their own. Exceptions are not thrown, but messages will be logged.
These configuration objects are typically defined in
plugin_customization.ini files, and these values are loaded into the
preference store. The parameter prefConstant is used to look
up this value, and should be the key (prefixed by the plug-in name,
net.refractions.udig.ui) used in the ini file.
The returned object will either be an instances of
interfaceClass or null.
The parameter xpid is the extension point ID that the value
specified in the ini file should point to. This extension point must
contain an attribute used for an id, and an attribute used for the class
which is an implementation of interfaceClass. idField
indicates the name of the attribute for id, and classField
indicates the name of the attribute for the class.
Example:
plugin_customization.ini
net.refractions.udig.ui/workbenchConfiguration=net.refractions.udig.internal.ui.UDIGWorkbenchConfiguration
store: net.refractions.udig.internal.ui.UiPlugin.getPreferenceStore()
(this corresponds to the first part of the key)
pluginID: "net.refractions.udig.ui"
prefConstant: "workbenchConfiguration"
xpid: "net.refractions.udig.ui.workbenchConfigurations"
idField: "id"
classField: "class"
This will return an instance of net.refractions.udig.ui.WorkbenchConfiguration,
or null if it cannot find one (in which case, check the logs!).
Make sure to be a good developer and use constants. Also make sure to
use a default implementation if this returns null! The code should not
explode!
TODO It would be nice to simplify this API call.
Parameters: interfaceClass - instance of the interface that will be instantiated and returned Parameters: store - the preference store used to lookup prefConstant Parameters: pluginID - the ID of the plug-in that the preference store lives Parameters: prefConstant - key used in plugin_customization.ini Parameters: xpid - extension point id key Parameters: idField - id attribute key used in extension point Parameters: classField - class attribute key used in extension point |
start | public void start(BundleContext context) throws Exception(Code) | | This method is called upon plug-in activation
Parameters: context - throws: Exception - |
trace | public static void trace(String traceID, Class caller, String message, Throwable e)(Code) | | Messages that only engage if getDefault().isDebugging() and the trace option traceID is true.
Available trace options can be found in the Trace class. (They must also be part of the .options file)
|
trace | public static void trace(Class caller, String message, Throwable e)(Code) | | Adds the name of the caller class to the message.
Parameters: caller - class of the object doing the trace. Parameters: message - tracing message, may be null. Parameters: e - exception, may be null. |
|
|