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 33171 Details for
Bug 123257
[RCP] [CoolBar] Need ability to provide a custom toolbar similar to the way we can supply a custom statusbar
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]
DRAFT patch for ui.workbench
ActionBarPresentation_workbench_I20051214-0010_patch.txt (text/plain), 37.23 KB, created by
Matthew Hatem
on 2006-01-17 16:25:35 EST
(
hide
)
Description:
DRAFT patch for ui.workbench
Filename:
MIME Type:
Creator:
Matthew Hatem
Created:
2006-01-17 16:25:35 EST
Size:
37.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java,v >retrieving revision 1.31 >diff -u -r1.31 WorkbenchWindowConfigurer.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java 15 Aug 2005 16:01:45 -0000 1.31 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java 17 Jan 2006 20:13:36 -0000 >@@ -38,6 +38,7 @@ > import org.eclipse.ui.application.IWorkbenchWindowConfigurer; > import org.eclipse.ui.application.WorkbenchAdvisor; > import org.eclipse.ui.presentations.AbstractPresentationFactory; >+import org.eclipse.ui.presentations.ActionBarPresentation; > import org.eclipse.ui.presentations.WorkbenchPresentationFactory; > > /** >@@ -205,7 +206,7 @@ > if (proxy != null) { > return proxy.getCoolBarManager(); > } >- return window.getCoolBarManager(); >+ return window.getCoolBarManager2(); > } > > /* (non-Javadoc) >@@ -217,6 +218,14 @@ > } > window.registerGlobalAction(action); > } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.application.IActionBarConfigurer#getToolBarPresentation() >+ */ >+ public ActionBarPresentation getActionBarPresentation() { >+ WorkbenchWindow window = (WorkbenchWindow)getWindowConfigurer().getWindow(); >+ return window.getActionPresentation().getActionBarPresentation(); >+ } > } > > /** >@@ -588,14 +597,16 @@ > * @see org.eclipse.ui.application.IWorkbenchWindowConfigurer > */ > public Control createCoolBarControl(Composite parent) { >- return window.getCoolBarManager().createControl(parent); >+ return actionBarConfigurer.getActionBarPresentation().createCoolBarControl( >+ window.getCoolBarManager2(), parent); > } > > /* (non-Javadoc) > * @see org.eclipse.ui.application.IWorkbenchWindowConfigurer > */ > public Control createStatusLineControl(Composite parent) { >- return window.getStatusLineManager().createControl(parent); >+ return actionBarConfigurer.getActionBarPresentation().createStatusLineControl( >+ window.getStatusLineManager(), parent); > } > > /* (non-Javadoc) >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java,v >retrieving revision 1.309 >diff -u -r1.309 WorkbenchWindow.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 7 Dec 2005 18:41:24 -0000 1.309 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 17 Jan 2006 20:13:36 -0000 >@@ -36,7 +36,10 @@ > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.action.IContributionItem; > import org.eclipse.jface.action.IContributionManager; >+import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.action.IMenuManager; >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.action.IToolBarManager2; > import org.eclipse.jface.action.MenuManager; > import org.eclipse.jface.action.Separator; > import org.eclipse.jface.action.StatusLineManager; >@@ -112,6 +115,7 @@ > import org.eclipse.ui.internal.registry.IActionSetDescriptor; > import org.eclipse.ui.internal.registry.UIExtensionTracker; > import org.eclipse.ui.internal.util.PrefUtil; >+import org.eclipse.ui.presentations.ActionBarPresentation; > > /** > * A window within the workbench. >@@ -293,8 +297,6 @@ > addCoolBar(SWT.FLAT); > addStatusLine(); > >- actionPresentation = new ActionPresentation(this); >- > // register with the tracker > getExtensionTracker() > .registerHandler( >@@ -742,7 +744,7 @@ > * Return whether or not the coolbar layout is locked. > */ > protected boolean isCoolBarLocked() { >- CoolBarManager cbm = getCoolBarManager(); >+ ICoolBarManager cbm = getCoolBarManager2(); > return cbm != null && cbm.getLockLayout(); > } > >@@ -1403,7 +1405,7 @@ > boolean result; > try { > // Clear the action sets, fix for bug 27416. >- actionPresentation.clearActionSets(); >+ getActionPresentation().clearActionSets(); > > // Remove the handler submissions. Bug 64024. > final IWorkbench workbench = getWorkbench(); >@@ -1465,7 +1467,7 @@ > */ > /* package */ > void lockCoolBar(boolean lock) { >- getCoolBarManager().setLockLayout(lock); >+ getCoolBarManager2().setLockLayout(lock); > } > > /** >@@ -1631,8 +1633,8 @@ > // Restore the cool bar order by creating all the tool bar contribution items > // This needs to be done before pages are created to ensure proper canonical creation > // of cool items >- if (getCoolBarManager() != null) { >- CoolBarManager coolBarMgr = getCoolBarManager(); >+ ICoolBarManager coolBarMgr = getCoolBarManager2(); >+ if (coolBarMgr != null) { > IMemento coolBarMem = memento > .getChild(IWorkbenchConstants.TAG_COOLBAR_LAYOUT); > if (coolBarMem != null) { >@@ -1917,7 +1919,7 @@ > if (coolbarMem == null) { > return false; > } >- CoolBarManager coolBarMgr = getCoolBarManager(); >+ ICoolBarManager coolBarMgr = getCoolBarManager2(); > // Check to see if layout is locked > Integer locked = coolbarMem.getInteger(IWorkbenchConstants.TAG_LOCKED); > boolean state = (locked != null) && (locked.intValue() == 1); >@@ -2243,16 +2245,17 @@ > } > > /// Save the order of the cool bar contribution items >- if (getCoolBarManager() != null) { >- getCoolBarManager().refresh(); >+ ICoolBarManager coolBarMgr = getCoolBarManager2(); >+ if (coolBarMgr != null) { >+ coolBarMgr.refresh(); > IMemento coolBarMem = memento > .createChild(IWorkbenchConstants.TAG_COOLBAR_LAYOUT); >- if (getCoolBarManager().getLockLayout() == true) { >+ if (coolBarMgr.getLockLayout() == true) { > coolBarMem.putInteger(IWorkbenchConstants.TAG_LOCKED, 1); > } else { > coolBarMem.putInteger(IWorkbenchConstants.TAG_LOCKED, 0); > } >- IContributionItem[] items = getCoolBarManager().getItems(); >+ IContributionItem[] items = coolBarMgr.getItems(); > for (int i = 0; i < items.length; i++) { > IMemento coolItemMem = coolBarMem > .createChild(IWorkbenchConstants.TAG_COOLITEM); >@@ -2590,7 +2593,7 @@ > } > // updateAll required in order to enable accelerators on pull-down menus > getMenuBarManager().updateAll(false); >- getCoolBarManager().update(false); >+ getCoolBarManager2().update(false); > getStatusLineManager().update(false); > } > >@@ -2652,12 +2655,13 @@ > > WorkbenchPage currentPage = getActiveWorkbenchPage(); > if (currentPage == null) >- actionPresentation.clearActionSets(); >+ getActionPresentation().clearActionSets(); > else { >- if (getCoolBarManager() != null) { >- getCoolBarManager().refresh(); >+ ICoolBarManager coolBarMgr = getCoolBarManager2(); >+ if (coolBarMgr != null) { >+ coolBarMgr.refresh(); > } >- actionPresentation.setActionSets(currentPage.getActionSets()); >+ getActionPresentation().setActionSets(currentPage.getActionSets()); > } > updateActionBars(); > >@@ -2669,7 +2673,7 @@ > IContributionItem item = getMenuBarManager().findUsingPath(path); > > // TODO remove: updateActiveActions(); >- IActionSet actionSets[] = actionPresentation.getActionSets(); >+ IActionSet actionSets[] = getActionPresentation().getActionSets(); > registerActionSets(actionSets); > > if (manager == null || item == null) >@@ -3120,10 +3124,28 @@ > .getPerspectiveBar(); > } > >- //for dynamic UI >+ /** >+ * Returns the action presentation for dynamic UI >+ * @return action presentation >+ */ > public ActionPresentation getActionPresentation() { >+ if (actionPresentation == null) { >+ ActionBarPresentation toolBarPresentation = getWindowConfigurer() >+ .getPresentationFactory().createToolBarPresentation(this); >+ actionPresentation = new ActionPresentation(this, toolBarPresentation); >+ } > return actionPresentation; > } >+ >+ private ActionBarPresentation getActionBarPresentation() { >+ ActionBarPresentation value = null; >+ ActionPresentation actionPresentation = getActionPresentation(); >+ >+ if (actionPresentation != null) >+ value = actionPresentation.getActionBarPresentation(); >+ >+ return value; >+ } > > /* (non-Javadoc) > * @see org.eclipse.jface.window.ApplicationWindow#showTopSeperator() >@@ -3133,6 +3155,52 @@ > } > > /** >+ * Returns a new cool bar manager for the window. >+ * <p> >+ * Subclasses may override this method to customize the cool bar manager. >+ * </p> >+ * >+ * @return a cool bar manager >+ */ >+ protected ICoolBarManager createCoolBarManager2(int style) { >+ return getActionBarPresentation().createCoolBarManager(style); >+ } >+ >+ /** >+ * Creates the control for the cool bar manager. >+ * <p> >+ * Subclasses may override this method to customize the cool bar manager. >+ * </p> >+ * >+ * @return an instance of <code>CoolBar</code> >+ */ >+ protected Control createCoolBarControl(Composite parent) { >+ return getActionBarPresentation().createCoolBarControl(getCoolBarManager2(), parent); >+ } >+ >+ /** >+ * Returns a new tool bar manager for the window. >+ * <p> >+ * Subclasses may override this method to customize the tool bar manager. >+ * </p> >+ * @return a tool bar manager >+ */ >+ protected IToolBarManager createToolBarManager2(int style) { >+ return getActionBarPresentation().createToolBarManager(style); >+ } >+ >+ /** >+ * Creates the control for the tool bar manager. >+ * <p> >+ * Subclasses may override this method to customize the tool bar manager. >+ * </p> >+ * @return a Control >+ */ >+ protected Control createToolBarControl(Composite parent) { >+ return getActionBarPresentation().createToolBarControl(getToolBarManager2(), parent); >+ } >+ >+ /** > * Delegate to the presentation factory. > * > * @see org.eclipse.jface.window.ApplicationWindow#createStatusLineManager >@@ -3140,8 +3208,14 @@ > */ > protected StatusLineManager createStatusLineManager() { > // @issue ApplicationWindow and WorkbenchWindow should allow full IStatusLineManager >- return (StatusLineManager) getWindowConfigurer() >+ StatusLineManager slm = (StatusLineManager) getWindowConfigurer() > .getPresentationFactory().createStatusLineManager(); >+ >+ // use new methods >+ if (slm == null) >+ slm = (StatusLineManager)getActionBarPresentation().createStatusLineManager(); >+ >+ return slm; > } > > /** >@@ -3151,8 +3225,12 @@ > * @since 3.0 > */ > protected void createStatusLine(Shell shell) { >- getWindowConfigurer().getPresentationFactory().createStatusLineControl( >+ Control control = getWindowConfigurer().getPresentationFactory().createStatusLineControl( > getStatusLineManager(), shell); >+ >+ // use the new method >+ if (control == null) >+ control = getActionBarPresentation().createStatusLineControl(getStatusLineManager(), shell); > } > > /** >@@ -3259,4 +3337,27 @@ > public ITrimManager getTrimManager() { > return defaultLayout; > } >+ >+ protected CoolBarManager createCoolBarManager(int style) { >+ // TODO Auto-generated method stub >+ return super.createCoolBarManager(style); >+ } >+ >+ protected ToolBarManager createToolBarManager(int style) { >+ // TODO Auto-generated method stub >+ return super.createToolBarManager(style); >+ } >+ >+ protected void addCoolBar(int style) { >+ if ((getShell() == null) && (toolBarManager == null) >+ && (coolBarManager == null)) { >+ coolBarManager = createCoolBarManager2(style); >+ } } >+ >+ protected void addToolBar(int style) { >+ if ((getShell() == null) && (toolBarManager == null) >+ && (coolBarManager == null)) { >+ toolBarManager = (IToolBarManager2)createToolBarManager2(style); >+ } >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/PluginActionSetBuilder.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionSetBuilder.java,v >retrieving revision 1.31 >diff -u -r1.31 PluginActionSetBuilder.java >--- Eclipse UI/org/eclipse/ui/internal/PluginActionSetBuilder.java 5 Apr 2005 17:21:15 -0000 1.31 >+++ Eclipse UI/org/eclipse/ui/internal/PluginActionSetBuilder.java 17 Jan 2006 20:13:35 -0000 >@@ -375,9 +375,8 @@ > } > > PluginAction action = ad.getAction(); >- PluginActionCoolBarContributionItem actionContribution = new PluginActionCoolBarContributionItem( >+ ActionContributionItem actionContribution = new PluginActionCoolBarContributionItem( > action); >- > bars.addAdjunctContribution(actionContribution); > > // create a coolitem for the toolbar id if it does not yet exist >@@ -430,7 +429,7 @@ > > // Create the action > PluginAction action = ad.getAction(); >- PluginActionCoolBarContributionItem actionContribution = new PluginActionCoolBarContributionItem( >+ ActionContributionItem actionContribution = new PluginActionCoolBarContributionItem( > action); > > // retreive the toolbar from the action bars. >@@ -562,7 +561,7 @@ > // if (menuMgr != null) > // revokeActionSetFromMenu(menuMgr, id); > >- revokeActionSetFromCoolbar(window.getCoolBarManager(), id); >+ revokeActionSetFromCoolbar(window.getCoolBarManager2(), id); > // IToolBarManager toolBarMgr = bars.getToolBarManager(); > // if (toolBarMgr != null && toolBarMgr instanceof CoolItemToolBarManager) > // revokeActionSetFromToolbar(toolBarMgr, id); >Index: Eclipse UI/org/eclipse/ui/internal/WWinActionBars.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WWinActionBars.java,v >retrieving revision 1.8 >diff -u -r1.8 WWinActionBars.java >--- Eclipse UI/org/eclipse/ui/internal/WWinActionBars.java 25 Feb 2005 20:52:12 -0000 1.8 >+++ Eclipse UI/org/eclipse/ui/internal/WWinActionBars.java 17 Jan 2006 20:13:35 -0000 >@@ -50,7 +50,7 @@ > * > */ > public ICoolBarManager getCoolBarManager() { >- return window.getCoolBarManager(); >+ return window.getCoolBarManager2(); > } > > /** >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java,v >retrieving revision 1.242 >diff -u -r1.242 WorkbenchPage.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 29 Nov 2005 21:36:20 -0000 1.242 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 17 Jan 2006 20:13:36 -0000 >@@ -37,7 +37,7 @@ > import org.eclipse.core.runtime.dynamichelpers.ExtensionTracker; > import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler; > import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker; >-import org.eclipse.jface.action.CoolBarManager; >+import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.dialogs.MessageDialog; >@@ -2542,7 +2542,7 @@ > // Run op in busy cursor. > // Use set redraw to eliminate the "flash" that can occur in the > // coolbar as the perspective is reset. >- CoolBarManager mgr = window.getCoolBarManager(); >+ ICoolBarManager mgr = window.getCoolBarManager2(); > try { > mgr.getControl().setRedraw(false); > BusyIndicator.showWhile(null, new Runnable() { >@@ -3147,7 +3147,7 @@ > // Going from multiple to single rows can make the coolbar > // and its adjacent views appear jumpy as perspectives are > // switched. Turn off redraw to help with this. >- CoolBarManager mgr = window.getCoolBarManager(); >+ ICoolBarManager mgr = window.getCoolBarManager2(); > try { > mgr.getControl().setRedraw(false); > getClientComposite().setRedraw(false); >@@ -3183,7 +3183,7 @@ > * Restore the toolbar layout for the active perspective. > */ > protected void resetToolBarLayout() { >- window.getCoolBarManager().resetItemOrder(); >+ window.getCoolBarManager2().resetItemOrder(); > } > > /** >Index: Eclipse UI/org/eclipse/ui/internal/EditorManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java,v >retrieving revision 1.95 >diff -u -r1.95 EditorManager.java >--- Eclipse UI/org/eclipse/ui/internal/EditorManager.java 29 Nov 2005 21:36:20 -0000 1.95 >+++ Eclipse UI/org/eclipse/ui/internal/EditorManager.java 17 Jan 2006 20:13:35 -0000 >@@ -340,8 +340,8 @@ > String type = actionBars.getEditorType(); > actionCache.remove(type); > // refresh the cool bar manager before disposing of a cool item >- if (window.getCoolBarManager() != null) { >- window.getCoolBarManager().refresh(); >+ if (window.getCoolBarManager2() != null) { >+ window.getCoolBarManager2().refresh(); > } > actionBars.dispose(); > } >Index: Eclipse UI/org/eclipse/ui/internal/ActionSetActionBars.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionSetActionBars.java,v >retrieving revision 1.21 >diff -u -r1.21 ActionSetActionBars.java >--- Eclipse UI/org/eclipse/ui/internal/ActionSetActionBars.java 25 Feb 2005 20:52:13 -0000 1.21 >+++ Eclipse UI/org/eclipse/ui/internal/ActionSetActionBars.java 17 Jan 2006 20:13:35 -0000 >@@ -26,12 +26,15 @@ > import org.eclipse.ui.IActionBars2; > import org.eclipse.ui.IWorkbenchActionConstants; > import org.eclipse.ui.SubActionBars2; >+import org.eclipse.ui.presentations.ActionBarPresentation; > > /** > * This class represents the action bars for an action set. > */ > public class ActionSetActionBars extends SubActionBars2 { > >+ private ActionPresentation actionPresentation = null; >+ > private String actionSetId; > > private ArrayList adjunctContributions = new ArrayList(); >@@ -49,6 +52,15 @@ > } > > /** >+ * Constructs a new action bars object >+ */ >+ public ActionSetActionBars(IActionBars2 parent, String actionSetId, ActionPresentation actionPresentation) { >+ super(parent); >+ this.actionSetId = actionSetId; >+ this.actionPresentation = actionPresentation; >+ } >+ >+ /** > * Adds to the list all the actions that are part of this action set but > * belong to different cool bar items. > * >@@ -179,6 +191,8 @@ > if (coolBarManager == null) { > return null; > } >+ if (actionPresentation != null) >+ return actionPresentation.getActionBarPresentation().createToolBarManager(coolBarManager.getStyle()); > return new ToolBarManager(coolBarManager.getStyle()); > } > >@@ -195,6 +209,7 @@ > // Check if a tool bar manager for an adjunct type is being requested > String toolBarId = actionSetId; > boolean isAdjunctType = false; >+ ActionBarPresentation actionBarPresentation = actionPresentation.getActionBarPresentation(); > if (!actionId.equals(actionSetId)) { > // Adjunct type > toolBarId = actionId; >@@ -229,15 +244,17 @@ > toolBarContributionItem = tbcbItem; > } > } else { >- >- coolItemToolBarMgr = new ToolBarManager(coolBarManager.getStyle()); >+ if (actionPresentation != null) >+ coolItemToolBarMgr = actionBarPresentation.createToolBarManager(coolBarManager.getStyle()); >+ else >+ coolItemToolBarMgr = new ToolBarManager(coolBarManager.getStyle()); > // If this is not an adjunct type then create a tool bar > // contribution item > // we don't create one for an adjunct type because another action > // set action bars contains one > > toolBarContributionItem = new ToolBarContributionItem( >- coolItemToolBarMgr, toolBarId); >+ coolItemToolBarMgr, toolBarId); > toolBarContributionItem.setParent(coolItemToolBarMgr); > toolBarContributionItem.setVisible(getActive()); > coolItemToolBarMgr.markDirty(); >Index: Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java,v >retrieving revision 1.20 >diff -u -r1.20 ActionPresentation.java >--- Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java 15 Jun 2005 18:41:21 -0000 1.20 >+++ Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java 17 Jan 2006 20:13:35 -0000 >@@ -22,6 +22,7 @@ > import org.eclipse.ui.SubActionBars; > import org.eclipse.ui.internal.registry.IActionSet; > import org.eclipse.ui.internal.registry.IActionSetDescriptor; >+import org.eclipse.ui.presentations.ActionBarPresentation; > > /** > * Manage the configurable actions for one window. >@@ -32,6 +33,8 @@ > private HashMap mapDescToRec = new HashMap(3); > > private HashMap invisibleBars = new HashMap(3); >+ >+ private ActionBarPresentation actionBarPresentation; > > private class SetRec { > public SetRec(IActionSetDescriptor desc, IActionSet set, >@@ -51,9 +54,10 @@ > /** > * ActionPresentation constructor comment. > */ >- public ActionPresentation(WorkbenchWindow window) { >+ public ActionPresentation(WorkbenchWindow window, ActionBarPresentation toolBarPresentation) { > super(); > this.window = window; >+ this.actionBarPresentation = toolBarPresentation; > } > > /** >@@ -146,7 +150,7 @@ > } else { > IActionSet set = desc.createActionSet(); > SubActionBars bars = new ActionSetActionBars(window >- .getActionBars(), desc.getId()); >+ .getActionBars(), desc.getId(), this); > rec = new SetRec(desc, set, bars); > set.init(window, bars); > sets.add(set); >@@ -217,4 +221,8 @@ > result[i] = ((SetRec) iterator.next()).set; > return result; > } >+ >+ public ActionBarPresentation getActionBarPresentation() { >+ return actionBarPresentation; >+ } > } >Index: Eclipse UI/org/eclipse/ui/application/IActionBarConfigurer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/IActionBarConfigurer.java,v >retrieving revision 1.12 >diff -u -r1.12 IActionBarConfigurer.java >--- Eclipse UI/org/eclipse/ui/application/IActionBarConfigurer.java 25 Feb 2005 20:52:36 -0000 1.12 >+++ Eclipse UI/org/eclipse/ui/application/IActionBarConfigurer.java 17 Jan 2006 20:13:35 -0000 >@@ -14,6 +14,7 @@ > import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.IStatusLineManager; >+import org.eclipse.ui.presentations.ActionBarPresentation; > > /** > * Interface providing special access for configuring the action bars >@@ -61,6 +62,15 @@ > * @return the cool bar manager > */ > public ICoolBarManager getCoolBarManager(); >+ >+ /** >+ * Returns the action bar presentaion used to create cool bar >+ * contributions. >+ * >+ * @return the action bar presentation >+ * @since 3.2 >+ */ >+ public ActionBarPresentation getActionBarPresentation(); > > /** > * Register the action as a global action with a workbench >Index: Eclipse UI/org/eclipse/ui/presentations/AbstractPresentationFactory.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/AbstractPresentationFactory.java,v >retrieving revision 1.15 >diff -u -r1.15 AbstractPresentationFactory.java >--- Eclipse UI/org/eclipse/ui/presentations/AbstractPresentationFactory.java 15 Jun 2005 18:41:21 -0000 1.15 >+++ Eclipse UI/org/eclipse/ui/presentations/AbstractPresentationFactory.java 17 Jan 2006 20:13:36 -0000 >@@ -11,10 +11,9 @@ > package org.eclipse.ui.presentations; > > import org.eclipse.jface.action.IStatusLineManager; >-import org.eclipse.jface.action.StatusLineManager; >-import org.eclipse.swt.SWT; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; >+import org.eclipse.ui.IWorkbenchWindow; > > /** > * This is a factory for presentation objects that control the appearance of >@@ -25,6 +24,15 @@ > public abstract class AbstractPresentationFactory { > > /** >+ * Creates an action presentation for a window >+ * @param window >+ * @return ActionPresentation >+ */ >+ public ActionBarPresentation createToolBarPresentation(IWorkbenchWindow window) { >+ return new ActionBarPresentation(); >+ } >+ >+ /** > * Creates an editor presentation for presenting editors. > * <p> > * The presentation creates its controls under the given parent composite. >@@ -82,9 +90,10 @@ > * Subclasses may override. > * > * @return the window's status line manager >+ * @deprecated use <code>ActionBarPresentation</code> > */ > public IStatusLineManager createStatusLineManager() { >- return new StatusLineManager(); >+ return null; > } > > /** >@@ -94,10 +103,11 @@ > * @param statusLine the window's status line manager > * @param parent the parent composite > * @return the window's status line control >+ * @deprecated use <code>ActionBarPresentation</code> > */ > public Control createStatusLineControl(IStatusLineManager statusLine, > Composite parent) { >- return ((StatusLineManager) statusLine).createControl(parent, SWT.NONE); >+ return null; > } > > /** >Index: Eclipse UI/org/eclipse/ui/internal/part/services/NullCoolBarManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/services/Attic/NullCoolBarManager.java,v >retrieving revision 1.2 >diff -u -r1.2 NullCoolBarManager.java >--- Eclipse UI/org/eclipse/ui/internal/part/services/NullCoolBarManager.java 25 Feb 2005 20:52:16 -0000 1.2 >+++ Eclipse UI/org/eclipse/ui/internal/part/services/NullCoolBarManager.java 17 Jan 2006 20:13:36 -0000 >@@ -10,9 +10,13 @@ > *******************************************************************************/ > package org.eclipse.ui.internal.part.services; > >+import org.eclipse.jface.action.IContributionItem; > import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.CoolBar; > > /** > * @since 3.1 >@@ -26,14 +30,46 @@ > > } > >- /* (non-Javadoc) >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#createControl(org.eclipse.swt.widgets.Composite) >+ */ >+ public CoolBar createControl(Composite parent) { >+ return null; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#createControl2(org.eclipse.swt.widgets.Composite) >+ */ >+ public Control createControl2(Composite parent) { >+ return createControl(parent); >+ } >+ >+ /* (non-Javadoc) > * @see org.eclipse.jface.action.ICoolBarManager#getContextMenuManager() > */ > public IMenuManager getContextMenuManager() { > return null; > } > >- /* (non-Javadoc) >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#getControl() >+ */ >+ public CoolBar getControl() { >+ return null; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#getControl2() >+ */ >+ public Control getControl2() { >+ return null; >+ } >+ >+ /* (non-Javadoc) > * @see org.eclipse.jface.action.ICoolBarManager#getLockLayout() > */ > public boolean getLockLayout() { >@@ -47,13 +83,37 @@ > return 0; > } > >- /* (non-Javadoc) >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#refresh() >+ */ >+ public void refresh() { >+ >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#resetItemOrder() >+ */ >+ public void resetItemOrder() { >+ >+ } >+ >+ /* (non-Javadoc) > * @see org.eclipse.jface.action.ICoolBarManager#setContextMenuManager(org.eclipse.jface.action.IMenuManager) > */ > public void setContextMenuManager(IMenuManager menuManager) { > > } > >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#setItems(org.eclipse.jface.action.IContributionItem[]) >+ */ >+ public void setItems(IContributionItem[] newItems) { >+ >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.jface.action.ICoolBarManager#setLockLayout(boolean) > */ >@@ -61,4 +121,7 @@ > > } > >+ public void dispose() { >+ >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java,v >retrieving revision 1.43 >diff -u -r1.43 CustomizePerspectiveDialog.java >--- Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java 6 Dec 2005 21:36:35 -0000 1.43 >+++ Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java 17 Jan 2006 20:13:36 -0000 >@@ -106,6 +106,7 @@ > import org.eclipse.ui.internal.util.BundleUtility; > import org.eclipse.ui.model.WorkbenchLabelProvider; > import org.eclipse.ui.model.WorkbenchViewerSorter; >+import org.eclipse.ui.presentations.ActionBarPresentation; > import org.eclipse.ui.views.IViewCategory; > import org.eclipse.ui.views.IViewDescriptor; > import org.eclipse.ui.views.IViewRegistry; >@@ -474,6 +475,10 @@ > menuManager.dispose(); > statusLineManager.dispose(); > } >+ >+ public ActionBarPresentation getActionBarPresentation() { >+ return null; >+ } > } > > class ShortcutMenuItemContentProvider implements IStructuredContentProvider { >Index: Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java,v >retrieving revision 1.18 >diff -u -r1.18 WorkbenchActivitySupport.java >--- Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java 7 Apr 2005 16:39:28 -0000 1.18 >+++ Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java 17 Jan 2006 20:13:36 -0000 >@@ -211,11 +211,11 @@ > if (manager != null) > updateManager(manager); > manager = window >- .getCoolBarManager(); >+ .getCoolBarManager2(); > if (manager != null) > updateManager(manager); > manager = window >- .getToolBarManager(); >+ .getToolBarManager2(); > if (manager != null) > updateManager(manager); > manager = window >Index: Eclipse UI/org/eclipse/ui/presentations/ActionBarPresentation.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/presentations/ActionBarPresentation.java >diff -N Eclipse UI/org/eclipse/ui/presentations/ActionBarPresentation.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/presentations/ActionBarPresentation.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,103 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2005 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.presentations; >+ >+import org.eclipse.jface.action.CoolBarManager; >+import org.eclipse.jface.action.ICoolBarManager; >+import org.eclipse.jface.action.IStatusLineManager; >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.action.IToolBarManager2; >+import org.eclipse.jface.action.StatusLineManager; >+import org.eclipse.jface.action.ToolBarManager; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+ >+/** >+ * Manage the creation of tool bars for a presentation factory. >+ * >+ * @since 3.2 >+ */ >+public class ActionBarPresentation { >+ >+ /** >+ * Creates CoolBarManager for WorkbenchWindow's tool bar >+ * @param style >+ * @return coolBarManager >+ * @since 3.2 >+ */ >+ public ICoolBarManager createCoolBarManager(int style) { >+ CoolBarManager coolBarManager = new CoolBarManager(style); >+ return coolBarManager; >+ } >+ >+ /** >+ * Creates the control for the window's cool bar. >+ * Subclasses may override. >+ * >+ * @param coolBarManager the window's status line manager >+ * @param parent the parent composite >+ * @return the window's cool bar control >+ * @since 3.2 >+ */ >+ public Control createCoolBarControl(ICoolBarManager coolBarManager, Composite parent) { >+ return coolBarManager.createControl2(parent); >+ } >+ >+ /** >+ * Creates ToolBarManager for WorkbenchWindow's tool bar >+ * @param style >+ * @return toolBarManager >+ * @since 3.2 >+ */ >+ public IToolBarManager createToolBarManager(int style) { >+ return new ToolBarManager(style); >+ } >+ >+ /** >+ * Creates the control for the window's tool bar. >+ * Subclasses may override. >+ * >+ * @param toolBarManager the window's status line manager >+ * @param parent the parent composite >+ * @return the window's tool bar control >+ * @since 3.2 >+ */ >+ public Control createToolBarControl(IToolBarManager2 toolBarManager, Composite parent) { >+ return toolBarManager.createControl2(parent); >+ } >+ >+ /** >+ * Creates the status line manager for the window. >+ * Subclasses may override. >+ * >+ * @return the window's status line manager >+ * @since 3.2 >+ */ >+ public IStatusLineManager createStatusLineManager() { >+ return new StatusLineManager(); >+ } >+ >+ /** >+ * Creates the control for the window's status line. >+ * Subclasses may override. >+ * >+ * @param statusLine the window's status line manager >+ * @param parent the parent composite >+ * @return the window's status line control >+ * @since 3.2 >+ */ >+ public Control createStatusLineControl(IStatusLineManager statusLine, >+ Composite parent) { >+ return ((StatusLineManager) statusLine).createControl(parent, SWT.NONE); >+ } >+ >+}
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 123257
:
33169
|
33171
|
33172
|
33173
|
34107
|
34108
|
34109
|
34110
|
34111
|
34239
|
34308
|
34367
|
34373
|
34437