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
embeddedHandleFields inherited from class org.eclipse.swt.widgets.Widget
handle -
Constructor Summary
ConstructorsConstructorDescriptionInputTextComposite(org.eclipse.swt.widgets.Composite parent, int style) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Sets the control disabled (grayed)voidenable()Sets the control enabledintbooleanbooleanvoidClears the limits set on the NudgePositionerComposite does not affect the underlying scannable limits.voidsetDisplayName(String displayName) Sets a different name to be used in the GUI instead of the default which is the scannable namevoidsetEnabled(boolean enabled) voidSets the description label for the composite to a bold fontvoidsetLimits(double lowerLimit, double upperLimit) Sets the limits which will be used to check if a new position is valid.voidsetLowerLimit(Double lowerLimit2) voidsetReadOnly(boolean readOnly) voidsetScannable(Scannable scannable) This sets the scannable which will be controlled and will automatically configure the control.voidsetTextInput(boolean textInput) voidsetTextWidth(int textWidth) voidsetUpperLimit(Double upperlimit2) voidsetUserUnit(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, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods 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, updateMethods 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
-
Constructor Details
-
InputTextComposite
public InputTextComposite(org.eclipse.swt.widgets.Composite parent, int style) Constructor- Parameters:
parent- The parent compositestyle- 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 limitupperLimit- the desired upper limit- Throws:
IllegalArgumentException- if the lowerLimit > upperLimit
-
getLowerLimit
-
getUpperLimit
-
removeLimits
public void removeLimits()Clears the limits set on the NudgePositionerComposite does not affect the underlying scannable limits. -
getDisplayName
-
setDisplayName
Sets a different name to be used in the GUI instead of the default which is the scannable nameAfter 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:
setEnabledin classorg.eclipse.swt.widgets.Control
-
enable
public void enable()Sets the control enabledEquivalent to setEnabled(true)
- See Also:
-
disable
public void disable()Sets the control disabled (grayed)Equivalent to setEnabled(false)
- See Also:
-
getScannable
-
setScannable
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
-
setUserUnit
-
getTextWidth
public int getTextWidth() -
setTextWidth
public void setTextWidth(int textWidth) -
isReadOnly
public boolean isReadOnly() -
setReadOnly
public void setReadOnly(boolean readOnly) -
setLowerLimit
-
setUpperLimit
-
setLabelToBold
public void setLabelToBold()Sets the description label for the composite to a bold font
-