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 34108 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]
Updated Workbench patch with feedback based on HEAD
ActionBarPresentation_workbench_HEAD_patch.txt (text/plain), 60.32 KB, created by
Matthew Hatem
on 2006-02-03 14:28:43 EST
(
hide
)
Description:
Updated Workbench patch with feedback based on HEAD
Filename:
MIME Type:
Creator:
Matthew Hatem
Created:
2006-02-03 14:28:43 EST
Size:
60.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/EditorReference.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java,v >retrieving revision 1.11 >diff -u -r1.11 EditorReference.java >--- Eclipse UI/org/eclipse/ui/internal/EditorReference.java 26 Jan 2006 21:21:36 -0000 1.11 >+++ Eclipse UI/org/eclipse/ui/internal/EditorReference.java 3 Feb 2006 19:18:23 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2006 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Common Public License v1.0 > * which accompanies this distribution, and is available at >@@ -21,7 +21,6 @@ > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FillLayout; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.ui.IActionBars2; > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.IEditorPart; > import org.eclipse.ui.IEditorReference; >@@ -401,8 +400,7 @@ > > EditorSite site = new EditorSite(this, part, manager.page, descr); > >- site.setActionBars(new EditorActionBars((IActionBars2) manager.page >- .getActionBars(), site, getId())); >+ site.setActionBars(new EditorActionBars(manager.page, site, getId())); > try { > part.init(site, input); > } catch (PartInitException e) { >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.32 >diff -u -r1.32 WorkbenchWindowConfigurer.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java 17 Jan 2006 16:45:19 -0000 1.32 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java 3 Feb 2006 19:18:30 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2005 IBM Corporation and others. >+ * Copyright (c) 2003, 2006 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 >@@ -20,6 +20,8 @@ > import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.IStatusLineManager; >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.action.IToolBarManager2; > import org.eclipse.jface.window.Window; > import org.eclipse.swt.SWT; > import org.eclipse.swt.dnd.DropTarget; >@@ -37,6 +39,7 @@ > import org.eclipse.ui.application.IWorkbenchConfigurer; > import org.eclipse.ui.application.IWorkbenchWindowConfigurer; > import org.eclipse.ui.application.WorkbenchAdvisor; >+import org.eclipse.ui.internal.presentations.ActionBarPresentation; > import org.eclipse.ui.presentations.AbstractPresentationFactory; > import org.eclipse.ui.presentations.WorkbenchPresentationFactory; > >@@ -205,7 +208,7 @@ > if (proxy != null) { > return proxy.getCoolBarManager(); > } >- return window.getCoolBarManager(); >+ return window.getCoolBarManager2(); > } > > /* (non-Javadoc) >@@ -217,6 +220,32 @@ > } > window.registerGlobalAction(action); > } >+ >+ private ActionBarPresentation getActionBarPresentation() { >+ WorkbenchWindow window = (WorkbenchWindow)getWindowConfigurer().getWindow(); >+ return window.getActionBarPresentation(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.application.IActionBarConfigurer#createToolBarManager(int) >+ */ >+ public IToolBarManager createToolBarManager(int style) { >+ return getActionBarPresentation().createToolBarManager(style); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.application.IActionBarConfigurer#createToolBarControl(org.eclipse.jface.action.IToolBarManager2, org.eclipse.swt.widgets.Composite) >+ */ >+ public Control createToolBarControl(IToolBarManager2 toolBarManager, Composite parent) { >+ return getActionBarPresentation().createToolBarControl(toolBarManager, parent); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.application.IActionBarConfigurer#createToolBarContributionItem(org.eclipse.jface.action.IToolBarManager, java.lang.String) >+ */ >+ public IContributionItem createToolBarContributionItem(IToolBarManager toolBarManager, String id) { >+ return getActionBarPresentation().createToolBarContributionItem(toolBarManager, id); >+ } > } > > /** >@@ -588,7 +617,8 @@ > * @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) >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.319 >diff -u -r1.319 WorkbenchWindow.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 2 Feb 2006 21:13:13 -0000 1.319 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 3 Feb 2006 19:18:30 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -36,12 +36,13 @@ > 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.IToolBarContributionItem; >+import org.eclipse.jface.action.IToolBarManager2; > import org.eclipse.jface.action.MenuManager; > import org.eclipse.jface.action.Separator; > import org.eclipse.jface.action.StatusLineManager; >-import org.eclipse.jface.action.ToolBarContributionItem; >-import org.eclipse.jface.action.ToolBarManager; > import org.eclipse.jface.commands.ActionHandler; > import org.eclipse.jface.menus.ILayoutNode; > import org.eclipse.jface.menus.SMenuLayout; >@@ -117,6 +118,8 @@ > import org.eclipse.ui.internal.misc.Policy; > import org.eclipse.ui.internal.misc.UIListenerLogging; > import org.eclipse.ui.internal.misc.UIStats; >+import org.eclipse.ui.internal.presentations.ActionBarPresentation; >+import org.eclipse.ui.internal.presentations.InternalPresentationFactory; > import org.eclipse.ui.internal.progress.ProgressRegion; > import org.eclipse.ui.internal.registry.ActionSetRegistry; > import org.eclipse.ui.internal.registry.IActionSetDescriptor; >@@ -125,6 +128,7 @@ > import org.eclipse.ui.internal.services.ServiceLocator; > import org.eclipse.ui.internal.util.PrefUtil; > import org.eclipse.ui.menus.IMenuService; >+import org.eclipse.ui.presentations.AbstractPresentationFactory; > > /** > * A window within the workbench. >@@ -318,8 +322,6 @@ > addCoolBar(SWT.FLAT); > addStatusLine(); > >- actionPresentation = new ActionPresentation(this); >- > // register with the tracker > getExtensionTracker() > .registerHandler( >@@ -700,7 +702,7 @@ > * Return whether or not the coolbar layout is locked. > */ > protected boolean isCoolBarLocked() { >- CoolBarManager cbm = getCoolBarManager(); >+ ICoolBarManager cbm = getCoolBarManager2(); > return cbm != null && cbm.getLockLayout(); > } > >@@ -1411,7 +1413,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(); >@@ -1476,7 +1478,7 @@ > */ > /* package */ > void lockCoolBar(boolean lock) { >- getCoolBarManager().setLockLayout(lock); >+ getCoolBarManager2().setLockLayout(lock); > } > > /** >@@ -1642,8 +1644,8 @@ > // 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) { >@@ -1711,12 +1713,13 @@ > if (oldItem != null) { > newItem = oldItem; > } else { >- newItem = new ToolBarContributionItem( >- new ToolBarManager(coolBarMgr >+ ActionBarPresentation actionBarPresentation = getActionBarPresentation(); >+ newItem = actionBarPresentation.createToolBarContributionItem( >+ actionBarPresentation.createToolBarManager(coolBarMgr > .getStyle()), id); > if (type > .equals(IWorkbenchConstants.TAG_TYPE_PLACEHOLDER)) { >- ToolBarContributionItem newToolBarItem = (ToolBarContributionItem) newItem; >+ IToolBarContributionItem newToolBarItem = (IToolBarContributionItem) newItem; > if (height != null) { > newToolBarItem.setCurrentHeight(height > .intValue()); >@@ -1744,13 +1747,13 @@ > } > // Set the current height and width > if ((width != null) >- && (newItem instanceof ToolBarContributionItem)) { >- ((ToolBarContributionItem) newItem) >+ && (newItem instanceof IToolBarContributionItem)) { >+ ((IToolBarContributionItem) newItem) > .setCurrentWidth(width.intValue()); > } > if ((height != null) >- && (newItem instanceof ToolBarContributionItem)) { >- ((ToolBarContributionItem) newItem) >+ && (newItem instanceof IToolBarContributionItem)) { >+ ((IToolBarContributionItem) newItem) > .setCurrentHeight(height.intValue()); > } > } >@@ -1935,7 +1938,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); >@@ -2027,11 +2030,12 @@ > } > // If a tool bar contribution item already exists for this id > // then use the old object >- if (oldItem instanceof ToolBarContributionItem) { >+ if (oldItem instanceof IToolBarContributionItem) { > newItem = oldItem; > } else { >- newItem = new ToolBarContributionItem(new ToolBarManager( >- coolBarMgr.getStyle()), id); >+ ActionBarPresentation actionBarPresentaiton = getActionBarPresentation(); >+ newItem = actionBarPresentaiton.createToolBarContributionItem( >+ actionBarPresentaiton.createToolBarManager(coolBarMgr.getStyle()), id); > // make it invisible by default > newItem.setVisible(false); > // Need to add the item to the cool bar manager so that its >@@ -2267,16 +2271,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); >@@ -2312,8 +2317,8 @@ > */ > final int height; > final int width; >- if (item instanceof ToolBarContributionItem) { >- ToolBarContributionItem toolBarItem = (ToolBarContributionItem) item; >+ if (item instanceof IToolBarContributionItem) { >+ IToolBarContributionItem toolBarItem = (IToolBarContributionItem) item; > toolBarItem.saveWidgetState(); > height = toolBarItem.getCurrentHeight(); > width = toolBarItem.getCurrentWidth(); >@@ -2619,7 +2624,7 @@ > } > // updateAll required in order to enable accelerators on pull-down menus > getMenuBarManager().updateAll(false); >- getCoolBarManager().update(false); >+ getCoolBarManager2().update(false); > getStatusLineManager().update(false); > } > >@@ -2683,12 +2688,12 @@ > > WorkbenchPage currentPage = getActiveWorkbenchPage(); > if (currentPage == null) >- actionPresentation.clearActionSets(); >+ getActionPresentation().clearActionSets(); > else { >- if (getCoolBarManager() != null) { >- getCoolBarManager().refresh(); >+ if (getCoolBarManager2() != null) { >+ getCoolBarManager2().refresh(); > } >- actionPresentation.setActionSets(currentPage.getActionSets()); >+ getActionPresentation().setActionSets(currentPage.getActionSets()); > } > fireActionSetsChanged(); > updateActionBars(); >@@ -3195,11 +3200,32 @@ > .getPerspectiveBar(); > } > >- // for dynamic UI >- public ActionPresentation getActionPresentation() { >- return actionPresentation; >- } >- >+ /** >+ * Returns the action presentation for dynamic UI >+ * @return action presentation >+ */ >+ public ActionPresentation getActionPresentation() { >+ if (actionPresentation == null) { >+ actionPresentation = new ActionPresentation(this); >+ } >+ return actionPresentation; >+ } >+ >+ /*package*/ ActionBarPresentation getActionBarPresentation() { >+ // allow replacement of the actionbar presentation >+ ActionBarPresentation actionBarPresentation; >+ AbstractPresentationFactory presentationFactory = >+ getWindowConfigurer().getPresentationFactory(); >+ if (presentationFactory instanceof InternalPresentationFactory) { >+ actionBarPresentation = ((InternalPresentationFactory) presentationFactory) >+ .createActionBarPresentation(this); >+ } >+ else >+ actionBarPresentation = new ActionBarPresentation(); >+ >+ return actionBarPresentation; >+ } >+ > /* > * (non-Javadoc) > * >@@ -3210,6 +3236,56 @@ > } > > /** >+ * 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 >+ * @since 3.2 >+ */ >+ 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>\ >+ * @since 3.2 >+ */ >+ 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 >+ * @since 3.2 >+ */ >+ protected IToolBarManager2 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 >+ * @since 3.2 >+ */ >+ protected Control createToolBarControl(Composite parent) { >+ return getActionBarPresentation().createToolBarControl(getToolBarManager2(), parent); >+ } >+ >+ /** > * Delegate to the presentation factory. > * > * @see org.eclipse.jface.window.ApplicationWindow#createStatusLineManager >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 3 Feb 2006 19:18:24 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -375,7 +375,7 @@ > } > > PluginAction action = ad.getAction(); >- PluginActionCoolBarContributionItem actionContribution = new PluginActionCoolBarContributionItem( >+ ActionContributionItem actionContribution = new PluginActionCoolBarContributionItem( > action); > > bars.addAdjunctContribution(actionContribution); >@@ -430,7 +430,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 +562,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.9 >diff -u -r1.9 WWinActionBars.java >--- Eclipse UI/org/eclipse/ui/internal/WWinActionBars.java 17 Jan 2006 16:00:27 -0000 1.9 >+++ Eclipse UI/org/eclipse/ui/internal/WWinActionBars.java 3 Feb 2006 19:18:24 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -41,7 +41,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.246 >diff -u -r1.246 WorkbenchPage.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 31 Jan 2006 17:49:43 -0000 1.246 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 3 Feb 2006 19:18:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -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; >@@ -2539,7 +2539,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() { >@@ -3144,9 +3144,9 @@ > // 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); >+ mgr.getControl2().setRedraw(false); > getClientComposite().setRedraw(false); > // Run op in busy cursor. > BusyIndicator.showWhile(null, new Runnable() { >@@ -3156,7 +3156,7 @@ > }); > } finally { > getClientComposite().setRedraw(true); >- mgr.getControl().setRedraw(true); >+ mgr.getControl2().setRedraw(true); > IWorkbenchPart part = getActivePart(); > if (part != null) > part.setFocus(); >@@ -3176,7 +3176,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.101 >diff -u -r1.101 EditorManager.java >--- Eclipse UI/org/eclipse/ui/internal/EditorManager.java 31 Jan 2006 14:31:15 -0000 1.101 >+++ Eclipse UI/org/eclipse/ui/internal/EditorManager.java 3 Feb 2006 19:18:22 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -52,8 +52,6 @@ > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.ActiveShellExpression; >-import org.eclipse.ui.ISaveableModel; >-import org.eclipse.ui.ISaveableModelSource; > import org.eclipse.ui.IEditorActionBarContributor; > import org.eclipse.ui.IEditorDescriptor; > import org.eclipse.ui.IEditorInput; >@@ -67,6 +65,8 @@ > import org.eclipse.ui.IPathEditorInput; > import org.eclipse.ui.IPersistableElement; > import org.eclipse.ui.IReusableEditor; >+import org.eclipse.ui.ISaveableModel; >+import org.eclipse.ui.ISaveableModelSource; > import org.eclipse.ui.ISaveablePart; > import org.eclipse.ui.ISaveablePart2; > import org.eclipse.ui.IViewPart; >@@ -296,8 +296,7 @@ > } > > // Create a new action bar set. >- actionBars = new EditorActionBars( >- (WWinActionBars) page.getActionBars(), site, type); >+ actionBars = new EditorActionBars(page, site, type); > actionBars.addRef(); > actionCache.put(type, actionBars); > >@@ -329,8 +328,7 @@ > > // Create a new action bar set. > // Note: It is an empty set. >- EditorActionBars actionBars = new EditorActionBars( >- (WWinActionBars) page.getActionBars(), site, type); >+ EditorActionBars actionBars = new EditorActionBars(page, site, type); > actionBars.addRef(); > actionCache.put(type, actionBars); > >@@ -347,8 +345,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/PlaceholderContributionItem.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java,v >retrieving revision 1.8 >diff -u -r1.8 PlaceholderContributionItem.java >--- Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java 25 Feb 2005 20:52:12 -0000 1.8 >+++ Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java 3 Feb 2006 19:18:23 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -13,8 +13,7 @@ > > import org.eclipse.jface.action.IContributionItem; > import org.eclipse.jface.action.IContributionManager; >-import org.eclipse.jface.action.ToolBarContributionItem; >-import org.eclipse.jface.action.ToolBarManager; >+import org.eclipse.jface.action.IToolBarContributionItem; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.CoolBar; > import org.eclipse.swt.widgets.Menu; >@@ -65,7 +64,7 @@ > * @param item > * The item to be replaced; must not be <code>null</code>. > */ >- PlaceholderContributionItem(final ToolBarContributionItem item) { >+ PlaceholderContributionItem(final IToolBarContributionItem item) { > item.saveWidgetState(); > id = item.getId(); > storedHeight = item.getCurrentHeight(); >@@ -74,27 +73,6 @@ > storedUseChevron = item.getUseChevron(); > } > >- /** >- * Creates a new tool bar contribution item on the given manager -- using >- * the stored data to initialize some of its properties. >- * >- * @param manager >- * The manager for which the contribution item should be >- * created; must not be <code>null</code> >- * @return A new tool bar contribution item equivalent to the contribution >- * item this placeholder was intended to replace; never <code>null</code>. >- */ >- ToolBarContributionItem createToolBarContributionItem( >- final ToolBarManager manager) { >- ToolBarContributionItem toolBarContributionItem = new ToolBarContributionItem( >- manager, id); >- toolBarContributionItem.setCurrentHeight(storedHeight); >- toolBarContributionItem.setCurrentWidth(storedWidth); >- toolBarContributionItem.setMinimumItemsToShow(storedMinimumItems); >- toolBarContributionItem.setUseChevron(storedUseChevron); >- return toolBarContributionItem; >- } >- > /* > * (non-Javadoc) > * >@@ -172,6 +150,29 @@ > int getWidth() { > return storedWidth; > } >+ >+ /** >+ * Returns the minimum number of tool items to show in the cool item. >+ * >+ * @return the minimum number of tool items to show, or <code>SHOW_ALL_ITEMS</code> >+ * if a value was not set >+ * @see #setMinimumItemsToShow(int) >+ * @since 3.2 >+ */ >+ int getMinimumItemsToShow() { >+ return storedMinimumItems; >+ } >+ >+ /** >+ * Returns whether chevron support is enabled. >+ * >+ * @return <code>true</code> if chevron support is enabled, <code>false</code> >+ * otherwise >+ * @since 3.2 >+ */ >+ boolean getUseChevron() { >+ return storedUseChevron; >+ } > > /* > * (non-Javadoc) >Index: Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java,v >retrieving revision 1.26 >diff -u -r1.26 EditorActionBars.java >--- Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java 31 Jan 2006 16:37:56 -0000 1.26 >+++ Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java 3 Feb 2006 19:18:21 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -18,12 +18,12 @@ > import org.eclipse.jface.action.IContributionManagerOverrides; > import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.action.IMenuManager; >+import org.eclipse.jface.action.IToolBarContributionItem; > import org.eclipse.jface.action.IToolBarManager; > import org.eclipse.jface.action.SubContributionManager; > import org.eclipse.jface.action.SubMenuManager; > import org.eclipse.jface.action.SubStatusLineManager; > import org.eclipse.jface.action.SubToolBarManager; >-import org.eclipse.jface.action.ToolBarContributionItem; > import org.eclipse.jface.action.ToolBarManager; > import org.eclipse.ui.IActionBars2; > import org.eclipse.ui.IEditorActionBarContributor; >@@ -33,6 +33,7 @@ > import org.eclipse.ui.SubActionBars2; > import org.eclipse.ui.actions.RetargetAction; > import org.eclipse.ui.internal.misc.Policy; >+import org.eclipse.ui.internal.presentations.ActionBarPresentation; > import org.eclipse.ui.services.IServiceLocator; > > /** >@@ -82,17 +83,21 @@ > > private int refCount; > >- private ToolBarContributionItem toolBarContributionItem = null; >+ private IToolBarContributionItem toolBarContributionItem = null; > > private String type; >+ >+ private ActionBarPresentation actionBarPresentation; > > /** > * Constructs the EditorActionBars for an editor. > */ >- public EditorActionBars(IActionBars2 parent, >+ public EditorActionBars(WorkbenchPage page, > final IServiceLocator serviceLocator, String type) { >- super(parent, serviceLocator); >+ super((IActionBars2)page.getActionBars(), serviceLocator); > this.type = type; >+ this.actionBarPresentation = ((WorkbenchWindow) page >+ .getWorkbenchWindow()).getActionBarPresentation(); > } > > /** >@@ -243,14 +248,13 @@ > } > if (toolBarContributionItem == null) { > IContributionItem foundItem = coolBarManager.find(type); >- if ((foundItem instanceof ToolBarContributionItem)) { >- toolBarContributionItem = (ToolBarContributionItem) foundItem; >- coolItemToolBarMgr = toolBarContributionItem >- .getToolBarManager(); >+ if ((foundItem instanceof IToolBarContributionItem)) { >+ toolBarContributionItem = (IToolBarContributionItem) foundItem; >+ coolItemToolBarMgr = toolBarContributionItem.getToolBarManager(); > if (coolItemToolBarMgr == null) { >- coolItemToolBarMgr = new ToolBarManager(coolBarManager >+ coolItemToolBarMgr = actionBarPresentation.createToolBarManager(coolBarManager > .getStyle()); >- toolBarContributionItem = new ToolBarContributionItem( >+ toolBarContributionItem = actionBarPresentation.createToolBarContributionItem( > coolItemToolBarMgr, type); > // Add editor item to group > coolBarManager.prependToGroup( >@@ -263,13 +267,13 @@ > if ((coolBarManager instanceof ContributionManager) > && (foundItem instanceof PlaceholderContributionItem)) { > PlaceholderContributionItem placeholder = (PlaceholderContributionItem) foundItem; >- toolBarContributionItem = placeholder >- .createToolBarContributionItem((ToolBarManager) coolItemToolBarMgr); >+ toolBarContributionItem = createToolBarContributionItem( >+ (ToolBarManager) coolItemToolBarMgr, placeholder); > // Restore from a placeholder > ((ContributionManager) coolBarManager).replaceItem(type, > toolBarContributionItem); > } else { >- toolBarContributionItem = new ToolBarContributionItem( >+ toolBarContributionItem = actionBarPresentation.createToolBarContributionItem( > coolItemToolBarMgr, type); > // Add editor item to group > coolBarManager.prependToGroup( >@@ -284,6 +288,21 @@ > > return coolItemToolBarMgr; > } >+ >+ /* >+ * Creates a new tool bar contribution item on the given manager -- using >+ * the stored data to initialize some of its properties. >+ */ >+ IToolBarContributionItem createToolBarContributionItem( >+ final ToolBarManager manager, PlaceholderContributionItem item) { >+ IToolBarContributionItem toolBarContributionItem = actionBarPresentation >+ .createToolBarContributionItem(manager, item.getId()); >+ toolBarContributionItem.setCurrentHeight(item.getHeight()); >+ toolBarContributionItem.setCurrentWidth(item.getWidth()); >+ toolBarContributionItem.setMinimumItemsToShow(item.getMinimumItemsToShow()); >+ toolBarContributionItem.setUseChevron(item.getUseChevron()); >+ return toolBarContributionItem; >+ } > > /** > * Returns whether the contribution list is visible. If the visibility is >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.22 >diff -u -r1.22 ActionSetActionBars.java >--- Eclipse UI/org/eclipse/ui/internal/ActionSetActionBars.java 13 Jan 2006 16:14:45 -0000 1.22 >+++ Eclipse UI/org/eclipse/ui/internal/ActionSetActionBars.java 3 Feb 2006 19:18:21 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -18,20 +18,22 @@ > import org.eclipse.jface.action.IContributionManager; > import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.action.IMenuManager; >+import org.eclipse.jface.action.IToolBarContributionItem; > import org.eclipse.jface.action.IToolBarManager; > import org.eclipse.jface.action.SubMenuManager; > import org.eclipse.jface.action.SubToolBarManager; >-import org.eclipse.jface.action.ToolBarContributionItem; >-import org.eclipse.jface.action.ToolBarManager; > import org.eclipse.ui.IActionBars2; > import org.eclipse.ui.IWorkbenchActionConstants; > import org.eclipse.ui.SubActionBars2; >+import org.eclipse.ui.internal.presentations.ActionBarPresentation; > import org.eclipse.ui.services.IServiceLocator; > > /** > * This class represents the action bars for an action set. > */ > public class ActionSetActionBars extends SubActionBars2 { >+ >+ private ActionBarPresentation actionBarPresentation = null; > > private String actionSetId; > >@@ -39,16 +41,17 @@ > > private IToolBarManager coolItemToolBarMgr = null; > >- private ToolBarContributionItem toolBarContributionItem = null; >+ private IToolBarContributionItem toolBarContributionItem = null; > > /** >- * Constructs a new action bars object >- */ >- public ActionSetActionBars(IActionBars2 parent, >- final IServiceLocator serviceLocator, String actionSetId) { >- super(parent, serviceLocator); >- this.actionSetId = actionSetId; >- } >+ * Constructs a new action bars object >+ */ >+ public ActionSetActionBars(IActionBars2 parent, final IServiceLocator serviceLocator, >+ String actionSetId, WorkbenchWindow window) { >+ super(parent, serviceLocator); >+ this.actionSetId = actionSetId; >+ this.actionBarPresentation = window.getActionBarPresentation(); >+ } > > /** > * Adds to the list all the actions that are part of this action set but >@@ -107,7 +110,7 @@ > for (int i = 0; i < adjunctContributions.size(); i++) { > ContributionItem item = (ContributionItem) adjunctContributions > .get(i); >- ToolBarManager parent = (ToolBarManager) item.getParent(); >+ IContributionManager parent = item.getParent(); > if (parent != null) { > parent.remove(item); > item.dispose(); >@@ -181,7 +184,7 @@ > if (coolBarManager == null) { > return null; > } >- return new ToolBarManager(coolBarManager.getStyle()); >+ return actionBarPresentation.createToolBarManager(coolBarManager.getStyle()); > } > > /** >@@ -221,9 +224,9 @@ > // tool bar > // id then create one. Otherwise retrieve the tool bar contribution > // item >- if (cbItem instanceof ToolBarContributionItem) { >+ if (cbItem instanceof IToolBarContributionItem) { > >- ToolBarContributionItem tbcbItem = (ToolBarContributionItem) cbItem; >+ IToolBarContributionItem tbcbItem = (IToolBarContributionItem) cbItem; > coolItemToolBarMgr = tbcbItem.getToolBarManager(); > // If this not an adjuct type then we can cashe the tool bar > // contribution type >@@ -231,15 +234,19 @@ > toolBarContributionItem = tbcbItem; > } > } else { >- >- coolItemToolBarMgr = new ToolBarManager(coolBarManager.getStyle()); >+ >+ coolItemToolBarMgr = actionBarPresentation >+ .createToolBarManager(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 >+ >+ IContributionItem toolBarContributionItem = actionBarPresentation >+ .createToolBarContributionItem(coolItemToolBarMgr, >+ toolBarId); > >- toolBarContributionItem = new ToolBarContributionItem( >- 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.21 >diff -u -r1.21 ActionPresentation.java >--- Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java 13 Jan 2006 16:14:45 -0000 1.21 >+++ Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java 3 Feb 2006 19:18:21 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -146,7 +146,7 @@ > } else { > IActionSet set = desc.createActionSet(); > SubActionBars bars = new ActionSetActionBars(window >- .getActionBars(), window, desc.getId()); >+ .getActionBars(), window, desc.getId(), window); > rec = new SetRec(desc, set, bars); > set.init(window, bars); > sets.add(set); >Index: Eclipse UI/org/eclipse/ui/internal/ViewPane.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewPane.java,v >retrieving revision 1.100 >diff -u -r1.100 ViewPane.java >--- Eclipse UI/org/eclipse/ui/internal/ViewPane.java 26 Jan 2006 21:36:46 -0000 1.100 >+++ Eclipse UI/org/eclipse/ui/internal/ViewPane.java 3 Feb 2006 19:18:24 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -13,8 +13,10 @@ > package org.eclipse.ui.internal; > > >+import org.eclipse.jface.action.IToolBarManager2; > import org.eclipse.jface.action.MenuManager; >-import org.eclipse.jface.action.ToolBarManager; >+import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.PropertyChangeEvent; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.MouseAdapter; > import org.eclipse.swt.events.MouseEvent; >@@ -28,6 +30,7 @@ > import org.eclipse.ui.IViewReference; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.internal.dnd.DragUtil; >+import org.eclipse.ui.internal.presentations.ActionBarPresentation; > import org.eclipse.ui.presentations.IPresentablePart; > import org.eclipse.ui.presentations.StackPresentation; > >@@ -41,8 +44,7 @@ > > // create initially toolbarless bar manager so that actions may be added in the > // init method of the view. >- private ToolBarManager isvToolBarMgr = new PaneToolBarManager(SWT.FLAT >- | SWT.WRAP); >+ private IToolBarManager2 isvToolBarMgr = null; > > private MenuManager isvMenuMgr; > >@@ -56,16 +58,31 @@ > /** > * Toolbar manager for the ISV toolbar. > */ >- class PaneToolBarManager extends ToolBarManager { >- public PaneToolBarManager(int style) { >- super(style); >- } >- >- protected void relayout(ToolBar toolBar, int oldCount, int newCount) { >- toolBarResized(toolBar, newCount); >- >- toolBar.layout(); >- } >+ private class ISVPropListener implements IPropertyChangeListener { >+ private Control toolBar; >+ >+ /** >+ * Constructor >+ * @param toolBar >+ */ >+ public ISVPropListener (Control toolBar) { >+ this.toolBar = toolBar; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) >+ */ >+ public void propertyChange(PropertyChangeEvent event) { >+ String property = event.getProperty(); >+ Integer newValue = (Integer)event.getNewValue(); >+ if (IToolBarManager2.PROP_LAYOUT.equals(property)) { >+ toolBarResized(toolBar, newValue != null ? newValue.intValue() : 0); >+ if (toolBar instanceof Composite) >+ ((Composite)toolBar).layout(); >+ else >+ toolBar.getParent().layout(); >+ } >+ } > } > > /** >@@ -92,6 +109,10 @@ > */ > public ViewPane(IViewReference ref, WorkbenchPage page) { > super(ref, page); >+ ActionBarPresentation actionBarPresentation = ((WorkbenchWindow) page >+ .getWorkbenchWindow()).getActionBarPresentation(); >+ >+ isvToolBarMgr = actionBarPresentation.createViewToolBarManager(SWT.FLAT | SWT.WRAP); > } > > /** >@@ -123,9 +144,9 @@ > > } > >- private void toolBarResized(ToolBar toolBar, int newSize) { >+ private void toolBarResized(Control toolBar, int newSize) { > >- Control toolbar = isvToolBarMgr.getControl(); >+ Control toolbar = isvToolBarMgr.getControl2(); > if (toolbar != null) { > Control ctrl = getControl(); > >@@ -146,7 +167,9 @@ > > // ISV toolbar. > // // 1GD0ISU: ITPUI:ALL - Dbl click on view tool cause zoom >- final ToolBar isvToolBar = isvToolBarMgr.createControl(parentControl.getParent()); >+ final Control isvToolBar = isvToolBarMgr.createControl2(parentControl.getParent()); >+ >+ isvToolBarMgr.addPropertyChangeListener(new ISVPropListener(isvToolBar)); > > isvToolBar.addMouseListener(new MouseAdapter() { > public void mouseDoubleClick(MouseEvent event) { >@@ -301,7 +324,7 @@ > /** > * @see ViewActionBars > */ >- public ToolBarManager getToolBarManager() { >+ public IToolBarManager2 getToolBarManager() { > return isvToolBarMgr; > } > >@@ -463,7 +486,7 @@ > super.reparent(newParent); > > if (isvToolBarMgr != null) { >- ToolBar bar = isvToolBarMgr.getControl(); >+ Control bar = isvToolBarMgr.getControl2(); > if (bar != null) { > bar.setParent(newParent); > bar.moveAbove(control); >@@ -499,19 +522,19 @@ > } > > public boolean toolbarIsVisible() { >- ToolBarManager toolbarManager = getToolBarManager(); >+ IToolBarManager2 toolbarManager = getToolBarManager(); > > if (toolbarManager == null) { > return false; > } > >- ToolBar control = toolbarManager.getControl(); >+ Control control = toolbarManager.getControl2(); > > if (control == null || control.isDisposed()) { > return false; > } > >- return control.getItemCount() > 0; >+ return toolbarManager.getItemCount() > 0; > } > > /* >@@ -559,12 +582,12 @@ > return internalGetToolbar(); > } > >- private ToolBar internalGetToolbar() { >+ private Control internalGetToolbar() { > if (isvToolBarMgr == null) { > return null; > } > >- return isvToolBarMgr.getControl(); >+ return isvToolBarMgr.getControl2(); > } > > /* (non-Javadoc) >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 3 Feb 2006 19:18:21 -0000 >@@ -11,9 +11,14 @@ > package org.eclipse.ui.application; > > import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.action.IContributionItem; > import org.eclipse.jface.action.ICoolBarManager; > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.IStatusLineManager; >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.action.IToolBarManager2; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; > > /** > * Interface providing special access for configuring the action bars >@@ -61,6 +66,35 @@ > * @return the cool bar manager > */ > public ICoolBarManager getCoolBarManager(); >+ >+ /** >+ * Creates tool bar manager for the workbench window's tool bar. >+ * >+ * @param style >+ * @return toolBarManager >+ * @since 3.2 >+ */ >+ public IToolBarManager createToolBarManager(int style); >+ >+ /** >+ * Creates the control for the window's tool bar. >+ * >+ * @param toolBarManager the window's tool bar manager >+ * @param parent the parent composite >+ * @return the window's tool bar control >+ * @since 3.2 >+ */ >+ public Control createToolBarControl(IToolBarManager2 toolBarManager, Composite parent); >+ >+ /** >+ * Creates a toolbar contribution item for the window's tool bar. >+ * >+ * @param toolBarManager the window's tool bar manager >+ * @param id the id of the contribution >+ * @return the contribution item >+ * @since 3.2 >+ */ >+ public IContributionItem createToolBarContributionItem(IToolBarManager toolBarManager, String id); > > /** > * Register the action as a global action with a workbench >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.47 >diff -u -r1.47 CustomizePerspectiveDialog.java >--- Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java 17 Jan 2006 16:45:19 -0000 1.47 >+++ Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java 3 Feb 2006 19:18:33 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Common Public License v1.0 > * which accompanies this distribution, and is available at >@@ -27,6 +27,7 @@ > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.IStatusLineManager; > import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.action.IToolBarManager2; > import org.eclipse.jface.action.MenuManager; > import org.eclipse.jface.action.StatusLineManager; > import org.eclipse.jface.action.ToolBarContributionItem; >@@ -479,6 +480,27 @@ > public final IServiceLocator getServiceLocator() { > return configurer.getWindow(); > } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.application.IActionBarConfigurer#createToolBarContributionItem(org.eclipse.jface.action.IToolBarManager, java.lang.String) >+ */ >+ public IContributionItem createToolBarContributionItem(IToolBarManager toolBarManager, String id) { >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.application.IActionBarConfigurer#createToolBarManager(int) >+ */ >+ public IToolBarManager createToolBarManager(int style) { >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.application.IActionBarConfigurer#createToolBarControl(org.eclipse.jface.action.IToolBarManager2, org.eclipse.swt.widgets.Composite) >+ */ >+ public Control createToolBarControl(IToolBarManager2 toolBarManager, Composite parent) { >+ return null; >+ } > } > > class ShortcutMenuItemContentProvider implements IStructuredContentProvider { >@@ -942,7 +964,7 @@ > private void buildMenusAndToolbarsFor(CustomizeActionBars customizeActionBars, ActionSetDescriptor actionSetDesc) { > String id = actionSetDesc.getId(); > ActionSetActionBars bars = new ActionSetActionBars( >- customizeActionBars, window, id); >+ customizeActionBars, window, id, window); > PluginActionSetBuilder builder = new PluginActionSetBuilder(); > PluginActionSet actionSet = null; > try { >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 3 Feb 2006 19:18:31 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2005 IBM Corporation and others. >+ * Copyright (c) 2003, 2006 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 >@@ -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/internal/presentations/ActionBarPresentation.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/internal/presentations/ActionBarPresentation.java >diff -N Eclipse UI/org/eclipse/ui/internal/presentations/ActionBarPresentation.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/internal/presentations/ActionBarPresentation.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,114 @@ >+/******************************************************************************* >+ * 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.internal.presentations; >+ >+import org.eclipse.jface.action.CoolBarManager; >+import org.eclipse.jface.action.ICoolBarManager; >+import org.eclipse.jface.action.IToolBarContributionItem; >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.action.IToolBarManager2; >+import org.eclipse.jface.action.ToolBarContributionItem; >+import org.eclipse.jface.action.ToolBarManager; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+ >+/** >+ * Manage the creation of tool bars for a presentation factory. >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This class or interface has been added as >+ * part of a work in progress. There is a guarantee neither that this API will >+ * work nor that it will remain the same. Please do not use this API without >+ * consulting with the Platform/UI team. >+ * </p> >+ * >+ * @since 3.2 >+ */ >+public class ActionBarPresentation { >+ >+ /** >+ * Creates CoolBarManager for WorkbenchWindow's tool bar >+ * >+ * @param style >+ * @return coolBarManager >+ */ >+ 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 >+ */ >+ public Control createCoolBarControl(ICoolBarManager coolBarManager, Composite parent) { >+ return coolBarManager.createControl2(parent); >+ } >+ >+ /** >+ * Creates ToolBarManager for WorkbenchWindow's tool bar >+ * >+ * @param style >+ * @return toolBarManager >+ */ >+ public IToolBarManager2 createToolBarManager(int style) { >+ return new ToolBarManager(style); >+ } >+ >+ /** >+ * Creates the control for the window's tool bar. >+ * Subclasses may override. >+ * >+ * @param toolBarManager the window's toolbar manager >+ * @param parent the parent composite >+ * @return the window's tool bar control >+ */ >+ public Control createToolBarControl(IToolBarManager2 toolBarManager, Composite parent) { >+ return toolBarManager.createControl2(parent); >+ } >+ >+ /** >+ * Creates ToolBarManager for a view part tool bar >+ * >+ * @param style >+ * @return toolBarManager >+ */ >+ public IToolBarManager2 createViewToolBarManager(int style) { >+ return new ToolBarManager(style); >+ } >+ >+ /** >+ * Creates the control for a view part tool bar. >+ * Subclasses may override. >+ * >+ * @param toolBarManager the view part's toolbar manager >+ * @param parent the parent composite >+ * @return the window's tool bar control >+ */ >+ public Control createViewToolBarControl(IToolBarManager2 toolBarManager, Composite parent) { >+ return toolBarManager.createControl2(parent); >+ } >+ >+ /** >+ * Creates a toolbar contribution. >+ * This is to support custom coolbar managers. >+ * >+ * @param toolBarManager the toolbar manager >+ * @param id the id of the contribution >+ * @return the toolbar contribution item >+ */ >+ public IToolBarContributionItem createToolBarContributionItem(IToolBarManager toolBarManager, String id) { >+ return new ToolBarContributionItem(toolBarManager, id); >+ } >+} >Index: Eclipse UI/org/eclipse/ui/internal/presentations/InternalPresentationFactory.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/internal/presentations/InternalPresentationFactory.java >diff -N Eclipse UI/org/eclipse/ui/internal/presentations/InternalPresentationFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/internal/presentations/InternalPresentationFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 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.presentations; >+ >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.presentations.WorkbenchPresentationFactory; >+ >+/** >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This class or interface has been added as >+ * part of a work in progress. There is a guarantee neither that this API will >+ * work nor that it will remain the same. Please do not use this API without >+ * consulting with the Platform/UI team. >+ * </p> >+ * >+ * @since 3.2 >+ */ >+public abstract class InternalPresentationFactory extends WorkbenchPresentationFactory { >+ >+ /** >+ * Creates an action presentation for a window >+ * @param window >+ * @return ActionPresentation >+ */ >+ public abstract ActionBarPresentation createActionBarPresentation(IWorkbenchWindow window); >+ >+}
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