Class PartZoomComboContributionItem
java.lang.Object
org.eclipse.jface.action.ContributionItem
org.csstudio.opibuilder.visualparts.PartZoomComboContributionItem
- All Implemented Interfaces:
org.eclipse.draw2d.zoom.ZoomListener
,org.eclipse.gef.editparts.ZoomListener
,IContributionItem
public class PartZoomComboContributionItem
extends ContributionItem
implements org.eclipse.gef.editparts.ZoomListener
Tweak
ZoomComboContributionItem
to dedicate to a part. A ControlContribution that uses a
Combo
as its control-
Constructor Summary
ConstructorDescriptionPartZoomComboContributionItem
(IPartService partService) Constructor for ComboToolItem.PartZoomComboContributionItem
(IPartService partService, String initString) Constructor for ComboToolItem.PartZoomComboContributionItem
(IPartService partService, String[] initStrings) Constructor for ComboToolItem. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
computeWidth
(Control control) Computes the width required by controlprotected Control
createControl
(Composite parent) Creates and returns the control for this contribution item under the given parent composite.void
dispose()
void
The control item implementation of thisIContributionItem
method calls thecreateControl
framework method.void
The control item implementation of thisIContributionItem
method throws an exception since controls cannot be added to menus.void
The control item implementation of thisIContributionItem
method calls thecreateControl
framework method to create a control under the given parent, and then creates a new tool item to hold it.org.eclipse.gef.editparts.ZoomManager
void
setPart
(IWorkbenchPart part) void
setZoomManager
(org.eclipse.gef.editparts.ZoomManager zm) void
zoomChanged
(double zoom) 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 Details
-
PartZoomComboContributionItem
Constructor for ComboToolItem.- Parameters:
partService
- used to add a PartListener
-
PartZoomComboContributionItem
Constructor for ComboToolItem.- Parameters:
partService
- used to add a PartListenerinitString
- the initial string displayed in the combo
-
PartZoomComboContributionItem
Constructor for ComboToolItem.- Parameters:
partService
- used to add a PartListenerinitStrings
- the initial string displayed in the combo
-
-
Method Details
-
computeWidth
Computes the width required by control- Parameters:
control
- The control to compute width- Returns:
- int The width required
-
createControl
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:
dispose
in interfaceIContributionItem
- Overrides:
dispose
in classContributionItem
-
fill
The control item implementation of thisIContributionItem
method calls thecreateControl
framework method. Subclasses must implementcreateControl
rather than overriding this method.- Specified by:
fill
in interfaceIContributionItem
- Overrides:
fill
in classContributionItem
-
fill
The control item implementation of thisIContributionItem
method throws an exception since controls cannot be added to menus.- Specified by:
fill
in interfaceIContributionItem
- Overrides:
fill
in classContributionItem
-
fill
The control item implementation of thisIContributionItem
method calls thecreateControl
framework method to create a control under the given parent, and then creates a new tool item to hold it. Subclasses must implementcreateControl
rather than overriding this method.- Specified by:
fill
in interfaceIContributionItem
- Overrides:
fill
in classContributionItem
-
getZoomManager
public org.eclipse.gef.editparts.ZoomManager getZoomManager() -
setZoomManager
public void setZoomManager(org.eclipse.gef.editparts.ZoomManager zm) -
zoomChanged
public void zoomChanged(double zoom) - Specified by:
zoomChanged
in interfaceorg.eclipse.draw2d.zoom.ZoomListener
-
setPart
- Parameters:
part
- a part which must have a ZoomManager Adapter.
-