From 542dbdaf8ca9296b623aada9a36a353e93ad60f1 Mon Sep 17 00:00:00 2001
From: Sebastian Schulz
Date: Thu, 14 Oct 2021 11:39:07 +0200
Subject: [PATCH] Format files related to issue #563
---
.../udig/catalog/ui/ISharedImages.java | 51 ++-
.../catalog/ui/ResolveTitlesDecorator.java | 345 ++++++++++--------
.../internal/wms/WMSGeoResourceImpl.java | 8 +-
.../udig/catalog/IGeoResource.java | 141 +++----
.../udig/core/AbstractUdigUIPlugin.java | 73 ++--
.../internal/australia.properties | 4 +-
6 files changed, 343 insertions(+), 279 deletions(-)
diff --git a/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ISharedImages.java b/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ISharedImages.java
index 5e3f565e8a..52fd700012 100644
--- a/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ISharedImages.java
+++ b/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ISharedImages.java
@@ -1,7 +1,7 @@
-/*
- * uDig - User Friendly Desktop Internet GIS client
- * http://udig.refractions.net
- * (C) 2004, Refractions Research Inc.
+/**
+ * uDig - User Friendly Desktop Internet GIS client
+ * http://udig.refractions.net
+ * (C) 2004, Refractions Research Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -16,6 +16,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
+
/**
* A registry for common images which may be useful to other plug-ins.
*
@@ -25,10 +26,12 @@
*
* To use one of these images:
*
- *
+ *
+ *
* ImageRegistry images = CatalogUIPlugin.getDefault().getImageRegistry();
* ImageDescriptor image = images.getDescriptor(ISharedImages.IMG_DATASTORE_OBJ);
- *
+ *
+ *
*
*
* This interface is not intended to be implemented by clients.
@@ -54,30 +57,37 @@ public interface ISharedImages {
* Generic catalog glyph
*/
public static final String CATALOG_OBJ = OBJECT + "repository_obj.gif"; //$NON-NLS-1$
+
/**
* Shared Image representing a database.
*/
public static final String DATABASE_OBJ = OBJECT + "database_obj.gif"; //$NON-NLS-1$
+
/**
* Shared Image representing a Datastore (generic feature information).
*/
public static final String DATASTORE_OBJ = OBJECT + "datastore_obj.gif"; //$NON-NLS-1$
+
/**
* Represent a data source with an erro condition.
*/
public static final String ERROR_OVR = OVERLAY + "error_ovr.gif"; //$NON-NLS-1$
+
/**
* Graphic representing a SimpleFeature File
*/
public static final String FEATURE_FILE_OBJ = OBJECT + "feature_file_obj.gif"; //$NON-NLS-1$
+
/**
- * Graphic representing a SimpleFeature (default for an indivudal IGeoResource)
+ * Graphic representing a SimpleFeature (default for an individual IGeoResource)
*/
public static final String FEATURE_OBJ = OBJECT + "feature_obj.gif"; //$NON-NLS-1$
+
/**
* Generic storage glyph.
*/
public static final String FILE_OBJ = OBJECT + "file_obj.gif"; //$NON-NLS-1$
+
/**
* Shared Image representing a Grid Coverage Exchange (generic raster information).
*/
@@ -89,12 +99,14 @@ public interface ISharedImages {
public static final String GRID_FILE_OBJ = OBJECT + "grid_file_obj.gif"; //$NON-NLS-1$
/**
- * Graphic representing a Grid (default for an indivudal IGeoResource)
+ * Graphic representing a Grid (default for an individual IGeoResource)
*/
public static final String GRID_OBJ = OBJECT + "grid_obj.gif"; //$NON-NLS-1$
+
public static final String GRID_MISSING = OBJECT + "grid_missing_obj.gif"; //$NON-NLS-1$
+
/**
- * Graphic representing a Grid (default for an indivudal IGeoResource)
+ * Graphic representing a Grid (default for an individual IGeoResource)
*/
public static final String PIXEL_OBJ = OBJECT + "pixel_obj.gif"; //$NON-NLS-1$
@@ -102,47 +114,54 @@ public interface ISharedImages {
* Generic storage glyph.
*/
public static final String MEMORY_OBJ = OBJECT + "memory_obj.gif"; //$NON-NLS-1$
+
/**
* Palette of map graphics (synthetic content)
*/
public static final String PALETTE_OBJ = OBJECT + "palette_obj.gif"; //$NON-NLS-1$
+
/**
- * Graphic representing a Grid (default for an indivudal IGeoResource)
+ * Graphic representing a Grid (default for an individual IGeoResource)
*/
public static final String RESOURCE_OBJ = OBJECT + "resource_obj.gif"; //$NON-NLS-1$
+
/**
* Generic external provider of information.
*/
public static final String SERVER_OBJ = OBJECT + "server_obj.gif"; //$NON-NLS-1$
+
/**
* Represent a data source waiting for status information.
*/
public static final String WAIT_OVR = OVERLAY + "wait_ovr.gif"; //$NON-NLS-1$
+
/**
- * Represents a data source with a warning codition.
+ * Represents a data source with a warning condition.
*
* A warning means that the system is making an assumption. The user should be able to edit the
* data source and fix the problem.
*
*
* The context menu could provide a list of suggested fixes, or if there is only one it should
- * probably just do it. An example of this would be getting back a redirect for WFS url. The fix
- * would be to remember the redirect (rather than the origional). This is the kind of thing that
+ * probably just do it. An example of this would be getting back a redirect for WFS URL. The fix
+ * would be to remember the redirect (rather than the original). This is the kind of thing that
* should just happen.
*
*/
public static final String WARNING_OVR = OVERLAY + "warning_ovr.gif"; //$NON-NLS-1$
+
/**
* Web SimpleFeature Server is a standards based external source of feature information.
*/
public static final String WFS_OBJ = OBJECT + "wfs_obj.gif"; //$NON-NLS-1$
+
/**
* Web Map Server is a standards based external source of raster information.
*/
public static final String WMS_OBJ = OBJECT + "wms_obj.gif"; //$NON-NLS-1$
/**
- * Wen Registry Service registry (a OWS Catalog)
+ * Web Registry Service registry (a OWS Catalog)
*/
public static final String WRS_OBJ = OBJECT + "wrs_obj.gif"; //$NON-NLS-1$
@@ -152,7 +171,7 @@ public interface ISharedImages {
* @param id Constant from ISharedImages
* @return Shared image for image ID, do plugin will manage disposal.
*/
- public Image get( String id );
+ public Image get(String id);
/**
* Returns the image descriptor for the given image ID. Returns null if there is no such image.
@@ -160,5 +179,5 @@ public interface ISharedImages {
* @param id Constant from ISharedImages
* @return ImageDescriptor locating resource associated with id
*/
- public ImageDescriptor getImageDescriptor( String id );
+ public ImageDescriptor getImageDescriptor(String id);
}
diff --git a/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ResolveTitlesDecorator.java b/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ResolveTitlesDecorator.java
index 0349816fe6..dbb59ff86a 100644
--- a/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ResolveTitlesDecorator.java
+++ b/plugins/org.locationtech.udig.catalog.ui/src/org/locationtech/udig/catalog/ui/ResolveTitlesDecorator.java
@@ -1,7 +1,7 @@
-/*
- * uDig - User Friendly Desktop Internet GIS client
- * http://udig.refractions.net
- * (C) 2004, Refractions Research Inc.
+/**
+ * uDig - User Friendly Desktop Internet GIS client
+ * http://udig.refractions.net
+ * (C) 2004, Refractions Research Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -24,22 +24,6 @@
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArraySet;
-import org.locationtech.udig.catalog.CatalogPlugin;
-import org.locationtech.udig.catalog.IForward;
-import org.locationtech.udig.catalog.IGeoResource;
-import org.locationtech.udig.catalog.IProcess;
-import org.locationtech.udig.catalog.IResolve;
-import org.locationtech.udig.catalog.IResolveChangeEvent;
-import org.locationtech.udig.catalog.IResolveChangeListener;
-import org.locationtech.udig.catalog.IResolveDelta;
-import org.locationtech.udig.catalog.IResolveFolder;
-import org.locationtech.udig.catalog.ISearch;
-import org.locationtech.udig.catalog.IService;
-import org.locationtech.udig.catalog.IResolveChangeEvent.Type;
-import org.locationtech.udig.catalog.IResolveDelta.Kind;
-import org.locationtech.udig.catalog.IServiceInfo;
-import org.locationtech.udig.catalog.ui.internal.Messages;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -59,6 +43,20 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
+import org.locationtech.udig.catalog.CatalogPlugin;
+import org.locationtech.udig.catalog.IGeoResource;
+import org.locationtech.udig.catalog.IProcess;
+import org.locationtech.udig.catalog.IResolve;
+import org.locationtech.udig.catalog.IResolveChangeEvent;
+import org.locationtech.udig.catalog.IResolveChangeEvent.Type;
+import org.locationtech.udig.catalog.IResolveChangeListener;
+import org.locationtech.udig.catalog.IResolveDelta;
+import org.locationtech.udig.catalog.IResolveDelta.Kind;
+import org.locationtech.udig.catalog.IResolveFolder;
+import org.locationtech.udig.catalog.ISearch;
+import org.locationtech.udig.catalog.IService;
+import org.locationtech.udig.catalog.IServiceInfo;
+import org.locationtech.udig.catalog.ui.internal.Messages;
/**
* Decorate labels with actual titles from the info objects.
@@ -68,52 +66,59 @@
*/
public class ResolveTitlesDecorator implements ILabelDecorator, IColorDecorator, IFontDecorator {
- static final Set listeners = new CopyOnWriteArraySet();
- final Set instanceListeners = new HashSet();
+ static final Set listeners = new CopyOnWriteArraySet<>();
+
+ final Set instanceListeners = new HashSet<>();
private ResolveLabelProviderSimple source;
- private final Map decorated = new IdentityHashMap();
- private final Map images = new IdentityHashMap();
- private final Map imageDescriptorCache=new IdentityHashMap();
+ private final Map decorated = new IdentityHashMap<>();
+
+ private final Map images = new IdentityHashMap<>();
- final Queue toDecorate = new ConcurrentLinkedQueue();
- final Queue imagesToDecorate = new ConcurrentLinkedQueue();
+ private final Map imageDescriptorCache = new IdentityHashMap<>();
+
+ final Queue toDecorate = new ConcurrentLinkedQueue<>();
+
+ final Queue imagesToDecorate = new ConcurrentLinkedQueue<>();
final UpdateLabel textWorker = new UpdateLabel(toDecorate, decorated, true);
- final Queue availableImageWorkers = new ConcurrentLinkedQueue();
- final List allImageWorkers=new ArrayList();
+ final Queue availableImageWorkers = new ConcurrentLinkedQueue<>();
+
+ final List allImageWorkers = new ArrayList<>();
private volatile boolean disposed;
private Font brokenFont;
- private IResolveChangeListener listener=new IResolveChangeListener(){
+ private IResolveChangeListener listener = new IResolveChangeListener() {
- public void changed( IResolveChangeEvent event ) {
+ @Override
+ public void changed(IResolveChangeEvent event) {
if (PlatformUI.getWorkbench().isClosing())
return;
if (event.getType() == Type.POST_CHANGE && event.getDelta() != null) {
- final List changed = new ArrayList();
- // TODO enable when resolve information is available
-// updateCache(event.getDelta(), changed);
+ final List changed = new ArrayList<>();
+ // TODO enable when resolve information is available
+ // updateCache(event.getDelta(), changed);
if (!changed.isEmpty()) {
- Runnable runnable = new Runnable(){
+ Runnable runnable = new Runnable() {
+ @Override
public void run() {
- LabelProviderChangedEvent labelEvent = new LabelProviderChangedEvent(source,
- changed.toArray());
- for( ILabelProviderListener l : listeners ) {
+ LabelProviderChangedEvent labelEvent = new LabelProviderChangedEvent(
+ source, changed.toArray());
+ for (ILabelProviderListener l : listeners) {
l.labelProviderChanged(labelEvent);
}
}
};
- if( Display.getCurrent()==null ){
+ if (Display.getCurrent() == null) {
Display.getDefault().asyncExec(runnable);
- }else{
+ } else {
runnable.run();
}
}
@@ -121,7 +126,8 @@ public void run() {
}
}
- private void updateCache( IResolveDelta delta, List changed ) {
+ @SuppressWarnings("unused")
+ private void updateCache(IResolveDelta delta, List changed) {
if (delta.getKind() == Kind.REPLACED || delta.getKind() == Kind.REMOVED
|| delta.getKind() == Kind.CHANGED) {
@@ -130,7 +136,7 @@ private void updateCache( IResolveDelta delta, List changed ) {
changed.add(delta.getResolve());
}
List children = delta.getChildren();
- for( IResolveDelta delta2 : children ) {
+ for (IResolveDelta delta2 : children) {
updateCache(delta2, changed);
}
}
@@ -148,30 +154,35 @@ private void updateCache( IResolveDelta delta, List changed ) {
*
* @param resolveLabelProviderSimple
*/
- public ResolveTitlesDecorator( ResolveLabelProviderSimple resolveLabelProviderSimple ) {
- this( resolveLabelProviderSimple, false);
+ public ResolveTitlesDecorator(ResolveLabelProviderSimple resolveLabelProviderSimple) {
+ this(resolveLabelProviderSimple, false);
}
+
/**
* @param resolveLabelProviderSimple
* @param decorateImages
*/
- public ResolveTitlesDecorator( ResolveLabelProviderSimple resolveLabelProviderSimple, boolean decorateImages ) {
+ public ResolveTitlesDecorator(ResolveLabelProviderSimple resolveLabelProviderSimple,
+ boolean decorateImages) {
this.source = resolveLabelProviderSimple;
- this.decorateImages=decorateImages;
+ this.decorateImages = decorateImages;
CatalogPlugin.addListener(listener);
CatalogPlugin.removeListener(source);
- for( int i = 0; i < 4; i++ ) {
+ for (int i = 0; i < 4; i++) {
UpdateLabel worker = new UpdateLabel(imagesToDecorate, images, false);
availableImageWorkers.add(worker);
allImageWorkers.add(worker);
}
}
- /*
+
+ /**
* @see org.eclipse.jface.viewers.ILabelDecorator#decorateImage(org.eclipse.swt.graphics.Image,
- * java.lang.Object)
+ * java.lang.Object)
*/
- public Image decorateImage( Image image, Object element ) {
- if( disposed ) return null;
+ @Override
+ public Image decorateImage(Image image, Object element) {
+ if (disposed)
+ return null;
if (!(element instanceof IResolve))
return null;
@@ -190,17 +201,18 @@ public Image decorateImage( Image image, Object element ) {
synchronized (imageRegistry) {
i = imageRegistry.get(resolve.getIdentifier().toString());
// if it is loaded and not disposed then we're good, return it.
- if( i!=null && !i.isDisposed()){
+ if (i != null && !i.isDisposed()) {
return i;
}
- if (i!=null && i.isDisposed() )
+ if (i != null && i.isDisposed())
imageRegistry.remove(resolve.getIdentifier().toString());
}
- // we tried to look up a cached version... If not around and viewer doesn't want decorated images then we'll return.
+ // we tried to look up a cached version... If not around and viewer doesn't want decorated
+ // images then we'll return.
- if( !resolve.getID().isLocal() && !decorateImages ){
+ if (!resolve.getID().isLocal() && !decorateImages) {
return null;
}
@@ -213,16 +225,18 @@ public Image decorateImage( Image image, Object element ) {
// get a worker for loading images and schedule it.
// If pool is empty then don't worry request will be processed.
UpdateLabel imageWorker = availableImageWorkers.poll();
- if( imageWorker!=null )
+ if (imageWorker != null)
imageWorker.schedule();
}
return null;
}
- public String decorateText( String text, Object element ) {
- if( disposed ) return null;
- if (!(element instanceof IResolve)){
+ @Override
+ public String decorateText(String text, Object element) {
+ if (disposed)
+ return null;
+ if (!(element instanceof IResolve)) {
return null;
}
@@ -230,12 +244,12 @@ public String decorateText( String text, Object element ) {
if (decorated.containsKey(element)) {
LabelData data = decorated.get(element);
- if (data == null){
+ if (data == null) {
return null;
}
- if( resolve instanceof IService ){
- if( resolve.getID().getTypeQualifier() != null ){
- return data.text + " ("+resolve.getID().getTypeQualifier() +")";
+ if (resolve instanceof IService) {
+ if (resolve.getID().getTypeQualifier() != null) {
+ return data.text + " (" + resolve.getID().getTypeQualifier() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
return data.text;
@@ -246,9 +260,9 @@ public String decorateText( String text, Object element ) {
LabelData data = new LabelData();
data.text = resolve.getTitle();
decorated.put(resolve, data);
- if( resolve instanceof IService ){
- if( resolve.getID().getTypeQualifier() != null ){
- return data.text + " ("+resolve.getID().getTypeQualifier() +")";
+ if (resolve instanceof IService) {
+ if (resolve.getID().getTypeQualifier() != null) {
+ return data.text + " (" + resolve.getID().getTypeQualifier() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
return data.text;
@@ -258,11 +272,15 @@ public String decorateText( String text, Object element ) {
return null;
}
- public Color decorateBackground( Object element ) {
+ @Override
+ public Color decorateBackground(Object element) {
return null;
}
- public Color decorateForeground( Object element ) {
- if( disposed ) return null;
+
+ @Override
+ public Color decorateForeground(Object element) {
+ if (disposed)
+ return null;
if (!(element instanceof IResolve))
return null;
@@ -270,43 +288,47 @@ public Color decorateForeground( Object element ) {
if (resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.BROKEN) {
return Display.getCurrent().getSystemColor(SWT.COLOR_RED);
}
- if (resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.RESTRICTED_ACCESS) {
+ if (resolve
+ .getStatus() == org.locationtech.udig.catalog.IResolve.Status.RESTRICTED_ACCESS) {
return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_YELLOW);
}
return null;
}
- public Font decorateFont( Object element ) {
+ @Override
+ public Font decorateFont(Object element) {
if (!(element instanceof IResolve))
return null;
IResolve resolve = (IResolve) element;
- if (resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.BROKEN
- || resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.RESTRICTED_ACCESS) {
+ if (resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.BROKEN || resolve
+ .getStatus() == org.locationtech.udig.catalog.IResolve.Status.RESTRICTED_ACCESS) {
return getBrokenFont();
}
return null;
}
private Font getBrokenFont() {
- if( brokenFont==null ){
+ if (brokenFont == null) {
Font systemFont = Display.getCurrent().getSystemFont();
FontData fd = systemFont.getFontData()[0];
- brokenFont=new Font(systemFont.getDevice(), fd.getName(), fd.getHeight(), SWT.ITALIC );
+ brokenFont = new Font(systemFont.getDevice(), fd.getName(), fd.getHeight(), SWT.ITALIC);
}
return brokenFont;
}
+
/**
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
- assert Display.getCurrent()!=null;
- disposed=true;
+ assert Display.getCurrent() != null;
+ disposed = true;
toDecorate.clear();
textWorker.cancel();
images.clear();
- for( UpdateLabel updater : allImageWorkers ) {
+ for (UpdateLabel updater : allImageWorkers) {
updater.cancel();
}
// clean up
@@ -314,7 +336,7 @@ public void dispose() {
listeners.removeAll(instanceListeners);
instanceListeners.clear();
CatalogPlugin.removeListener(listener);
- if( brokenFont!=null )
+ if (brokenFont != null)
brokenFont.dispose();
}
@@ -322,9 +344,11 @@ public void dispose() {
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object,
* java.lang.String)
*/
- public boolean isLabelProperty( Object element, String property ) {
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
return true;
}
+
public ILabelProvider getSource() {
return source;
}
@@ -332,17 +356,20 @@ public ILabelProvider getSource() {
/**
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
- public void removeListener( ILabelProviderListener listener ) {
- assert Display.getCurrent()!=null;
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ assert Display.getCurrent() != null;
listeners.remove(listener);
instanceListeners.remove(listener);
}
- /*
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ /**
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.
+ * ILabelProviderListener)
*/
- public void addListener( ILabelProviderListener listener ) {
- assert Display.getCurrent()!=null;
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ assert Display.getCurrent() != null;
listeners.add(listener);
instanceListeners.add(listener);
}
@@ -356,88 +383,95 @@ public void addListener( ILabelProviderListener listener ) {
private class UpdateLabel extends Job {
DisplayUpdater updater;
+
private Queue toDecorate;
+
private Map decorated;
+
private boolean text;
- public UpdateLabel(Queue toDecorate, Map decorated, boolean text) {
+ public UpdateLabel(Queue toDecorate, Map decorated,
+ boolean text) {
// message is just for debugging since job is a system job
- super("Decorate Resolve "+(text?"Titles":"Images")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("Decorate Resolve " + (text ? "Titles" : "Images")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
setSystem(true);
setPriority(DECORATE);
- this.toDecorate=toDecorate;
- this.decorated=decorated;
- this.text=text;
+ this.toDecorate = toDecorate;
+ this.decorated = decorated;
+ this.text = text;
}
- public IStatus run( final IProgressMonitor monitor ) {
- updater=new DisplayUpdater(monitor);
- try{
- while( true ) {
+ @Override
+ public IStatus run(final IProgressMonitor monitor) {
+ updater = new DisplayUpdater(monitor);
+ try {
+ while (true) {
final IResolve element = toDecorate.poll();
- if(element == null) break;
- // check if some how request has already been fullfilled.
+ if (element == null)
+ break;
+ // check if some how request has already been fulfilled.
LabelData labelData = decorated.get(element);
if (text && labelData != null)
continue;
- if (!text && labelData!=null)
+ if (!text && labelData != null)
continue;
URL identifier = element.getIdentifier();
monitor.beginTask(Messages.ResolveTitlesDecorator_0 + identifier.getFile(),
IProgressMonitor.UNKNOWN);
- if( monitor.isCanceled() ){
+ if (monitor.isCanceled()) {
return Status.OK_STATUS;
}
LabelData data = new LabelData();
try {
- if(text){
- if(element instanceof IGeoResource) {
- IGeoResource resource = (IGeoResource) element;
- data.text = resource.getInfo(monitor).getTitle();
- IService service = resource.service(monitor);
- if( service != null ){
- service.getPersistentProperties().put(resource.getID() + "_title", data.text);
- }
- } else if(element instanceof IService) {
- IService service = (IService) element;
- IServiceInfo info = service.getInfo(monitor);
- if( info != null ){
- data.text = info.getTitle();
- service.getPersistentProperties().put("title", data.text);
- }
- } else if(element instanceof IProcess) {
- IProcess proc = (IProcess) element;
- data.text = proc.getInfo(monitor).getTitle();
- } else if(element instanceof ISearch) {
- ISearch search = (ISearch) element;
- data.text = search.getInfo(monitor).getTitle();
- } else {
- IResolveFolder folder = (IResolveFolder) element;
- data.text = folder.getID().toString();
- }
+ if (text) {
+ if (element instanceof IGeoResource) {
+ IGeoResource resource = (IGeoResource) element;
+ data.text = resource.getInfo(monitor).getTitle();
+ IService service = resource.service(monitor);
+ if (service != null) {
+ service.getPersistentProperties()
+ .put(resource.getID() + "_title", data.text); //$NON-NLS-1$
+ }
+ } else if (element instanceof IService) {
+ IService service = (IService) element;
+ IServiceInfo info = service.getInfo(monitor);
+ if (info != null) {
+ data.text = info.getTitle();
+ service.getPersistentProperties().put("title", data.text); //$NON-NLS-1$
+ }
+ } else if (element instanceof IProcess) {
+ IProcess proc = (IProcess) element;
+ data.text = proc.getInfo(monitor).getTitle();
+ } else if (element instanceof ISearch) {
+ ISearch search = (ISearch) element;
+ data.text = search.getInfo(monitor).getTitle();
+ } else {
+ IResolveFolder folder = (IResolveFolder) element;
+ data.text = folder.getID().toString();
+ }
}
} catch (Throwable e) {
CatalogUIPlugin.log("Error fetching the Title for the resource", e); //$NON-NLS-1$
continue;
}
try {
- if(!text)
- creatImage(data,element);
+ if (!text)
+ creatImage(data, element);
} catch (Throwable e) {
CatalogUIPlugin.log("Error fetching the Image for the resource", e); //$NON-NLS-1$
continue;
}
decorated.put(element, data);
- if( monitor.isCanceled() )
+ if (monitor.isCanceled())
return Status.OK_STATUS;
addUpdate(monitor, element);
}
return Status.OK_STATUS;
- }finally{
- if( !text ){
+ } finally {
+ if (!text) {
// need to protect the items put in the image registry
// in addition to availableImageWorkers
synchronized (images) {
@@ -453,30 +487,31 @@ public IStatus run( final IProgressMonitor monitor ) {
* @param monitor
* @param element
*/
- private void addUpdate( final IProgressMonitor monitor, final IResolve element ) {
+ private void addUpdate(final IProgressMonitor monitor, final IResolve element) {
// we are processing as many resolve as possible.
// so there is a possibility that we will resolve a few
// before the view is updated so batch the updates
// since the updates are in the updater thread
// we have to synchronize on the updates list.
synchronized (updater.updates) {
- if (updater.updates.isEmpty()){
- updater=new DisplayUpdater(monitor);
+ if (updater.updates.isEmpty()) {
+ updater = new DisplayUpdater(monitor);
updater.updates.add(element);
final Display display = Display.getDefault();
- display.asyncExec(new Runnable(){
+ display.asyncExec(new Runnable() {
+ @Override
public void run() {
display.timerExec(500, updater);
}
});
- }else{
+ } else {
updater.updates.add(element);
}
}
}
- private Image creatImage( LabelData data, final IResolve element ) throws IOException {
+ private Image creatImage(LabelData data, final IResolve element) throws IOException {
String key = element.getIdentifier().toString();
ImageRegistry imageRegistry = CatalogUIPlugin.getDefault().getImageRegistry();
// need to protect the items put in the image registry
@@ -485,27 +520,27 @@ private Image creatImage( LabelData data, final IResolve element ) throws IOExce
synchronized (imageRegistry) {
i = imageRegistry.get(key);
}
- if (i==null || i.isDisposed()){
+ if (i == null || i.isDisposed()) {
data.image = CatalogUIPlugin.icon(element);
imageDescriptorCache.put(element, data.image);
- try{
- if( data.image!=null)
+ try {
+ if (data.image != null)
i = data.image.createImage();
- }catch (Throwable e) {
+ } catch (Throwable e) {
CatalogUIPlugin.log("Error creating the Image for the resource", e); //$NON-NLS-1$
}
- }else{
- data.image=imageDescriptorCache.get(element);// get cached
+ } else {
+ data.image = imageDescriptorCache.get(element);// get cached
}
- if( i==null )
- i=CatalogUIPlugin.image(element);
+ if (i == null)
+ i = CatalogUIPlugin.image(element);
synchronized (imageRegistry) {
Image i2 = imageRegistry.get(key);
- if( i2!=null && !i2.isDisposed()){
+ if (i2 != null && !i2.isDisposed()) {
return i;
}
- if (i2!=null && i2.isDisposed() )
+ if (i2 != null && i2.isDisposed())
imageRegistry.remove(key);
imageRegistry.put(key, i);
@@ -515,25 +550,28 @@ private Image creatImage( LabelData data, final IResolve element ) throws IOExce
}
- private class DisplayUpdater implements Runnable{
+ private class DisplayUpdater implements Runnable {
IProgressMonitor monitor;
- Queue updates=new LinkedList();
- public DisplayUpdater( IProgressMonitor monitor2 ) {
- this.monitor=monitor2;
+ Queue updates = new LinkedList<>();
+
+ public DisplayUpdater(IProgressMonitor monitor2) {
+ this.monitor = monitor2;
}
+ @Override
public void run() {
- if( disposed ) return ;
+ if (disposed)
+ return;
- while( !updates.isEmpty() ) {
+ while (!updates.isEmpty()) {
Object[] element;
synchronized (updates) {
element = updates.toArray();
updates.clear();
}
- for( ILabelProviderListener l : listeners ) {
+ for (ILabelProviderListener l : listeners) {
if (monitor.isCanceled())
return;
l.labelProviderChanged(new LabelProviderChangedEvent(source, element));
@@ -542,10 +580,11 @@ public void run() {
}
}
+
private static class LabelData {
public ImageDescriptor image;
+
String text;
}
-
}
diff --git a/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wms/WMSGeoResourceImpl.java b/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wms/WMSGeoResourceImpl.java
index 906548fae2..d73c359047 100644
--- a/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wms/WMSGeoResourceImpl.java
+++ b/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wms/WMSGeoResourceImpl.java
@@ -26,7 +26,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
@@ -145,11 +145,11 @@ protected WMSResourceInfo createInfo(IProgressMonitor monitor) throws IOExceptio
if (monitor == null)
monitor = new NullProgressMonitor();
- WMSServiceImpl wmsServer = service(new SubProgressMonitor(monitor, 50));
+ WMSServiceImpl wmsServer = service(SubMonitor.convert(monitor, 50));
wmsServer.rLock.lock();
try {
- return new WMSResourceInfo(new SubProgressMonitor(monitor, 50));
+ return new WMSResourceInfo(SubMonitor.convert(monitor, 50));
} finally {
wmsServer.rLock.unlock();
}
@@ -556,8 +556,6 @@ private class WMSResourceInfo extends IGeoResourceInfo {
description = caps.getService().get_abstract();
super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.GRID_OBJ);
-
- // icon = fetchIcon( monitor );
}
private void getKeywords(WMSCapabilities caps, String parentid) {
diff --git a/plugins/org.locationtech.udig.catalog/src/org/locationtech/udig/catalog/IGeoResource.java b/plugins/org.locationtech.udig.catalog/src/org/locationtech/udig/catalog/IGeoResource.java
index af2497b375..132b77451f 100644
--- a/plugins/org.locationtech.udig.catalog/src/org/locationtech/udig/catalog/IGeoResource.java
+++ b/plugins/org.locationtech.udig.catalog/src/org/locationtech/udig/catalog/IGeoResource.java
@@ -1,7 +1,7 @@
-/*
- * uDig - User Friendly Desktop Internet GIS client
- * http://udig.refractions.net
- * (C) 2004, Refractions Research Inc.
+/**
+ * uDig - User Friendly Desktop Internet GIS client
+ * http://udig.refractions.net
+ * (C) 2004, Refractions Research Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -22,7 +22,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.swt.widgets.Display;
/**
@@ -43,7 +43,7 @@
* Please consider implementing support for resolve( ImageDescriptor.class, null ) as it will allow
* your IGeoResource to show up with a unique representation in the Catalog view.
*
- *
+ *
* @author David Zwiers, Refractions Research
* @since 0.6
*/
@@ -60,7 +60,7 @@ public abstract class IGeoResource implements IResolve {
/**
* Blocking operation to resolve into the adaptee, if available.
*
- * Required adaptions:
+ * Required adoptions:
*
* - GeoResource.class - this
*
- IGeoResourceInfo.class - getInfo( monitor ) ie about this handles contents
@@ -68,22 +68,22 @@ public abstract class IGeoResource implements IResolve {
*
*
* Example Use (no casting required!):
- *
+ *
*
*
* IGeoResourceInfo info = resolve(IGeoResourceInfo.class);
*
*
- *
+ *
*
*
- * Recommended adaptions:
+ * Recommended adoptions:
*
* - ImageDescriptor.class (for icon provided by external service)
- *
- List.class - members( monitor ) ie children of this georesource as in the wms layer case
+ *
- List.class - members( monitor ) ie children of this GeoResource as in the WMS layer case
*
*
- *
+ *
* @param adaptee
* @param monitor
* @return instance of adaptee, or null if unavailable (IGeoResourceInfo and IService must be
@@ -92,7 +92,8 @@ public abstract class IGeoResource implements IResolve {
* @see IService
* @see IResolve#resolve(Class, IProgressMonitor)
*/
- public T resolve( Class adaptee, IProgressMonitor monitor ) throws IOException {
+ @Override
+ public T resolve(Class adaptee, IProgressMonitor monitor) throws IOException {
if (monitor == null)
monitor = new NullProgressMonitor();
@@ -109,9 +110,9 @@ public T resolve( Class adaptee, IProgressMonitor monitor ) throws IOExce
if (adaptee.isAssignableFrom(IServiceInfo.class)) {
try {
monitor.beginTask("service info", 100); //$NON-NLS-1$
- IService service = service(new SubProgressMonitor(monitor, 40));
+ IService service = service(SubMonitor.convert(monitor, 40));
if (service != null) {
- IServiceInfo info = service.getInfo(new SubProgressMonitor(monitor, 60));
+ IServiceInfo info = service.getInfo(SubMonitor.convert(monitor, 60));
return adaptee.cast(info);
}
} finally {
@@ -131,27 +132,28 @@ public T resolve( Class adaptee, IProgressMonitor monitor ) throws IOExce
}
return null; // no adapter found (check to see if ResolveAdapter is registered?)
}
+
/**
- * Harded coded to capture the IGeoResource contract.
+ * Hard coded to capture the IGeoResource contract.
*
* That is we *must* resolve the following:
*
- * Required adaptions:
+ * Required adoptions:
*
* - GeoResource.class - this
*
- IGeoResourceInfo.class - getInfo (ie about this handles contents)
*
- IService.class - service (ie that is responsible for this GeoResource)
*
*
- * Recommendated adaptions:
+ * Recommended adoptions:
*
* - ImageDescriptor.class (for icon provided by external service)
- *
- List.class - members (ie children of this georesource as in the wms layer case)
+ *
- List.class - members (ie children of this GeoResource as in the WMS layer case)
*
*
* Here is an implementation example (for something that can adapt to ImageDescriptor and
* FeatureSource):
- *
+ *
*
*
* public <T> boolean canResolve( Class<T> adaptee ) {
@@ -162,7 +164,8 @@ public T resolve( Class adaptee, IProgressMonitor monitor ) throws IOExce
*
*
*/
- public boolean canResolve( Class adaptee ) {
+ @Override
+ public boolean canResolve(Class adaptee) {
return adaptee != null && (adaptee.isAssignableFrom(IGeoResource.class) || // this
adaptee.isAssignableFrom(IService.class) || // service( monitor )
adaptee.isAssignableFrom(getClass()) || adaptee.isAssignableFrom(IResolve.class) || // parent
@@ -172,11 +175,11 @@ public boolean canResolve( Class adaptee ) {
/**
* Delegate to implementing classes to create and return the appropriate IGeoResourceInfo
* implementation.
- *
+ *
* @return IGeoResourceInfo resolve(IGeoResourceInfo.class,IProgressMonitor monitor);
* @throws IOException
*/
- protected abstract IGeoResourceInfo createInfo( IProgressMonitor monitor ) throws IOException;
+ protected abstract IGeoResourceInfo createInfo(IProgressMonitor monitor) throws IOException;
/**
* Blocking operation to describe this service.
@@ -185,6 +188,7 @@ public boolean canResolve( Class adaptee ) {
* LabelDecorators to acquire title, and icon.
*
* Example implementation:
+ *
*
* @Override
* public CSVGeoResourceInfo getInfo( IProgressMonitor monitor ) throws IOException {
@@ -201,36 +205,27 @@ public boolean canResolve( Class adaptee ) {
* *super.getInfo* as it is providing caching for you and will insure that createInfo is only
* called once.
*
- *
+ *
* @return IGeoResourceInfo resolve(IGeoResourceInfo.class,IProgressMonitor monitor);
* @see IGeoResource#resolve(Class, IProgressMonitor)
* @see IGeoResource#createInfo(IProgressMonitor)
* @see IGeoResource#getTitle()
*/
- public IGeoResourceInfo getInfo( IProgressMonitor monitor ) throws IOException {
+ public IGeoResourceInfo getInfo(IProgressMonitor monitor) throws IOException {
if (info == null) { // lazy creation
synchronized (this) { // support concurrent access
if (info == null) {
if (Display.getCurrent() != null) {
// This is bad and has a chance of hanging the UI
- if( Platform.inDevelopmentMode()){
- throw new IllegalStateException("Lookup of getInfo not available from the display thread"); //$NON-NLS-1$
+ if (Platform.inDevelopmentMode()) {
+ throw new IllegalStateException(
+ "Lookup of getInfo not available from the display thread"); //$NON-NLS-1$
}
}
info = createInfo(monitor);
if (info == null) {
// could not connect or INFO_UNAVAILABLE
info = INFO_UNAVAILABLE;
- } else {
- // could issue a catalog event indicating new information is available
- // this delta describes what has changed
- /*
- IResolveDelta delta = new ResolveDelta(this, IResolveDelta.Kind.CHANGED);
-
- // fire the change
- CatalogImpl localCatalog = (CatalogImpl) CatalogPlugin.getDefault().getLocalCatalog();
- localCatalog.fire(new ResolveChangeEvent(this, IResolveChangeEvent.Type.POST_CHANGE, delta));
- */
}
}
}
@@ -240,17 +235,17 @@ public IGeoResourceInfo getInfo( IProgressMonitor monitor ) throws IOException {
}
return info;
}
-
+
/**
* Map of this resource's persistent properties, may be empty.
- *
+ *
* @return The map containing the persistent properties where the key is the
* {@link QualifiedName} of the property and the value is the {@link String} value of
* the property.
*/
public Map getPersistentProperties() {
- ID id = this.getID();
- Map properties = service.getPersistentProperties( id );
+ ID id = this.getID();
+ Map properties = service.getPersistentProperties(id);
return properties;
}
@@ -258,7 +253,7 @@ public Map getPersistentProperties() {
* Returns parent for this GeoResource.
*
* Most implementations will use the following code example:
- *
+ *
*
*
* public IService parent( IProgressMonitor monitor ) throws IOException {
@@ -266,18 +261,18 @@ public Map getPersistentProperties() {
* }
*
*
- *
- * This code example preserves backwords compatibility with uDig 1.0 via type narrowing IResolve
+ *
+ * This code example preserves backwards compatibility with uDig 1.0 via type narrowing IResolve
* to IService.
*
* You will need to provide a different implementation when working with nested content (like
- * database schema or wms layers).
- *
+ * database schema or WMS layers).
+ *
* @return parent IResolve for this GeoResource
* @see IGeoResource#resolve(Class, IProgressMonitor)
*/
- // TODO public abstract IResolve parent( IProgressMonitor monitor ) throws IOException;
- public IResolve parent( IProgressMonitor monitor ) throws IOException {
+ @Override
+ public IResolve parent(IProgressMonitor monitor) throws IOException {
return service(monitor);
}
@@ -286,22 +281,24 @@ public IResolve parent( IProgressMonitor monitor ) throws IOException {
*
* The provided implementation indicates that this IGeoResource is a leaf.
*
- *
+ *
* @return Collections.emptyList();
* @see org.locationtech.udig.catalog.IResolve#members(org.eclipse.core.runtime.IProgressMonitor)
*/
- public List members( IProgressMonitor monitor ) {
+ @Override
+ public List members(IProgressMonitor monitor) {
return Collections.emptyList(); // type safe EMPTY_LIST
}
/**
* This should represent the identifier
- *
+ *
* @see Object#equals(java.lang.Object)
* @param arg0
* @return
*/
- public boolean equals( Object other ) {
+ @Override
+ public boolean equals(Object other) {
if (other != null && other instanceof IGeoResource) {
IGeoResource resource = (IGeoResource) other;
if (getID() != null)
@@ -312,10 +309,11 @@ public boolean equals( Object other ) {
/**
* This should represent the identified
- *
+ *
* @see Object#hashCode()
* @return
*/
+ @Override
public int hashCode() {
int value = 31;
@@ -342,16 +340,17 @@ public int hashCode() {
*/
/**
* Indicate class and id.
- *
+ *
* @return string representing this IResolve
*/
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
String classname = getClass().getSimpleName();
buf.append(classname);
buf.append("("); //$NON-NLS-1$
ID ref = getID();
- buf.append( ref.labelResource() );
+ buf.append(ref.labelResource());
buf.append(")"); //$NON-NLS-1$
return buf.toString();
}
@@ -360,47 +359,53 @@ public String toString() {
* The identifier of a IGeoResource is identified by parent().getIdentifer()#ResourceID
*
* For example: A WMS (IService) with an id of http://www.something.com/wms?Service=WMS would
- * have georesources with ids similar to: http://www.something.com/wms?Service=WMS#layer1
- *
+ * have GeoResources with IDds similar to: http://www.something.com/wms?Service=WMS#layer1
+ *
* @see IResolve#getIdentifier()
*/
+ @Override
public abstract URL getIdentifier();
+ @Override
public ID getID() {
return new ID(getIdentifier());
}
/**
- * hide user password from the layer ID if it exists and returns
- * ID as String.
- *
+ * hide user password from the layer ID if it exists and returns ID as String.
+ *
* @param layer
* @return
*/
public String getDisplayID() {
String userInfo = getIdentifier().getUserInfo();
if (userInfo != null) {
- userInfo = userInfo.substring(0, userInfo.indexOf(":")+1);
- userInfo = userInfo.concat("******");
- return new ID(getIdentifier().toString().replace(getIdentifier().getUserInfo(), userInfo), null).toString();
+ userInfo = userInfo.substring(0, userInfo.indexOf(":") + 1); //$NON-NLS-1$
+ userInfo = userInfo.concat("******"); //$NON-NLS-1$
+ return new ID(
+ getIdentifier().toString().replace(getIdentifier().getUserInfo(), userInfo),
+ null).toString();
}
return getID().toString();
}
/**
* Disposes of any resources or listeners required. Default implementation does nothing.
- *
+ *
* @param monitor monitor to show progress
*/
- public void dispose( IProgressMonitor monitor ) {
+ @Override
+ public void dispose(IProgressMonitor monitor) {
// default impl does nothing
}
+
/**
* Retrieves the title from the IService cache or from the GeoResourceInfo object if they exist.
* No objects are created and null is returned if there is no title readily available.
- *
+ *
* @return title or null if none is readily available
*/
+ @Override
public String getTitle() {
String title = null;
if (info != null) {
@@ -420,8 +425,8 @@ public String getTitle() {
}
return title;
}
-
- public IService service( IProgressMonitor monitor ) throws IOException {
+
+ public IService service(IProgressMonitor monitor) throws IOException {
return service;
}
}
diff --git a/plugins/org.locationtech.udig.core/src/org/locationtech/udig/core/AbstractUdigUIPlugin.java b/plugins/org.locationtech.udig.core/src/org/locationtech/udig/core/AbstractUdigUIPlugin.java
index 06a77844dd..bc758e8cd4 100644
--- a/plugins/org.locationtech.udig.core/src/org/locationtech/udig/core/AbstractUdigUIPlugin.java
+++ b/plugins/org.locationtech.udig.core/src/org/locationtech/udig/core/AbstractUdigUIPlugin.java
@@ -1,4 +1,5 @@
-/* uDig - User Friendly Desktop Internet GIS client
+/**
+ * uDig - User Friendly Desktop Internet GIS client
* http://udig.refractions.net
* (C) 2012, Refractions Research Inc.
*
@@ -19,55 +20,57 @@
import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
- * Dynamic ImageRegistry
+ * Dynamic ImageRegistry
+ *
* @author fgdrf
*/
public abstract class AbstractUdigUIPlugin extends AbstractUIPlugin {
-
+
/**
* the default Icon path to access images
*/
- public static final String DEFAULT_ICON_PATH = "icons/";
+ public static final String DEFAULT_ICON_PATH = "icons/"; //$NON-NLS-1$
/**
* The constructor.
*/
- public AbstractUdigUIPlugin() {
- super();
- }
-
- 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(getIconPath(), symbolicName);
- }
- return imageRegistry.getDescriptor(symbolicName);
- }
+ public AbstractUdigUIPlugin() {
+ super();
+ }
+
+ 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(getIconPath(), symbolicName);
+ }
+ return imageRegistry.getDescriptor(symbolicName);
+ }
- 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(getIconPath(), symbolicName);
- }
- return imageRegistry.get(symbolicName);
- }
-
- private void registerImage(IPath iconPath, String symbolicName) {
- URL imageUrl = FileLocator.find(getBundle(), iconPath.append(symbolicName), null);
+ 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(getIconPath(), symbolicName);
+ }
+ return imageRegistry.get(symbolicName);
+ }
+
+ private void registerImage(IPath iconPath, String symbolicName) {
+ URL imageUrl = FileLocator.find(getBundle(), iconPath.append(symbolicName), null);
ImageDescriptor image = ImageDescriptor.createFromURL(imageUrl);
ImageRegistry imageRegistry = getImageRegistry();
-
+
imageRegistry.put(symbolicName, image);
- }
-
- /**
+ }
+
+ /**
* Returns the shared instance.
+ *
* @return {@link AbstractUdigUIPlugin} singleton
*/
- public abstract IPath getIconPath();
+ public abstract IPath getIconPath();
}
diff --git a/plugins/org.locationtech.udig.document.tests/internal/australia.properties b/plugins/org.locationtech.udig.document.tests/internal/australia.properties
index 55f8a104c5..0a6360f8ef 100644
--- a/plugins/org.locationtech.udig.document.tests/internal/australia.properties
+++ b/plugins/org.locationtech.udig.document.tests/internal/australia.properties
@@ -1,5 +1,5 @@
#
-#Sun May 06 23:49:54 CEST 2018
+#Thu Oct 14 10:35:19 CEST 2021
australia.1_documents=australia.documents/australia.1/australia.png|~|ATTACHMENT|~|FILE|~|fileDoc2|~|fileDocDesc2|~|true
-hotlink_attributes=FILE|~|FILE|~|config|~|fileLabel|~|description|\:|LINK|~|WEB|~|config|~|webLabel|~|description|\:|STATE|~|ACTION|~|config|~|actionLabel|~|description
shp_documents=
+hotlink_attributes=FILE|~|FILE|~|config|~|fileLabel|~|description|\:|LINK|~|WEB|~|config|~|webLabel|~|description|\:|STATE|~|ACTION|~|config|~|actionLabel|~|description