|
||||||||||
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.SWTDayChooser
public class CalendarControl.SWTDayChooser
The Class SWTDayChooser.
Nested Class Summary | |
---|---|
class |
CalendarControl.SWTDayChooser.DayControl
The Class DayControl. |
class |
CalendarControl.SWTDayChooser.DayLabel
The Class DayLabel. |
Field Summary | |
---|---|
private org.eclipse.swt.graphics.Color |
activeSelectionBackground
The active selection background. |
private org.eclipse.swt.graphics.Color |
activeSelectionForeground
The active selection foreground. |
private Calendar |
calendar
The calendar. |
private int |
dayOffset
The day offset. |
private CalendarControl.SWTDayChooser.DayControl[] |
days
The days. |
private org.eclipse.swt.widgets.Label[] |
dayTitles
The day titles. |
private org.eclipse.swt.graphics.Color |
inactiveSelectionBackground
The inactive selection background. |
private org.eclipse.swt.graphics.Color |
inactiveSelectionForeground
The inactive selection foreground. |
private List<CalendarControl.SWTCalendarListener> |
listeners
The listeners. |
private Locale |
locale
The locale. |
private org.eclipse.swt.graphics.Color |
otherMonthColor
The other month color. |
static int |
RED_SATURDAY
Style constant for making Saturdays red. |
static int |
RED_SUNDAY
Style constant for making Sundays red. |
static int |
RED_WEEKEND
Style constant for making weekends red. |
private int |
style
The style. |
private Calendar |
today
The today. |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
CalendarControl.SWTDayChooser(org.eclipse.swt.widgets.Composite parent,
int style)
Instantiates a new SWT day chooser. |
Method Summary | |
---|---|
void |
addRealMouseListener(org.eclipse.swt.events.MouseListener listener)
Adds the real mouse listener. |
void |
addSWTCalendarListener(CalendarControl.SWTCalendarListener listener)
Adds the SWT calendar listener. |
private void |
dateChanged()
Date changed. |
protected void |
drawDays()
Draw days. |
private int |
findDay(org.eclipse.swt.widgets.Widget dayControl)
Finds position of a control in days array. |
void |
focusGained(org.eclipse.swt.events.FocusEvent event)
|
void |
focusLost(org.eclipse.swt.events.FocusEvent event)
|
Calendar |
getCalendar()
Gets the calendar. |
private CalendarControl.SWTDayChooser.DayControl |
getSelectedDayControl()
Gets the selected day control. |
private org.eclipse.swt.graphics.Color |
getSelectionBackgroundColor()
Gets the selection background color. |
private org.eclipse.swt.graphics.Color |
getSelectionForegroundColor()
Gets the selection foreground color. |
protected void |
init()
Init. |
boolean |
isFocusControl()
|
private boolean |
isSameDay(Calendar cal1,
Calendar cal2)
Checks if is same day. |
private boolean |
isSameMonth(Calendar cal1,
Calendar cal2)
Checks if is same month. |
void |
keyPressed(org.eclipse.swt.events.KeyEvent event)
|
void |
keyReleased(org.eclipse.swt.events.KeyEvent event)
|
void |
keyTraversed(org.eclipse.swt.events.TraverseEvent event)
|
void |
mouseDoubleClick(org.eclipse.swt.events.MouseEvent event)
|
void |
mouseDown(org.eclipse.swt.events.MouseEvent event)
|
void |
mouseUp(org.eclipse.swt.events.MouseEvent event)
|
void |
removeRealMouseListener(org.eclipse.swt.events.MouseListener listener)
Removes the real mouse listener. |
void |
removeSWTCalendarListener(CalendarControl.SWTCalendarListener listener)
Removes the SWT calendar listener. |
private void |
selectDay(int day)
Select day. |
void |
setCalendar(Calendar cal)
Sets the calendar. |
void |
setFont(org.eclipse.swt.graphics.Font font)
|
void |
setLocale(Locale locale)
Sets the locale. |
void |
setMonth(int month)
Sets the month. |
void |
setYear(int year)
Sets the year. |
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, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, 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 |
---|
public static final int RED_SUNDAY
public static final int RED_SATURDAY
public static final int RED_WEEKEND
private org.eclipse.swt.widgets.Label[] dayTitles
private CalendarControl.SWTDayChooser.DayControl[] days
private int dayOffset
private org.eclipse.swt.graphics.Color activeSelectionBackground
private org.eclipse.swt.graphics.Color inactiveSelectionBackground
private org.eclipse.swt.graphics.Color activeSelectionForeground
private org.eclipse.swt.graphics.Color inactiveSelectionForeground
private org.eclipse.swt.graphics.Color otherMonthColor
private Calendar calendar
private Calendar today
private Locale locale
private List<CalendarControl.SWTCalendarListener> listeners
private int style
Constructor Detail |
---|
public CalendarControl.SWTDayChooser(org.eclipse.swt.widgets.Composite parent, int style)
parent
- the parentstyle
- the styleMethod Detail |
---|
protected void init()
protected void drawDays()
private boolean isSameDay(Calendar cal1, Calendar cal2)
cal1
- the cal1cal2
- the cal2
private boolean isSameMonth(Calendar cal1, Calendar cal2)
cal1
- the cal1cal2
- the cal2
public void setMonth(int month)
month
- the new monthpublic void setYear(int year)
year
- the new yearpublic void setCalendar(Calendar cal)
cal
- the new calendarpublic void mouseDown(org.eclipse.swt.events.MouseEvent event)
mouseDown
in interface org.eclipse.swt.events.MouseListener
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent event)
mouseDoubleClick
in interface org.eclipse.swt.events.MouseListener
public void mouseUp(org.eclipse.swt.events.MouseEvent event)
mouseUp
in interface org.eclipse.swt.events.MouseListener
public void focusGained(org.eclipse.swt.events.FocusEvent event)
focusGained
in interface org.eclipse.swt.events.FocusListener
public void focusLost(org.eclipse.swt.events.FocusEvent event)
focusLost
in interface org.eclipse.swt.events.FocusListener
public void keyTraversed(org.eclipse.swt.events.TraverseEvent event)
keyTraversed
in interface org.eclipse.swt.events.TraverseListener
public void keyPressed(org.eclipse.swt.events.KeyEvent event)
keyPressed
in interface org.eclipse.swt.events.KeyListener
public void keyReleased(org.eclipse.swt.events.KeyEvent event)
keyReleased
in interface org.eclipse.swt.events.KeyListener
private int findDay(org.eclipse.swt.widgets.Widget dayControl)
days
array.
dayControl
- a control to find.
dayControl
in days
array, or -1 if not found.private void selectDay(int day)
day
- the dayprivate CalendarControl.SWTDayChooser.DayControl getSelectedDayControl()
private org.eclipse.swt.graphics.Color getSelectionBackgroundColor()
private org.eclipse.swt.graphics.Color getSelectionForegroundColor()
public boolean isFocusControl()
isFocusControl
in class org.eclipse.swt.widgets.Control
public void addSWTCalendarListener(CalendarControl.SWTCalendarListener listener)
listener
- the listenerpublic void removeSWTCalendarListener(CalendarControl.SWTCalendarListener listener)
listener
- the listenerprivate void dateChanged()
public Calendar getCalendar()
public void setLocale(Locale locale)
locale
- the new localepublic void setFont(org.eclipse.swt.graphics.Font font)
setFont
in class org.eclipse.swt.widgets.Control
public void addRealMouseListener(org.eclipse.swt.events.MouseListener listener)
listener
- the listenerpublic void removeRealMouseListener(org.eclipse.swt.events.MouseListener listener)
listener
- the listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |