|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
semorg.gui.util.TimeControl
public class TimeControl
The Class TimeControl provides widgets to enter times.
Nested Class Summary | |
---|---|
static interface |
TimeControl.TimeChangeListener
The listener interface for receiving timeChange events. |
Field Summary | |
---|---|
private boolean |
activated
Indicates if the composite is activated or not. |
private org.eclipse.swt.widgets.Text |
backgroundHack
The background text field. |
private org.eclipse.swt.widgets.Button |
checker
The button to enable the control. |
private org.eclipse.swt.graphics.Font |
defaultFont
The default font. |
private boolean |
enabled
If true the control is enabled, false otherwise. |
private org.eclipse.swt.widgets.Label |
floatingPoint
The colon between the hours and minutes. |
private org.eclipse.swt.widgets.Spinner |
hours
The hours spinner. |
private Set<TimeControl.TimeChangeListener> |
listeners
The listeners which react on changes of the time. |
private org.eclipse.swt.widgets.Spinner |
minutes
The minutes spinner. |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
TimeControl(org.eclipse.swt.widgets.Composite par)
Instantiates a new time control. |
Method Summary | |
---|---|
void |
addTimeChangeListener(TimeControl.TimeChangeListener listener)
Adds the time change listener. |
private void |
fireInputChanged()
Fires all TimeControl.TimeChangeListener listener in the vector
listeners . |
int |
getHours()
Returns the hours of the hours control. |
int |
getMinutes()
Returns the minutes of the minutes control. |
Time |
getTime()
If acivated is true this method returns the time entered in the hours and minutes controls. |
void |
removeTimeChangeListener(TimeControl.TimeChangeListener listener)
Removes the time change listener. |
protected void |
setActivated(boolean activ)
Activates / deactivates the controls of this composite depending on the given parameter. |
void |
setData(String key,
String value)
Sets a pair of key and value to this control needed for testing with ATOSj. |
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is true, and disables it otherwise. |
void |
setTime(Time time)
Sets time the given time to hours and minutes controls. |
void |
setToolTipText(String toolTipText)
Sets the tooltip text of the composite to the tooltips of the checker , the floatingPoint , the hours and
the minutes components, such that it appears if the user moves
the mouse pointer of one of the visible components of the control. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final org.eclipse.swt.widgets.Spinner hours
private final org.eclipse.swt.widgets.Spinner minutes
private final org.eclipse.swt.widgets.Button checker
private final org.eclipse.swt.widgets.Label floatingPoint
private org.eclipse.swt.widgets.Text backgroundHack
private final org.eclipse.swt.graphics.Font defaultFont
private boolean activated
private boolean enabled
private Set<TimeControl.TimeChangeListener> listeners
Constructor Detail |
---|
public TimeControl(org.eclipse.swt.widgets.Composite par)
par
- the parent compositeMethod Detail |
---|
public int getHours()
hours
control.
public int getMinutes()
minutes
control.
public Time getTime()
hours
and minutes
controls.
private void fireInputChanged()
TimeControl.TimeChangeListener
listener in the vector
listeners
.
public void addTimeChangeListener(TimeControl.TimeChangeListener listener)
listener
- the listener to addpublic void removeTimeChangeListener(TimeControl.TimeChangeListener listener)
listener
- the listener to removepublic void setTime(Time time)
hours
and minutes
controls.
If the given time is null the controls get deactivated.
time
- the new timeprotected void setActivated(boolean activ)
activ
- the new activated statepublic void setEnabled(boolean enabled)
setEnabled
in class org.eclipse.swt.widgets.Control
enabled
- the new enabled state.public void setData(String key, String value)
key
- the key (type) of the value setvalue
- the value set to the controlpublic void setToolTipText(String toolTipText)
checker
, the floatingPoint
, the hours
and
the minutes
components, such that it appears if the user moves
the mouse pointer of one of the visible components of the control.
setToolTipText
in class org.eclipse.swt.widgets.Control
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |