org.eclipse.graphiti.ui.internal.util.ui

## Class DoubleFieldWithDropDown

- java.lang.Object
- - org.eclipse.swt.widgets.Widget
  - - org.eclipse.swt.widgets.Control
    - - org.eclipse.swt.widgets.Scrollable
      - - org.eclipse.swt.widgets.Composite
        - - org.eclipse.graphiti.ui.internal.util.ui.DoubleFieldWithDropDown

All Implemented Interfaces:
  EventListener, ModifyListener, SelectionListener, Drawable, SWTEventListener

    public class DoubleFieldWithDropDown
    extends Composite
    implements ModifyListener, SelectionListener

A Combo control allowing only non-negative decimal input. Writes its state to a IPrintPreferences object passed in the constructor.

### Field Summary

Fields
`static String` `decimalNumberFormat`

### Fields inherited from class org.eclipse.swt.widgets.Composite

`embeddedHandle`

### Fields inherited from class org.eclipse.swt.widgets.Widget

`handle`

### Constructor Summary

Constructors
Constructor and Description
`DoubleFieldWithDropDown(Composite parent, int style, IPrintPreferences prefs, int index, double[] defaults)` Creates a new DoubleFieldWithDropDown.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addModifyListener(ModifyListener listener)`
`Object` `getText()`
`void` `modifyText(ModifyEvent e)`
`void` `setEnabled(boolean en)`
`void` `updateControl()` Updates control according to value in the IPrintPreferences.
`void` `widgetDefaultSelected(SelectionEvent e)`
`void` `widgetSelected(SelectionEvent e)`

### Methods inherited from class org.eclipse.swt.widgets.Composite

`changed, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

### Methods inherited from class org.eclipse.swt.widgets.Scrollable

`computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar`

### Methods inherited from class org.eclipse.swt.widgets.Control

`addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update`

### Methods inherited from class org.eclipse.swt.widgets.Widget

`addDisposeListener, addListener, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, reskin, setData, setData, toString`

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

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

### Methods inherited from interface org.eclipse.swt.events.SelectionListener

`widgetDefaultSelectedAdapter, widgetSelectedAdapter`

### Methods inherited from interface org.eclipse.swt.graphics.Drawable

`isAutoScalable`

### Field Detail

#### decimalNumberFormat

    public static final String decimalNumberFormat

See Also:
  Constant Field Values

### Constructor Detail

#### DoubleFieldWithDropDown

    public DoubleFieldWithDropDown(Composite parent,
                                   int style,
                                   IPrintPreferences prefs,
                                   int index,
                                   double[] defaults)

Creates a new DoubleFieldWithDropDown.

### Method Detail

#### setEnabled

    public void setEnabled(boolean en)

Overrides:
  `setEnabled` in class `Control`

#### updateControl

    public void updateControl()

Updates control according to value in the IPrintPreferences. If it is the first update with an empty textfield, the preference value is set. If it is not the first time an empty text field occurs, nothing happens avoiding the confusing behaviour of updating to 0.00 when the user deletes all characters for preparing new input.

#### getText

    public Object getText()

#### addModifyListener

    public void addModifyListener(ModifyListener listener)

#### modifyText

    public void modifyText(ModifyEvent e)

Specified by:
  `modifyText` in interface `ModifyListener`

#### widgetSelected

    public void widgetSelected(SelectionEvent e)

Specified by:
  `widgetSelected` in interface `SelectionListener`

#### widgetDefaultSelected

    public void widgetDefaultSelected(SelectionEvent e)

Specified by:
  `widgetDefaultSelected` in interface `SelectionListener`