Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improved kml wizard (fixed missing icons), fixed NPE in WorkflowWizar…

…dAdapter
  • Loading branch information...
commit e04c9fd8e8391922d4eddc68eb992ff7469aa9f5 1 parent f6ff2ca
@fgdrf authored
View
BIN  plugins/eu.udig.catalog.kml/icons/export_wiz.png
Deleted file not rendered
View
BIN  plugins/eu.udig.catalog.kml/icons/icon_kml48.png
Deleted file not rendered
View
BIN  plugins/eu.udig.catalog.kml/icons/wizban/exportkml_wiz.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  plugins/eu.udig.catalog.kml/icons/wizban/importkml_wiz.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
14 plugins/eu.udig.catalog.kml/src/main/java/eu/udig/catalog/kml/core/KmlToolPlugin.java
@@ -1,6 +1,6 @@
/*
- * JGrass - Free Open Source Java GIS http://www.jgrass.org
* (C) HydroloGIS - www.hydrologis.com
+ * JGrass - Free Open Source Java GIS http://www.jgrass.org
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Library General Public License as published by the Free
@@ -18,14 +18,17 @@
*/
package eu.udig.catalog.kml.core;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import net.refractions.udig.core.AbstractUdigUIPlugin;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
* @author Frank Gasdorf
*/
-public class KmlToolPlugin extends AbstractUIPlugin {
+public class KmlToolPlugin extends AbstractUdigUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "eu.udig.tools.kml"; //$NON-NLS-1$
@@ -66,4 +69,9 @@ public static KmlToolPlugin getDefault() {
return plugin;
}
+ @Override
+ public IPath getIconPath() {
+ return new Path(DEFAULT_ICON_PATH);
+ }
+
}
View
26 plugins/eu.udig.catalog.kml/src/main/java/eu/udig/catalog/kml/internal/ui/ImageConstants.java
@@ -0,0 +1,26 @@
+package eu.udig.catalog.kml.internal.ui;
+
+/**
+ * Image constants for the kml bundle
+ *
+ * @author Frank Gasdorf
+ */
+
+public interface ImageConstants {
+
+ /**
+ * Wizard banners
+ */
+ public final static String PATH_WIZBAN = "wizban/"; //$NON-NLS-1$
+
+ /**
+ * import wizard banner icon
+ */
+ public final static String IMPORTKML_WIZ = PATH_WIZBAN + "importkml_wiz.gif"; //$NON-NLS-1$
+
+ /**
+ * export wizard banner icon
+ */
+ public final static String EXPORTKML_WIZ = PATH_WIZBAN + "exportkml_wiz.gif"; //$NON-NLS-1$
+
+}
View
5 plugins/eu.udig.catalog.kml/src/main/java/eu/udig/catalog/kml/wizard/KmlExportWizard.java
@@ -32,7 +32,6 @@
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IExportWizard;
import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.geotools.data.simple.SimpleFeatureSource;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
@@ -40,6 +39,7 @@
import eu.udig.catalog.kml.core.KmlToolPlugin;
import eu.udig.catalog.kml.core.KmlUtils;
import eu.udig.catalog.kml.internal.Messages;
+import eu.udig.catalog.kml.internal.ui.ImageConstants;
/**
* @author Andrea Antonello (www.hydrologis.com)
@@ -57,8 +57,7 @@ public KmlExportWizard() {
public void init( IWorkbench workbench, IStructuredSelection selection ) {
setWindowTitle(Messages.getString("KmlExportWizard.windowTitle")); //$NON-NLS-1$
- setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(KmlToolPlugin.PLUGIN_ID,
- "icons/export_wiz.png")); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(KmlToolPlugin.getDefault().getImageDescriptor(ImageConstants.EXPORTKML_WIZ));
setNeedsProgressMonitor(true);
mainPage = new KmlExportWizardPage();
View
5 plugins/eu.udig.catalog.kml/src/main/java/eu/udig/catalog/kml/wizard/KmlImportWizard.java
@@ -36,7 +36,6 @@
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.geotools.data.FeatureStore;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.opengis.feature.simple.SimpleFeature;
@@ -45,6 +44,7 @@
import eu.udig.catalog.kml.core.KmlToolPlugin;
import eu.udig.catalog.kml.core.KmlUtils;
import eu.udig.catalog.kml.internal.Messages;
+import eu.udig.catalog.kml.internal.ui.ImageConstants;
/**
* @author Andrea Antonello - www.hydrologis.com
* @author Frank Gasdorf
@@ -63,8 +63,7 @@ public KmlImportWizard() {
public void init( IWorkbench workbench, IStructuredSelection selection ) {
setWindowTitle(Messages.getString("KmlImportWizard.windowTitle")); //$NON-NLS-1$
- setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(KmlToolPlugin.PLUGIN_ID,
- "icons/icon_kml48.png")); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(KmlToolPlugin.getDefault().getImageDescriptor(ImageConstants.IMPORTKML_WIZ));
setNeedsProgressMonitor(true);
mainPage = new KmlImportWizardPage(Messages.getString("KmlImportWizard.KmlFilImportPageName"), params); //$NON-NLS-1$
}
View
4 .../net.refractions.udig.catalog.ui/src/net/refractions/udig/catalog/ui/workflow/WorkflowWizardAdapter.java
@@ -112,7 +112,9 @@ public void init( IWorkbench workbench, IStructuredSelection selection ) {
public void handleEvent( Event event ) {
// this is called when the dialog is closed either by cancel or finish
- getContainer().getShell().close();
+ if (getContainer() != null && getContainer().getShell() != null) {
+ getContainer().getShell().close();
+ }
}
}
View
5 plugins/net.refractions.udig.core/src/net/refractions/udig/core/AbstractUdigUIPlugin.java
@@ -28,6 +28,11 @@
* @author fgdrf
*/
public abstract class AbstractUdigUIPlugin extends AbstractUIPlugin {
+
+ /**
+ * the default Icon path to access images
+ */
+ public static final String DEFAULT_ICON_PATH = "icons/";
/**
* The constructor.
Please sign in to comment.
Something went wrong with that request. Please try again.