Skip to main content
summaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorThomas Fletcher2003-07-09 17:51:48 -0400
committerThomas Fletcher2003-07-09 17:51:48 -0400
commitc52d8ebf715a91f29278223b4ab84cb8323ec59a (patch)
tree778a5756613f1ff0b9c7c8a795fd82ab29325ba2 /launch
parentd71d9270d85cbf9963deae1b57b6ce99b7e0395d (diff)
downloadorg.eclipse.cdt-c52d8ebf715a91f29278223b4ab84cb8323ec59a.tar.gz
org.eclipse.cdt-c52d8ebf715a91f29278223b4ab84cb8323ec59a.tar.xz
org.eclipse.cdt-c52d8ebf715a91f29278223b4ab84cb8323ec59a.zip
Update to fill out the LaunchImage class which was not loading images.
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/ChangeLog4
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif (renamed from launch/org.eclipse.cdt.launch/icons/arguments_tab.gif)bin108 -> 108 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gifbin0 -> 166 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gifbin0 -> 198 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gifbin0 -> 152 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gifbin0 -> 157 bytes
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java80
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java2
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java10
9 files changed, 86 insertions, 10 deletions
diff --git a/launch/org.eclipse.cdt.launch/ChangeLog b/launch/org.eclipse.cdt.launch/ChangeLog
index 8e6afcd42d..0abe504477 100644
--- a/launch/org.eclipse.cdt.launch/ChangeLog
+++ b/launch/org.eclipse.cdt.launch/ChangeLog
@@ -1,3 +1,7 @@
+2003-07-09 David Inglis
+ * src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
+ Filled out this class which previously wasn't loading images ... now it is.
+
2003-07-03 David Inglis
* src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
* src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
diff --git a/launch/org.eclipse.cdt.launch/icons/arguments_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif
index 8670a384bd..8670a384bd 100644
--- a/launch/org.eclipse.cdt.launch/icons/arguments_tab.gif
+++ b/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif
new file mode 100644
index 0000000000..8b4f2340c9
--- /dev/null
+++ b/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif
new file mode 100644
index 0000000000..65d63ec00d
--- /dev/null
+++ b/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif
new file mode 100644
index 0000000000..6b86d07978
--- /dev/null
+++ b/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif
new file mode 100644
index 0000000000..3976f8f791
--- /dev/null
+++ b/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif
Binary files differ
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
index df3baf02d5..28bb0f2cf5 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
@@ -1,5 +1,11 @@
package org.eclipse.cdt.launch.internal.ui;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
/*
@@ -7,18 +13,72 @@ import org.eclipse.swt.graphics.Image;
* All Rights Reserved.
*/
public class LaunchImages {
- public static String IMG_VIEW_ARGUMENTS_TAB = "";
- public static String IMG_VIEW_ENVIRONMENT_TAB = "";
- public static String IMG_VIEW_MAIN_TAB = "";
- public static String IMG_VIEW_DEBUGGER_TAB = "";
+ private static final String NAME_PREFIX= LaunchUIPlugin.PLUGIN_ID + '.';
+ private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length();
+
+ // The plugin registry
+ private static ImageRegistry imageRegistry = new ImageRegistry();
+
+ // Subdirectory (under the package containing this class) where 16 color images are
+ private static URL fgIconBaseURL;
+ static {
+ try {
+ fgIconBaseURL= new URL(LaunchUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" );
+ } catch (MalformedURLException e) {
+ //LaunchUIPlugin.getDefault().log(e);
+ }
+ }
+
+ private static final String T_TABS = "tabs/";
+ public static String IMG_VIEW_MAIN_TAB = NAME_PREFIX + "main_tab.gif";
+ public static String IMG_VIEW_ARGUMENTS_TAB = NAME_PREFIX + "arguments_tab.gif";
+ public static String IMG_VIEW_ENVIRONMENT_TAB = NAME_PREFIX + "environment_tab.gif";
+ public static String IMG_VIEW_DEBUGGER_TAB = NAME_PREFIX + "debugger_tab.gif";
+ public static String IMG_VIEW_SOURCE_TAB = NAME_PREFIX + "source_tab.gif";
+
+ public static final ImageDescriptor DESC_TAB_MAIN= createManaged(T_TABS, IMG_VIEW_MAIN_TAB);
+ public static final ImageDescriptor DESC_TAB_ARGUMENTS = createManaged(T_TABS, IMG_VIEW_ARGUMENTS_TAB);
+ public static final ImageDescriptor DESC_TAB_ENVIRONMENT = createManaged(T_TABS, IMG_VIEW_ENVIRONMENT_TAB);
+ public static final ImageDescriptor DESC_TAB_DEBUGGER = createManaged(T_TABS, IMG_VIEW_DEBUGGER_TAB);
+ public static final ImageDescriptor DESC_TAB_SOURCE = createManaged(T_TABS, IMG_VIEW_SOURCE_TAB);
+
+ public static void initialize() {
+ }
+
+ private static ImageDescriptor createManaged(String prefix, String name) {
+ return createManaged(imageRegistry, prefix, name);
+ }
+
+ private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) {
+ ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
+ registry.put(name, result);
+ return result;
+ }
+
+ public static Image get(String key) {
+ return imageRegistry.get(key);
+ }
+
+ private static ImageDescriptor create(String prefix, String name) {
+ return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
+ }
+
+ private static URL makeIconFileURL(String prefix, String name) {
+ StringBuffer buffer= new StringBuffer(prefix);
+ buffer.append(name);
+ try {
+ return new URL(fgIconBaseURL, buffer.toString());
+ } catch (MalformedURLException e) {
+ CUIPlugin.getDefault().log(e);
+ return null;
+ }
+ }
+
/**
- * Method get.
- * @param string
- * @return Image
+ * Helper method to access the image registry from the JavaPlugin class.
*/
- public static Image get(String string) {
- return null;
+ static ImageRegistry getImageRegistry() {
+ return imageRegistry;
}
-
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
index d0667cd5dc..f7602ad57c 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
@@ -23,6 +23,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
*/
public class LaunchUIPlugin extends AbstractUIPlugin
implements IDebugEventSetListener {
+ public static final String PLUGIN_ID = "org.eclipse.cdt.launch";
/**
* Launch UI plug-in instance
@@ -173,6 +174,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin
public void startup() throws CoreException {
super.startup();
DebugPlugin.getDefault().addDebugEventListener(this);
+ LaunchImages.initialize();
}
/**
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java
index 3b1da503e5..fd348f2b56 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java
@@ -8,6 +8,7 @@ package org.eclipse.cdt.launch.ui;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
import org.eclipse.cdt.debug.ui.sourcelookup.SourceLookupBlock;
+import org.eclipse.cdt.launch.internal.ui.LaunchImages;
import org.eclipse.cdt.launch.sourcelookup.DefaultSourceLocator;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -15,6 +16,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -115,6 +117,13 @@ public class CSourceLookupTab extends CLaunchConfigurationTab
return "Source";
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
+ */
+ public Image getImage() {
+ return LaunchImages.get(LaunchImages.IMG_VIEW_SOURCE_TAB);
+ }
+
private IProject getProject( ILaunchConfiguration configuration )
{
IProject project = null;
@@ -134,4 +143,5 @@ public class CSourceLookupTab extends CLaunchConfigurationTab
{
return string == null || string.length() == 0;
}
+
}

Back to the top