Package gda.rcp.views

Class InputTextComposite

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
gda.rcp.views.InputTextComposite
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class InputTextComposite extends org.eclipse.swt.widgets.Composite
A class which provides a GUI composite to allow easy control of a scannable.

It provides the current position which can be edited and set to new value.

The format of the displayed number will be specified by the scannable output format.

  • Field Summary

    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
    InputTextComposite(org.eclipse.swt.widgets.Composite parent, int style)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the control disabled (grayed)
    void
    Sets the control enabled
     
     
     
    int
     
     
     
    boolean
     
    boolean
     
    void
    Clears the limits set on the NudgePositionerComposite does not affect the underlying scannable limits.
    void
    setDisplayName(String displayName)
    Sets a different name to be used in the GUI instead of the default which is the scannable name
    void
    setEnabled(boolean enabled)
     
    void
    Sets the description label for the composite to a bold font
    void
    setLimits(double lowerLimit, double upperLimit)
    Sets the limits which will be used to check if a new position is valid.
    void
    setLowerLimit(Double lowerLimit2)
     
    void
    setReadOnly(boolean readOnly)
     
    void
    This sets the scannable which will be controlled and will automatically configure the control.
    void
    setTextInput(boolean textInput)
     
    void
    setTextWidth(int textWidth)
     
    void
    setUpperLimit(Double upperlimit2)
     
    void
    setUserUnit(String userUnit)
     

    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, toString

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • InputTextComposite

      public InputTextComposite(org.eclipse.swt.widgets.Composite parent, int style)
      Constructor
      Parameters:
      parent - The parent composite
      style - SWT style parameter (Typically SWT.NONE)
  • Method Details

    • setLimits

      public void setLimits(double lowerLimit, double upperLimit)
      Sets the limits which will be used to check if a new position is valid.
      Parameters:
      lowerLimit - the desired lower limit
      upperLimit - the desired upper limit
      Throws:
      IllegalArgumentException - if the lowerLimit > upperLimit
    • getLowerLimit

      public Double getLowerLimit()
    • getUpperLimit

      public Double getUpperLimit()
    • removeLimits

      public void removeLimits()
      Clears the limits set on the NudgePositionerComposite does not affect the underlying scannable limits.
    • getDisplayName

      public String getDisplayName()
    • setDisplayName

      public void setDisplayName(String displayName)
      Sets a different name to be used in the GUI instead of the default which is the scannable name

      After calling this method the control will be automatically redrawn.

      Parameters:
      displayName - The name to be used in the GUI
    • setEnabled

      public void setEnabled(boolean enabled)
      Overrides:
      setEnabled in class org.eclipse.swt.widgets.Control
    • enable

      public void enable()
      Sets the control enabled

      Equivalent to setEnabled(true)

      See Also:
    • disable

      public void disable()
      Sets the control disabled (grayed)

      Equivalent to setEnabled(false)

      See Also:
    • getScannable

      public Scannable getScannable()
    • setScannable

      public void setScannable(Scannable scannable)
      This sets the scannable which will be controlled and will automatically configure the control.

      This can also be called to change the scannable controlled at any time which will reconfigure the control.

      Parameters:
      scannable - The scannable to control
    • isTextInput

      public boolean isTextInput()
    • setTextInput

      public void setTextInput(boolean textInput)
    • getUserUnit

      public String getUserUnit()
    • setUserUnit

      public void setUserUnit(String userUnit)
    • getTextWidth

      public int getTextWidth()
    • setTextWidth

      public void setTextWidth(int textWidth)
    • isReadOnly

      public boolean isReadOnly()
    • setReadOnly

      public void setReadOnly(boolean readOnly)
    • setLowerLimit

      public void setLowerLimit(Double lowerLimit2)
    • setUpperLimit

      public void setUpperLimit(Double upperlimit2)
    • setLabelToBold

      public void setLabelToBold()
      Sets the description label for the composite to a bold font