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 34107 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 JFace patch with feedback based on HEAD
ActionBarPresentation_jface_HEAD_patch.txt (text/plain), 28.39 KB, created by
Matthew Hatem
on 2006-02-03 14:28:19 EST
(
hide
)
Description:
Updated JFace patch with feedback based on HEAD
Filename:
MIME Type:
Creator:
Matthew Hatem
Created:
2006-02-03 14:28:19 EST
Size:
28.39 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 3 Feb 2006 19:25:16 -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 >@@ -15,6 +15,8 @@ > > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.jface.action.CoolBarManager; >+import org.eclipse.jface.action.ICoolBarManager; >+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 +79,7 @@ > * > * @see #addToolBar > */ >- private ToolBarManager toolBarManager = null; >+ protected IToolBarManager2 toolBarManager = null; > > /** > * Status line manager, or <code>null</code> if none (default). >@@ -92,7 +94,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. >@@ -255,7 +257,7 @@ > protected void addToolBar(int style) { > if ((getShell() == null) && (toolBarManager == null) > && (coolBarManager == null)) { >- toolBarManager = createToolBarManager(style); >+ toolBarManager = createToolBarManager2(style); > } > } > >@@ -270,8 +272,8 @@ > protected void addCoolBar(int style) { > if ((getShell() == null) && (toolBarManager == null) > && (coolBarManager == null)) { >- coolBarManager = createCoolBarManager(style); >- } >+ coolBarManager = createCoolBarManager2(style); >+ } > } > > /* (non-Javadoc) >@@ -404,6 +406,20 @@ > protected ToolBarManager createToolBarManager(int style) { > return new ToolBarManager(style); > } >+ >+ /** >+ * Returns a new tool bar manager for the window. >+ * <p> >+ * By default this method calls <code>createToolBarManager</code>. Subclasses >+ * may override this method to provide an alternative implementation for the >+ * tool bar manager. >+ * </p> >+ * @return a tool bar manager >+ * @since 3.2 >+ */ >+ protected IToolBarManager2 createToolBarManager2(int style) { >+ return createToolBarManager(style); >+ } > > /** > * Returns a new cool bar manager for the window. >@@ -417,6 +433,21 @@ > protected CoolBarManager createCoolBarManager(int style) { > return new CoolBarManager(style); > } >+ >+ /** >+ * Returns a new cool bar manager for the window. >+ * <p> >+ * By default this method calls <code>createCoolBarManager</code>. Subclasses >+ * may override this method to provide an alternative implementation for the >+ * cool bar manager. >+ * </p> >+ * >+ * @return a cool bar manager >+ * @since 3.2 >+ */ >+ protected ICoolBarManager createCoolBarManager2(int style) { >+ return createCoolBarManager(style); >+ } > > /** > * Creates the control for the tool bar manager. >@@ -427,7 +458,7 @@ > */ > protected Control createToolBarControl(Composite parent) { > if (toolBarManager != null) { >- return toolBarManager.createControl(parent); >+ return toolBarManager.createControl2(parent); > } > return null; > } >@@ -443,7 +474,7 @@ > */ > protected Control createCoolBarControl(Composite composite) { > if (coolBarManager != null) { >- return coolBarManager.createControl(composite); >+ return coolBarManager.createControl2(composite); > } > return null; > } >@@ -510,6 +541,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 +567,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 3 Feb 2006 19:25:14 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2004 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 >@@ -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/ToolBarContributionItem.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/action/ToolBarContributionItem.java,v >retrieving revision 1.24 >diff -u -r1.24 ToolBarContributionItem.java >--- src/org/eclipse/jface/action/ToolBarContributionItem.java 2 Aug 2005 17:40:41 -0000 1.24 >+++ src/org/eclipse/jface/action/ToolBarContributionItem.java 3 Feb 2006 19:25:15 -0000 >@@ -43,7 +43,7 @@ > * > * @since 3.0 > */ >-public class ToolBarContributionItem extends ContributionItem { >+public class ToolBarContributionItem extends ContributionItem implements IToolBarContributionItem { > > /** > * A constant used by <code>setMinimumItemsToShow</code> and <code>getMinimumItemsToShow</code> >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 3 Feb 2006 19:25:14 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2004 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 >@@ -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 control. Does not create a >+ * new control if one already exists. >+ * >+ * @param parent >+ * the parent control >+ * @return the 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 bar control for this manager. >+ * >+ * @return the 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,46 @@ > 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(); >+ >+ /** >+ * Disposes the resources for this manager. >+ * >+ * @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. >+ * >+ * @since 3.2 >+ */ >+ 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> >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 3 Feb 2006 19:25:15 -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,6 +13,9 @@ > import java.util.ArrayList; > import java.util.Iterator; > >+import org.eclipse.core.runtime.ListenerList; >+import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.PropertyChangeEvent; > import org.eclipse.swt.SWT; > import org.eclipse.swt.accessibility.ACC; > import org.eclipse.swt.accessibility.AccessibleAdapter; >@@ -33,7 +36,7 @@ > * </p> > */ > public class ToolBarManager extends ContributionManager implements >- IToolBarManager { >+ IToolBarManager2 { > > /** > * The tool bar items style; <code>SWT.NONE</code> by default. >@@ -54,6 +57,12 @@ > private MenuManager contextMenuManager = null; > > /** >+ * A collection of objects listening to changes to this manager. This >+ * collection is <code>null</code> if there are no listeners. >+ */ >+ private transient ListenerList listenerList = null; >+ >+ /** > * Creates a new tool bar manager with the default SWT button style. Use the > * <code>createControl</code> method to create the tool bar control. > */ >@@ -182,6 +191,7 @@ > protected void relayout(ToolBar layoutBar, int oldCount, int newCount) { > if ((oldCount == 0) != (newCount == 0)) > layoutBar.getParent().layout(); >+ firePropertyChange(PROP_LAYOUT, new Integer(oldCount), new Integer(newCount)); > } > > /** >@@ -396,4 +406,90 @@ > } > } > >+ /* (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(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.IToolBarManager2#getItemCount() >+ */ >+ public int getItemCount() { >+ if (!toolBarExist()) >+ return 0; >+ return toolBar.getItemCount(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.IToolBarManager2#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) >+ */ >+ public void addPropertyChangeListener(IPropertyChangeListener listener) { >+ if (listenerList == null) { >+ listenerList = new ListenerList(ListenerList.IDENTITY); >+ } >+ >+ listenerList.add(listener); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.IToolBarManager2#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) >+ */ >+ public void removePropertyChangeListener(IPropertyChangeListener listener) { >+ if (listenerList != null) { >+ listenerList.remove(listener); >+ >+ if (listenerList.isEmpty()) { >+ listenerList = null; >+ } >+ } >+ } >+ >+ /* >+ * Returns the listeners attached to this event manager. >+ * The listeners currently attached; may be empty, but never >+ * null. >+ */ >+ protected final Object[] getListeners() { >+ final ListenerList list = listenerList; >+ if (list == null) { >+ return new Object[0]; >+ } >+ >+ return list.getListeners(); >+ } >+ >+ /* >+ * Notifies any property change listeners that a property has changed. Only >+ * listeners registered at the time this method is called are notified. >+ */ >+ private void firePropertyChange(final PropertyChangeEvent event) { >+ final Object[] list = getListeners(); >+ for (int i = 0; i < list.length; ++i) { >+ ((IPropertyChangeListener) list[i]).propertyChange(event); >+ } >+ } >+ >+ /* >+ * Notifies any property change listeners that a property has changed. Only >+ * listeners registered at the time this method is called are notified. This >+ * method avoids creating an event object if there are no listeners >+ * registered, but calls firePropertyChange(PropertyChangeEvent) if there are. >+ */ >+ private void firePropertyChange(final String propertyName, >+ final Object oldValue, final Object newValue) { >+ if (listenerList != null) { >+ firePropertyChange(new PropertyChangeEvent(this, propertyName, >+ oldValue, newValue)); >+ } >+ } >+ > } >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 3 Feb 2006 19:25:14 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2004 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 >@@ -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,17 @@ > getParentCoolBarManager().update(force); > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.ICoolBarManager#dispose() >+ */ >+ 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,103 @@ >+/******************************************************************************* >+ * Copyright (c) 2005, 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.jface.action; >+ >+import org.eclipse.jface.util.IPropertyChangeListener; >+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> >+ * <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> >+ * >+ * This package also provides a concrete tool bar manager implementation, >+ * {@link ToolBarManager <code>ToolBarManager</code>}. >+ * </p> >+ * >+ * @since 3.2 >+ */ >+public interface IToolBarManager2 extends IToolBarManager { >+ >+ /** >+ * The property id for changes to the control's layout >+ */ >+ public static final String PROP_LAYOUT = "PROP_LAYOUT"; //$NON-NLS-1$ >+ >+ /** >+ * Creates and returns this manager's toolbar control. Does not create a >+ * new control if one already exists. >+ * >+ * @param parent >+ * the parent control >+ * @return the toolbar control >+ */ >+ public ToolBar createControl(Composite parent); >+ >+ /** >+ * Creates and returns this manager's control. Does not create a >+ * new control if one already exists. >+ * >+ * @param parent >+ * the parent control >+ * @return the control >+ */ >+ public Control createControl2(Composite parent); >+ >+ /** >+ * Returns the toolbar control for this manager. >+ * >+ * @return the toolbar control, or <code>null</code> if none >+ */ >+ public ToolBar getControl(); >+ >+ /** >+ * Returns the control for this manager. >+ * >+ * @return the control, or <code>null</code> if none >+ */ >+ public Control getControl2(); >+ >+ /** >+ * Disposes the resources for this manager. >+ */ >+ public void dispose(); >+ >+ /** >+ * Returns the item count of the control used >+ * by this manager. >+ * >+ * @return the number of items in the control >+ */ >+ public int getItemCount(); >+ >+ /** >+ * Registers a property change listner with this manager. >+ * >+ * @param listener >+ */ >+ public void addPropertyChangeListener(IPropertyChangeListener listener); >+ >+ /** >+ * Removes a property change listner from this manager. >+ * >+ * @param listener >+ */ >+ public void removePropertyChangeListener(IPropertyChangeListener listener); >+ >+} >Index: src/org/eclipse/jface/action/IToolBarContributionItem.java >=================================================================== >RCS file: src/org/eclipse/jface/action/IToolBarContributionItem.java >diff -N src/org/eclipse/jface/action/IToolBarContributionItem.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/action/IToolBarContributionItem.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,117 @@ >+/******************************************************************************* >+ * 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.jface.action; >+ >+/** >+ * <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 interface IToolBarContributionItem extends IContributionItem { >+ >+ /** >+ * Returns the current height of the corresponding cool item. >+ * >+ * @return the current height >+ */ >+ public int getCurrentHeight(); >+ >+ /** >+ * Returns the current width of the corresponding cool item. >+ * >+ * @return the current size >+ */ >+ public int getCurrentWidth(); >+ >+ /** >+ * 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) >+ */ >+ public int getMinimumItemsToShow(); >+ >+ /** >+ * Returns whether chevron support is enabled. >+ * >+ * @return <code>true</code> if chevron support is enabled, <code>false</code> >+ * otherwise >+ */ >+ public boolean getUseChevron(); >+ >+ /** >+ * Sets the current height of the cool item. Update(SIZE) should be called >+ * to adjust the widget. >+ * >+ * @param currentHeight >+ * the current height to set >+ */ >+ public void setCurrentHeight(int currentHeight); >+ >+ /** >+ * Sets the current width of the cool item. Update(SIZE) should be called >+ * to adjust the widget. >+ * >+ * @param currentWidth >+ * the current width to set >+ */ >+ public void setCurrentWidth(int currentWidth); >+ >+ /** >+ * Sets the minimum number of tool items to show in the cool item. If this >+ * number is less than the total tool items, a chevron will appear and the >+ * hidden tool items appear in a drop down menu. By default, all the tool >+ * items are shown in the cool item. >+ * >+ * @param minimumItemsToShow >+ * the minimum number of tool items to show. >+ * @see #getMinimumItemsToShow() >+ * @see #setUseChevron(boolean) >+ */ >+ public void setMinimumItemsToShow(int minimumItemsToShow); >+ >+ /** >+ * Enables or disables chevron support for the cool item. By default, >+ * chevron support is enabled. >+ * >+ * @param value >+ * <code>true</code> to enable chevron support, <code>false</code> >+ * otherwise. >+ */ >+ public void setUseChevron(boolean value); >+ >+ /** >+ * Returns the internal tool bar manager of the contribution item. >+ * >+ * @return the tool bar manager, or <code>null</code> if one is not >+ * defined. >+ * @see IToolBarManager >+ */ >+ public IToolBarManager getToolBarManager(); >+ >+ /** >+ * Returns the parent contribution manager, or <code>null</code> if this >+ * contribution item is not currently added to a contribution manager. >+ * >+ * @return the parent contribution manager, or <code>null</code> >+ * >+ * TODO may not need this, getToolBarManager may be enough. >+ */ >+ public IContributionManager getParent(); >+ >+}
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