RESOLVED - bug 183818: [pde viz] Add forward and back button support to the PDE Dependency Graph
https://bugs.eclipse.org/bugs/show_bug.cgi?id=183818
diff --git a/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/backward_disabled.gif b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/backward_disabled.gif
new file mode 100644
index 0000000..2972ff5
--- /dev/null
+++ b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/backward_disabled.gif
Binary files differ
diff --git a/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/backward_enabled.gif b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/backward_enabled.gif
new file mode 100644
index 0000000..4fb4150
--- /dev/null
+++ b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/backward_enabled.gif
Binary files differ
diff --git a/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/forward_disabled.gif b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/forward_disabled.gif
new file mode 100644
index 0000000..319fe8d
--- /dev/null
+++ b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/forward_disabled.gif
Binary files differ
diff --git a/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/forward_enabled.gif b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/forward_enabled.gif
new file mode 100644
index 0000000..e2f8c3e
--- /dev/null
+++ b/visualization/plugins/org.eclipse.pde.visualization.dependency/icons/obj16/forward_enabled.gif
Binary files differ
diff --git a/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/Activator.java b/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/Activator.java
index ac4c07e..58f5df3 100644
--- a/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/Activator.java
+++ b/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/Activator.java
@@ -11,9 +11,13 @@
  *******************************************************************************/
 package org.eclipse.pde.visualization.dependency;
 
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
-
+import org.eclipse.core.runtime.Path;
 /**
  * The activator class controls the plug-in life cycle
  */
@@ -21,6 +25,9 @@
 
 	// The plug-in ID
 	public static final String PLUGIN_ID = "org.eclipse.pde.visualization.dependency";
+	
+	public static final String FORWARD_ENABLED = "icons/obj16/forward_enabled.gif";
+	public static final String BACKWARD_ENABLED = "icons/obj16/backward_enabled.gif";
 
 	// The shared instance
 	private static Activator plugin;
@@ -38,6 +45,16 @@
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
 		plugin = this;
+		addImage(FORWARD_ENABLED);
+		addImage(BACKWARD_ENABLED);
+	}
+	
+	private void addImage(String imagePath) {
+		String path = "$nl$/" + imagePath; //$NON-NLS-1$
+		URL url = FileLocator.find(this.getBundle(), new Path(path), null);
+		ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(url);
+		getImageRegistry().put(imagePath, imageDescriptor);
+		
 	}
 
 	/*
@@ -47,6 +64,7 @@
 	public void stop(BundleContext context) throws Exception {
 		plugin = null;
 		super.stop(context);
+		getImageRegistry().dispose();
 	}
 
 	/**
diff --git a/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/views/PluginVisualizationView.java b/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/views/PluginVisualizationView.java
index 938db5c..87189d4 100644
--- a/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/views/PluginVisualizationView.java
+++ b/visualization/plugins/org.eclipse.pde.visualization.dependency/src/org/eclipse/pde/visualization/dependency/views/PluginVisualizationView.java
@@ -44,6 +44,7 @@
 import org.eclipse.osgi.service.resolver.BundleDescription;
 import org.eclipse.pde.core.plugin.IPluginModelBase;
 import org.eclipse.pde.internal.ui.wizards.PluginSelectionDialog;
+import org.eclipse.pde.visualization.dependency.Activator;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.ui.IActionBars;
@@ -319,6 +320,7 @@
 		historyAction.setText("Back");
 		historyAction.setToolTipText("Previous plugin");
 		historyAction.setEnabled(false);
+		historyAction.setImageDescriptor(Activator.getDefault().getImageRegistry().getDescriptor(Activator.BACKWARD_ENABLED));
 		
 		forwardAction = new Action() {
 			public void run() {
@@ -335,6 +337,7 @@
 		forwardAction.setText("Forward");
 		forwardAction.setToolTipText("Go forward one plugin");
 		forwardAction.setEnabled(false);
+		forwardAction.setImageDescriptor(Activator.getDefault().getImageRegistry().getDescriptor(Activator.FORWARD_ENABLED));
 		
 	}