net.sf.ecl.datepicker
Class TimeZonePicker

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 net.sf.ecl.datepicker.TimeZonePicker
All Implemented Interfaces:
Drawable

public final class TimeZonePicker
extends Composite

is a drop-down combo for TimeZone selection. The drop-down list in prefilled with all timezones known by the JVM.

Author:
Alexey Afanasyev, Alexey Kharlamov

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
TimeZonePicker(Composite parent, int style)
          creates instance of TimeZonePicker.
 
Method Summary
 void addSelectionListener(SelectionListener listener)
          adds a selection listener to the control.
 Point computeSize(int wHint, int hHint, boolean changed)
           
 TimeZone getSelection()
          return selected TimeZone.
 void layout(boolean changed)
           
 void removeSelectionListener(SelectionListener listener)
          removes the given selection listener.
 void setSelection(String timeZoneId)
          makes the given TimeZone selected in the control.
 void setSelection(TimeZone timeZone)
          makes the given TimeZone selected in the control.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, 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, 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
 

Constructor Detail

TimeZonePicker

public TimeZonePicker(Composite parent,
                      int style)
creates instance of TimeZonePicker.

Parameters:
parent - the parent composite.
style - the control's style.
Method Detail

addSelectionListener

public void addSelectionListener(SelectionListener listener)
adds a selection listener to the control.

Parameters:
listener - the listener.

computeSize

public Point computeSize(int wHint,
                         int hHint,
                         boolean changed)
Overrides:
computeSize in class Composite

getSelection

public TimeZone getSelection()
return selected TimeZone.

Returns:
the selected TimeZone.

layout

public void layout(boolean changed)
Overrides:
layout in class Composite

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
removes the given selection listener.

Parameters:
listener - the listener.

setSelection

public void setSelection(String timeZoneId)
makes the given TimeZone selected in the control.

Parameters:
timeZoneId - the identfier of the TimeZone.

setSelection

public void setSelection(TimeZone timeZone)
makes the given TimeZone selected in the control.

Parameters:
timeZone - the TimeZone.