org.eclipse.gef4.zest.core.viewers

## Class ZoomContributionViewItem

- java.lang.Object
- - org.eclipse.jface.action.ContributionItem
  - - org.eclipse.gef4.zest.core.viewers.ZoomContributionViewItem

All Implemented Interfaces:
  ZoomListener, IContributionItem

    public class ZoomContributionViewItem
    extends ContributionItem
    implements ZoomListener

A contribution item that adds a combo to a toolbar or coolbar, or a list of zooms to a menu. Can only be used for one toolbar, coolbar, or menu. In order to use this item, let your workbench part implement IZoomableWorkbenchPart. If the workbench part then supplies a viewer that is zoomable, the combo or menu created by this item will be enabled.

### Field Summary

Fields
`static java.lang.String` `FIT_ALL` Zooms to fit entirely within the viewport.
`static java.lang.String` `FIT_HEIGHT` Zooms to fit the height.
`static java.lang.String` `FIT_WIDTH` Zooms to fit the width.

### Constructor Summary

Constructors
Constructor and Description
`ZoomContributionViewItem(IZoomableWorkbenchPart part)` Creates a new contribution item that will work on the given part service.initialZooms will be used to populate the combo or the menu.

### Method Summary

Methods
`void` `dispose()`
`void` `fill(CoolBar parent, int index)`
`void` `fill(Menu menu, int index)`
`void` `fill(ToolBar parent, int index)`
`void` `zoomChanged(double z)` 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`

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

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

### Field Detail

#### FIT_WIDTH

    public static final java.lang.String FIT_WIDTH

Zooms to fit the width.

#### FIT_HEIGHT

    public static final java.lang.String FIT_HEIGHT

Zooms to fit the height.

#### FIT_ALL

    public static final java.lang.String FIT_ALL

Zooms to fit entirely within the viewport.

### Constructor Detail

#### ZoomContributionViewItem

    public ZoomContributionViewItem(IZoomableWorkbenchPart part)

Creates a new contribution item that will work on the given part service.initialZooms will be used to populate the combo or the menu. Valid values for initialZooms are percentage numbers (e.g., "100%"), or FIT_WIDTH, FIT_HEIGHT, FIT_ALL.

Parameters:
  `partService` - service used to see whether the view is zoomable.

### Method Detail

#### fill

    public void fill(Menu menu,
            int index)

Specified by:
  `fill` in interface `IContributionItem`
Overrides:
  `fill` in class `ContributionItem`

#### fill

    public void fill(CoolBar parent,
            int index)

Specified by:
  `fill` in interface `IContributionItem`
Overrides:
  `fill` in class `ContributionItem`

#### fill

    public void fill(ToolBar parent,
            int index)

Specified by:
  `fill` in interface `IContributionItem`
Overrides:
  `fill` in class `ContributionItem`

#### zoomChanged

    public void zoomChanged(double z)

Description copied from interface: `ZoomListener`
Called whenever the ZoomManager's zoom level changes.

Specified by:
  `zoomChanged` in interface `ZoomListener`
Parameters:
  `z` - the new zoom level.

#### dispose

    public void dispose()

Specified by:
  `dispose` in interface `IContributionItem`
Overrides:
  `dispose` in class `ContributionItem`