Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactored ImageRegistry access with dyn. registration for additional…

… Images
  • Loading branch information...
commit e762cb1fc43204673aa61607768bfefcfa6cd140 1 parent bec5850
@fgdrf fgdrf authored
Showing with 227 additions and 436 deletions.
  1. +1 −1  plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/FeatureCatalogTreeViewer.java
  2. +2 −2 plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/FeatureLayerTreeViewer.java
  3. +1 −1  plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/JGRasterCatalogTreeViewer.java
  4. +1 −1  plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/JGRasterLayerTreeViewer.java
  5. +4 −4 plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/core/JGrassMapGeoResource.java
  6. +2 −2 plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/core/JGrassMapsetGeoResource.java
  7. +6 −6 ...fractions.udig.catalog.geotools/src/net/refractions/udig/catalog/geotools/data/DataStoreConnectionPage.java
  8. +1 −1  ...ions.udig.catalog.geotools/src/net/refractions/udig/catalog/geotools/data/FeatureSourceGeoResourceInfo.java
  9. +5 −5 plugins/net.refractions.udig.catalog.geotools/src/net/refractions/udig/catalog/geotools/data/GTFormat.java
  10. +1 −1  ...s/net.refractions.udig.catalog.geotools/src/net/refractions/udig/catalog/geotools/process/LocalProcess.java
  11. +2 −2 plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/internal/ui/CatalogView.java
  12. +1 −1  ...ins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/internal/ui/ResourceSelectionPage.java
  13. +3 −3 plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/internal/ui/ServiceDecorator.java
  14. +1 −1  plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/service/database/UserHostPage.java
  15. +24 −60 plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/CatalogUIPlugin.java
  16. +1 −1  plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/export/CatalogExport.java
  17. +2 −2 plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/internal/Messages.java
  18. +1 −1  plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/operation/ReshapeOperation.java
  19. +1 −1  plugins/net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/search/SearchView.java
  20. +1 −1  plugins/net.refractions.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSFolder.java
  21. +9 −9 plugins/net.refractions.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSGeoResourceImpl.java
  22. +1 −1  plugins/net.refractions.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSGeoResourceInfo.java
  23. +1 −1  ...ns/net.refractions.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wmsc/WMSCGeoResourceInfo.java
  24. +15 −26 plugins/net.refractions.udig.core/src/net/refractions/udig/core/AbstractUdigUIPlugin.java
  25. +12 −10 plugins/net.refractions.udig.issues.test/src/net/refractions/udig/issues/test/IssuesViewTest.java
  26. +10 −24 plugins/net.refractions.udig.issues/src/net/refractions/udig/issues/internal/IssuesActivator.java
  27. +9 −9 plugins/net.refractions.udig.issues/src/net/refractions/udig/issues/internal/view/IssuesLabelProvider.java
  28. +3 −3 plugins/net.refractions.udig.issues/src/net/refractions/udig/issues/internal/view/IssuesView.java
  29. +7 −32 plugins/net.refractions.udig.location/src/net/refractions/udig/location/LocationUIPlugin.java
  30. +2 −2 plugins/net.refractions.udig.location/src/net/refractions/udig/location/internal/Messages.java
  31. +1 −1  plugins/net.refractions.udig.location/src/net/refractions/udig/location/ui/LocationView.java
  32. +1 −1  plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/LayerStateDecorator.java
  33. +15 −15 plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/LayerStatusDecorator.java
  34. +2 −2 plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/LayersView.java
  35. +1 −1  plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/MapEditor.java
  36. +1 −1  plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/MapStylePage.java
  37. +2 −2 plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/ProjectExplorer.java
  38. +10 −15 plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/ProjectUIPlugin.java
  39. +1 −1  ...s/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/TemporaryLayerDecorator.java
  40. +1 −1  ...t.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/wizard/NewProjectWizardPage.java
  41. +1 −1  ...actions.udig.project.ui/src/net/refractions/udig/project/ui/wizard/export/image/ExportMapToImageWizard.java
  42. +1 −1  .../net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/wizard/export/map/ExportMapWizard.java
  43. +6 −60 plugins/net.refractions.udig.style.sld/src/net/refractions/udig/style/sld/SLDPlugin.java
  44. +22 −22 plugins/net.refractions.udig.style.sld/src/net/refractions/udig/style/sld/editor/StyleThemePage.java
  45. +7 −29 plugins/net.refractions.udig.style/src/net/refractions/udig/style/StylePlugin.java
  46. +2 −2 plugins/net.refractions.udig.style/src/net/refractions/udig/style/ui/StyleView.java
  47. +1 −1  plugins/net.refractions.udig.ui/src/net/refractions/udig/internal/ui/SendLogDialog.java
  48. +4 −17 plugins/net.refractions.udig.ui/src/net/refractions/udig/internal/ui/UiPlugin.java
  49. +2 −2 plugins/net.refractions.udig.ui/src/net/refractions/udig/ui/FeatureTypeEditor.java
  50. +1 −1  plugins/net.refractions.udig.ui/src/net/refractions/udig/ui/action/NewObjectContribution.java
  51. +2 −2 plugins/net.refractions.udig.ui/src/net/refractions/udig/ui/internal/Messages.java
  52. +11 −42 plugins/net.refractions.udig.validation/src/net/refractions/udig/validation/ValidationPlugin.java
  53. +1 −1  plugins/net.refractions.udig.validation/src/net/refractions/udig/validation/ValidationProcessor.java
  54. +1 −1  plugins/net.refractions.udig.validation/src/net/refractions/udig/validation/ui/ValidationDialog.java
View
2  ...alog.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/FeatureCatalogTreeViewer.java
@@ -234,7 +234,7 @@ public LabelProvider() {
listeners = new ArrayList<ILabelProviderListener>();
// Create the images
- vectorMaps = CatalogUIPlugin.getImageDescriptor(
+ vectorMaps = CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.FEATURE_OBJ).createImage();
}
View
4 ...atalog.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/FeatureLayerTreeViewer.java
@@ -239,8 +239,8 @@ public LabelProvider() {
listeners = new ArrayList<ILabelProviderListener>();
// Create the images
- vectorMaps = CatalogUIPlugin.getImageDescriptor(ISharedImages.FEATURE_OBJ).createImage();
- mainMaps = CatalogUIPlugin.getImageDescriptor(ISharedImages.CATALOG_OBJ).createImage();
+ vectorMaps = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.FEATURE_OBJ).createImage();
+ mainMaps = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.CATALOG_OBJ).createImage();
}
/**
View
2  ...log.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/JGRasterCatalogTreeViewer.java
@@ -313,7 +313,7 @@ public LabelProvider() {
listeners = new ArrayList<ILabelProviderListener>();
// Create the images
- rasterMaps = CatalogUIPlugin.getImageDescriptor(ISharedImages.GRID_OBJ).createImage();
+ rasterMaps = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.GRID_OBJ).createImage();
mainRasterMaps = AbstractUIPlugin
.imageDescriptorFromPlugin(JGrassPlugin.PLUGIN_ID, "icons/obj16/jgrass_obj.gif").createImage(); //$NON-NLS-1$
grassasciiRasterMaps = AbstractUIPlugin.imageDescriptorFromPlugin(JGrassPlugin.PLUGIN_ID,
View
2  ...talog.jgrass/src/eu/udig/catalog/jgrass/activeregion/dialogs/JGRasterLayerTreeViewer.java
@@ -309,7 +309,7 @@ public LabelProvider() {
listeners = new ArrayList<ILabelProviderListener>();
// Create the images
- rasterMaps = CatalogUIPlugin.getImageDescriptor(ISharedImages.GRID_OBJ).createImage();
+ rasterMaps = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.GRID_OBJ).createImage();
mainRasterMaps = AbstractUIPlugin
.imageDescriptorFromPlugin(JGrassPlugin.PLUGIN_ID, "icons/obj16/jgrass_obj.gif").createImage(); //$NON-NLS-1$
grassasciiRasterMaps = AbstractUIPlugin.imageDescriptorFromPlugin(JGrassPlugin.PLUGIN_ID,
View
8 plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/core/JGrassMapGeoResource.java
@@ -241,7 +241,7 @@ public JGrassMapGeoResourceInfo( IProgressMonitor monitor ) {
.getJGrassCrs();
bounds = new ReferencedEnvelope(fileWindow.getEnvelope(), grassCrs);
- super.icon = CatalogUIPlugin.getImageDescriptor(ISharedImages.GRID_OBJ);
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.GRID_OBJ);
}
/*
* what if it is a grass ascii raster map?
@@ -286,7 +286,7 @@ else if (JGrassMapGeoResource.this.type.equals(JGrassConstants.FTRASTERMAP)) {
* what if it is a vector map
*/
else if (JGrassMapGeoResource.this.type.equals(JGrassConstants.GRASS6VECTORMAP)) {
- super.icon = CatalogUIPlugin.getImageDescriptor(ISharedImages.FEATURE_OBJ);
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.FEATURE_OBJ);
}
/*
* what if it is a point map
@@ -327,9 +327,9 @@ else if (JGrassMapGeoResource.this.type.equals(JGrassConstants.SITESMAP)) {
bounds = new ReferencedEnvelope(tmpBounds,
((JGrassMapsetGeoResource) JGrassMapGeoResource.this.parent).getJGrassCrs());
- super.icon = CatalogUIPlugin.getImageDescriptor(ISharedImages.PIXEL_OBJ);
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.PIXEL_OBJ);
} else {
- super.icon = CatalogUIPlugin.getImageDescriptor(ISharedImages.GRID_MISSING);
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.GRID_MISSING);
}
} catch (Exception e) {
super.icon = AbstractUIPlugin.imageDescriptorFromPlugin(JGrassPlugin.PLUGIN_ID, "icons/obj16/problem.gif"); //$NON-NLS-1$
View
4 plugins/eu.udig.catalog.jgrass/src/eu/udig/catalog/jgrass/core/JGrassMapsetGeoResource.java
@@ -367,7 +367,7 @@ public JGrassMapsetGeoResourceInfo( IProgressMonitor monitor ) throws IOExceptio
// calculate bounds
JGrassRegion activeRegionWindow = getActiveRegionWindow();
this.bounds = new ReferencedEnvelope(activeRegionWindow.getEnvelope(), getCRS());
- super.icon = CatalogUIPlugin.getImageDescriptor(ISharedImages.CATALOG_OBJ);
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.CATALOG_OBJ);
}
public CoordinateReferenceSystem getCRS() {
@@ -405,7 +405,7 @@ public CoordinateReferenceSystem getJGrassCrs() {
public ImageDescriptor getIcon( IProgressMonitor monitor ) {
if (icon == null) {
- icon = CatalogUIPlugin.getImageDescriptor(ISharedImages.GRID_OBJ);
+ icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.GRID_OBJ);
}
return icon;
}
View
12 ...alog.geotools/src/net/refractions/udig/catalog/geotools/data/DataStoreConnectionPage.java
@@ -93,22 +93,22 @@ public Image getImage( Object element ) {
String name = element.getClass().getSimpleName();
if (element instanceof JDBCDataStoreFactory) {
- return CatalogUIPlugin.getImage(ISharedImages.DATABASE_OBJ);
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.DATABASE_OBJ);
}
if (element instanceof FileDataStoreFactorySpi) {
- return CatalogUIPlugin.getImage(ISharedImages.FEATURE_FILE_OBJ);
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.FEATURE_FILE_OBJ);
}
if (name.indexOf("WFSDataStoreFactory") != -1) {
- return CatalogUIPlugin.getImage(ISharedImages.WFS_OBJ);
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.WFS_OBJ);
}
if (name.indexOf("PropertyDataStoreFactory") != -1){
- return CatalogUIPlugin.getImage(ISharedImages.FEATURE_FILE_OBJ );
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.FEATURE_FILE_OBJ );
}
if (name.indexOf("PostgisDataStoreFactory")!=-1){
- return CatalogUIPlugin.getImage(ISharedImages.DATABASE_OBJ);
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.DATABASE_OBJ);
}
if (element instanceof DataStoreFactorySpi) {
- return CatalogUIPlugin.getImage(ISharedImages.DATASTORE_OBJ );
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.DATASTORE_OBJ );
}
return super.getImage(element);
}
View
2  ...geotools/src/net/refractions/udig/catalog/geotools/data/FeatureSourceGeoResourceInfo.java
@@ -45,7 +45,7 @@ public FeatureSourceGeoResourceInfo( ResourceInfo info ) {
this.title = title.replace('_', ' ');
}
- this.icon = CatalogUIPlugin.getImageDescriptor( ISharedImages.FEATURE_OBJ ); // generic!
+ this.icon = CatalogUIPlugin.getDefault().getImageDescriptor( ISharedImages.FEATURE_OBJ ); // generic!
}
/**
* Can be called to refresh the bounds from the internal info object.
View
10 ...ctions.udig.catalog.geotools/src/net/refractions/udig/catalog/geotools/data/GTFormat.java
@@ -101,7 +101,7 @@ public ID toID( DataAccessFactory factory, Map<String, ? > params ) {
@Override
public ImageDescriptor getIcon() {
- return CatalogUIPlugin.getImageDescriptor( ISharedImages.DATABASE_OBJ ); // generic!
+ return CatalogUIPlugin.getDefault().getImageDescriptor( ISharedImages.DATABASE_OBJ ); // generic!
}
},
FILE {
@@ -146,7 +146,7 @@ public ID toID( DataAccessFactory factory, Map<String, ? > params ) {
}
@Override
public ImageDescriptor getIcon() {
- return CatalogUIPlugin.getImageDescriptor( ISharedImages.FEATURE_FILE_OBJ ); // generic!
+ return CatalogUIPlugin.getDefault().getImageDescriptor( ISharedImages.FEATURE_FILE_OBJ ); // generic!
}
},
WFS {
@@ -172,7 +172,7 @@ public ID toID( DataAccessFactory factory, Map<String, ? > params ) {
}
@Override
public ImageDescriptor getIcon() {
- return CatalogUIPlugin.getImageDescriptor( ISharedImages.WFS_OBJ ); // generic!
+ return CatalogUIPlugin.getDefault().getImageDescriptor( ISharedImages.WFS_OBJ ); // generic!
}
},
PROPERTY {
@@ -202,7 +202,7 @@ public ID toID( DataAccessFactory factory, Map<String, ? > params ) {
}
@Override
public ImageDescriptor getIcon() {
- return CatalogUIPlugin.getImageDescriptor( ISharedImages.FEATURE_FILE_OBJ ); // generic!
+ return CatalogUIPlugin.getDefault().getImageDescriptor( ISharedImages.FEATURE_FILE_OBJ ); // generic!
}
},
OTHER {
@@ -258,7 +258,7 @@ public ID toID( DataAccessFactory factory, Map<String, ? > params ) {
}
@Override
public ImageDescriptor getIcon() {
- return CatalogUIPlugin.getImageDescriptor( ISharedImages.DATASTORE_OBJ ); // generic!
+ return CatalogUIPlugin.getDefault().getImageDescriptor( ISharedImages.DATASTORE_OBJ ); // generic!
}
};
View
2  ...udig.catalog.geotools/src/net/refractions/udig/catalog/geotools/process/LocalProcess.java
@@ -48,7 +48,7 @@
if (version != null) {
this.keywords = new String[]{version};
}
- icon = CatalogUIPlugin
+ icon = CatalogUIPlugin.getDefault()
.getImageDescriptor(ISharedImages.GRID_OBJ);
}
}
View
4 ...refractions.udig.catalog.ui/src/net/refractions/udig/catalog/internal/ui/CatalogView.java
@@ -199,7 +199,7 @@ public void run() {
Messages.initAction(removeAction, "action_remove"); //$NON-NLS-1$
removeAction.setEnabled(false);
- removeAction.setImageDescriptor(CatalogUIPlugin.getImageDescriptor(ImageConstants.REMOVE_CO));
+ removeAction.setImageDescriptor(CatalogUIPlugin.getDefault().getImageDescriptor(ImageConstants.REMOVE_CO));
removeAction.setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.DELETE.getId(), removeAction);
getSite().getKeyBindingService().registerAction(removeAction);
@@ -335,7 +335,7 @@ private void createToolbar() {
IWorkbenchWindow window = getSite().getWorkbenchWindow();
IAction action = ActionFactory.IMPORT.create(window);
- action.setImageDescriptor(CatalogUIPlugin
+ action.setImageDescriptor(CatalogUIPlugin.getDefault()
.getImageDescriptor(ImageConstants.PATH_ETOOL + "import_wiz.gif")); //$NON-NLS-1$
mgr.add(action);
View
2  ...s.udig.catalog.ui/src/net/refractions/udig/catalog/internal/ui/ResourceSelectionPage.java
@@ -81,7 +81,7 @@ public ResourceSelectionPage( String pageName ) {
setTitle(Messages.ResourceSelectionPage_title);
setMessage(Messages.ResourceSelectionPage_message);
setDescription(Messages.ResourceSelectionPage_description);
- setImageDescriptor(CatalogUIPlugin.getImageDescriptor(ImageConstants.CHOOSE_LAYER_WIZARD));
+ setImageDescriptor(CatalogUIPlugin.getDefault().getImageDescriptor(ImageConstants.CHOOSE_LAYER_WIZARD));
schemaSelected = null;
}
View
6 ...ctions.udig.catalog.ui/src/net/refractions/udig/catalog/internal/ui/ServiceDecorator.java
@@ -90,14 +90,14 @@ public Image decorateImage( Image image, Object element ) {
}
switch( service.getStatus() ) {
case CONNECTED:
- return overlayCache.applyStatus(image, CatalogUIPlugin
+ return overlayCache.applyStatus(image, CatalogUIPlugin.getDefault()
.getImageDescriptor(ImageConstants.CONNECTED_OVR));
case NOTCONNECTED:
- return overlayCache.applyStatus(image, CatalogUIPlugin.getImageDescriptor(ImageConstants.WAIT_OVR));
+ return overlayCache.applyStatus(image, CatalogUIPlugin.getDefault().getImageDescriptor(ImageConstants.WAIT_OVR));
case BROKEN:
- return overlayCache.applyStatus(image, CatalogUIPlugin.getImageDescriptor(ImageConstants.ERROR_OVR));
+ return overlayCache.applyStatus(image, CatalogUIPlugin.getDefault().getImageDescriptor(ImageConstants.ERROR_OVR));
default:
return image;
View
2  ...tions.udig.catalog.ui/src/net/refractions/udig/catalog/service/database/UserHostPage.java
@@ -277,7 +277,7 @@ private Text createLabelAndText( Composite parent, String labelText, int textSty
ImageRegistry imageRegistry = CatalogUIPlugin.getDefault().getImageRegistry();
Image image = imageRegistry.get(REQUIRED_DECORATION);
if (image == null) {
- image = CatalogUIPlugin.getImageDescriptor(ISharedImages.WARNING_OVR).createImage();
+ image = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.WARNING_OVR).createImage();
imageRegistry.put(REQUIRED_DECORATION, image);
}
decoration.setImage(image);
View
84 .../net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/CatalogUIPlugin.java
@@ -6,23 +6,19 @@
import net.refractions.udig.catalog.CatalogPlugin;
import net.refractions.udig.catalog.ICatalog;
-import net.refractions.udig.catalog.ICatalogInfo;
import net.refractions.udig.catalog.ID;
import net.refractions.udig.catalog.IGeoResource;
import net.refractions.udig.catalog.IGeoResourceInfo;
import net.refractions.udig.catalog.IResolve;
import net.refractions.udig.catalog.IResolveChangeEvent;
+import net.refractions.udig.catalog.IResolveChangeEvent.Type;
import net.refractions.udig.catalog.IResolveChangeListener;
import net.refractions.udig.catalog.IResolveDelta;
+import net.refractions.udig.catalog.IResolveDelta.Kind;
import net.refractions.udig.catalog.IResolveFolder;
import net.refractions.udig.catalog.IService;
import net.refractions.udig.catalog.IServiceInfo;
-import net.refractions.udig.catalog.IResolveChangeEvent.Type;
-import net.refractions.udig.catalog.IResolveDelta.Kind;
-import net.refractions.udig.catalog.ui.internal.Messages;
-import net.refractions.udig.catalog.util.HandleListener;
import net.refractions.udig.core.AbstractUdigUIPlugin;
-import net.refractions.udig.core.internal.CorePlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -36,13 +32,9 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.geotools.data.DataStore;
import org.geotools.data.FeatureSource;
import org.osgi.framework.BundleContext;
-//import org.picocontainer.Disposable;
-//import org.picocontainer.MutablePicoContainer;
-//import org.picocontainer.Startable;
/**
* Lifecycle & Resource management for RegistryUI.
@@ -53,7 +45,7 @@
*
* <pre><code>
* ImageRegistry images = CatalogUIPlugin.getDefault().getImageRegistry();
- * ImageDescriptor image = CatalogUIPlugin.getImageDescriptor(ISharedImages.IMG_DATASTORE_OBJ);
+ * ImageDescriptor image = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.IMG_DATASTORE_OBJ);
* </code></pre>
*
* </p>
@@ -71,6 +63,7 @@
*/
public class CatalogUIPlugin extends AbstractUdigUIPlugin {
+ private static CatalogUIPlugin INSTANCE;
/**
* The id of the plug-in
*/
@@ -86,11 +79,6 @@
private static final String LABELS_PREFERENCE_STORE = "CATALOG_LABELS_PREFERENCE_STORAGE"; //$NON-NLS-1$
- private boolean loaded = false;
-
- // The shared instance.
- private static CatalogUIPlugin plugin;
-
/** Managed Images instance */
//private Images images = new Images();
//private volatile static MutablePicoContainer pluginContainer;
@@ -100,7 +88,7 @@
*/
public CatalogUIPlugin() {
super();
- plugin = this;
+ INSTANCE = this;
}
/**
@@ -152,35 +140,6 @@ private void updateCache( IResolveDelta delta, IPreferenceStore p ) {
}
/**
- * Cleanup after shared images.
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- * @param context
- * @throws Exception
- */
- public void stop( BundleContext context ) throws Exception {
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- *
- * @return CatalogUIPlugin singleton
- */
- public static CatalogUIPlugin getDefault() {
- if (plugin == null || !plugin.loaded) {
- synchronized (CatalogUIPlugin.class) {
-
- if (plugin == null) {
- plugin = new CatalogUIPlugin();
- }
-
- }
- }
- return plugin;
- }
-
- /**
* Logs the Throwable in the plugin's log.
* <p>
* This will be a user visable ERROR iff:
@@ -265,22 +224,22 @@ public static Image image( IResolve resolve ) {
return null;
}
if (resolve instanceof IResolveFolder ) {
- return CatalogUIPlugin.getImage(ISharedImages.FOLDER_OBJ);
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.FOLDER_OBJ);
}else if (resolve instanceof IGeoResource) {
IGeoResource resource = (IGeoResource) resolve;
boolean isFeature = resource.canResolve(FeatureSource.class);
String iconId = iconInternalResource( resource.getID(), isFeature );
- return CatalogUIPlugin.getImage( iconId );
+ return CatalogUIPlugin.getDefault().getImage( iconId );
} else if (resolve instanceof IService) {
IService service = (IService) resolve;
boolean isFeature = service.canResolve(DataStore.class);
String iconId = iconInternalService( service.getID(), isFeature );
- return CatalogUIPlugin.getImage( iconId );
+ return CatalogUIPlugin.getDefault().getImage( iconId );
} else if (resolve instanceof ICatalog) {
- return CatalogUIPlugin.getImage(ISharedImages.CATALOG_OBJ);
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.CATALOG_OBJ);
}
- return CatalogUIPlugin.getImage(ISharedImages.RESOURCE_OBJ);
+ return CatalogUIPlugin.getDefault().getImage(ISharedImages.RESOURCE_OBJ);
}
public static ImageDescriptor icon( IResolve resolve ) throws IOException {
@@ -308,7 +267,6 @@ public static ImageDescriptor icon( final IResolve resolve, IProgressMonitor mon
ImageDescriptor icon = icon((IGeoResource) resolve, monitor);
return icon != null ? icon : new ImageDescriptor(){
- @Override
public ImageData getImageData() {
return image(resolve).getImageData();
}
@@ -321,19 +279,19 @@ public ImageData getImageData() {
if( icon != null ){
return icon;
}
- return CatalogUIPlugin.getImageDescriptor(ISharedImages.SERVER_OBJ);
+ return CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.SERVER_OBJ);
}
if (resolve instanceof IResolveFolder) {
ImageDescriptor icon = icon((IResolveFolder) resolve, monitor);
- return icon != null ? icon : CatalogUIPlugin.getImageDescriptor(ISharedImages.FOLDER_OBJ);
+ return icon != null ? icon : CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.FOLDER_OBJ);
}
if (resolve instanceof ICatalog)
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.CATALOG_OBJ);
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.RESOURCE_OBJ);
}
@@ -367,7 +325,7 @@ private static ImageDescriptor icon( IGeoResource resource, IProgressMonitor mon
// check for default icon last
boolean isFeature = resource.canResolve(FeatureSource.class);
String iconId = iconInternalResource( resource.getID(), isFeature );
- return CatalogUIPlugin.getImageDescriptor( iconId );
+ return CatalogUIPlugin.getDefault().getImageDescriptor( iconId );
}
/** Lookup default resource icon id */
@@ -409,7 +367,7 @@ private static ImageDescriptor icon( IResolveFolder folder, IProgressMonitor mon
if( icon != null ) return icon;
}
// check for default icon last
- return CatalogUIPlugin.getImageDescriptor( ISharedImages.FOLDER_OBJ );
+ return CatalogUIPlugin.getDefault().getImageDescriptor( ISharedImages.FOLDER_OBJ );
}
@@ -446,7 +404,7 @@ private static ImageDescriptor icon( IService service, IProgressMonitor monitor
// check for default icon last
boolean isFeature = service.canResolve( DataStore.class );
String iconId = iconInternalService( service.getID(), isFeature );
- return CatalogUIPlugin.getImageDescriptor( iconId );
+ return CatalogUIPlugin.getDefault().getImageDescriptor( iconId );
}
private static String iconInternalService(ID id, boolean isFeature) {
@@ -479,9 +437,15 @@ private static String iconInternalService(ID id, boolean isFeature) {
}
}
- @Override
+ /* (non-Javadoc)
+ * @see net.refractions.udig.core.AbstractUdigUIPlugin#getIconPath()
+ */
public IPath getIconPath() {
return new Path(ICONS_PATH);
}
+ public static CatalogUIPlugin getDefault() {
+ return INSTANCE;
+ }
+
}
View
2  ...refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/export/CatalogExport.java
@@ -165,7 +165,7 @@ protected Workflow createWorkflow() {
protected Map<Class<? extends State>, WorkflowWizardPageProvider> createPageMapping() {
HashMap<Class<? extends State>, WorkflowWizardPageProvider> map = new HashMap<Class<? extends State>, WorkflowWizardPageProvider>();
String title = Messages.LayerSelectionPage_title;
- ImageDescriptor banner = CatalogUIPlugin.getImageDescriptor(ImageConstants.PATH_WIZBAN+"exportshapefile_wiz.gif"); //$NON-NLS-1$
+ ImageDescriptor banner = CatalogUIPlugin.getDefault().getImageDescriptor(ImageConstants.PATH_WIZBAN+"exportshapefile_wiz.gif"); //$NON-NLS-1$
ExportResourceSelectionPage page = new ExportResourceSelectionPage("Select Layers", title, banner );
map.put(ExportResourceSelectionState.class, new BasicWorkflowWizardPageFactory(page));
View
4 ...et.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/internal/Messages.java
@@ -283,12 +283,12 @@ public static void initAction( IAction a, String id ) {
}
ImageDescriptor image;
- image = CatalogUIPlugin.getImageDescriptor(ePath);
+ image = CatalogUIPlugin.getDefault().getImageDescriptor(ePath);
if (id != null) {
CatalogUIPlugin.trace(id + ": '" + ePath + "' found " + id); //$NON-NLS-1$ //$NON-NLS-2$
a.setImageDescriptor(image);
}
- image = CatalogUIPlugin.getImageDescriptor(dPath);
+ image = CatalogUIPlugin.getDefault().getImageDescriptor(dPath);
if (id != null) {
CatalogUIPlugin.trace(id + ": '" + dPath + "' found " + id); //$NON-NLS-1$ //$NON-NLS-2$
a.setDisabledImageDescriptor(image);
View
2  ...tions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/operation/ReshapeOperation.java
@@ -268,7 +268,7 @@ protected Control createDialogArea(Composite parent) {
text.setLayoutData(gridData);
errors = new ControlDecoration(text, SWT.LEFT|SWT.TOP);
- ImageDescriptor desc = CatalogUIPlugin.getImageDescriptor(ISharedImages.ERROR_OVR);
+ ImageDescriptor desc = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.ERROR_OVR);
ImageRegistry imageRegistry = CatalogUIPlugin.getDefault().getImageRegistry();
Image image = imageRegistry.get(ISharedImages.ERROR_OVR);
if( image==null ){
View
2  ...et.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/search/SearchView.java
@@ -297,7 +297,7 @@ public void menuAboutToShow( IMenuManager mgr ) {
contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
contextMenu.add(new Separator());
- refreshAction.setImageDescriptor(CatalogUIPlugin.getImageDescriptor(ImageConstants.REFRESH_CO));
+ refreshAction.setImageDescriptor(CatalogUIPlugin.getDefault().getImageDescriptor(ImageConstants.REFRESH_CO));
// contextMenu.add(refreshAction);
IWorkbenchWindow window = getSite().getWorkbenchWindow();
View
2  ...refractions.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSFolder.java
@@ -167,7 +167,7 @@ public ImageDescriptor getIcon( IProgressMonitor monitor ) {
if (icon == null) {
icon = WMSGeoResourceImpl.fetchIcon(monitor, layer, service);
if (icon == null) {
- icon = CatalogUIPlugin.getImageDescriptor(
+ icon = CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
}
}
View
18 ...ns.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSGeoResourceImpl.java
@@ -194,7 +194,7 @@ public ImageDescriptor getIcon( IProgressMonitor monitor ) throws IOException {
if (icon == null) {
icon = fetchIcon(monitor, layer, service(monitor));
if (icon == null) {
- icon = CatalogUIPlugin.getImageDescriptor(
+ icon = CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
}
}
@@ -220,7 +220,7 @@ protected static ImageDescriptor fetchIcon( IProgressMonitor monitor, Layer laye
if (layer.getChildren() != null && layer.getChildren().length != 0) {
// Do not request "parent" layer graphics - this kills Mapserver
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
}
@@ -272,7 +272,7 @@ public ImageData getImageData() {
int sh = 0;
ImageData contents = image.getImageData();
if (contents == null) {
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_MISSING);
}
if (contents.maskData != null) {
@@ -379,7 +379,7 @@ public ImageData getImageData() {
}
} catch (IOException t) {
WmsPlugin.trace("Could not get icon", t); //$NON-NLS-1$
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_MISSING);
}
}
@@ -390,7 +390,7 @@ private static ImageDescriptor requestImage( IProgressMonitor monitor, Layer lay
WebMapServer wms = service.getWMS(monitor);
if (wms.getCapabilities().getRequest().getGetLegendGraphic() == null) {
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
}
@@ -433,16 +433,16 @@ public int compare( String format1, String format2 ) {
if (imageDescriptor == null) {
// cannot understand any of the provided formats
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
}
} catch (UnsupportedOperationException notAvailable) {
WmsPlugin.trace("Icon is not available", notAvailable); //$NON-NLS-1$
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
} catch (ServiceException e) {
WmsPlugin.trace("Icon is not available", e); //$NON-NLS-1$
- return CatalogUIPlugin.getImageDescriptor(
+ return CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
}
@@ -544,7 +544,7 @@ public Throwable getMessage() {
}
description = caps.getService().get_abstract();
- super.icon = CatalogUIPlugin.getImageDescriptor(
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
// icon = fetchIcon( monitor );
View
2  ...ns.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSGeoResourceInfo.java
@@ -111,7 +111,7 @@
} else {
title = caps.getService().getTitle();
}
- super.icon = CatalogUIPlugin.getImageDescriptor(
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(
ISharedImages.GRID_OBJ);
}
public String getName() {
View
2  ....udig.catalog.wms/src/net/refractions/udig/catalog/internal/wmsc/WMSCGeoResourceInfo.java
@@ -64,7 +64,7 @@ public WMSCGeoResourceInfo( WMSCGeoResourceImpl geoResourceImpl, IProgressMonito
keywordsFromWMSC.add(this.name);
this.keywords = keywordsFromWMSC.toArray(new String[keywordsFromWMSC.size()]);
- super.icon = CatalogUIPlugin.getImageDescriptor(ISharedImages.GRID_OBJ);
+ super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.GRID_OBJ);
}
View
41 plugins/net.refractions.udig.core/src/net/refractions/udig/core/AbstractUdigUIPlugin.java
@@ -4,12 +4,10 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
/**
* Dynamic ImageRegistry
@@ -17,54 +15,45 @@
*/
public abstract class AbstractUdigUIPlugin extends AbstractUIPlugin {
- /** The shared instance **/
- private static AbstractUdigUIPlugin plugin;
-
/**
* The constructor.
*/
public AbstractUdigUIPlugin() {
super();
- plugin = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
}
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- public static ImageDescriptor getImageDescriptor(String symbolicName) {
- ImageRegistry imageRegistry = plugin.getImageRegistry();
+ public ImageDescriptor getImageDescriptor(String symbolicName) {
+
+ ImageRegistry imageRegistry = getImageRegistry();
ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(symbolicName);
if (imageDescriptor == null) {
// create it from Path and add it to registry
- registerImage(plugin.getIconPath(), symbolicName);
+ registerImage(getIconPath(), symbolicName);
}
return imageRegistry.getDescriptor(symbolicName);
}
- public static Image getImage(String symbolicName) {
- ImageRegistry imageRegistry = plugin.getImageRegistry();
+ public Image getImage(String symbolicName) {
+ ImageRegistry imageRegistry = getImageRegistry();
Image image = imageRegistry.get(symbolicName);
if (image == null) {
// create it from Path and add it to registry
- registerImage(plugin.getIconPath(), symbolicName);
+ registerImage(getIconPath(), symbolicName);
}
return imageRegistry.get(symbolicName);
}
- private static void registerImage(IPath iconPath, String symbolicName) {
- URL imageUrl = FileLocator.find(plugin.getBundle(), iconPath.append(symbolicName), null);
+ private void registerImage(IPath iconPath, String symbolicName) {
+ URL imageUrl = FileLocator.find(getBundle(), iconPath.append(symbolicName), null);
ImageDescriptor image = ImageDescriptor.createFromURL(imageUrl);
- ImageRegistry imageRegistry = plugin.getImageRegistry();
+ ImageRegistry imageRegistry = getImageRegistry();
imageRegistry.put(symbolicName, image);
}
-
+
+ /**
+ * Returns the shared instance.
+ * @return {@link AbstractUdigUIPlugin} singleton
+ */
public abstract IPath getIconPath();
}
View
22 ...net.refractions.udig.issues.test/src/net/refractions/udig/issues/test/IssuesViewTest.java
@@ -37,6 +37,8 @@
import net.refractions.udig.project.ui.internal.MapEditor;
import net.refractions.udig.ui.tests.support.UDIGTestUtil;
+import opendap.servlet.GetDirHandler;
+
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -113,15 +115,15 @@ public void run() {
assertNotNull(p.getColumnImage(list.get(4), IssuesView.PRIORITY_COLUMN));
assertEquals(p.getColumnImage(list.get(0), IssuesView.PRIORITY_COLUMN), IssuesActivator
- .getImage(ImageConstants.PRIORITY_CRITICAL));
+ .getDefault().getImage(ImageConstants.PRIORITY_CRITICAL));
assertEquals(p.getColumnImage(list.get(1), IssuesView.PRIORITY_COLUMN), IssuesActivator
- .getImage(ImageConstants.PRIORITY_HIGH));
+ .getDefault().getImage(ImageConstants.PRIORITY_HIGH));
assertEquals(p.getColumnImage(list.get(2), IssuesView.PRIORITY_COLUMN), IssuesActivator
- .getImage(ImageConstants.PRIORITY_LOW));
+ .getDefault().getImage(ImageConstants.PRIORITY_LOW));
assertEquals(p.getColumnImage(list.get(3), IssuesView.PRIORITY_COLUMN), IssuesActivator
- .getImage(ImageConstants.PRIORITY_TRIVIAL));
+ .getDefault().getImage(ImageConstants.PRIORITY_TRIVIAL));
assertEquals(p.getColumnImage(list.get(4), IssuesView.PRIORITY_COLUMN), IssuesActivator
- .getImage(ImageConstants.PRIORITY_WARNING));
+ .getDefault().getImage(ImageConstants.PRIORITY_WARNING));
// resolution image
assertNotNull(p.getColumnImage(list.get(0), IssuesView.RESOLUTION_COLUMN));
@@ -131,15 +133,15 @@ public void run() {
assertNotNull(p.getColumnImage(list.get(4), IssuesView.RESOLUTION_COLUMN));
assertEquals(p.getColumnImage(list.get(0), IssuesView.RESOLUTION_COLUMN), IssuesActivator
- .getImage(ImageConstants.RESOLUTION_UNRESOLVED));
+ .getDefault().getImage(ImageConstants.RESOLUTION_UNRESOLVED));
assertEquals(p.getColumnImage(list.get(1), IssuesView.RESOLUTION_COLUMN), IssuesActivator
- .getImage(ImageConstants.RESOLUTION_VIEWED));
+ .getDefault().getImage(ImageConstants.RESOLUTION_VIEWED));
assertEquals(p.getColumnImage(list.get(2), IssuesView.RESOLUTION_COLUMN), IssuesActivator
- .getImage(ImageConstants.RESOLUTION_RESOLVED));
+ .getDefault().getImage(ImageConstants.RESOLUTION_RESOLVED));
assertEquals(p.getColumnImage(list.get(3), IssuesView.RESOLUTION_COLUMN), IssuesActivator
- .getImage(ImageConstants.RESOLUTION_UNKNOWN));
+ .getDefault().getImage(ImageConstants.RESOLUTION_UNKNOWN));
assertEquals(p.getColumnImage(list.get(4), IssuesView.RESOLUTION_COLUMN), IssuesActivator
- .getImage(ImageConstants.RESOLUTION_UNRESOLVED));
+ .getDefault().getImage(ImageConstants.RESOLUTION_UNRESOLVED));
// name image
assertNull(p.getColumnImage(list.get(0), IssuesView.OBJECT_COLUMN));
View
34 ...net.refractions.udig.issues/src/net/refractions/udig/issues/internal/IssuesActivator.java
@@ -13,7 +13,6 @@
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchListener;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
@@ -26,14 +25,13 @@
static final String ICONS_PATH = "icons/"; //$NON-NLS-1$
- // The shared instance
- private static IssuesActivator plugin;
-
+ private static IssuesActivator INSTANCE;
+
/**
* The constructor
*/
public IssuesActivator() {
- plugin = this;
+ super();
}
/*
@@ -62,24 +60,6 @@ public boolean preShutdown( IWorkbench workbench, boolean forced ) {
});
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static IssuesActivator getDefault() {
- return plugin;
- }
/**
* Writes an info log in the plugin's log.
@@ -94,7 +74,13 @@ public static void log( String message2, Throwable e ) {
getDefault().getLog().log(new Status(IStatus.INFO, PLUGIN_ID, IStatus.OK, message, e));
}
- @Override
+ public static IssuesActivator getDefault() {
+ return INSTANCE;
+ }
+
+ /* (non-Javadoc)
+ * @see net.refractions.udig.core.AbstractUdigUIPlugin#getIconPath()
+ */
public IPath getIconPath() {
return new Path(ICONS_PATH);
}
View
18 ...ctions.udig.issues/src/net/refractions/udig/issues/internal/view/IssuesLabelProvider.java
@@ -32,15 +32,15 @@ public Image getColumnImage(Object element, int columnIndex) {
case IssuesView.PRIORITY_COLUMN:
switch (issue.getPriority()) {
case CRITICAL:
- return IssuesActivator.getImage(ImageConstants.PRIORITY_CRITICAL);
+ return IssuesActivator.getDefault().getImage(ImageConstants.PRIORITY_CRITICAL);
case HIGH:
- return IssuesActivator.getImage(ImageConstants.PRIORITY_HIGH);
+ return IssuesActivator.getDefault().getImage(ImageConstants.PRIORITY_HIGH);
case WARNING:
- return IssuesActivator.getImage(ImageConstants.PRIORITY_WARNING);
+ return IssuesActivator.getDefault().getImage(ImageConstants.PRIORITY_WARNING);
case LOW:
- return IssuesActivator.getImage(ImageConstants.PRIORITY_LOW);
+ return IssuesActivator.getDefault().getImage(ImageConstants.PRIORITY_LOW);
case TRIVIAL:
- return IssuesActivator.getImage(ImageConstants.PRIORITY_TRIVIAL);
+ return IssuesActivator.getDefault().getImage(ImageConstants.PRIORITY_TRIVIAL);
default:
break;
@@ -48,13 +48,13 @@ public Image getColumnImage(Object element, int columnIndex) {
case IssuesView.RESOLUTION_COLUMN:
switch (issue.getResolution()) {
case RESOLVED:
- return IssuesActivator.getImage(ImageConstants.RESOLUTION_RESOLVED);
+ return IssuesActivator.getDefault().getImage(ImageConstants.RESOLUTION_RESOLVED);
case UNKNOWN:
- return IssuesActivator.getImage(ImageConstants.RESOLUTION_UNKNOWN);
+ return IssuesActivator.getDefault().getImage(ImageConstants.RESOLUTION_UNKNOWN);
case UNRESOLVED:
- return IssuesActivator.getImage(ImageConstants.RESOLUTION_UNRESOLVED);
+ return IssuesActivator.getDefault().getImage(ImageConstants.RESOLUTION_UNRESOLVED);
case IN_PROGRESS:
- return IssuesActivator.getImage(ImageConstants.RESOLUTION_VIEWED);
+ return IssuesActivator.getDefault().getImage(ImageConstants.RESOLUTION_VIEWED);
default:
break;
View
6 ...net.refractions.udig.issues/src/net/refractions/udig/issues/internal/view/IssuesView.java
@@ -375,7 +375,7 @@ public void menuAboutToShow(IMenuManager mgr) {
private IAction createDeleteGroupAction() {
IAction action = new Action(Messages.IssuesView_deleteRelatedAction, IssuesActivator
- .getImageDescriptor(ImageConstants.DELETE_GROUP)) {
+ .getDefault().getImageDescriptor(ImageConstants.DELETE_GROUP)) {
@Override
public void runWithEvent(Event event) {
IStructuredSelection sel = (IStructuredSelection) viewer
@@ -443,7 +443,7 @@ public void selectionChanged(SelectionChangedEvent event) {
private IAction createDeleteAction() {
Action action = new Action(Messages.IssuesView_DeleteIssueAction, IssuesActivator
- .getImageDescriptor(ImageConstants.DELETE)) {
+ .getDefault().getImageDescriptor(ImageConstants.DELETE)) {
@SuppressWarnings("unchecked")
@Override
public void runWithEvent(Event event) {
@@ -545,7 +545,7 @@ public void runWithEvent(Event event) {
fixIssue((IIssue) sel.getFirstElement());
}
};
- action.setImageDescriptor(IssuesActivator
+ action.setImageDescriptor(IssuesActivator.getDefault()
.getImageDescriptor(ImageConstants.GOTO_ISSUE));
action.setText(Messages.IssuesView_fix_action_name);
action.setToolTipText(Messages.IssuesView_fix_action_tooltip);
View
39 ...ins/net.refractions.udig.location/src/net/refractions/udig/location/LocationUIPlugin.java
@@ -7,55 +7,28 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class LocationUIPlugin extends AbstractUdigUIPlugin {
+ private static LocationUIPlugin INSTANCE;
public static String ID = "net.refractions.udig.location"; //$NON-NLS-1$
/** Icons path (value "icons/") */
public final static String ICONS_PATH = "icons/";//$NON-NLS-1$
- //The shared instance.
- private static LocationUIPlugin plugin;
-
/**
* The constructor.
*/
public LocationUIPlugin() {
- plugin = this;
+ super();
+ INSTANCE = this;
}
- /**
- * Set up shared images.
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- * @param context
- * @throws Exception
- */
- public void start( BundleContext context ) throws Exception {
- super.start(context);
- }
- /**
- * Cleanup after shared images.
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- * @param context
- * @throws Exception
- */
- public void stop( BundleContext context ) throws Exception {
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- */
public static LocationUIPlugin getDefault() {
- return plugin;
+ return INSTANCE;
}
-
/**
* Logs the Throwable in the plugin's log.
* <p>
@@ -123,7 +96,9 @@ public static boolean isDebugging( final String trace ) {
&& "true".equalsIgnoreCase(Platform.getDebugOption(trace)); //$NON-NLS-1$
}
- @Override
+ /* (non-Javadoc)
+ * @see net.refractions.udig.core.AbstractUdigUIPlugin#getIconPath()
+ */
public IPath getIconPath() {
return new Path(ICONS_PATH);
}
View
4 ...ns/net.refractions.udig.location/src/net/refractions/udig/location/internal/Messages.java
@@ -115,12 +115,12 @@ public static void initAction( IAction a, String id ) {
}
ImageDescriptor image;
- image = LocationUIPlugin.getImageDescriptor(ePath);
+ image = LocationUIPlugin.getDefault().getImageDescriptor(ePath);
if (id != null) {
LocationUIPlugin.trace(id + ": '" + ePath + "' found " + id); //$NON-NLS-1$ //$NON-NLS-2$
a.setImageDescriptor(image);
}
- image = LocationUIPlugin.getImageDescriptor(dPath);
+ image = LocationUIPlugin.getDefault().getImageDescriptor(dPath);
if (id != null) {
LocationUIPlugin.trace(id + ": '" + dPath + "' found " + id); //$NON-NLS-1$ //$NON-NLS-2$
a.setDisabledImageDescriptor(image);
View
2  plugins/net.refractions.udig.location/src/net/refractions/udig/location/ui/LocationView.java
@@ -280,7 +280,7 @@ public void menuAboutToShow(IMenuManager mgr) {
IWorkbenchActionConstants.MB_ADDITIONS));
contextMenu.add(new Separator());
- showAction.setImageDescriptor( LocationUIPlugin.getImageDescriptor(ImageConstants.SHOW_CO));
+ showAction.setImageDescriptor( LocationUIPlugin.getDefault().getImageDescriptor(ImageConstants.SHOW_CO));
contextMenu.add(showAction);
}
View
2  ...ons.udig.project.ui/src/net/refractions/udig/project/ui/internal/LayerStateDecorator.java
@@ -76,7 +76,7 @@ void refresh() {
public void decorate( Object element, IDecoration decoration ) {
Layer layer = (Layer) element; // should be safe, extention point does the instanceof
// check
- decoration.addOverlay(ProjectUIPlugin.getImageDescriptor(ISharedImages.WRITE_OVR));
+ decoration.addOverlay(ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.WRITE_OVR));
if (!layer.eAdapters().contains(hack)) {
layer.eAdapters().add(hack);
View
30 ...ns.udig.project.ui/src/net/refractions/udig/project/ui/internal/LayerStatusDecorator.java
@@ -88,7 +88,7 @@ public synchronized void decorate( Object element, IDecoration decoration ) {
if (ovr != null)
decoration.addOverlay(ovr, IDecoration.BOTTOM_LEFT);
- // decoration.addOverlay( ProjectUIPlugin.getImageDescriptor( ISharedImages.SELECT_UDR ),
+ // decoration.addOverlay( ProjectUIPlugin.getDefault().getImageDescriptor( ISharedImages.SELECT_UDR ),
// IDecoration.UNDERLAY );
if (!layer.eAdapters().contains(hack))
@@ -99,34 +99,34 @@ private ImageDescriptor statusIcon( Layer layer ) {
currentlyDisplayedStatus.put(layer, layer.getStatus());
switch( layer.getStatus() ) {
case ILayer.WARNING:
- return ProjectUIPlugin.getImageDescriptor(ISharedImages.WARN_OVR);
+ return ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.WARN_OVR);
case ILayer.ERROR:
- return ProjectUIPlugin.getImageDescriptor(ISharedImages.ERROR_OVR);
+ return ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.ERROR_OVR);
case ILayer.MISSING:
- return ProjectUIPlugin.getImageDescriptor(ISharedImages.HUH_OVR);
+ return ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.HUH_OVR);
case ILayer.UNCONFIGURED:
- return ProjectUIPlugin.getImageDescriptor(ISharedImages.UNCONFIGURED_OVR);
+ return ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.UNCONFIGURED_OVR);
case ILayer.WAIT:
- return ProjectUIPlugin.getImageDescriptor(ISharedImages.WAIT_OVR);
+ return ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.WAIT_OVR);
case ILayer.WORKING:
- return ProjectUIPlugin.getImageDescriptor(ISharedImages.CLOCK0_OVR);
+ return ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.CLOCK0_OVR);
/*
* { int clock = 0; if( layer.getProperties().contains("clock")){ clock =
* layer.getProperties().getInteger( "clock" ); } clock++; if ( clock > 7 ) clock = 0;
* layer.getProperties().putInteger( "clock", clock ); switch( clock ){ case 0: return
- * ProjectUIPlugin.getImageDescriptor( ISharedImages.CLOCK0_OVR ); case 1: return ProjectUIPlugin.getImageDescriptor(
- * ISharedImages.CLOCK1_OVR ); case 2: return ProjectUIPlugin.getImageDescriptor(
- * ISharedImages.CLOCK2_OVR ); case 3: return ProjectUIPlugin.getImageDescriptor(
- * ISharedImages.CLOCK3_OVR ); case 4: return ProjectUIPlugin.getImageDescriptor(
- * ISharedImages.CLOCK4_OVR ); case 5: return ProjectUIPlugin.getImageDescriptor(
- * ISharedImages.CLOCK5_OVR ); case 6: return ProjectUIPlugin.getImageDescriptor(
- * ISharedImages.CLOCK6_OVR ); case 7: return ProjectUIPlugin.getImageDescriptor(
- * ISharedImages.CLOCK7_OVR ); default: return ProjectUIPlugin.getImageDescriptor(
+ * ProjectUIPlugin.getDefault().getImageDescriptor( ISharedImages.CLOCK0_OVR ); case 1: return ProjectUIPlugin.getDefault().getImageDescriptor(
+ * ISharedImages.CLOCK1_OVR ); case 2: return ProjectUIPlugin.getDefault().getImageDescriptor(
+ * ISharedImages.CLOCK2_OVR ); case 3: return ProjectUIPlugin.getDefault().getImageDescriptor(
+ * ISharedImages.CLOCK3_OVR ); case 4: return ProjectUIPlugin.getDefault().getImageDescriptor(
+ * ISharedImages.CLOCK4_OVR ); case 5: return ProjectUIPlugin.getDefault().getImageDescriptor(
+ * ISharedImages.CLOCK5_OVR ); case 6: return ProjectUIPlugin.getDefault().getImageDescriptor(
+ * ISharedImages.CLOCK6_OVR ); case 7: return ProjectUIPlugin.getDefault().getImageDescriptor(
+ * ISharedImages.CLOCK7_OVR ); default: return ProjectUIPlugin.getDefault().getImageDescriptor(
* ISharedImages.WAIT_OVR ); } }
*/
case ILayer.DONE:
View
4 ....refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/LayersView.java
@@ -744,7 +744,7 @@ public void run() {
};
downAction.setEnabled(false);
downAction.setToolTipText(Messages.LayersView_down_tooltip);
- downAction.setImageDescriptor(ProjectUIPlugin.getImageDescriptor(ISharedImages.DOWN_CO));
+ downAction.setImageDescriptor(ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.DOWN_CO));
return downAction;
}
@@ -765,7 +765,7 @@ public void run() {
};
upAction.setEnabled(false);
upAction.setToolTipText(Messages.LayersView_up_tooltip);
- upAction.setImageDescriptor(ProjectUIPlugin.getImageDescriptor(ISharedImages.UP_CO));
+ upAction.setImageDescriptor(ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.UP_CO));
return upAction;
}
View
2  ...t.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/MapEditor.java
@@ -915,7 +915,7 @@ public void createPartControl( final Composite parent ) {
setPartName(getMap().getName());
setTitleToolTip(Messages.MapEditor_titleToolTip);
- setTitleImage(ProjectUIPlugin.getImage(ISharedImages.MAP_OBJ));
+ setTitleImage(ProjectUIPlugin.getDefault().getImage(ISharedImages.MAP_OBJ));
final IPreferenceStore preferenceStore = ProjectPlugin.getPlugin().getPreferenceStore();
boolean istiled = preferenceStore
View
2  ...efractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/MapStylePage.java
@@ -56,7 +56,7 @@
*/
protected MapStylePage( List layers ) {
super(
- Messages.MapStylePage_editStyles, Messages.MapStylePage_editStyles, ProjectUIPlugin.getImageDescriptor(ISharedImages.NEWMAP_WIZBAN));
+ Messages.MapStylePage_editStyles, Messages.MapStylePage_editStyles, ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.NEWMAP_WIZBAN));
setDescription(Messages.MapStylePage_editStyles_description);
this.layers = layers;
}
View
4 ...actions.udig.project.ui/src/net/refractions/udig/project/ui/internal/ProjectExplorer.java
@@ -376,8 +376,8 @@ public void runWithEvent( Event event ) {
};
boolean linked = preferenceStore.getBoolean(PROJECT_EXPLORER_LINKED);
linkAction.setChecked(linked);
- linkAction.setImageDescriptor(ProjectUIPlugin.getImageDescriptor(ISharedImages.LINKED_ENABLED_CO));
- linkAction.setDisabledImageDescriptor(ProjectUIPlugin
+ linkAction.setImageDescriptor(ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.LINKED_ENABLED_CO));
+ linkAction.setDisabledImageDescriptor(ProjectUIPlugin.getDefault()
.getImageDescriptor(ISharedImages.LINKED_DISABLED_CO));
linkAction.setToolTipText(Messages.ProjectExplorer_link_tooltip);
if (linked)
View
25 ...actions.udig.project.ui/src/net/refractions/udig/project/ui/internal/ProjectUIPlugin.java
@@ -8,14 +8,12 @@
*/
package net.refractions.udig.project.ui.internal;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.refractions.udig.core.AbstractUdigUIPlugin;
import net.refractions.udig.project.ui.feature.FeaturePanelProcessor;
-import net.refractions.udig.ui.PlatformGIS;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -36,7 +34,6 @@
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.PropertySheetPage;
import org.osgi.framework.BundleContext;
@@ -48,16 +45,12 @@
* @author Jesse Eichar
* @version $Revision: 1.9 $
*/
+/**
+ * @author fgdrf
+ *
+ */
public class ProjectUIPlugin extends AbstractUdigUIPlugin {
-
- /**
- * Keep track of the singleton. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static final ProjectUIPlugin INSTANCE = new ProjectUIPlugin();
-
/**
* The default speed for mouse double click in milliseconds.
*/
@@ -77,7 +70,7 @@
*/
public static final int MAX_RESOURCES_IN_SERVICE = 1;
- private static ProjectUIPlugin plugin;
+ private static ProjectUIPlugin INSTANCE;
List<AdapterFactory> adapterFactories;
@@ -92,7 +85,7 @@
*/
public ProjectUIPlugin() {
super();
- plugin = this;
+ INSTANCE = this;
}
FeatureEditorExtensionProcessor featureEditProcessor = new FeatureEditorExtensionProcessor();
@@ -114,7 +107,7 @@ public void start( BundleContext context ) throws Exception {
* @return the plugin object
*/
public static ProjectUIPlugin getDefault() {
- return plugin;
+ return INSTANCE;
}
/**
@@ -325,7 +318,9 @@ public int getDoubleClickSpeed() {
return mouseSpeed;
}
- @Override
+ /* (non-Javadoc)
+ * @see net.refractions.udig.core.AbstractUdigUIPlugin#getIconPath()
+ */
public IPath getIconPath() {
return new Path(ICONS_PATH);
}
View
2  ...udig.project.ui/src/net/refractions/udig/project/ui/internal/TemporaryLayerDecorator.java
@@ -32,7 +32,7 @@
public void decorate( Object element, IDecoration decoration ) {
ILayer layer = (ILayer) element;
if( layer.hasResource(ITransientResolve.class) ){
- decoration.addOverlay(ProjectUIPlugin.getImageDescriptor(ISharedImages.CHANGED_OVR));
+ decoration.addOverlay(ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.CHANGED_OVR));
}
}
View
2  ....project.ui/src/net/refractions/udig/project/ui/internal/wizard/NewProjectWizardPage.java
@@ -43,7 +43,7 @@
*/
public NewProjectWizardPage() {
super(
- Messages.NewProjectWizardPage_newProject, Messages.NewProjectWizardPage_newProject, ProjectUIPlugin.getImageDescriptor(ISharedImages.NEWPROJECT_WIZBAN));
+ Messages.NewProjectWizardPage_newProject, Messages.NewProjectWizardPage_newProject, ProjectUIPlugin.getDefault().getImageDescriptor(ISharedImages.NEWPROJECT_WIZBAN));
setDescription(Messages.NewProjectWizardPage_newProject_description);
}
View
2  ...ct.ui/src/net/refractions/udig/project/ui/wizard/export/image/ExportMapToImageWizard.java
@@ -72,7 +72,7 @@ public ExportMapToImageWizard() {
setDialogSettings(ProjectUIPlugin.getDefault().getDialogSettings());
String title = null; // will use default title
- ImageDescriptor banner = ProjectUIPlugin.getImageDescriptor(Icons.WIZBAN + "exportimage_wiz.gif"); //$NON-NLS-1$
+ ImageDescriptor banner = ProjectUIPlugin.getDefault().getImageDescriptor(Icons.WIZBAN + "exportimage_wiz.gif"); //$NON-NLS-1$
setDefaultPageImageDescriptor(banner);
mapSelectorPage = new MapSelectorPageWithScaleColumn("Select Map With Scale", title, banner); //$NON-NLS-1$
addPage(mapSelectorPage);
View
2  ...dig.project.ui/src/net/refractions/udig/project/ui/wizard/export/map/ExportMapWizard.java
@@ -32,7 +32,7 @@
public ExportMapWizard() {
setWindowTitle("Export Map");
String title = null; // will use default page title
- ImageDescriptor banner = ProjectUIPlugin.getImageDescriptor( Icons.WIZBAN +"exportselection_wiz.gif" );
+ ImageDescriptor banner = ProjectUIPlugin.getDefault().getImageDescriptor( Icons.WIZBAN +"exportselection_wiz.gif" );
//setDefaultPageImageDescriptor(banner);
mapSelector = new MapSelectorPageWithScaleColumn("Export Selection", title, banner );
}
View
66 plugins/net.refractions.udig.style.sld/src/net/refractions/udig/style/sld/SLDPlugin.java
@@ -1,8 +1,5 @@
package net.refractions.udig.style.sld;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
import net.refractions.udig.core.AbstractUdigUIPlugin;
import org.eclipse.core.runtime.IPath;
@@ -10,7 +7,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
@@ -21,70 +17,17 @@
public static final String ID = "net.refractions.udig.style.sld"; //$NON-NLS-1$
/** Icons path (value "icons/") */
public final static String ICONS_PATH = "icons/";//$NON-NLS-1$
-
- // The shared instance.
- private static SLDPlugin plugin;
- // Resource bundle.
- private ResourceBundle resourceBundle;
+ private static SLDPlugin INSTANCE;
/**
* The constructor.
*/
public SLDPlugin() {
super();
- plugin = this;
+ INSTANCE = this;
}
/**
- * This method is called upon plug-in activation
- */
- public void start( BundleContext context ) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop( BundleContext context ) throws Exception {
- plugin = null;
- resourceBundle = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- */
- public static SLDPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle, or 'key' if not found.
- */
- public static String getResourceString( String key ) {
- ResourceBundle bundle = SLDPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle
- .getBundle("net.refractions.udig.style.sld.SldPluginResources"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- /**
* Writes an info log in the plugin's log.
* <p>
* This should be used for user level messages.
@@ -125,7 +68,10 @@ public static boolean isDebugging( final String trace ){
"true".equalsIgnoreCase(Platform.getDebugOption(trace)); //$NON-NLS-1$
}
- @Override
+ public static SLDPlugin getDefault() {
+ return INSTANCE;
+ }
+
public IPath getIconPath() {
return new Path(ICONS_PATH);
}
View
44 ....refractions.udig.style.sld/src/net/refractions/udig/style/sld/editor/StyleThemePage.java
@@ -511,12 +511,12 @@ private void createSuitabilityDisplay(Composite compBottomRight) {
layout.marginWidth = 0;
icons.setLayout(layout);
- createSuitabilityIcon(icons, LABEL_ICON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour, SLDPlugin.getImageDescriptor(ImageConstants.COLORBLIND_ICON).createImage());
- createSuitabilityIcon(icons, LABEL_ICON_CRT, Messages.StyleEditor_theme_suitability_crt, SLDPlugin.getImageDescriptor(ImageConstants.CRT_ICON).createImage());
- createSuitabilityIcon(icons, LABEL_ICON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj, SLDPlugin.getImageDescriptor(ImageConstants.PROJECTOR_ICON).createImage());
- createSuitabilityIcon(icons, LABEL_ICON_LCD, Messages.StyleEditor_theme_suitability_lcd, SLDPlugin.getImageDescriptor(ImageConstants.LAPTOP_ICON).createImage());
- createSuitabilityIcon(icons, LABEL_ICON_PRINT, Messages.StyleEditor_theme_suitability_print, SLDPlugin.getImageDescriptor(ImageConstants.PRINTER_ICON).createImage());
- createSuitabilityIcon(icons, LABEL_ICON_PHOTOCOPY, Messages.StyleEditor_theme_suitability_pcopy, SLDPlugin.getImageDescriptor(ImageConstants.PHOTOCOPY_ICON).createImage());
+ createSuitabilityIcon(icons, LABEL_ICON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON).createImage());
+ createSuitabilityIcon(icons, LABEL_ICON_CRT, Messages.StyleEditor_theme_suitability_crt, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON).createImage());
+ createSuitabilityIcon(icons, LABEL_ICON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PROJECTOR_ICON).createImage());
+ createSuitabilityIcon(icons, LABEL_ICON_LCD, Messages.StyleEditor_theme_suitability_lcd, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON).createImage());
+ createSuitabilityIcon(icons, LABEL_ICON_PRINT, Messages.StyleEditor_theme_suitability_print, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON).createImage());
+ createSuitabilityIcon(icons, LABEL_ICON_PHOTOCOPY, Messages.StyleEditor_theme_suitability_pcopy, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PHOTOCOPY_ICON).createImage());
}
private CellEditor[] createCellEditors() {
@@ -793,12 +793,12 @@ public void widgetDefaultSelected( SelectionEvent e ) {
compMiddle4.setLayout(layout);
//toggle buttons
- createToggleButton(compMiddle4, BUTTON_COLORBLIND, SLDPlugin.getImageDescriptor(ImageConstants.COLORBLIND_ICON).createImage());
- createToggleButton(compMiddle4, BUTTON_CRT, SLDPlugin.getImageDescriptor(ImageConstants.CRT_ICON).createImage());
- createToggleButton(compMiddle4, BUTTON_PROJECTOR, SLDPlugin.getImageDescriptor(ImageConstants.PROJECTOR_ICON).createImage());
- createToggleButton(compMiddle4, BUTTON_LCD, SLDPlugin.getImageDescriptor(ImageConstants.LAPTOP_ICON).createImage());
- createToggleButton(compMiddle4, BUTTON_PRINT, SLDPlugin.getImageDescriptor(ImageConstants.PRINTER_ICON).createImage());
- createToggleButton(compMiddle4, BUTTON_PHOTOCOPY, SLDPlugin.getImageDescriptor(ImageConstants.PHOTOCOPY_ICON).createImage());
+ createToggleButton(compMiddle4, BUTTON_COLORBLIND, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON).createImage());
+ createToggleButton(compMiddle4, BUTTON_CRT, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON).createImage());
+ createToggleButton(compMiddle4, BUTTON_PROJECTOR, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PROJECTOR_ICON).createImage());
+ createToggleButton(compMiddle4, BUTTON_LCD, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON).createImage());
+ createToggleButton(compMiddle4, BUTTON_PRINT, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON).createImage());
+ createToggleButton(compMiddle4, BUTTON_PHOTOCOPY, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PHOTOCOPY_ICON).createImage());
}
private Composite createPaletteLabel(Font font, Composite compMiddle) {
@@ -1691,17 +1691,17 @@ private void updateSuitabilities(int[] suitability) {
+ controlNames.get(icon) + " "; //$NON-NLS-1$
Label label = getLabel(icon);
if (quality == PaletteSuitability.QUALITY_GOOD) {
- //getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getImageDescriptor(ImageConstants.GOOD_OVERLAY)));
+ //getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.GOOD_OVERLAY)));
label.setImage(getImageWithOverlay(icon, null));
label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_good);
} else if (quality == PaletteSuitability.QUALITY_DOUBTFUL) {
- getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getImageDescriptor(ImageConstants.DOUBTFUL_OVERLAY)));
+ getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.DOUBTFUL_OVERLAY)));
label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_doubtful);
} else if (quality == PaletteSuitability.QUALITY_BAD) {
- getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getImageDescriptor(ImageConstants.BAD_OVERLAY)));
+ getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.BAD_OVERLAY)));
label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_bad);
} else { //UNKNOWN
- getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getImageDescriptor(ImageConstants.UNKNOWN_OVERLAY)));
+ getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.UNKNOWN_OVERLAY)));
label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_unknown);
}
}
@@ -1711,12 +1711,12 @@ private Image getImageWithOverlay(int iconLabelID, ImageDescriptor overlay) {
//get the base image
ImageDescriptor descriptor = null;
Image base = null;
- if (iconLabelID == LABEL_ICON_COLORBLIND) descriptor = SLDPlugin.getImageDescriptor(ImageConstants.COLORBLIND_ICON);
- else if (iconLabelID == LABEL_ICON_CRT) descriptor = SLDPlugin.getImageDescriptor(ImageConstants.CRT_ICON);
- else if (iconLabelID == LABEL_ICON_LCD) descriptor = SLDPlugin.getImageDescriptor(ImageConstants.LAPTOP_ICON);
- else if (iconLabelID == LABEL_ICON_PHOTOCOPY) descriptor = SLDPlugin.getImageDescriptor(ImageConstants.PHOTOCOPY_ICON);
- else if (iconLabelID == LABEL_ICON_PRINT) descriptor = SLDPlugin.getImageDescriptor(ImageConstants.PRINTER_ICON);
- else if (iconLabelID == LABEL_ICON_PROJECTOR) descriptor = SLDPlugin.getImageDescriptor(ImageConstants.PROJECTOR_ICON);
+ if (iconLabelID == LABEL_ICON_COLORBLIND) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON);
+ else if (iconLabelID == LABEL_ICON_CRT) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON);
+ else if (iconLabelID == LABEL_ICON_LCD) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON);
+ else if (iconLabelID == LABEL_ICON_PHOTOCOPY) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PHOTOCOPY_ICON);
+ else if (iconLabelID == LABEL_ICON_PRINT) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON);
+ else if (iconLabelID == LABEL_ICON_PROJECTOR) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PROJECTOR_ICON);
if (descriptor != null) base = descriptor.createImage();
if (overlay == null) return base;
//apply the overlay
View
36 plugins/net.refractions.udig.style/src/net/refractions/udig/style/StylePlugin.java
@@ -4,7 +4,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.osgi.framework.BundleContext;
public class StylePlugin extends AbstractUdigUIPlugin {
@@ -13,43 +12,22 @@
/** Icons path (value "icons/") */
public final static String ICONS_PATH = "icons/";//$NON-NLS-1$
-
- /** The shared instance **/
- private static StylePlugin plugin;
+
+ private static StylePlugin INSTANCE;
/**
* The constructor.
*/
public StylePlugin() {
super();
- plugin = this;
+ INSTANCE = this;
}
- /**
- * Set up shared images.
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- * @param context
- * @throws Exception
- */
- public void start(BundleContext context) throws Exception {
- super.start( context );
- }
-
- /**
- * Returns the shared instance.
- * @return StylePlugin singleton
- */
- public static StylePlugin getDefault() {
- return plugin;
- }
-
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- @Override
public IPath getIconPath() {
return new Path(ICONS_PATH);
}
+
+ public static StylePlugin getDefault() {
+ return INSTANCE;
+ }
}
View
4 plugins/net.refractions.udig.style/src/net/refractions/udig/style/ui/StyleView.java
@@ -602,7 +602,7 @@ public void run() {
};
applyAction.setEnabled(false);
applyAction.setToolTipText(Messages.StyleView_apply_tooltip);
- applyAction.setImageDescriptor(StylePlugin.getImageDescriptor(ImageConstants.APPLY_STYLE));
+ applyAction.setImageDescriptor(StylePlugin.getDefault().getImageDescriptor(ImageConstants.APPLY_STYLE));
// applyCI = new ActionContributionItem(applyAction);
cancelAction = new Action("cancel"){ //$NON-NLS-1$
@@ -612,7 +612,7 @@ public void run() {
};
cancelAction.setEnabled(false);
cancelAction.setToolTipText(Messages.StyleView_cancel_tooltip);
- cancelAction.setImageDescriptor(StylePlugin.getImageDescriptor(ImageConstants.CANCEL_STYLE));
+ cancelAction.setImageDescriptor(StylePlugin.getDefault().getImageDescriptor(ImageConstants.CANCEL_STYLE));
// cancelCI = new ActionContributionItem(cancelAction);
}
View
2  plugins/net.refractions.udig.ui/src/net/refractions/udig/internal/ui/SendLogDialog.java
@@ -83,7 +83,7 @@ protected Point getInitialSize() {
@Override
protected Control createDialogArea( Composite parent ) {
setTitle(Messages.SendLogDialog_description);
- ImageDescriptor image = UiPlugin.getImageDescriptor(ImageConstants.LOG_WIZ);
+ ImageDescriptor image = UiPlugin.getDefault().getImageDescriptor(ImageConstants.LOG_WIZ);
if (image != null) setTitleImage(image.createImage());
// create a composite with standard margins and spacing
View
21 plugins/net.refractions.udig.ui/src/net/refractions/udig/internal/ui/UiPlugin.java
@@ -61,8 +61,6 @@
* @author Jody
*/
public class UiPlugin extends AbstractUdigUIPlugin {
- // The shared instance.
- private static UiPlugin plugin;
/** Icons path (value "icons/") */
public final static String ICONS_PATH = "icons/";//$NON-NLS-1$
@@ -88,13 +86,15 @@
* @see loadVersion()
*/
private String version;
+
+ private static UiPlugin INSTANCE;
/**
* The constructor.
*/
public UiPlugin() {
super();
- plugin = this;
+ INSTANCE = this;
}
/**
@@ -232,7 +232,7 @@ synchronized ImageDescriptor create( String id ) {
* Returns the shared instance.
*/
public static UiPlugin getDefault() {
- return plugin;
+ return INSTANCE;
}
public OperationMenuFactory getOperationMenuFactory() {
@@ -243,17 +243,6 @@ public OperationMenuFactory getOperationMenuFactory() {
return operationMenuFactory;
}
- public void stop( BundleContext context ) throws Exception {
- // try{
- // // if( preferences!=null )
- // // preferences.flush();
- // }catch (Throwable e) {
- // log("Error saving preferences", e); //$NON-NLS-1$
- // }
- super.stop(context);
-
- plugin = null;
- }
/**
* Logs the given throwable to the platform log, indicating the class and
* method from where it is being logged (this is not necessarily where it
@@ -697,9 +686,7 @@ public static Preferences getUserPreferences() {
return new InstanceScope().getNode(ID);
}
- @Override
public IPath getIconPath() {
return new Path(ICONS_PATH);
}
-
}
View
4 plugins/net.refractions.udig.ui/src/net/refractions/udig/ui/FeatureTypeEditor.java
@@ -446,7 +446,7 @@ public void runWithEvent( Event event ) {
createAttributeAction.setId("net.refractions.udig.ui.FeatureTypeEditor.createAttributeAction"); //$NON-NLS-1$
createAttributeAction.setText(Messages.addAttributeAction_label);
createAttributeAction.setToolTipText(Messages.addAttributeAction_label);
- createAttributeAction.setImageDescriptor(UiPlugin.getImageDescriptor("elcl16/new_attribute.gif")); //$NON-NLS-1$
+ createAttributeAction.setImageDescriptor(UiPlugin.getDefault().getImageDescriptor("elcl16/new_attribute.gif")); //$NON-NLS-1$
}
return createAttributeAction;
}
@@ -476,7 +476,7 @@ public void runWithEvent( Event event ) {
};
deleteAttributeAction.setText(Messages.deleteAttributeAction_label);
deleteAttributeAction.setToolTipText(Messages.deleteAttributeAction_tooltip);
- deleteAttributeAction.setImageDescriptor(UiPlugin.getImageDescriptor("elcl16/delete.gif")); //$NON-NLS-1$
+ deleteAttributeAction.setImageDescriptor(UiPlugin.getDefault().getImageDescriptor("elcl16/delete.gif")); //$NON-NLS-1$
deleteAttributeAction.setDescription(Messages.deleteAttributeAction_description);
deleteAttributeAction.setId("net.refractions.udig.ui.FeatureTypeEditor.deleteAttributeAction"); //$NON-NLS-1$
}
View
2  ...ins/net.refractions.udig.ui/src/net/refractions/udig/ui/action/NewObjectContribution.java
@@ -55,7 +55,7 @@ public NewObjectContribution( IWorkbenchWindow window ) {
*/
public void fill( final ToolBar parent, int index ) {
ToolItem item = new ToolItem(parent, SWT.DROP_DOWN, index);
- item.setImage(UiPlugin.getImage(ImageConstants.NEW_WIZ));
+ item.setImage(UiPlugin.getDefault().getImage(ImageConstants.NEW_WIZ));
item.addSelectionListener(new SelectionListener(){
protected ImageRegistry registry;
View
4 plugins/net.refractions.udig.ui/src/net/refractions/udig/ui/internal/Messages.java
@@ -274,11 +274,11 @@ public static void initAction( IAction a, String id ) {
}
ImageDescriptor image;
- image = UiPlugin.getImageDescriptor(ePath);
+ image = UiPlugin.getDefault().getImageDescriptor(ePath);
if (id != null) {
a.setImageDescriptor(image);
}
- image = UiPlugin.getImageDescriptor(dPath);
+ image = UiPlugin.getDefault().getImageDescriptor(dPath);
if (id != null) {
a.setDisabledImageDescriptor(image);
}
View
53 ...net.refractions.udig.validation/src/net/refractions/udig/validation/ValidationPlugin.java
@@ -1,7 +1,5 @@
package net.refractions.udig.validation;
-import java.net.URL;
-
import net.refractions.udig.core.AbstractUdigUIPlugin;
import org.eclipse.core.runtime.IPath;
@@ -9,59 +7,23 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class ValidationPlugin extends AbstractUdigUIPlugin {
- private static ValidationPlugin plugin;
private static final String ID = "net.refractions.udig.validation"; //$NON-NLS-1$
public final static String ICONS_PATH = "icons/";//$NON-NLS-1$
+ private static ValidationPlugin INSTANCE;
/**
* The constructor.
*/
public ValidationPlugin() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
+ super();
}
- /**
- * Returns the shared instance.
- */
- public static ValidationPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }