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 172005 Details for
Bug 316303
[Compatibility] turn actionSets into MenuContributions
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]
ActionSets v02 (draft)
actionSets-v02.txt (text/plain), 22.00 KB, created by
Paul Webster
on 2010-06-15 19:11:48 EDT
(
hide
)
Description:
ActionSets v02 (draft)
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2010-06-15 19:11:48 EDT
Size:
22.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.e4.ui.workbench.renderers.swt >Index: src/org/eclipse/e4/ui/workbench/renderers/swt/MenuRenderer.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuRenderer.java,v >retrieving revision 1.1 >diff -u -r1.1 MenuRenderer.java >--- src/org/eclipse/e4/ui/workbench/renderers/swt/MenuRenderer.java 4 Jun 2010 20:22:12 -0000 1.1 >+++ src/org/eclipse/e4/ui/workbench/renderers/swt/MenuRenderer.java 15 Jun 2010 23:10:16 -0000 >@@ -56,6 +56,29 @@ > return newMenu; > } > >+ /* >+ * (non-Javadoc) >+ * >+ * @see >+ * org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer#processContents >+ * (org.eclipse.e4.ui.model.application.ui.MElementContainer) >+ */ >+ @Override >+ public void processContents(MElementContainer<MUIElement> container) { >+ Object obj = container.getWidget(); >+ Object menuModel = container; >+ if ((obj instanceof Menu) && (((Menu) obj).getStyle() & SWT.BAR) != 0 >+ && (menuModel instanceof MMenu)) { >+ // we don't process the children of the main menu bar >+ // are we bad people? >+ // IEclipseContext ctx = getContext(container); >+ // MenuServiceFilter filter = ctx.get(MenuServiceFilter.class); >+ // filter.showMenu(null, (Menu) obj, (MMenu) menuModel); >+ return; >+ } >+ super.processContents(container); >+ } >+ > private void setItemText(MMenu model, MenuItem item) { > String text = model.getLabel(); > if (text == null) { >#P org.eclipse.e4.ui.workbench.swt >Index: src/org/eclipse/e4/ui/workbench/swt/modeling/MenuServiceFilter.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/modeling/MenuServiceFilter.java,v >retrieving revision 1.11 >diff -u -r1.11 MenuServiceFilter.java >--- src/org/eclipse/e4/ui/workbench/swt/modeling/MenuServiceFilter.java 15 Jun 2010 20:25:30 -0000 1.11 >+++ src/org/eclipse/e4/ui/workbench/swt/modeling/MenuServiceFilter.java 15 Jun 2010 23:10:16 -0000 >@@ -101,6 +101,10 @@ > > private void handleMenu(final Event event, final Menu menu, > final MMenu menuModel) { >+ if ((menu.getStyle() & SWT.BAR) != 0) { >+ // don't process the menu bar, it's not fair :-) >+ return; >+ } > switch (event.type) { > case SWT.Show: > if (DEBUG) { >@@ -124,7 +128,7 @@ > } > } > >- private void showMenu(final Event event, final Menu menu, >+ public void showMenu(final Event event, final Menu menu, > final MMenu menuModel) { > final IEclipseContext parentContext = modelService > .getContainingContext(menuModel); >@@ -174,7 +178,7 @@ > } > } > >- private void hidePopup(Event event, Menu menu, MPopupMenu menuModel) { >+ public void hidePopup(Event event, Menu menu, MPopupMenu menuModel) { > final IEclipseContext popupContext = menuModel.getContext(); > final IEclipseContext parentContext = popupContext.getParent(); > final IEclipseContext originalChild = (IEclipseContext) popupContext >@@ -190,7 +194,7 @@ > } > } > >- private void showPopup(final Event event, final Menu menu, >+ public void showPopup(final Event event, final Menu menu, > final MPopupMenu menuModel) { > final IEclipseContext popupContext = menuModel.getContext(); > final IEclipseContext parentContext = popupContext.getParent(); >@@ -313,7 +317,7 @@ > } > } > >- private void showRenderedMenu(final Event event, final Menu menu, >+ public void showRenderedMenu(final Event event, final Menu menu, > final MRenderedMenu menuModel) { > if (!(menuModel.getContributionManager() instanceof MenuManager)) { > return; >@@ -347,7 +351,7 @@ > event.doit = false; > } > >- private void cleanUp(final Menu menu) { >+ public void cleanUp(final Menu menu) { > if (DEBUG) { > trace("cleanUp", menu, null); > } >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java >diff -N Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,180 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ui.internal.menus; >+ >+import java.util.ArrayList; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.Path; >+import org.eclipse.e4.core.contexts.IEclipseContext; >+import org.eclipse.e4.ui.model.application.MApplication; >+import org.eclipse.e4.ui.model.application.ui.MElementContainer; >+import org.eclipse.e4.ui.model.application.ui.menu.MMenu; >+import org.eclipse.e4.ui.model.application.ui.menu.MMenuContribution; >+import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement; >+import org.eclipse.e4.ui.model.application.ui.menu.impl.MenuFactoryImpl; >+import org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter; >+import org.eclipse.ui.IWorkbenchActionConstants; >+import org.eclipse.ui.internal.e4.compatibility.E4Util; >+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; >+ >+/** >+ * @since e4 >+ * >+ */ >+public class ActionSet { >+ >+ private IConfigurationElement configElement; >+ >+ private MApplication application; >+ >+ public ActionSet(MApplication application, IEclipseContext appContext, >+ IConfigurationElement element) { >+ this.application = application; >+ this.configElement = element; >+ } >+ >+ public void addToModel(ArrayList<MMenuContribution> contributions) { >+ >+ String idContrib = MenuHelper.getId(configElement); >+ IConfigurationElement[] menus = configElement >+ .getChildren(IWorkbenchRegistryConstants.TAG_MENU); >+ for (IConfigurationElement element : menus) { >+ addContribution(idContrib, contributions, element, true); >+ } >+ >+ IConfigurationElement[] actions = configElement >+ .getChildren(IWorkbenchRegistryConstants.TAG_ACTION); >+ for (IConfigurationElement element : actions) { >+ addContribution(idContrib, contributions, element, false); >+ } >+ >+ // for entertainment purposes only >+ // printContributions(contributions); >+ } >+ >+ void printContributions(ArrayList<MMenuContribution> contributions) { >+ for (MMenuContribution c : contributions) { >+ for (MMenuElement element : c.getChildren()) { >+ printElement(1, element); >+ } >+ } >+ } >+ >+ private void printElement(int level, MMenuElement element) { >+ for (int i = 0; i < level; i++) { >+ System.out.print('\t'); >+ } >+ System.out.println(element); >+ if (element instanceof MMenu) { >+ for (MMenuElement item : ((MMenu) element).getChildren()) { >+ printElement(level + 1, item); >+ } >+ } >+ } >+ >+ private void addContribution(String idContrib, ArrayList<MMenuContribution> contributions, >+ IConfigurationElement element, boolean isMenu) { >+ MMenuContribution menuContribution = MenuFactoryImpl.eINSTANCE.createMenuContribution(); >+ menuContribution.getTags().add(MenuServiceFilter.MC_MENU); >+ final String elementId = MenuHelper.getId(element); >+ if (idContrib != null && idContrib.length() > 0) { >+ menuContribution.setElementId(idContrib + "/" + elementId); //$NON-NLS-1$ >+ } else { >+ menuContribution.setElementId(elementId); >+ } >+ >+ String path = isMenu ? MenuHelper.getPath(element) : MenuHelper.getMenuBarPath(element); >+ if (path == null || path.length() == 0) { >+ if (!isMenu) { >+ return; >+ } >+ path = IWorkbenchActionConstants.MB_ADDITIONS; >+ } >+ Path menuPath = new Path(path); >+ String parentId = "org.eclipse.ui.main.menu"; //$NON-NLS-1$ >+ String positionInParent = "after=" + menuPath.segment(0); //$NON-NLS-1$ >+ int segmentCount = menuPath.segmentCount(); >+ if (segmentCount > 1) { >+ parentId = menuPath.segment(segmentCount - 2); >+ positionInParent = "after=" + menuPath.segment(segmentCount - 1); //$NON-NLS-1$ >+ } >+ menuContribution.setParentID(parentId); >+ menuContribution.setPositionInParent(positionInParent); >+ if (isMenu) { >+ MMenu menu = MenuHelper.createMenuAddition(element); >+ menuContribution.getChildren().add(menu); >+ } else { >+ if (parentId.equals("org.eclipse.ui.main.menu")) { //$NON-NLS-1$ >+ E4Util.unsupported("****MC: bad pie: " + menuPath); //$NON-NLS-1$ >+ parentId = IWorkbenchActionConstants.M_WINDOW; >+ menuContribution.setParentID(parentId); >+ } >+ MMenuElement action = MenuHelper.createLegacyActionAdditions(application, element); >+ if (action != null) { >+ menuContribution.getChildren().add(action); >+ } >+ } >+ if (menuContribution.getChildren().size() > 0) { >+ contributions.add(menuContribution); >+ } >+ if (isMenu) { >+ processGroups(idContrib, contributions, element); >+ } >+ } >+ >+ private void processGroups(String idContrib, ArrayList<MMenuContribution> contributions, >+ IConfigurationElement element) { >+ MMenuContribution menuContribution = MenuFactoryImpl.eINSTANCE.createMenuContribution(); >+ menuContribution.getTags().add(MenuServiceFilter.MC_MENU); >+ final String elementId = MenuHelper.getId(element); >+ if (idContrib != null && idContrib.length() > 0) { >+ menuContribution.setElementId(idContrib + "/" + elementId + ".groups"); //$NON-NLS-1$ //$NON-NLS-2$ >+ } else { >+ menuContribution.setElementId(elementId + ".groups"); //$NON-NLS-1$ >+ } >+ menuContribution.setParentID(elementId); >+ IConfigurationElement[] children = element.getChildren(); >+ for (IConfigurationElement sepAddition : children) { >+ String name = sepAddition.getAttribute(IWorkbenchRegistryConstants.ATT_NAME); >+ MMenuElement sep = MenuFactoryImpl.eINSTANCE.createMenuSeparator(); >+ sep.setElementId(name); >+ if (!MenuHelper.isSeparatorVisible(sepAddition)) { >+ sep.setVisible(false); >+ } >+ menuContribution.getChildren().add(sep); >+ } >+ if (menuContribution.getChildren().size() > 0) { >+ contributions.add(menuContribution); >+ } >+ } >+ >+ MElementContainer<MMenuElement> findMenuFromPath(MElementContainer<MMenuElement> menu, >+ Path menuPath, int segment) { >+ int idx = MenuHelper.indexForId(menu, menuPath.segment(segment)); >+ if (idx == -1) { >+ if (segment + 1 < menuPath.segmentCount() || !menuPath.hasTrailingSeparator()) { >+ return null; >+ } >+ return menu; >+ } >+ MElementContainer<MMenuElement> item = (MElementContainer<MMenuElement>) menu.getChildren() >+ .get(idx); >+ if (item.getChildren().size() == 0) { >+ if (segment + 1 == menuPath.segmentCount()) { >+ return menu; >+ } else { >+ return null; >+ } >+ } >+ return findMenuFromPath(item, menuPath, segment + 1); >+ } >+} >Index: Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.compatibility/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java,v >retrieving revision 1.8 >diff -u -r1.8 MenuAdditionCacheEntry.java >--- Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java 15 Jun 2010 20:25:31 -0000 1.8 >+++ Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java 15 Jun 2010 23:10:17 -0000 >@@ -12,6 +12,7 @@ > > package org.eclipse.ui.internal.menus; > >+import java.util.ArrayList; > import java.util.Map; > import org.eclipse.core.runtime.IConfigurationElement; > import org.eclipse.e4.core.contexts.IEclipseContext; >@@ -41,7 +42,6 @@ > // private IEclipseContext appContext; > private IConfigurationElement configElement; > private MenuLocationURI location; >- private MMenuContribution menuContribution; > > private MToolBarContribution toolBarContribution; > >@@ -158,8 +158,6 @@ > MMenu element = createMenuAddition(items[i]); > element.getTags().add(filter); > container.getChildren().add(element); >- addMenuChildren(element, items[i], filter); >- // newItem = createMenuAdditionContribution(items[i]); > } else if (IWorkbenchRegistryConstants.TAG_TOOLBAR.equals(itemType)) { > E4Util.unsupported("Toolbar: " + id + " in " + location); //$NON-NLS-1$//$NON-NLS-2$ > } >@@ -188,44 +186,12 @@ > if (IWorkbenchRegistryConstants.TAG_COMMAND.equals(itemType)) { > MToolBarElement element = createToolBarCommandAddition(items[i]); > container.getChildren().add(element); >- // } else if >- // (IWorkbenchRegistryConstants.TAG_DYNAMIC.equals(itemType)) { >- // E4Util.unsupported("Dynamic: " + id + " in " + location); //$NON-NLS-1$//$NON-NLS-2$ >- // } else if >- // (IWorkbenchRegistryConstants.TAG_CONTROL.equals(itemType)) { >- // E4Util.unsupported("Control: " + id + " in " + location); //$NON-NLS-1$//$NON-NLS-2$ >- // } else if >- // (IWorkbenchRegistryConstants.TAG_SEPARATOR.equals(itemType)) >- // { >- // MMenuElement element = createSeparatorAddition(items[i]); >- // container.getChildren().add(element); >- // } else if >- // (IWorkbenchRegistryConstants.TAG_MENU.equals(itemType)) { >- // MMenu element = createMenuAddition(items[i]); >- // element.getTags().add(filter); >- // container.getChildren().add(element); >- // addMenuChildren(element, items[i], filter); >- // // newItem = createMenuAdditionContribution(items[i]); >- // } else if >- // (IWorkbenchRegistryConstants.TAG_TOOLBAR.equals(itemType)) { >- // E4Util.unsupported("Toolbar: " + id + " in " + location); //$NON-NLS-1$//$NON-NLS-2$ > } > >- // if (newItem instanceof InternalControlContribution) { >- // ((InternalControlContribution) >- // newItem).setWorkbenchWindow(window); >- // } >- >- // Cache the relationship between the ICI and the >- // registry element used to back it >- // if (newItem != null) { >- // additions.addContributionItem(newItem, >- // getVisibleWhenForItem(newItem, items[i])); >- // } > } > } > >- public void addToModel() { >+ public void addToModel(ArrayList<MMenuContribution> contributions) { > if (inToolbar()) { > toolBarContribution = MenuFactoryImpl.eINSTANCE.createToolBarContribution(); > String idContrib = MenuHelper.getId(configElement); >@@ -243,7 +209,7 @@ > > return; > } >- menuContribution = MenuFactoryImpl.eINSTANCE.createMenuContribution(); >+ MMenuContribution menuContribution = MenuFactoryImpl.eINSTANCE.createMenuContribution(); > String idContrib = MenuHelper.getId(configElement); > if (idContrib != null && idContrib.length() > 0) { > menuContribution.setElementId(idContrib); >@@ -266,11 +232,35 @@ > menuContribution.getTags().add(filter); > menuContribution.setVisibleWhen(MenuHelper.getVisibleWhen(configElement)); > addMenuChildren(menuContribution, configElement, filter); >- application.getMenuContributions().add(menuContribution); >+ contributions.add(menuContribution); >+ processMenuChildren(contributions, configElement, filter); > } > >- public void dispose() { >- application.getMenuContributions().remove(menuContribution); >- application.getToolBarContributions().remove(toolBarContribution); >+ /** >+ * @param contributions >+ * @param element >+ * @param filter >+ */ >+ private void processMenuChildren(ArrayList<MMenuContribution> contributions, >+ IConfigurationElement element, String filter) { >+ IConfigurationElement[] menus = element.getChildren(IWorkbenchRegistryConstants.TAG_MENU); >+ if (menus.length == 0) { >+ return; >+ } >+ for (IConfigurationElement menu : menus) { >+ MMenuContribution menuContribution = MenuFactoryImpl.eINSTANCE.createMenuContribution(); >+ String idContrib = MenuHelper.getId(menu); >+ if (idContrib != null && idContrib.length() > 0) { >+ menuContribution.setElementId(idContrib); >+ } >+ menuContribution.setParentID(idContrib); >+ menuContribution.getTags().add("scheme:" + location.getScheme()); //$NON-NLS-1$ >+ menuContribution.getTags().add(filter); >+ menuContribution.setVisibleWhen(MenuHelper.getVisibleWhen(menu)); >+ addMenuChildren(menuContribution, menu, filter); >+ contributions.add(menuContribution); >+ processMenuChildren(contributions, menu, filter); >+ } > } >+ > } >Index: Eclipse UI/org/eclipse/ui/internal/menus/MenuPersistence.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.compatibility/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuPersistence.java,v >retrieving revision 1.3 >diff -u -r1.3 MenuPersistence.java >--- Eclipse UI/org/eclipse/ui/internal/menus/MenuPersistence.java 9 Jun 2010 18:31:31 -0000 1.3 >+++ Eclipse UI/org/eclipse/ui/internal/menus/MenuPersistence.java 15 Jun 2010 23:10:17 -0000 >@@ -12,6 +12,7 @@ > package org.eclipse.ui.internal.menus; > > import java.util.ArrayList; >+import java.util.Arrays; > import java.util.Collections; > import java.util.Comparator; > import java.util.Iterator; >@@ -22,6 +23,7 @@ > import org.eclipse.core.runtime.Platform; > import org.eclipse.e4.core.contexts.IEclipseContext; > import org.eclipse.e4.ui.model.application.MApplication; >+import org.eclipse.e4.ui.model.application.ui.menu.MMenuContribution; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.internal.e4.compatibility.E4Util; > import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; >@@ -42,7 +44,9 @@ > > private MApplication application; > private IEclipseContext appContext; >- private ArrayList<MenuAdditionCacheEntry> contributions = new ArrayList<MenuAdditionCacheEntry>(); >+ private ArrayList<MenuAdditionCacheEntry> cacheEntries = new ArrayList<MenuAdditionCacheEntry>(); >+ private ArrayList<ActionSet> actionContributions = new ArrayList<ActionSet>(); >+ private ArrayList<MMenuContribution> menuContributions = new ArrayList<MMenuContribution>(); > > /** > * Constructs a new instance of {@link MenuPersistence}. >@@ -59,10 +63,10 @@ > } > > public final void dispose() { >- for (MenuAdditionCacheEntry mc : contributions) { >- mc.dispose(); >- } >- contributions.clear(); >+ application.getMenuContributions().removeAll(menuContributions); >+ menuContributions.clear(); >+ cacheEntries.clear(); >+ actionContributions.clear(); > super.dispose(); > } > >@@ -99,8 +103,16 @@ > // Read legacy 3.2 'trim' additions > readTrimAdditions(); > >+ ArrayList<MMenuContribution> contributions = new ArrayList<MMenuContribution>(); > // read the 3.3 menu additions >- readAdditions(); >+ readAdditions(contributions); >+ >+ // convert actionSets to MenuContributions >+ readActionSets(contributions); >+ >+ // can I rationalize them? >+ MenuHelper.mergeContributions(contributions, menuContributions); >+ application.getMenuContributions().addAll(menuContributions); > } > > // >@@ -165,9 +177,9 @@ > // } > } > >- public void readAdditions() { >+ public void readAdditions(ArrayList<MMenuContribution> contributions) { > final IExtensionRegistry registry = Platform.getExtensionRegistry(); >- ArrayList configElements = new ArrayList(); >+ ArrayList<IConfigurationElement> configElements = new ArrayList<IConfigurationElement>(); > > final IConfigurationElement[] menusExtensionPoint = registry > .getConfigurationElementsFor(EXTENSION_MENUS); >@@ -178,22 +190,17 @@ > configElements.add(menusExtensionPoint[i]); > } > } >- Comparator comparer = new Comparator() { >- public int compare(Object o1, Object o2) { >- IConfigurationElement c1 = (IConfigurationElement) o1; >- IConfigurationElement c2 = (IConfigurationElement) o2; >- return c1.getNamespaceIdentifier().compareToIgnoreCase( >- c2.getNamespaceIdentifier()); >+ Comparator<IConfigurationElement> comparer = new Comparator<IConfigurationElement>() { >+ public int compare(IConfigurationElement c1, IConfigurationElement c2) { >+ return c1.getNamespaceIdentifier().compareToIgnoreCase(c2.getNamespaceIdentifier()); > } > }; > Collections.sort(configElements, comparer); > >- Iterator i = configElements.iterator(); >+ Iterator<IConfigurationElement> i = configElements.iterator(); > while (i.hasNext()) { >- final IConfigurationElement configElement = (IConfigurationElement) i >- .next(); >- >- >+ final IConfigurationElement configElement = i.next(); >+ > if (isProgramaticContribution(configElement)) { > // newFactory = new ProxyMenuAdditionCacheEntry( > // configElement >@@ -202,13 +209,12 @@ > E4Util.unsupported("Programmatic Contribution Factories not supported"); //$NON-NLS-1$ > > } else { >- MenuAdditionCacheEntry menuContribution = new MenuAdditionCacheEntry(application, appContext, >- configElement, >- configElement >- .getAttribute(IWorkbenchRegistryConstants.TAG_LOCATION_URI), >+ MenuAdditionCacheEntry menuContribution = new MenuAdditionCacheEntry(application, >+ appContext, configElement, >+ configElement.getAttribute(IWorkbenchRegistryConstants.TAG_LOCATION_URI), > configElement.getNamespaceIdentifier()); >- contributions.add(menuContribution); >- menuContribution.addToModel(); >+ cacheEntries.add(menuContribution); >+ menuContribution.addToModel(contributions); > } > } > } >@@ -223,4 +229,25 @@ > private boolean isProgramaticContribution(IConfigurationElement menuAddition) { > return menuAddition.getAttribute(IWorkbenchRegistryConstants.ATT_CLASS) != null; > } >+ >+ private void readActionSets(ArrayList<MMenuContribution> contributions) { >+ final IExtensionRegistry registry = Platform.getExtensionRegistry(); >+ ArrayList<IConfigurationElement> configElements = new ArrayList<IConfigurationElement>(); >+ >+ configElements.addAll(Arrays.asList(registry >+ .getConfigurationElementsFor(IWorkbenchRegistryConstants.EXTENSION_ACTION_SETS))); >+ >+ Comparator<IConfigurationElement> comparer = new Comparator<IConfigurationElement>() { >+ public int compare(IConfigurationElement c1, IConfigurationElement c2) { >+ return c1.getNamespaceIdentifier().compareToIgnoreCase(c2.getNamespaceIdentifier()); >+ } >+ }; >+ Collections.sort(configElements, comparer); >+ >+ for (IConfigurationElement element : configElements) { >+ ActionSet actionSet = new ActionSet(application, appContext, element); >+ actionContributions.add(actionSet); >+ actionSet.addToModel(contributions); >+ } >+ } > }
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 316303
:
171886
| 172005 |
172179
|
172665
|
172806
|
172855