Package org.eclipse.gef.ui.actions
Class ZoomComboContributionItem
- java.lang.Object
-
- org.eclipse.jface.action.ContributionItem
-
- org.eclipse.gef.ui.actions.ZoomComboContributionItem
-
- All Implemented Interfaces:
ZoomListener,IContributionItem
public class ZoomComboContributionItem extends ContributionItem implements ZoomListener
A ControlContribution that uses aComboas its control
-
-
Constructor Summary
Constructors Constructor Description ZoomComboContributionItem(IPartService partService)Constructor for ComboToolItem.ZoomComboContributionItem(IPartService partService, java.lang.String initString)Constructor for ComboToolItem.ZoomComboContributionItem(IPartService partService, java.lang.String[] initStrings)Constructor for ComboToolItem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcomputeWidth(Control control)Computes the width required by controlprotected ControlcreateControl(Composite parent)Creates and returns the control for this contribution item under the given parent composite.voiddispose()voidfill(Composite parent)The control item implementation of thisIContributionItemmethod calls thecreateControlframework method.voidfill(Menu parent, int index)The control item implementation of thisIContributionItemmethod throws an exception since controls cannot be added to menus.voidfill(ToolBar parent, int index)The control item implementation of thisIContributionItemmethod calls thecreateControlframework method to create a control under the given parent, and then creates a new tool item to hold it.ZoomManagergetZoomManager()Returns the zoomManager.voidsetZoomManager(ZoomManager zm)Sets the ZoomManagervoidzoomChanged(double zoom)Called whenever the ZoomManager's zoom level changes.-
Methods inherited from class org.eclipse.jface.action.ContributionItem
fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
-
-
-
-
Constructor Detail
-
ZoomComboContributionItem
public ZoomComboContributionItem(IPartService partService)
Constructor for ComboToolItem.- Parameters:
partService- used to add a PartListener
-
ZoomComboContributionItem
public ZoomComboContributionItem(IPartService partService, java.lang.String initString)
Constructor for ComboToolItem.- Parameters:
partService- used to add a PartListenerinitString- the initial string displayed in the combo
-
ZoomComboContributionItem
public ZoomComboContributionItem(IPartService partService, java.lang.String[] initStrings)
Constructor for ComboToolItem.- Parameters:
partService- used to add a PartListenerinitStrings- the initial string displayed in the combo
-
-
Method Detail
-
computeWidth
protected int computeWidth(Control control)
Computes the width required by control- Parameters:
control- The control to compute width- Returns:
- int The width required
-
createControl
protected Control createControl(Composite parent)
Creates and returns the control for this contribution item under the given parent composite.- Parameters:
parent- the parent composite- Returns:
- the new control
-
dispose
public void dispose()
- Specified by:
disposein interfaceIContributionItem- Overrides:
disposein classContributionItem- See Also:
ContributionItem.dispose()
-
fill
public final void fill(Composite parent)
The control item implementation of thisIContributionItemmethod calls thecreateControlframework method. Subclasses must implementcreateControlrather than overriding this method.- Specified by:
fillin interfaceIContributionItem- Overrides:
fillin classContributionItem- Parameters:
parent- The parent of the control to fill
-
fill
public final void fill(Menu parent, int index)
The control item implementation of thisIContributionItemmethod throws an exception since controls cannot be added to menus.- Specified by:
fillin interfaceIContributionItem- Overrides:
fillin classContributionItem- Parameters:
parent- The menuindex- Menu index
-
fill
public void fill(ToolBar parent, int index)
The control item implementation of thisIContributionItemmethod calls thecreateControlframework method to create a control under the given parent, and then creates a new tool item to hold it. Subclasses must implementcreateControlrather than overriding this method.- Specified by:
fillin interfaceIContributionItem- Overrides:
fillin classContributionItem- Parameters:
parent- The ToolBar to add the new control toindex- Index
-
getZoomManager
public ZoomManager getZoomManager()
Returns the zoomManager.- Returns:
- ZoomManager
-
setZoomManager
public void setZoomManager(ZoomManager zm)
Sets the ZoomManager- Parameters:
zm- The ZoomManager
-
zoomChanged
public void zoomChanged(double zoom)
Description copied from interface:ZoomListenerCalled whenever the ZoomManager's zoom level changes.- Specified by:
zoomChangedin interfaceZoomListener- Parameters:
zoom- the new zoom level.- See Also:
ZoomListener.zoomChanged(double)
-
-