public class DateChooserTheme
extends java.lang.Object
DateChooser
widgets. Defines the GUI settings
(colors, font...) applied to the different elements of the calendar.
Some default themes are provided as constants of this class. The GRAY theme
is defined as the default for all new calendars. This can be changed with
the setDefaultTheme()
method.
To define a new theme, instantiate a new DateChooserTheme
. It
takes by default the same settings as the GRAY theme. Each setting can then
be changed by the corresponding setter. For colors, setters exist under 2
forms:
Color
parameterint
parameter, corresponding to the SWT
colors codeModifier and Type | Field and Description |
---|---|
static DateChooserTheme |
BLUE
BLUE theme
|
(package private) org.eclipse.swt.graphics.Color |
borderBackground
Color for the border
|
(package private) int |
borderSize
Border size in pixels (default 0)
|
(package private) int |
cellPadding
Horizontal cell padding
|
static DateChooserTheme |
CLASSIC
CLASSIC theme
|
(package private) org.eclipse.swt.graphics.Color |
dayCellBackground
Color for day cells background
|
(package private) org.eclipse.swt.graphics.Color |
dayCellForeground
Color for worked days cells foreground
|
protected static DateChooserTheme |
defaultTheme
Default theme
|
(package private) org.eclipse.swt.graphics.Color |
extraMonthForeground
Color for adjacent days foreground
|
(package private) org.eclipse.swt.graphics.Color |
focusColor
Color for focus box
|
(package private) org.eclipse.swt.graphics.Font |
font
Font
|
static DateChooserTheme |
GRAY
GRAY theme.
|
(package private) org.eclipse.swt.graphics.Color |
gridHeaderBackground
Color for grid days headers background
|
(package private) org.eclipse.swt.graphics.Color |
gridHeaderForeground
Color for grid days headers foreground
|
(package private) org.eclipse.swt.graphics.Color |
gridLinesColor
Color for grid lines
|
(package private) int |
gridVisible
Flag to set grid visible or not
|
(package private) org.eclipse.swt.graphics.Color |
headerBackground
Color for month header background
|
(package private) org.eclipse.swt.graphics.Color |
headerForeground
Color for month header foreground
|
(package private) org.eclipse.swt.graphics.Color |
selectedBackground
Color for selected cell background
|
(package private) org.eclipse.swt.graphics.Color |
selectedForeground
Color for selected cell foreground
|
static DateChooserTheme |
SYSTEM
SYSTEM theme
|
(package private) org.eclipse.swt.graphics.Color |
todayBackground
Color for today cell background
|
(package private) org.eclipse.swt.graphics.Color |
todayForeground
Color for today cell foreground
|
(package private) org.eclipse.swt.graphics.Color |
weekendForeground
Color for week end foreground
|
static DateChooserTheme |
YELLOW
YELLOW theme
|
Constructor and Description |
---|
DateChooserTheme()
Constructs a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAllCustom()
Clear all custom colors/tooltips/state for all days
|
void |
clearCustomColors()
Clear all custom color for all days
|
void |
clearCustomStates()
Clear all custom enabled state for all days
|
void |
clearCustomTooltips()
Clear all custom tootlips for all days
|
java.lang.Object |
clone() |
org.eclipse.swt.graphics.Color |
getCustomColor(java.util.Date date)
Change the background color of a day
Use null to change the color of all days |
boolean |
getCustomState(java.util.Date date) |
java.lang.String |
getCustomTootlip(java.util.Date date)
Change the background color of a day
Use null to change the color of all days |
static DateChooserTheme |
getDefaultTheme()
Returns the default theme.
|
void |
setAdjascentForeground(int extraMonthForeground) |
void |
setBorderBackground(org.eclipse.swt.graphics.Color borderBackground) |
void |
setBorderSize(int borderSize) |
void |
setCellPadding(int cellPadding) |
void |
setCustom(java.util.Date date,
java.lang.String tootlip,
org.eclipse.swt.graphics.Color color,
boolean enabled) |
void |
setCustomColor(java.util.Date date,
org.eclipse.swt.graphics.Color color)
Change the background color of a day.
|
void |
setCustomState(java.util.Date date,
boolean enabled)
Change the enabled state of a day
A disabled day can not be selected Use null to change the enabled state of all days Warning this method will not redraw the control each time it is called, call it manually after |
void |
setCustomTooltip(java.util.Date date,
java.lang.String tootlip)
Change the background color of a day.
|
void |
setDayCellBackground(org.eclipse.swt.graphics.Color dayCellBackground) |
void |
setDayCellBackground(int dayCellBackground) |
void |
setDayCellForeground(org.eclipse.swt.graphics.Color dayCellForeground) |
void |
setDayCellForeground(int dayCellForeground) |
static void |
setDefaultTheme(DateChooserTheme defaultTheme)
Sets a new default theme for all new
DateChooser widgets. |
void |
setExtraMonthForeground(org.eclipse.swt.graphics.Color extraMonthForeground) |
void |
setFocusColor(org.eclipse.swt.graphics.Color focusColor) |
void |
setFocusColor(int focusColor) |
void |
setFont(org.eclipse.swt.graphics.Font font) |
void |
setGridHeaderBackground(org.eclipse.swt.graphics.Color gridHeaderBackground) |
void |
setGridHeaderBackground(int gridHeaderBackground) |
void |
setGridHeaderForeground(org.eclipse.swt.graphics.Color gridHeaderForeground) |
void |
setGridHeaderForeground(int gridHeaderForeground) |
void |
setGridLinesColor(org.eclipse.swt.graphics.Color gridLinesColor) |
void |
setGridLinesColor(int gridLinesColor) |
void |
setGridVisible(boolean gridVisible)
Deprecated.
|
void |
setGridVisible(int gridVisible) |
void |
setHeaderBack(org.eclipse.swt.graphics.Color headerBackground) |
void |
setHeaderBack(int headerBackground) |
void |
setHeaderForg(org.eclipse.swt.graphics.Color headerForeground) |
void |
setHeaderForg(int headerForeground) |
void |
setSelectedBackground(org.eclipse.swt.graphics.Color selectedBackground) |
void |
setSelectedBackground(int selectedBackground) |
void |
setSelectedForeground(org.eclipse.swt.graphics.Color selectedForeground) |
void |
setSelectedForeground(int selectedForeground) |
void |
setTodayBackground(org.eclipse.swt.graphics.Color todayBackground) |
void |
setTodayBackground(int todayBackground) |
void |
setTodayForeground(org.eclipse.swt.graphics.Color todayForeground) |
void |
setTodayForeground(int todayForeground) |
void |
setWeekendForeground(org.eclipse.swt.graphics.Color weekendForeground) |
void |
setWeekendForeground(int weekendForeground) |
public static final DateChooserTheme GRAY
public static final DateChooserTheme BLUE
public static final DateChooserTheme YELLOW
public static final DateChooserTheme CLASSIC
public static final DateChooserTheme SYSTEM
protected static DateChooserTheme defaultTheme
org.eclipse.swt.graphics.Color borderBackground
org.eclipse.swt.graphics.Color headerBackground
org.eclipse.swt.graphics.Color headerForeground
org.eclipse.swt.graphics.Color gridHeaderBackground
org.eclipse.swt.graphics.Color gridHeaderForeground
org.eclipse.swt.graphics.Color gridLinesColor
org.eclipse.swt.graphics.Color dayCellBackground
org.eclipse.swt.graphics.Color dayCellForeground
org.eclipse.swt.graphics.Color selectedBackground
org.eclipse.swt.graphics.Color selectedForeground
org.eclipse.swt.graphics.Color todayBackground
org.eclipse.swt.graphics.Color todayForeground
org.eclipse.swt.graphics.Color extraMonthForeground
org.eclipse.swt.graphics.Color weekendForeground
org.eclipse.swt.graphics.Color focusColor
int borderSize
int gridVisible
int cellPadding
org.eclipse.swt.graphics.Font font
public DateChooserTheme()
public static DateChooserTheme getDefaultTheme()
public static void setDefaultTheme(DateChooserTheme defaultTheme)
DateChooser
widgets.defaultTheme
- new default themepublic void setBorderBackground(org.eclipse.swt.graphics.Color borderBackground)
public void setBorderSize(int borderSize)
public void setDayCellBackground(org.eclipse.swt.graphics.Color dayCellBackground)
public void setDayCellBackground(int dayCellBackground)
public void setDayCellForeground(org.eclipse.swt.graphics.Color dayCellForeground)
public void setDayCellForeground(int dayCellForeground)
public void setGridHeaderBackground(org.eclipse.swt.graphics.Color gridHeaderBackground)
public void setGridHeaderBackground(int gridHeaderBackground)
public void setGridHeaderForeground(org.eclipse.swt.graphics.Color gridHeaderForeground)
public void setGridHeaderForeground(int gridHeaderForeground)
public void setGridLinesColor(org.eclipse.swt.graphics.Color gridLinesColor)
public void setGridLinesColor(int gridLinesColor)
public void setHeaderBack(org.eclipse.swt.graphics.Color headerBackground)
public void setHeaderBack(int headerBackground)
public void setHeaderForg(org.eclipse.swt.graphics.Color headerForeground)
public void setHeaderForg(int headerForeground)
public void setSelectedBackground(org.eclipse.swt.graphics.Color selectedBackground)
public void setSelectedBackground(int selectedBackground)
public void setSelectedForeground(org.eclipse.swt.graphics.Color selectedForeground)
public void setSelectedForeground(int selectedForeground)
public void setTodayBackground(org.eclipse.swt.graphics.Color todayBackground)
public void setTodayBackground(int todayBackground)
public void setTodayForeground(org.eclipse.swt.graphics.Color todayForeground)
public void setTodayForeground(int todayForeground)
public void setExtraMonthForeground(org.eclipse.swt.graphics.Color extraMonthForeground)
public void setAdjascentForeground(int extraMonthForeground)
public void setWeekendForeground(org.eclipse.swt.graphics.Color weekendForeground)
public void setWeekendForeground(int weekendForeground)
public void setFocusColor(org.eclipse.swt.graphics.Color focusColor)
public void setFocusColor(int focusColor)
@Deprecated public void setGridVisible(boolean gridVisible)
gridVisible
- true
to set grid visible, else false
public void setGridVisible(int gridVisible)
public void setCellPadding(int cellPadding)
public void setFont(org.eclipse.swt.graphics.Font font)
public void clearCustomColors()
public void clearCustomTooltips()
public void clearCustomStates()
public void clearAllCustom()
public boolean getCustomState(java.util.Date date)
date
- the date to ask the enabled statepublic void setCustomState(java.util.Date date, boolean enabled)
date
- the date to change the colorenabled
- the state to set on this datepublic org.eclipse.swt.graphics.Color getCustomColor(java.util.Date date)
date
- public void setCustomColor(java.util.Date date, org.eclipse.swt.graphics.Color color)
date
- the date to change the color, or null for all datescolor
- the color to set on this datepublic java.lang.String getCustomTootlip(java.util.Date date)
date
- public void setCustomTooltip(java.util.Date date, java.lang.String tootlip)
date
- the date to change the color, or null for all datestootlip
- the tooltip to set on this datepublic void setCustom(java.util.Date date, java.lang.String tootlip, org.eclipse.swt.graphics.Color color, boolean enabled)
public java.lang.Object clone()
clone
in class java.lang.Object