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:
  `org.eclipse.draw2d.zoom.ZoomListener`, `ZoomListener`, `IContributionItem`

public class ZoomComboContributionItem extends ContributionItem implements ZoomListener
A ControlContribution that uses a `Combo` as its control

## Constructor Summary

Constructors
Constructor
Description
`ZoomComboContributionItem(IPartService partService)`
Constructor for ComboToolItem.
`ZoomComboContributionItem(IPartService partService, String initString)`
Constructor for ComboToolItem.
`ZoomComboContributionItem(IPartService partService, String[] initStrings)`
Constructor for ComboToolItem.

## Method Summary

Modifier and Type
Method
Description
`protected int`
`computeWidth(Control control)`
Computes the width required by control
`protected Control`
`createControl(Composite parent)`
Creates and returns the control for this contribution item under the given parent composite.
`void`
`dispose()`
`final void`
`fill(Composite parent)`
The control item implementation of this `IContributionItem` method calls the `createControl` framework method.
`final void`
`fill(Menu parent, int index)`
The control item implementation of this `IContributionItem` method throws an exception since controls cannot be added to menus.
`void`
`fill(ToolBar parent, int index)`
The control item implementation of this `IContributionItem` method calls the `createControl` framework method to create a control under the given parent, and then creates a new tool item to hold it.
`ZoomManager`
`getZoomManager()`
Returns the zoomManager.
`void`
`setZoomManager(ZoomManager zm)`
Sets the ZoomManager
`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ZoomComboContributionItem

public ZoomComboContributionItem(IPartService partService)
Constructor for ComboToolItem.

Parameters:
  `partService` - used to add a PartListener

### ZoomComboContributionItem

public ZoomComboContributionItem(IPartService partService, String initString)
Constructor for ComboToolItem.

Parameters:
  `partService` - used to add a PartListener
  `initString` - the initial string displayed in the combo

### ZoomComboContributionItem

public ZoomComboContributionItem(IPartService partService, String[] initStrings)
Constructor for ComboToolItem.

Parameters:
  `partService` - used to add a PartListener
  `initStrings` - the initial string displayed in the combo

## Method Details

### 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:
  `dispose` in interface `IContributionItem`
Overrides:
  `dispose` in class `ContributionItem`
See Also:
  - `ContributionItem.dispose()`

### fill

public final void fill(Composite parent)
The control item implementation of this `IContributionItem` method calls the `createControl` framework method. Subclasses must implement `createControl` rather than overriding this method.

Specified by:
  `fill` in interface `IContributionItem`
Overrides:
  `fill` in class `ContributionItem`
Parameters:
  `parent` - The parent of the control to fill

### fill

public final void fill(Menu parent, int index)
The control item implementation of this `IContributionItem` method throws an exception since controls cannot be added to menus.

Specified by:
  `fill` in interface `IContributionItem`
Overrides:
  `fill` in class `ContributionItem`
Parameters:
  `parent` - The menu
  `index` - Menu index

### fill

public void fill(ToolBar parent, int index)
The control item implementation of this `IContributionItem` method calls the `createControl` framework method to create a control under the given parent, and then creates a new tool item to hold it. Subclasses must implement `createControl` rather than overriding this method.

Specified by:
  `fill` in interface `IContributionItem`
Overrides:
  `fill` in class `ContributionItem`
Parameters:
  `parent` - The ToolBar to add the new control to
  `index` - 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)

Specified by:
  `zoomChanged` in interface `org.eclipse.draw2d.zoom.ZoomListener`
See Also:
  - `ZoomListener.zoomChanged(double)`