Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkradloff2003-02-13 20:38:46 +0000
committerkradloff2003-02-13 20:38:46 +0000
commiteee5b2cb042fb90fd8bef20a20a826775a2c14f1 (patch)
treef5ab209a5986c1a01c4fafa01719aa9d73533008 /bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
parentf351f2ac293a5bc77644342d4c901ac561d23e05 (diff)
downloadeclipse.platform.ui-eee5b2cb042fb90fd8bef20a20a826775a2c14f1.tar.gz
eclipse.platform.ui-eee5b2cb042fb90fd8bef20a20a826775a2c14f1.tar.xz
eclipse.platform.ui-eee5b2cb042fb90fd8bef20a20a826775a2c14f1.zip
Fixes bug 30449
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java')
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java63
1 files changed, 45 insertions, 18 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
index 722fbfbe518..8bd70dc8626 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
@@ -13,8 +13,11 @@ package org.eclipse.ui.internal;
import java.util.*;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.*;
+import org.eclipse.ui.internal.registry.WorkingSetDescriptor;
+import org.eclipse.ui.internal.registry.WorkingSetRegistry;
/**
* A working set holds a number of IAdaptable elements.
@@ -96,24 +99,6 @@ public class WorkingSet implements IAdaptable, IPersistableElement, IWorkingSet
/**
* Implements IWorkingSet
*
- * @see org.eclipse.ui.IWorkingSet#getName()
- */
- public String getName() {
- return name;
- }
- /**
- * Implements IWorkingSet
- *
- * @see org.eclipse.ui.IWorkingSet#getId()
- * @see org.eclipse.ui.dialogs.IWorkingSetPage
- * @since 2.1
- */
- public String getId() {
- return editPageId;
- }
- /**
- * Implements IWorkingSet
- *
* @see org.eclipse.ui.IWorkingSet#getElements()
*/
public IAdaptable[] getElements() {
@@ -143,6 +128,48 @@ public class WorkingSet implements IAdaptable, IPersistableElement, IWorkingSet
return FACTORY_ID;
}
/**
+ * Implements IWorkingSet
+ *
+ * @see org.eclipse.ui.IWorkingSet#getId()
+ * @see org.eclipse.ui.dialogs.IWorkingSetPage
+ * @since 2.1
+ */
+ public String getId() {
+ return editPageId;
+ }
+ /**
+ * Returns the working set icon.
+ * Currently, this is one of the icons specified in the extensions
+ * of the org.eclipse.ui.workingSets extension point.
+ * The extension is identified using the value returned by
+ * <code>getId()</code>.
+ * Returns <code>null</code> if no icon has been specified in the
+ * extension or if <code>getId()</code> returns <code>null</code>.
+ *
+ * @return the working set icon or <code>null</code>.
+ * @since 2.1
+ */
+ public ImageDescriptor getImage() {
+ WorkingSetRegistry registry = WorkbenchPlugin.getDefault().getWorkingSetRegistry();
+ WorkingSetDescriptor descriptor = null;
+
+ if (editPageId != null) {
+ descriptor = registry.getWorkingSetDescriptor(editPageId);
+ }
+ if (descriptor == null) {
+ return null;
+ }
+ return descriptor.getIcon();
+ }
+ /**
+ * Implements IWorkingSet
+ *
+ * @see org.eclipse.ui.IWorkingSet#getName()
+ */
+ public String getName() {
+ return name;
+ }
+ /**
* Returns the hash code.
*
* @return the hash code.

Back to the top