speedscheduler
Class HourSpanComposite

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 speedscheduler.HourSpanComposite
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

 class HourSpanComposite
extends org.eclipse.swt.widgets.Composite

A widget for choosing a span of time during a single day.


Field Summary
private static Time DEFAULT_END_TIME
           
private static Time DEFAULT_START_TIME
           
private  Time endTime
           
private  org.eclipse.swt.widgets.Label messageLabel
           
private  org.eclipse.swt.graphics.Color red
           
private  Time startTime
           
private static java.lang.String WARNING_START_AFTER_END
           
private static java.lang.String WARNING_ZERO_MINUTE_SPAN
          Minutes in this interval are selectable.
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
HourSpanComposite(org.eclipse.swt.widgets.Composite parent)
          Create a new HourSpanComposite and place it in the specified parent Composite.
HourSpanComposite(org.eclipse.swt.widgets.Composite parent, Time defaultStartTime, Time defaultEndTime)
          Creates a new HourSpanComposite given a parent and default selected start and end times.
 
Method Summary
 boolean checkTimes()
          Returns true if times are sane, and posts messages to the widget if not.
 Time getEndTime()
          Gets the end time chosen by the user.
 Time getStartTime()
          Gets the start time chosen by the user.
private  void setMessageText(java.lang.String msg)
          A message area is displayed on the widget for informing the user about bone-headed actions they may take.
 
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, getCursor, 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, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, 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

startTime

private Time startTime

endTime

private Time endTime

WARNING_ZERO_MINUTE_SPAN

private static final java.lang.String WARNING_ZERO_MINUTE_SPAN
Minutes in this interval are selectable.

See Also:
Constant Field Values

WARNING_START_AFTER_END

private static final java.lang.String WARNING_START_AFTER_END
See Also:
Constant Field Values

DEFAULT_START_TIME

private static final Time DEFAULT_START_TIME

DEFAULT_END_TIME

private static final Time DEFAULT_END_TIME

messageLabel

private org.eclipse.swt.widgets.Label messageLabel

red

private org.eclipse.swt.graphics.Color red
Constructor Detail

HourSpanComposite

public HourSpanComposite(org.eclipse.swt.widgets.Composite parent)
Create a new HourSpanComposite and place it in the specified parent Composite.

Parameters:
parent - The parent composite to embed this widget in.

HourSpanComposite

public HourSpanComposite(org.eclipse.swt.widgets.Composite parent,
                         Time defaultStartTime,
                         Time defaultEndTime)
Creates a new HourSpanComposite given a parent and default selected start and end times.

Parameters:
parent - The parent Composite in which to place this widget.
defaultStartTime - The start time to be selected when the widget is drawn.
defaultEndTime - The end time to be selected when the widget is drawn.
Method Detail

setMessageText

private void setMessageText(java.lang.String msg)
A message area is displayed on the widget for informing the user about bone-headed actions they may take.

Parameters:
msg - The message to post to the form.

checkTimes

public boolean checkTimes()
Returns true if times are sane, and posts messages to the widget if not.

Returns:
True if times chosen are sane, false if not.

getStartTime

public Time getStartTime()
Gets the start time chosen by the user.

Returns:
The start time chosen by the user.

getEndTime

public Time getEndTime()
Gets the end time chosen by the user.

Returns:
The end time chosen by the user.