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 33169 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 jface
ActionBarPresentation_jface_I20051214-0010_patch.txt (text/plain), 15.27 KB, created by
Matthew Hatem
on 2006-01-17 16:24:55 EST
(
hide
)
Description:
DRAFT patch for jface
Filename:
MIME Type:
Creator:
Matthew Hatem
Created:
2006-01-17 16:24:55 EST
Size:
15.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >Index: src/org/eclipse/jface/window/ApplicationWindow.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/window/ApplicationWindow.java,v >retrieving revision 1.24 >diff -u -r1.24 ApplicationWindow.java >--- src/org/eclipse/jface/window/ApplicationWindow.java 2 Aug 2005 17:40:41 -0000 1.24 >+++ src/org/eclipse/jface/window/ApplicationWindow.java 17 Jan 2006 20:11:49 -0000 >@@ -15,6 +15,9 @@ > > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.jface.action.CoolBarManager; >+import org.eclipse.jface.action.ICoolBarManager; >+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.ToolBarManager; >@@ -77,7 +80,7 @@ > * > * @see #addToolBar > */ >- private ToolBarManager toolBarManager = null; >+ protected IToolBarManager2 toolBarManager = null; > > /** > * Status line manager, or <code>null</code> if none (default). >@@ -92,7 +95,7 @@ > * @see #addCoolBar > * @since 3.0 > */ >- private CoolBarManager coolBarManager = null; >+ protected ICoolBarManager coolBarManager = null; > > /** > * The seperator between the menu bar and the rest of the window. >@@ -404,6 +407,19 @@ > protected ToolBarManager createToolBarManager(int style) { > return new ToolBarManager(style); > } >+ >+ /** >+ * Returns a new tool bar manager for the window. >+ * <p> >+ * Subclasses may override this method to customize the tool bar manager. >+ * The default implementation calls <code>createToolBarManager</code>. >+ * </p> >+ * @return a tool bar manager >+ * @since 3.2 >+ */ >+ protected IToolBarManager createToolBarManager2(int style) { >+ return createToolBarManager(style); >+ } > > /** > * Returns a new cool bar manager for the window. >@@ -417,6 +433,20 @@ > protected CoolBarManager createCoolBarManager(int style) { > return new CoolBarManager(style); > } >+ >+ /** >+ * Returns a new cool bar manager for the window. >+ * <p> >+ * Subclasses may override this method to customize the cool bar manager. >+ * The default implementation calls <code>createCoolBarManager</code> >+ * </p> >+ * >+ * @return a cool bar manager >+ * @since 3.2 >+ */ >+ protected ICoolBarManager createCoolBarManager2(int style) { >+ return new CoolBarManager(style); >+ } > > /** > * Creates the control for the tool bar manager. >@@ -443,7 +473,7 @@ > */ > protected Control createCoolBarControl(Composite composite) { > if (coolBarManager != null) { >- return coolBarManager.createControl(composite); >+ return coolBarManager.createControl2(composite); > } > return null; > } >@@ -510,6 +540,20 @@ > * @see #addToolBar(int) > */ > public ToolBarManager getToolBarManager() { >+ if (toolBarManager instanceof ToolBarManager) >+ return (ToolBarManager)toolBarManager; >+ return null; >+ } >+ >+ /** >+ * Returns the tool bar manager for this window (if it has one). >+ * >+ * @return the tool bar manager, or <code>null</code> if >+ * this window does not have a tool bar >+ * @see #addToolBar(int) >+ * @since 3.2 >+ */ >+ public IToolBarManager2 getToolBarManager2() { > return toolBarManager; > } > >@@ -522,6 +566,20 @@ > * @since 3.0 > */ > public CoolBarManager getCoolBarManager() { >+ if (coolBarManager instanceof CoolBarManager) >+ return (CoolBarManager)coolBarManager; >+ return null; >+ } >+ >+ /** >+ * Returns the cool bar manager for this window. >+ * >+ * @return the cool bar manager, or <code>null</code> if >+ * this window does not have a cool bar >+ * @see #addCoolBar(int) >+ * @since 3.2 >+ */ >+ public ICoolBarManager getCoolBarManager2() { > return coolBarManager; > } > >Index: src/org/eclipse/jface/action/CoolBarManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/action/CoolBarManager.java,v >retrieving revision 1.29 >diff -u -r1.29 CoolBarManager.java >--- src/org/eclipse/jface/action/CoolBarManager.java 27 Sep 2005 14:06:34 -0000 1.29 >+++ src/org/eclipse/jface/action/CoolBarManager.java 17 Jan 2006 20:11:49 -0000 >@@ -245,6 +245,19 @@ > } > return coolBar; > } >+ >+ /** >+ * Creates and returns this manager's cool bar control. Does not create a >+ * new control if one already exists. >+ * >+ * @param parent >+ * the parent control >+ * @return the cool bar control >+ * @since 3.2 >+ */ >+ public Control createControl2(Composite parent) { >+ return createControl(parent); >+ } > > /** > * Disposes of this cool bar manager and frees all allocated SWT resources. >@@ -382,6 +395,16 @@ > public CoolBar getControl() { > return coolBar; > } >+ >+ /** >+ * Returns the control for this manager. >+ * >+ * @return the control, or <code>null</code> if none >+ * @since 3.2 >+ */ >+ public Control getControl2() { >+ return coolBar; >+ } > > /** > * Returns an array list of all the contribution items in the manager. >Index: src/org/eclipse/jface/action/ICoolBarManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/action/ICoolBarManager.java,v >retrieving revision 1.8 >diff -u -r1.8 ICoolBarManager.java >--- src/org/eclipse/jface/action/ICoolBarManager.java 25 Feb 2005 20:39:54 -0000 1.8 >+++ src/org/eclipse/jface/action/ICoolBarManager.java 17 Jan 2006 20:11:49 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jface.action; > >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.CoolBar; > > /** >@@ -50,6 +52,28 @@ > * @see ToolBarContributionItem > */ > public void add(IToolBarManager toolBarManager); >+ >+ /** >+ * Creates and returns this manager's cool bar control. Does not create a >+ * new control if one already exists. >+ * >+ * @param parent >+ * the parent control >+ * @return the cool bar control >+ * @since 3.2 >+ */ >+ public CoolBar createControl(Composite parent); >+ >+ /** >+ * Creates and returns this manager's cool bar control. Does not create a >+ * new control if one already exists. >+ * >+ * @param parent >+ * the parent control >+ * @return the cool bar control >+ * @since 3.2 >+ */ >+ public Control createControl2(Composite parent); > > /** > * Returns the context menu manager used by this cool bar manager. This >@@ -62,6 +86,22 @@ > public IMenuManager getContextMenuManager(); > > /** >+ * Returns the cool bar control for this manager. >+ * >+ * @return the cool bar control, or <code>null</code> if none >+ * @since 3.2 >+ */ >+ public CoolBar getControl(); >+ >+ /** >+ * Returns the cool bar control for this manager. >+ * >+ * @return the cool bar control, or <code>null</code> if none >+ * @since 3.2 >+ */ >+ public Control getControl2(); >+ >+ /** > * Returns whether the layout of the underlying cool bar widget is locked. > * > * @return <code>true</code> if cool bar layout is locked, <code>false</code> >@@ -87,6 +127,42 @@ > public void setContextMenuManager(IMenuManager menuManager); > > /** >+ * Synchronizes the visual order of the cool items in the control with this >+ * manager's internal data structures. This method should be called before >+ * requesting the order of the contribution items to ensure that the order >+ * is accurate. >+ * <p> >+ * Note that <code>update()</code> and <code>refresh()</code> are >+ * converses: <code>update()</code> changes the visual order to match the >+ * internal structures, and <code>refresh</code> changes the internal >+ * structures to match the visual order. >+ * </p> >+ * >+ * @since 3.2 >+ */ >+ public void refresh(); >+ >+ /** >+ * @since 3.2 >+ */ >+ public void dispose(); >+ >+ /** >+ * Restores the canonical order of this cool bar manager. The canonical >+ * order is the order in which the contribution items where added. >+ */ >+ public void resetItemOrder(); >+ >+ /** >+ * Replaces the current items with the given items. >+ * Forces an update. >+ * >+ * @param newItems the items with which to replace the current items >+ * @since 3.2 >+ */ >+ public void setItems(IContributionItem[] newItems); >+ >+ /** > * Locks or unlocks the layout of the underlying cool bar widget. Once the > * cool bar is locked, cool items cannot be repositioned by the user. > * <p> >@@ -97,7 +173,7 @@ > * @param value > * <code>true</code> to lock the cool bar, <code>false</code> > * to unlock >- */ >+ * @since 3.2 >+ */ > public void setLockLayout(boolean value); >- > } >Index: src/org/eclipse/jface/action/ToolBarManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/action/ToolBarManager.java,v >retrieving revision 1.18 >diff -u -r1.18 ToolBarManager.java >--- src/org/eclipse/jface/action/ToolBarManager.java 24 May 2005 14:58:44 -0000 1.18 >+++ src/org/eclipse/jface/action/ToolBarManager.java 17 Jan 2006 20:11:49 -0000 >@@ -33,7 +33,7 @@ > * </p> > */ > public class ToolBarManager extends ContributionManager implements >- IToolBarManager { >+ IToolBarManager2 { > > /** > * The tool bar items style; <code>SWT.NONE</code> by default. >@@ -396,4 +396,18 @@ > } > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.IToolBarManager2#createControl2(org.eclipse.swt.widgets.Composite) >+ */ >+ public Control createControl2(Composite parent) { >+ return createControl(parent); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.IToolBarManager2#getControl2() >+ */ >+ public Control getControl2() { >+ return getControl(); >+ } >+ > } >Index: src/org/eclipse/jface/action/SubCoolBarManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/action/SubCoolBarManager.java,v >retrieving revision 1.5 >diff -u -r1.5 SubCoolBarManager.java >--- src/org/eclipse/jface/action/SubCoolBarManager.java 1 Sep 2005 19:34:36 -0000 1.5 >+++ src/org/eclipse/jface/action/SubCoolBarManager.java 17 Jan 2006 20:11:49 -0000 >@@ -11,6 +11,9 @@ > package org.eclipse.jface.action; > > import org.eclipse.jface.util.Assert; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.CoolBar; > > /** > * A <code>SubCoolBarManager</code> monitors the additional and removal of >@@ -42,6 +45,38 @@ > super.add(new ToolBarContributionItem(toolBarManager)); > } > >+ /* >+ * (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#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#getStyle() > */ >@@ -82,6 +117,22 @@ > return null; > } > >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#refresh() >+ */ >+ public void refresh() { >+ // do nothing >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#resetItemOrder() >+ */ >+ public void resetItemOrder() { >+ // do nothing >+ } >+ > /* (non-Javadoc) > * In SubCoolBarManager we do nothing. > */ >@@ -89,6 +140,14 @@ > // do nothing > } > >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#setItems(org.eclipse.jface.action.IContributionItem[]) >+ */ >+ public void setItems(IContributionItem[] newItems) { >+ // do nothing >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.jface.action.IContributionManager#update(boolean) > */ >@@ -99,4 +158,14 @@ > getParentCoolBarManager().update(force); > } > >+ public void dispose() { >+ // do nothing >+ } >+ >+ >+ >+ >+ >+ >+ > } >Index: src/org/eclipse/jface/action/IToolBarManager2.java >=================================================================== >RCS file: src/org/eclipse/jface/action/IToolBarManager2.java >diff -N src/org/eclipse/jface/action/IToolBarManager2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/action/IToolBarManager2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,55 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 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.jface.action; >+ >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.ToolBar; >+ >+/** >+ * The <code>IToolBarManager2</code> interface provides protocol for managing >+ * contributions to a tool bar. It extends <code>IToolBarManager</code> >+ * and provides a <code>dispose</code> method. >+ * <p> >+ * This package also provides a concrete tool bar manager implementation, >+ * {@link ToolBarManager <code>ToolBarManager</code>}. >+ * </p> >+ */ >+public interface IToolBarManager2 extends IToolBarManager { >+ >+ /** >+ * @param parent >+ * @return >+ */ >+ public ToolBar createControl(Composite parent); >+ >+ /** >+ * @param parent >+ * @return >+ */ >+ public Control createControl2(Composite parent); >+ >+ /** >+ * @return >+ */ >+ public ToolBar getControl(); >+ >+ /** >+ * @return >+ */ >+ public Control getControl2(); >+ >+ /** >+ * >+ */ >+ public void dispose(); >+ >+}
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