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 107561 Details for
Bug 43573
[Contributions] Support icon in <menu>
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to add an 'icon' attribute to the 'menu'.
bug43573-patch.txt (text/plain), 3.52 KB, created by
Remy Suen
on 2008-07-15 23:38:49 EDT
(
hide
)
Description:
Patch to add an 'icon' attribute to the 'menu'.
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2008-07-15 23:38:49 EDT
Size:
3.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java,v >retrieving revision 1.28 >diff -u -r1.28 PluginActionBuilder.java >--- Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java 9 May 2008 14:13:13 -0000 1.28 >+++ Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java 16 Jul 2008 03:36:11 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 43573 [Contributions] Support icon in <menu> > *******************************************************************************/ > package org.eclipse.ui.internal; > >@@ -22,10 +23,12 @@ > import org.eclipse.jface.action.IToolBarManager; > import org.eclipse.jface.action.MenuManager; > import org.eclipse.jface.action.Separator; >+import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.ui.IWorkbenchActionConstants; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; > import org.eclipse.ui.internal.registry.RegistryReader; >+import org.eclipse.ui.plugin.AbstractUIPlugin; > > /** > * This class contains shared functionality for reading action contributions >@@ -241,6 +244,14 @@ > String id = menuElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); > String label = menuElement.getAttribute(IWorkbenchRegistryConstants.ATT_LABEL); > String path = menuElement.getAttribute(IWorkbenchRegistryConstants.ATT_PATH); >+ String icon = menuElement.getAttribute(IWorkbenchRegistryConstants.ATT_ICON); >+ ImageDescriptor image = null; >+ if (icon != null) { >+ String extendingPluginId = menuElement.getDeclaringExtension() >+ .getContributor().getName(); >+ image = AbstractUIPlugin.imageDescriptorFromPlugin( >+ extendingPluginId, icon); >+ } > if (label == null) { > WorkbenchPlugin.log("Plugin \'" //$NON-NLS-1$ > + menuElement.getContributor().getName() >@@ -297,7 +308,7 @@ > // If the menu does not exist create it. > IMenuManager newMenu = parent.findMenuUsingPath(id); > if (newMenu == null) { >- newMenu = new MenuManager(label, id); >+ newMenu = new MenuManager(label, image, id); > } > > // Add the menu >#P org.eclipse.ui >Index: schema/commonAction.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui/schema/commonAction.exsd,v >retrieving revision 1.11 >diff -u -r1.11 commonAction.exsd >--- schema/commonAction.exsd 16 Mar 2007 18:00:06 -0000 1.11 >+++ schema/commonAction.exsd 16 Jul 2008 03:36:12 -0000 >@@ -48,6 +48,17 @@ > </documentation> > </annotation> > </attribute> >+ <attribute name="icon" type="string"> >+ <annotation> >+ <documentation> >+ a relative path of an icon used to visually represent the action in its context. >+The path is relative to the location of the plugin.xml file of the contributing plug-in. >+ </documentation> >+ <appinfo> >+ <meta.attribute kind="resource"/> >+ </appinfo> >+ </annotation> >+ </attribute> > </complexType> > </element> >
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
Flags:
pwebster
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 43573
: 107561