Class AbstractSettings
java.lang.Object
org.eclipse.nebula.widgets.calendarcombo.AbstractSettings
- All Implemented Interfaces:
ISettings
- Direct Known Subclasses:
DefaultSettings
public abstract class AbstractSettings extends java.lang.Object implements ISettings
-
Constructor Summary
Constructors Constructor Description AbstractSettings()
-
Method Summary
Modifier and Type Method Description char[]
getAcceptedDateSeparatorChars()
Returns a list of chars that can be used to separate dates.java.util.List
getAdditionalDateFormats()
Returns a list of date formats that can be parsed into a Date.int
getArrowLeftSpacing()
Returns the left spacing before the arrow.int
getArrowTopSpacing()
Returns the top margin size of the arrows.int
getBoxSpacer()
Returns the width between each calendar date.int
getButtonHeight()
Returns the height of the "Today" and "None" buttons.int
getButtonsHorizontalSpace()
Returns the horizontal spacing between the "Today" and the "None" button.int
getButtonVerticalSpace()
Returns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are.int
getButtonWidth()
Returns the width of the "Today" and "None" buttons.int
getButtonWidthCarbon()
Returns the width of the "Today" and "None" buttons for Carbon.int
getCalendarHeight()
Returns the height of the calendar.int
getCalendarHeightMacintosh()
CALLED ON MACINTOSH ONLY!int
getCalendarWidth()
Returns the width of the calendar.int
getCalendarWidthMacintosh()
CALLED ON MACINTOSH ONLY!char
getCarbonArrowDownChar()
On OSX/Carbon the arrow up/down don't work due to an eclipse bug so they need alternative keys.char
getCarbonArrowUpChar()
On OSX/Carbon the arrow up/down don't work due to an eclipse bug so they need alternative keys.int
getCarbonButtonHeight()
Returns the height of the "Today" and "None" buttons for Carbon.int
getCarbonButtonsHorizontalSpace()
Returns the horizontal spacing between the "Today" and the "None" button.int
getCarbonButtonVerticalSpace()
Returns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are.int
getCarbonButtonWidth()
Returns the arrow width of the combo button itself for Carbon.org.eclipse.swt.graphics.Font
getCarbonDrawFont()
Returns the font to draw on Carbon.java.lang.String
getDateFormat()
Returns the date format to be used in the text display area.int
getDatesLeftMargin()
Returns the left margin size where the dates are shown.int
getDatesRightMargin()
Returns the right margin size where the dates are shown.int
getGTKButtonWidth()
Returns the arrow width of the combo button itself for GTK.int
getHeaderHeight()
Returns the height of the header.int
getHeaderLeftMargin()
Returns the left margin size of the header.int
getHeaderRightMargin()
Returns the right margin size of the header.int
getHeaderTopMargin()
Returns the top margin size of the header.java.util.Locale
getLocale()
Returns the Locale that the calendar should use when calculating dates etc.java.lang.String
getNoDateSetText()
Returns the text shown in the text area of the combo when there is no date selected.java.lang.String
getNoneText()
Returns the text written on the "None" buttonint
getOneDateBoxSize()
Returns the size (width) of the box that one date is contained in.java.lang.String
getTodayText()
Returns the text written on the "Today" buttonint
getWindowsButtonWidth()
Returns the arrow width of the combo button itself for Windows.org.eclipse.swt.graphics.Font
getWindowsMonthPopupDrawFont()
Returns the font used to draw the month selector text on Windows.boolean
isWindows7()
boolean
keyboardNavigatesCalendar()
If it returns true, keyboard down key etc will open the calendar and navigate the calendar through the keyboard.boolean
showCalendarInRightCorner()
True if the calendar should be drawn with the right hand side of the calendar aligned with the drop down button.boolean
showMonthPickerOnMonthNameMousePress()
Whether to show the month selector pop-up when the mouse is pressed and held on the month name in the calendar window.
-
Constructor Details
-
AbstractSettings
public AbstractSettings()
-
-
Method Details
-
isWindows7
public boolean isWindows7() -
getArrowLeftSpacing
public int getArrowLeftSpacing()Description copied from interface:ISettings
Returns the left spacing before the arrow.- Specified by:
getArrowLeftSpacing
in interfaceISettings
- Returns:
- Left arrow spacing
-
getArrowTopSpacing
public int getArrowTopSpacing()Description copied from interface:ISettings
Returns the top margin size of the arrows.- Specified by:
getArrowTopSpacing
in interfaceISettings
- Returns:
- Top arrow spacing
-
getOneDateBoxSize
public int getOneDateBoxSize()Description copied from interface:ISettings
Returns the size (width) of the box that one date is contained in.- Specified by:
getOneDateBoxSize
in interfaceISettings
- Returns:
- Calendar day box size
-
getBoxSpacer
public int getBoxSpacer()Description copied from interface:ISettings
Returns the width between each calendar date.- Specified by:
getBoxSpacer
in interfaceISettings
- Returns:
- Calendar date spacer width
-
getCalendarHeight
public int getCalendarHeight()Description copied from interface:ISettings
Returns the height of the calendar.- Specified by:
getCalendarHeight
in interfaceISettings
- Returns:
- Calendar height
-
getCalendarWidth
public int getCalendarWidth()Description copied from interface:ISettings
Returns the width of the calendar.- Specified by:
getCalendarWidth
in interfaceISettings
- Returns:
- Calendar width
-
getCalendarWidthMacintosh
public int getCalendarWidthMacintosh()Description copied from interface:ISettings
CALLED ON MACINTOSH ONLY! Returns the width of the calendar.- Specified by:
getCalendarWidthMacintosh
in interfaceISettings
- Returns:
- Calendar width
-
getCalendarHeightMacintosh
public int getCalendarHeightMacintosh()Description copied from interface:ISettings
CALLED ON MACINTOSH ONLY! Returns the height of the calendar.- Specified by:
getCalendarHeightMacintosh
in interfaceISettings
- Returns:
- Calendar height
-
getDatesLeftMargin
public int getDatesLeftMargin()Description copied from interface:ISettings
Returns the left margin size where the dates are shown.- Specified by:
getDatesLeftMargin
in interfaceISettings
- Returns:
- Dates left margin width
-
getDatesRightMargin
public int getDatesRightMargin()Description copied from interface:ISettings
Returns the right margin size where the dates are shown.- Specified by:
getDatesRightMargin
in interfaceISettings
- Returns:
- Dates right margin width
-
getHeaderHeight
public int getHeaderHeight()Description copied from interface:ISettings
Returns the height of the header.- Specified by:
getHeaderHeight
in interfaceISettings
- Returns:
- Header height
-
getHeaderLeftMargin
public int getHeaderLeftMargin()Description copied from interface:ISettings
Returns the left margin size of the header.- Specified by:
getHeaderLeftMargin
in interfaceISettings
- Returns:
- Left margin width
-
getHeaderRightMargin
public int getHeaderRightMargin()Description copied from interface:ISettings
Returns the right margin size of the header.- Specified by:
getHeaderRightMargin
in interfaceISettings
- Returns:
- Right margin width
-
getHeaderTopMargin
public int getHeaderTopMargin()Description copied from interface:ISettings
Returns the top margin size of the header.- Specified by:
getHeaderTopMargin
in interfaceISettings
- Returns:
- Top margin width
-
showCalendarInRightCorner
public boolean showCalendarInRightCorner()Description copied from interface:ISettings
True if the calendar should be drawn with the right hand side of the calendar aligned with the drop down button. False if it should be aligned in the opposite way.- Specified by:
showCalendarInRightCorner
in interfaceISettings
- Returns:
- True to align in right corner
-
getDateFormat
public java.lang.String getDateFormat()Description copied from interface:ISettings
Returns the date format to be used in the text display area. Please note that this does not support just any format. You need to stick to Month Day and Year related formats and no others.- Specified by:
getDateFormat
in interfaceISettings
- Returns:
- Date format string
- See Also:
DateFormat
-
getButtonHeight
public int getButtonHeight()Description copied from interface:ISettings
Returns the height of the "Today" and "None" buttons.- Specified by:
getButtonHeight
in interfaceISettings
- Returns:
- Height
-
getButtonsHorizontalSpace
public int getButtonsHorizontalSpace()Description copied from interface:ISettings
Returns the horizontal spacing between the "Today" and the "None" button.- Specified by:
getButtonsHorizontalSpace
in interfaceISettings
- Returns:
- Space size
-
getCarbonButtonsHorizontalSpace
public int getCarbonButtonsHorizontalSpace()Description copied from interface:ISettings
Returns the horizontal spacing between the "Today" and the "None" button. Used on Carbon only.- Specified by:
getCarbonButtonsHorizontalSpace
in interfaceISettings
- Returns:
- Space size
-
getButtonVerticalSpace
public int getButtonVerticalSpace()Description copied from interface:ISettings
Returns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are.- Specified by:
getButtonVerticalSpace
in interfaceISettings
- Returns:
- Spacer size
-
getCarbonButtonVerticalSpace
public int getCarbonButtonVerticalSpace()Description copied from interface:ISettings
Returns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are. Used on Carbon only.- Specified by:
getCarbonButtonVerticalSpace
in interfaceISettings
- Returns:
- Spacer size
-
getButtonWidth
public int getButtonWidth()Description copied from interface:ISettings
Returns the width of the "Today" and "None" buttons.- Specified by:
getButtonWidth
in interfaceISettings
- Returns:
- Width
-
getButtonWidthCarbon
public int getButtonWidthCarbon()Description copied from interface:ISettings
Returns the width of the "Today" and "None" buttons for Carbon.- Specified by:
getButtonWidthCarbon
in interfaceISettings
- Returns:
- Width
-
getNoneText
public java.lang.String getNoneText()Description copied from interface:ISettings
Returns the text written on the "None" button- Specified by:
getNoneText
in interfaceISettings
- Returns:
- String
-
getTodayText
public java.lang.String getTodayText()Description copied from interface:ISettings
Returns the text written on the "Today" button- Specified by:
getTodayText
in interfaceISettings
- Returns:
- String
-
getNoDateSetText
public java.lang.String getNoDateSetText()Description copied from interface:ISettings
Returns the text shown in the text area of the combo when there is no date selected. It's suggested you return a blank string "" (which is the default).- Specified by:
getNoDateSetText
in interfaceISettings
- Returns:
- String (never null!)
-
showMonthPickerOnMonthNameMousePress
public boolean showMonthPickerOnMonthNameMousePress()Description copied from interface:ISettings
Whether to show the month selector pop-up when the mouse is pressed and held on the month name in the calendar window. The month popup is a small borderless window that allows the user to quickly select a month in the future or past by holding down the mouse button and moving the pointer either up (to scroll into the past) or down (to scroll into the future). Please refer to the Microsoft Outlook calendar for a visual reference.- Specified by:
showMonthPickerOnMonthNameMousePress
in interfaceISettings
- Returns:
- true if to show the dialog. Default is true.
-
getCarbonButtonHeight
public int getCarbonButtonHeight()Description copied from interface:ISettings
Returns the height of the "Today" and "None" buttons for Carbon.- Specified by:
getCarbonButtonHeight
in interfaceISettings
- Returns:
- Height
-
getCarbonButtonWidth
public int getCarbonButtonWidth()Description copied from interface:ISettings
Returns the arrow width of the combo button itself for Carbon.
IMPORTANT:
This does not change the combo button size, it is used to determine when the user clicks the arrow button on the combo and not the text field. If you notice that there is some area of the button that is either too large or small when clicked so that the popup does not show, you will probably need to adjust this.- Specified by:
getCarbonButtonWidth
in interfaceISettings
- Returns:
- size that the current OS. Defaults are: OSX: 25, Windows: 19, GTK: 25.
-
getGTKButtonWidth
public int getGTKButtonWidth()Description copied from interface:ISettings
Returns the arrow width of the combo button itself for GTK.
IMPORTANT:
This does not change the combo button size, it is used to determine when the user clicks the arrow button on the combo and not the text field. If you notice that there is some area of the button that is either too large or small when clicked so that the popup does not show, you will probably need to adjust this.- Specified by:
getGTKButtonWidth
in interfaceISettings
- Returns:
- size that the current OS. Defaults are: OSX: 25, Windows: 19, GTK: 25.
-
getWindowsButtonWidth
public int getWindowsButtonWidth()Description copied from interface:ISettings
Returns the arrow width of the combo button itself for Windows.
IMPORTANT:
This does not change the combo button size, it is used to determine when the user clicks the arrow button on the combo and not the text field. If you notice that there is some area of the button that is either too large or small when clicked so that the popup does not show, you will probably need to adjust this.- Specified by:
getWindowsButtonWidth
in interfaceISettings
- Returns:
- size that the current OS. Defaults are: OSX: 25, Windows: 19, GTK: 25.
-
getLocale
public java.util.Locale getLocale()Description copied from interface:ISettings
Returns the Locale that the calendar should use when calculating dates etc. -
getCarbonDrawFont
public org.eclipse.swt.graphics.Font getCarbonDrawFont()Description copied from interface:ISettings
Returns the font to draw on Carbon. Do note that the drawing does not take font size into account, so change at your own risk.- Specified by:
getCarbonDrawFont
in interfaceISettings
- Returns:
- Font to be used on Carbon.
-
getWindowsMonthPopupDrawFont
public org.eclipse.swt.graphics.Font getWindowsMonthPopupDrawFont()Description copied from interface:ISettings
Returns the font used to draw the month selector text on Windows. It is not advised to change this setting.- Specified by:
getWindowsMonthPopupDrawFont
in interfaceISettings
- Returns:
- Font to be used in the month popup on Windows.
-
getAdditionalDateFormats
public java.util.List getAdditionalDateFormats()Description copied from interface:ISettings
Returns a list of date formats that can be parsed into a Date. For example, if this list contains "mmddYY" and the user types in the date 030508 the date will be parsed into the date and displayed and formatted according to the getDateFormat() value automatically. The order of this list is relevant as the first matched date that "works" will be used as the date. This list is only used as a last resort if all other date parses failed.- Specified by:
getAdditionalDateFormats
in interfaceISettings
- Returns:
- List of dateformats. Default is an empty list.
- See Also:
DateFormat
,ISettings.getDateFormat()
-
keyboardNavigatesCalendar
public boolean keyboardNavigatesCalendar()Description copied from interface:ISettings
If it returns true, keyboard down key etc will open the calendar and navigate the calendar through the keyboard. If it returns false, keyboard will instead navigate the various text parts of the calendar, so if the date in the box is 12/13/2008 and the cursor is on the "13" and arrow up/down are pressed, that number will increase. Default is true.- Specified by:
keyboardNavigatesCalendar
in interfaceISettings
-
getAcceptedDateSeparatorChars
public char[] getAcceptedDateSeparatorChars()Description copied from interface:ISettings
Returns a list of chars that can be used to separate dates. If your users enter characters other than / - . you will want to override this and add whatever character is missing. These are used when parsing the date in the box when the user hits the arrow up/down buttons or + - on mac. Do note that if the default date format returned by the settings has no separator characters in them, this method is not called as it would not make sense.- Specified by:
getAcceptedDateSeparatorChars
in interfaceISettings
- Returns:
- char array, default is '/', '.', '-'
-
getCarbonArrowUpChar
public char getCarbonArrowUpChar()Description copied from interface:ISettings
On OSX/Carbon the arrow up/down don't work due to an eclipse bug so they need alternative keys. You may re-define those keys here if you wish. By default Carbon uses + - instead of the arrows. Do note that this method only matters ifISettings.keyboardNavigatesCalendar()
returns true.- Specified by:
getCarbonArrowUpChar
in interfaceISettings
- Returns:
- Arrow up replacement for carbon. Default is '-'.
-
getCarbonArrowDownChar
public char getCarbonArrowDownChar()Description copied from interface:ISettings
On OSX/Carbon the arrow up/down don't work due to an eclipse bug so they need alternative keys. You may re-define those keys here if you wish. By default Carbon uses + - instead of the arrows. Do note that this method only matters ifISettings.keyboardNavigatesCalendar()
returns true.- Specified by:
getCarbonArrowDownChar
in interfaceISettings
- Returns:
- Arrow down replacement for carbon. Default is '+'.
-