### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.workbench Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchImages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchImages.java,v retrieving revision 1.64 diff -u -r1.64 WorkbenchImages.java --- Eclipse UI/org/eclipse/ui/internal/WorkbenchImages.java 20 Oct 2008 17:17:26 -0000 1.64 +++ Eclipse UI/org/eclipse/ui/internal/WorkbenchImages.java 2 Jan 2009 04:47:47 -0000 @@ -15,6 +15,10 @@ import java.util.Map; import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.swt.SWT; @@ -595,9 +599,34 @@ imageRegistry = new ImageRegistry(); descriptors = new HashMap(); declareImages(); + loadFromRegistry(); } - /** + private static void loadFromRegistry() { + IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.idConstants"); //$NON-NLS-1$ + IExtension[] extensions = extensionPoint.getExtensions(); + for (int i = 0; i < extensions.length; i++) { + IConfigurationElement[] categories = extensions[i].getConfigurationElements(); + for (int j = 0; j < categories.length; j++) { + if(categories[j].getName().equals("category")) { //$NON-NLS-1$ + String categoryId = categories[j].getAttribute("id"); //$NON-NLS-1$ + IConfigurationElement[] constants = categories[j].getChildren(); + for (int k = 0; k < constants.length; k++) { + String name = constants[k].getAttribute("name"); //$NON-NLS-1$ + try { + URL url = new URL(constants[k].getAttribute("value")); //$NON-NLS-1$ + ImageDescriptor desc = ImageDescriptor.createFromURL(url); + declareImage("org.eclipse.ui.idConstants/"+categoryId+'/'+name, desc, true); //$NON-NLS-1$ + } catch (Exception e) { + // log here... + } + } + } + } + } + } + + /** * Disposes and clears the workbench images. * Called when the workbench is shutting down. * Index: Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java,v retrieving revision 1.53 diff -u -r1.53 MenuAdditionCacheEntry.java --- Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java 24 Nov 2008 18:43:07 -0000 1.53 +++ Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java 2 Jan 2009 04:47:48 -0000 @@ -32,6 +32,7 @@ import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.commands.ICommandImageService; import org.eclipse.ui.internal.WorkbenchWindow; import org.eclipse.ui.internal.provisional.presentations.IActionBarPresentationFactory; @@ -409,11 +410,14 @@ .getContributor().getName(); String iconPath = getIconPath(element); + ImageDescriptor descriptor = null; if (iconPath != null) { - return AbstractUIPlugin.imageDescriptorFromPlugin( - extendingPluginId, iconPath); + if(iconPath.startsWith("org.eclipse.ui.idConstants/")) //$NON-NLS-1$ + descriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(iconPath); + else + descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(extendingPluginId, iconPath); } - return null; + return descriptor; } static ImageDescriptor getDisabledIconDescriptor( #P org.eclipse.ui Index: plugin.xml =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui/plugin.xml,v retrieving revision 1.437 diff -u -r1.437 plugin.xml --- plugin.xml 7 Oct 2008 09:13:48 -0000 1.437 +++ plugin.xml 2 Jan 2009 04:47:57 -0000 @@ -50,6 +50,7 @@ + @@ -2194,4 +2195,18 @@ + + + + + + + + Index: plugin.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui/plugin.properties,v retrieving revision 1.215 diff -u -r1.215 plugin.properties --- plugin.properties 12 Sep 2008 19:54:46 -0000 1.215 +++ plugin.properties 2 Jan 2009 04:47:57 -0000 @@ -57,6 +57,7 @@ ExtPoint.statusHandlers = Status Handlers ExtPoint.installationPages = Installation Pages ExtPoint.tweaklets = Tweaklets (internal/experimental) +ExtPoint.idConstants = ID Constants Views.Category.Basic = General Views.IntroAdapter = Welcome Index: schema/idConstants.exsd =================================================================== RCS file: schema/idConstants.exsd diff -N schema/idConstants.exsd --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ schema/idConstants.exsd 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,121 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + \ No newline at end of file