| net.refractions.udig.catalog.ui.CatalogUIPlugin
CatalogUIPlugin | public class CatalogUIPlugin extends AbstractUIPlugin (Code) | | Lifecycle & Resource management for RegistryUI.
The CatalogUIPlugin provides access for shared images descriptors.
Example use of a shared image descriptor:
ImageRegistry images = CatalogUIPlugin.getDefault().getImageRegistry();
ImageDescriptor image = images.getDescriptor(ISharedImages.IMG_DATASTORE_OBJ);
Implementation Note
The CatalogUIPlugin delegates the following resource management tasks:
- ResourceBundle: Policy
- ImageDescriptors: Images
These resources are intended for use by classes within this plugin.
author: Jody Garnett, Refractions Research, Inc |
Method Summary | |
public static MutablePicoContainer | getContainer() Gets the container for catalog ui. | public static MutablePicoContainer | getContainer(IResolve handle) Gets a container associated with this handle. | public static CatalogUIPlugin | getDefault() Returns the shared instance. | public ImageRegistry | getImageRegistry() | public ISharedImages | getImages() Images instance for use with ImageConstants. | public static boolean | hasCachedTitle(IResolve resolve) Returns true if the title to the resolve was cached during a previous run. | public static ImageDescriptor | icon(IResolve resolve) | public static ImageDescriptor | icon(IResolve resolve, IProgressMonitor monitor) | public static Image | image(IResolve resolve) Quick and dirty image generated based on ID, this image is shared and should not be disposed.
This method does not block and can be safely used to by a LabelProvider. | 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 String | label(IResolve resource) Quick and dirty label generation based on ID.
This method does not block and can be safely used to by a LabelProvider. | public static void | log(String message2, Throwable t) Logs the Throwable in the plugin's log. | public void | start(BundleContext context) Set up shared images. | public void | stop(BundleContext context) Cleanup after shared images. | public static void | storeLabel(IResolve element, String text) | public static String | title(IResolve resource, IProgressMonitor monitor) Retrieve title, this is based on associated metadata (aka LayerPointInfo object). | public static String | title(IResolve resource) Retrive title, this is based on associated metadata (aka LayerPointInfo object). | public static void | trace(String message, Throwable e) | public static void | trace(String message) |
ICONS_PATH | final public static String ICONS_PATH(Code) | | Icons path (value "icons/")
|
PREF_OPEN_DIALOG_DIRECTORY | final public static String PREF_OPEN_DIALOG_DIRECTORY(Code) | | Preference store for the last directory open by the file selection dialog
|
CatalogUIPlugin | public CatalogUIPlugin()(Code) | | The constructor.
|
getContainer | public static MutablePicoContainer getContainer()(Code) | | Gets the container for catalog ui.
This is used by the IResourceLabel decorator to pass titles, and images between threads.
Container assocaited with the catalog ui |
getContainer | public static MutablePicoContainer getContainer(IResolve handle)(Code) | | Gets a container associated with this handle.
As with any container, the contents should not be assumned, etc...
Parameters: handle - Container associated with display of resolve |
getDefault | public static CatalogUIPlugin getDefault()(Code) | | Returns the shared instance.
CatalogUIPlugin singleton |
getImageRegistry | public ImageRegistry getImageRegistry()(Code) | | |
getImages | public ISharedImages getImages()(Code) | | Images instance for use with ImageConstants.
Images for use with ImageConstants. |
hasCachedTitle | public static boolean hasCachedTitle(IResolve resolve)(Code) | | Returns true if the title to the resolve was cached during a previous run. In this case
CatalogUIPlugin.label(IResolve) will have returned
the cached title.
Parameters: resolve - the resolve to check for a title. true if the title to the resolve was cached during a previous run. |
icon | public static ImageDescriptor icon(IResolve resolve, IProgressMonitor monitor) throws IOException(Code) | | Create icon for provided resource, this will block!
Parameters: resource - ImageDescriptor for resource. throws: IOException - |
image | public static Image image(IResolve resolve)(Code) | | Quick and dirty image generated based on ID, this image is shared and should not be disposed.
This method does not block and can be safely used to by a LabelProvider. This method does not
make use of any information available via an info object (because that would require blocking
and be unsafe).
See Also: glyph Parameters: resource - Image representing provided resource |
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 true if -debug is on for this plugin |
label | public static String label(IResolve resource)(Code) | | Quick and dirty label generation based on ID.
This method does not block and can be safely used to by a LabelProvider. This method does not
make use of any title information available via an info object (because that would require
blocking and be unsafe).
See Also: title Label for provided resource |
log | public static void log(String message2, Throwable t)(Code) | | Logs the Throwable in the plugin's log.
This will be a user visable ERROR iff:
- t is an Exception we are assuming it is human readable or if a message is provided
Parameters: message - Parameters: t - |
start | public void start(BundleContext context) throws Exception(Code) | | Set up shared images.
See Also: org.eclipse.ui.plugin.AbstractUIPlugin.start(org.osgi.framework.BundleContext) Parameters: context - throws: Exception - |
stop | public void stop(BundleContext context) throws Exception(Code) | | Cleanup after shared images.
See Also: org.eclipse.ui.plugin.AbstractUIPlugin.stop(org.osgi.framework.BundleContext) Parameters: context - throws: Exception - |
title | public static String title(IResolve resource, IProgressMonitor monitor) throws IOException(Code) | | Retrieve title, this is based on associated metadata (aka LayerPointInfo object).
This method is *not* suitable for use with a LabelProvider, only a LabelDecorator that works
in its own thread.
title, or null if not found (consider use of label( resource ) |
title | public static String title(IResolve resource) throws IOException(Code) | | Retrive title, this is based on associated metadata (aka LayerPointInfo object).
This method is *not* suitable for use with a LabelProvider, only a LabelDecorator that works
in its own thread.
title, or null if not found (consider use of label( resource ) |
trace | public static void trace(String message, Throwable e)(Code) | | Messages that only engage if getDefault().isDebugging()
It is much prefered to do this:
private static final String RENDERING = "net.refractions.udig.project/render/trace";
if (ProjectUIPlugin.getDefault().isDebugging() && "true".equalsIgnoreCase(RENDERING)) {
System.out.println("your message here");
}
Parameters: message - Parameters: e - |
|
|