Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 117425 Details for
Bug 246224
[Contributions] Accessing SharedImages in plugin.xml (for ex. org.eclipse.ui.menus)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch v02
Shared Images v02.txt (text/plain), 9.67 KB, created by
Prakash Rangaraj
on 2008-11-10 05:11:00 EST
(
hide
)
Description:
Patch v02
Filename:
MIME Type:
Creator:
Prakash Rangaraj
Created:
2008-11-10 05:11:00 EST
Size:
9.67 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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 10 Nov 2008 09:54:40 -0000 >@@ -50,6 +50,7 @@ > <extension-point id="browserSupport" name="%ExtPoint.browserSupport" schema="schema/browserSupport.exsd"/> > <extension-point id="internalTweaklets" name="%ExtPoint.tweaklets" schema="schema/internalTweaklets.exsd"/> > <extension-point id="installationPages" name="%ExtPoint.installationPages" schema="schema/installationPages.exsd"/> >+ <extension-point id="sharedImages" name="%ExtPoint.sharedImages" schema="schema/sharedImages.exsd"/> > > <extension > point="org.eclipse.ui.contexts"> >@@ -2194,4 +2195,18 @@ > </variable> > </sourceProvider> > </extension> >+ <extension >+ point="org.eclipse.ui.sharedImages"> >+ <category >+ id="org.eclipse.ui"> >+ <constant >+ name="IMG_ETOOL_PRINT_EDIT" >+ value="platform:/plugin/org.eclipse.ui/icons/full/etool16/print_edit.gif"> >+ </constant> >+ <constant >+ name="IMG_ETOOL_SAVE_EDIT" >+ value="platform:/plugin/org.eclipse.ui/icons/full/etool16/save_edit.gif"> >+ </constant> >+ </category> >+ </extension> > </plugin> >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 10 Nov 2008 09:52:35 -0000 >@@ -57,6 +57,7 @@ > ExtPoint.statusHandlers = Status Handlers > ExtPoint.installationPages = Installation Pages > ExtPoint.tweaklets = Tweaklets (internal/experimental) >+ExtPoint.sharedImages = Shared Images > > Views.Category.Basic = General > Views.IntroAdapter = Welcome >Index: schema/sharedImages.exsd >=================================================================== >RCS file: schema/sharedImages.exsd >diff -N schema/sharedImages.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/sharedImages.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,121 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.ui" xmlns="http://www.w3.org/2001/XMLSchema"> >+<annotation> >+ <appinfo> >+ <meta.schema plugin="org.eclipse.ui" id="sharedImages" name="%sharedImages"/> >+ </appinfo> >+ <documentation> >+ [Enter description of this extension point.] >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appinfo> >+ <meta.element /> >+ </appinfo> >+ </annotation> >+ <complexType> >+ <sequence minOccurs="1" maxOccurs="unbounded"> >+ <element ref="category"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appinfo> >+ <meta.attribute translatable="true"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="constant"> >+ <complexType> >+ <attribute name="name" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="value" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="category"> >+ <complexType> >+ <sequence minOccurs="1" maxOccurs="unbounded"> >+ <element ref="constant"/> >+ </sequence> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="since"/> >+ </appinfo> >+ <documentation> >+ [Enter the first release in which this extension point appears.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="examples"/> >+ </appinfo> >+ <documentation> >+ [Enter extension point usage example here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="apiinfo"/> >+ </appinfo> >+ <documentation> >+ [Enter API information here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="implementation"/> >+ </appinfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ >+</schema> >\ No newline at end of file >#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 10 Nov 2008 09:56:27 -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.sharedImages"); //$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.sharedImages/images/"+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.52 >diff -u -r1.52 MenuAdditionCacheEntry.java >--- Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java 3 Oct 2008 17:04:01 -0000 1.52 >+++ Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java 10 Nov 2008 09:56:44 -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; >@@ -419,11 +420,14 @@ > .getContributor().getName(); > > String iconPath = getIconPath(element); >+ ImageDescriptor descriptor = null; > if (iconPath != null) { >- return AbstractUIPlugin.imageDescriptorFromPlugin( >- extendingPluginId, iconPath); >+ if(iconPath.startsWith("org.eclipse.ui.sharedImages/images/")) //$NON-NLS-1$ >+ descriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(iconPath); >+ else >+ descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(extendingPluginId, iconPath); > } >- return null; >+ return descriptor; > } > > static ImageDescriptor getDisabledIconDescriptor(
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 246224
:
116534
|
117425
|
117426
|
121422
|
127448
|
127613
|
127798
|
127799
|
127800
|
127840
|
127858