Class DoubleFieldWithDropDown

  • All Implemented Interfaces:
    java.util.EventListener, org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener

    public class DoubleFieldWithDropDown
    extends org.eclipse.swt.widgets.Composite
    implements org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.SelectionListener
    A Combo control allowing only non-negative decimal input. Writes its state to a IPrintPreferences object passed in the constructor.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.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 Description
      DoubleFieldWithDropDown​(org.eclipse.swt.widgets.Composite parent, int style, IPrintPreferences prefs, int index, double[] defaults)
      Creates a new DoubleFieldWithDropDown.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addModifyListener​(org.eclipse.swt.events.ModifyListener listener)  
      java.lang.Object getText()  
      void modifyText​(org.eclipse.swt.events.ModifyEvent e)  
      void setEnabled​(boolean en)  
      void updateControl()
      Updates control according to value in the IPrintPreferences.
      void widgetDefaultSelected​(org.eclipse.swt.events.SelectionEvent e)  
      void widgetSelected​(org.eclipse.swt.events.SelectionEvent e)  
      • Methods inherited from class org.eclipse.swt.widgets.Composite

        changed, checkSubclass, 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, isAutoScalable, 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, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • decimalNumberFormat

        public static final java.lang.String decimalNumberFormat
        See Also:
        Constant Field Values
    • Constructor Detail

      • DoubleFieldWithDropDown

        public DoubleFieldWithDropDown​(org.eclipse.swt.widgets.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 org.eclipse.swt.widgets.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 java.lang.Object getText()
      • addModifyListener

        public void addModifyListener​(org.eclipse.swt.events.ModifyListener listener)
      • modifyText

        public void modifyText​(org.eclipse.swt.events.ModifyEvent e)
        Specified by:
        modifyText in interface org.eclipse.swt.events.ModifyListener
      • widgetSelected

        public void widgetSelected​(org.eclipse.swt.events.SelectionEvent e)
        Specified by:
        widgetSelected in interface org.eclipse.swt.events.SelectionListener
      • widgetDefaultSelected

        public void widgetDefaultSelected​(org.eclipse.swt.events.SelectionEvent e)
        Specified by:
        widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener