|
||||||||||
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.CalendarControl
public class CalendarControl
This class provides a CalendarControl which enables the user to select a date in very comfortable manner.
Nested Class Summary | |
---|---|
private class |
CalendarControl.SWTCalendar
This class provides the calendar of the control. |
class |
CalendarControl.SWTCalendarEvent
The Class SWTCalendarEvent. |
static interface |
CalendarControl.SWTCalendarListener
The listener interface for receiving SWTCalendar events. |
private class |
CalendarControl.SWTCalendarPopup
The Class SWTCalendarPopup. |
static interface |
CalendarControl.SWTCalendarPopupListener
The listener interface for receiving SWTCalendarPopup events. |
class |
CalendarControl.SWTDayChooser
The Class SWTDayChooser. |
private class |
CalendarControl.SWTMonthChooser
The Class SWTMonthChooser. |
Field Summary | |
---|---|
private boolean |
activated
true if the popup window is open, false otherwise. |
private org.eclipse.swt.widgets.Text |
backgroundHack
The background hack. |
private org.eclipse.swt.widgets.Button |
checker
The button to activate the control. |
private Date |
date
The date displayed in the control. |
private List<CalendarControl.SWTCalendarListener> |
dateChangeListeners
The date change listeners. |
private org.eclipse.swt.widgets.Button |
openPopupButton
The button to open th popup. |
private org.eclipse.swt.widgets.Composite |
parent
The parent composite. |
private CalendarControl.SWTCalendarPopup |
popup
The popup. |
private List<CalendarControl.SWTCalendarPopupListener> |
popupListeners
The popup listeners. |
private org.eclipse.swt.widgets.Text |
t
The text field to display the date. |
private int |
titleBarHeight
The title bar height. |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
CalendarControl(org.eclipse.swt.widgets.Composite par,
int tbh)
Instantiates a new calendar control. |
Method Summary | |
---|---|
void |
addSWTCalendarlistener(CalendarControl.SWTCalendarListener listener)
Adds the given SWT calendar listener from the dateChangeListeners vector. |
void |
addSWTCalendarPopuplistener(CalendarControl.SWTCalendarPopupListener listener)
Adds the given SWT calendar popup listener to popupListeners . |
void |
closePopup()
Closes popup window. |
private void |
fireSWTCalendarDateChanged()
Fires all CalendarControl.SWTCalendarListener instances in the
dateChangeListeners Vector. |
private void |
fireSWTCalendarPopupClosed()
Fires all CalendarControl.SWTCalendarListener in the vector
popupListeners . |
private void |
fireSWTCalendarPopupOpened()
Fires all CalendarControl.SWTCalendarListener instances in the vector
popupListeners . |
Date |
getDate()
Returns the date. |
org.eclipse.swt.widgets.Button |
getOpenPopupButton()
Return button to open the popup. |
boolean |
isPopupOpen()
Checks if the popup window is open. |
private void |
onOpen()
This method is invoked on clicking the openPopupButton . |
void |
removeSWTCalendarlistener(CalendarControl.SWTCalendarListener listener)
Removes the given SWT calendar listener from the dateChangeListeners vector. |
void |
removeSWTCalendarPopuplistener(CalendarControl.SWTCalendarPopupListener listener)
Removes the given SWT calendar popup listener from popupListeners . |
void |
setActivated(boolean activ)
Sets activated to the give value, i.e. activates / deactivates
the calendar control. |
void |
setDate(Date d)
Sets the date displayed in the text field to the given value.. |
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is true , and
disables it otherwise. |
void |
setFont(org.eclipse.swt.graphics.Font font)
Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null. |
void |
setToolTipText(String toolTipText)
Sets the tooltip the CalendarControl to the given string. |
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, 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.Composite parent
private final org.eclipse.swt.widgets.Text t
private final org.eclipse.swt.widgets.Button openPopupButton
private final org.eclipse.swt.widgets.Button checker
private Date date
private int titleBarHeight
private org.eclipse.swt.widgets.Text backgroundHack
private boolean activated
private List<CalendarControl.SWTCalendarListener> dateChangeListeners
private List<CalendarControl.SWTCalendarPopupListener> popupListeners
private CalendarControl.SWTCalendarPopup popup
Constructor Detail |
---|
public CalendarControl(org.eclipse.swt.widgets.Composite par, int tbh)
par
- the parent compositetbh
- the tbhMethod Detail |
---|
private void onOpen()
openPopupButton
. It
activates the calendar control, i.e. it opens the popup.
private void fireSWTCalendarPopupClosed()
CalendarControl.SWTCalendarListener
in the vector
popupListeners
.
private void fireSWTCalendarPopupOpened()
CalendarControl.SWTCalendarListener
instances in the vector
popupListeners
.
public void setActivated(boolean activ)
activated
to the give value, i.e. activates / deactivates
the calendar control. If deactivated the controls appears "grayed".
activ
- the new activated state.public Date getDate()
activated
is true, null
otherwise.public void setFont(org.eclipse.swt.graphics.Font font)
setFont
in class org.eclipse.swt.widgets.Control
font
- the new font (or null)Control.setFont(org.eclipse.swt.graphics.Font)
public void setDate(Date d)
d
- the new date to display.public void addSWTCalendarPopuplistener(CalendarControl.SWTCalendarPopupListener listener)
popupListeners
.
listener
- the listener to add.public void removeSWTCalendarPopuplistener(CalendarControl.SWTCalendarPopupListener listener)
popupListeners
.
listener
- the listener to remove.public void addSWTCalendarlistener(CalendarControl.SWTCalendarListener listener)
dateChangeListeners
vector.
listener
- the listenerpublic void removeSWTCalendarlistener(CalendarControl.SWTCalendarListener listener)
dateChangeListeners
vector.
listener
- the listener to remove.private void fireSWTCalendarDateChanged()
CalendarControl.SWTCalendarListener
instances in the
dateChangeListeners
Vector.
public void setEnabled(boolean enabled)
true
, and
disables it otherwise.
setEnabled
in class org.eclipse.swt.widgets.Control
public org.eclipse.swt.widgets.Button getOpenPopupButton()
Button
instance to open the popup.public boolean isPopupOpen()
public void closePopup()
public void setToolTipText(String toolTipText)
CalendarControl
to the given string.
setToolTipText
in class org.eclipse.swt.widgets.Control
toolTipText
- the new tooltip text.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |