Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.unibe.iam.scg.archie.ui.widgets
Class TextWidget

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by ch.unibe.iam.scg.archie.ui.widgets.AbstractWidget
                      extended by ch.unibe.iam.scg.archie.ui.widgets.TextWidget
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
DateWidget, NumericWidget

public class TextWidget
extends AbstractWidget

Serves as a base for implementing field composites with a text control. They have an inner SmartField. The smartField is an inner class, which is able to validate itself, decorate itself, provide content assistance and a quick-fix.

$Id$


Nested Class Summary
protected  class TextWidget.SmartField
          A SmartField has a control (e.g. a text field) a decoration and optional a quick-fix menu.
 
Field Summary
protected  org.eclipse.jface.fieldassist.ControlDecoration controlDecoration
           
protected static int DECORATION_HORIZONTAL_MARGIN
           
protected  TextWidget.SmartField smartField
           
 
Fields inherited from class ch.unibe.iam.scg.archie.ui.widgets.AbstractWidget
control, label, layout, regexValidation, STD_COLUMN_HORIZONTAL_SPACING
 
Fields inherited from class org.eclipse.swt.widgets.Control
view
 
Constructor Summary
TextWidget(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String labelText, RegexValidation regex)
           
 
Method Summary
 void addListener(int eventType, org.eclipse.swt.widgets.Listener listener)
           
protected  void createSmartField()
          Default implementation, subclasses may override.
 java.lang.Object getValue()
          Returns a widget's value.
protected  void handleModify(TextWidget.SmartField smartField)
          Every time the field gets modified this gets run.
protected  void hideError(TextWidget.SmartField smartField)
           
protected  void hideQuickfix(TextWidget.SmartField smartField)
           
protected  void hideValid(TextWidget.SmartField smartField)
           
protected  void hideWarning(TextWidget.SmartField smartField)
           
 boolean isValid()
          Returns true if the value in a widget's control field is valid.
 void setDescription(java.lang.String description)
          Describes this FieldComposites (e.g. for a ToolTip)
 void setValue(java.lang.Object value)
          Sets the text (contents) of the containing smart field.
protected  void showError(TextWidget.SmartField smartField)
           
protected  void showQuickfix(TextWidget.SmartField smartField)
           
protected  void showValid(TextWidget.SmartField smartField)
           
protected  void showWarning(TextWidget.SmartField smartField)
           
 
Methods inherited from class ch.unibe.iam.scg.archie.ui.widgets.AbstractWidget
createLayout, getLabel, hasRegexValidation, setEnabled
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, 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, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, 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

DECORATION_HORIZONTAL_MARGIN

protected static final int DECORATION_HORIZONTAL_MARGIN
See Also:
Constant Field Values

controlDecoration

protected org.eclipse.jface.fieldassist.ControlDecoration controlDecoration

smartField

protected TextWidget.SmartField smartField
Constructor Detail

TextWidget

public TextWidget(org.eclipse.swt.widgets.Composite parent,
                  int style,
                  java.lang.String labelText,
                  RegexValidation regex)
Parameters:
parent - Composite
style - Integer
labelText - String
regex - String Optional RegexValidation, can be null if not desired.
Method Detail

createSmartField

protected void createSmartField()
Default implementation, subclasses may override.


getValue

public java.lang.Object getValue()
Description copied from class: AbstractWidget
Returns a widget's value. This is usually the contents of the control field in a widget. Depending on the widget type, different types of values are returned (e.g. checkbox true, combo string etc.).

Specified by:
getValue in class AbstractWidget
Returns:
String Contents of the AbstractSmartField

setValue

public void setValue(java.lang.Object value)
Sets the text (contents) of the containing smart field.

Specified by:
setValue in class AbstractWidget
Parameters:
value -

isValid

public boolean isValid()
Description copied from class: AbstractWidget
Returns true if the value in a widget's control field is valid.

Specified by:
isValid in class AbstractWidget
Returns:
true if the contents of this objects smartField are valid, false else.

addListener

public void addListener(int eventType,
                        org.eclipse.swt.widgets.Listener listener)
Overrides:
addListener in class org.eclipse.swt.widgets.Widget
See Also:
Widget.addListener(int, org.eclipse.swt.widgets.Listener)

handleModify

protected void handleModify(TextWidget.SmartField smartField)
Every time the field gets modified this gets run. Checks in what state the field is an decorates accordingly.

Parameters:
smartField -

showError

protected void showError(TextWidget.SmartField smartField)
Parameters:
smartField -

hideError

protected void hideError(TextWidget.SmartField smartField)
Parameters:
smartField -

showQuickfix

protected void showQuickfix(TextWidget.SmartField smartField)
Parameters:
smartField -

hideQuickfix

protected void hideQuickfix(TextWidget.SmartField smartField)
Parameters:
smartField -

showWarning

protected void showWarning(TextWidget.SmartField smartField)
Parameters:
smartField -

hideWarning

protected void hideWarning(TextWidget.SmartField smartField)
Parameters:
smartField -

showValid

protected void showValid(TextWidget.SmartField smartField)
Parameters:
smartField -

hideValid

protected void hideValid(TextWidget.SmartField smartField)
Parameters:
smartField -

setDescription

public void setDescription(java.lang.String description)
Description copied from class: AbstractWidget
Describes this FieldComposites (e.g. for a ToolTip)

Specified by:
setDescription in class AbstractWidget
See Also:
AbstractWidget.setDescription(java.lang.String)

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013