public class DatePicker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int | LONG
Constant for long style pattern.
|
static int | SHORT
Constant for short style pattern.
|
Constructor and Description |
---|
DatePicker(org.eclipse.swt.widgets.Shell parentShell, com.ibm.icu.util.ULocale locale)
Constructor.
|
DatePicker(org.eclipse.swt.widgets.Shell parentShell, com.ibm.icu.util.ULocale locale, java.util.Date start, java.util.Date end)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void | close()
This method closes this window, and disposes of the resources.
|
static int | convertHorizontalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics, int dlus)
This method returns the number of pixels corresponding to the given number of horizontal dialog units.
|
protected int | convertHorizontalDLUsToPixels(int dlus)
This method returns the number of pixels corresponding to the given number of horizontal dialog units.
|
static int | convertVerticalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics, int dlus)
This method returns the number of pixels corresponding to the given number of vertical dialog units.
|
protected int | convertVerticalDLUsToPixels(int dlus)
This method returns the number of pixels corresponding to the given number of vertical dialog units.
|
protected org.eclipse.swt.widgets.Control | createContentPane(org.eclipse.swt.widgets.Composite parent)
This method creates the day selection content pane.
|
protected org.eclipse.swt.widgets.Control | createFooterPane(org.eclipse.swt.widgets.Composite parent)
This method creates the footer pane containing today's date.
|
protected org.eclipse.swt.widgets.Control | createNavigatorPane(org.eclipse.swt.widgets.Composite parent)
This method creates the month and year navigator pane.
|
protected org.eclipse.swt.widgets.Control | createSeparator(org.eclipse.swt.widgets.Composite parent)
This method adds a separator to the composite.
|
java.lang.String | getDate(int type)
This method gets the locale specific date.
|
int | getDay()
This method returns the currently selected day.
|
com.ibm.icu.util.ULocale | getLocale()
This method returns the international locale.
|
java.lang.String[] | getMonthNames()
This method returns the locale-specific month names.
|
protected void | initializeDialogUnits(org.eclipse.swt.widgets.Control control)
This method initializes the computation of horizontal and vertical dialog units based on the size of the current font.
|
protected boolean | isAllowedDate(java.util.Date aDate)
This method checks whether the given date falls within the range defined by the start and end dates, if specified.
|
void | open()
This method opens this window, creating it first if it has not yet been created.
|
void | setDate(java.util.Date date)
This method sets the date.
|
protected void | setEnd(java.util.Date endDate)
This method sets the last allowable date.
|
void | setLocation(int x, int y)
This method sets the date picker's location.
|
protected void | setStart(java.util.Date startDate)
This method sets the first allowable date.
|
protected void | update()
Refreshes the content of the date picker.
|
public static final int LONG
public static final int SHORT
public DatePicker(org.eclipse.swt.widgets.Shell parentShell, com.ibm.icu.util.ULocale locale)
public DatePicker(org.eclipse.swt.widgets.Shell parentShell, com.ibm.icu.util.ULocale locale, java.util.Date start, java.util.Date end)
protected org.eclipse.swt.widgets.Control createNavigatorPane(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.swt.widgets.Control createContentPane(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.swt.widgets.Control createFooterPane(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.swt.widgets.Control createSeparator(org.eclipse.swt.widgets.Composite parent)
This method adds a horizontal separator to the composite dividing the two sections.
Subclasses may override.
public void open()
public void close()
public int getDay()
public java.lang.String getDate(int type)
Note: Returns null if no date was selected.
public com.ibm.icu.util.ULocale getLocale()
public java.lang.String[] getMonthNames()
public void setDate(java.util.Date date)
public void setLocation(int x, int y)
protected void update()
protected void initializeDialogUnits(org.eclipse.swt.widgets.Control control)
This method must be called before any of the dialog unit based conversion methods are called.
protected int convertHorizontalDLUsToPixels(int dlus)
This method may only be called after initializeDialogUnits has been called.
Clients may call this framework method, but should not override it.
public static int convertHorizontalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics, int dlus)
The required FontMetrics parameter may be created in the following way: GC gc = new GC(control); gc.setFont(control.getFont()); fontMetrics = gc.getFontMetrics(); gc.dispose();
protected int convertVerticalDLUsToPixels(int dlus)
This method may only be called after initializeDialogUnits has been called.
Clients may call this framework method, but should not override it.
public static int convertVerticalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics, int dlus)
The required FontMetrics parameter may be created in the following way: GC gc = new GC(control); gc.setFont(control.getFont()); fontMetrics = gc.getFontMetrics(); gc.dispose();
protected boolean isAllowedDate(java.util.Date aDate)
protected void setStart(java.util.Date startDate)
protected void setEnd(java.util.Date endDate)