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.ListgetAdditionalDateFormats()Returns a list of date formats that can be parsed into a Date.intgetArrowLeftSpacing()Returns the left spacing before the arrow.intgetArrowTopSpacing()Returns the top margin size of the arrows.intgetBoxSpacer()Returns the width between each calendar date.intgetButtonHeight()Returns the height of the "Today" and "None" buttons.intgetButtonsHorizontalSpace()Returns the horizontal spacing between the "Today" and the "None" button.intgetButtonVerticalSpace()Returns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are.intgetButtonWidth()Returns the width of the "Today" and "None" buttons.intgetButtonWidthCarbon()Returns the width of the "Today" and "None" buttons for Carbon.intgetCalendarHeight()Returns the height of the calendar.intgetCalendarHeightMacintosh()CALLED ON MACINTOSH ONLY!intgetCalendarWidth()Returns the width of the calendar.intgetCalendarWidthMacintosh()CALLED ON MACINTOSH ONLY!chargetCarbonArrowDownChar()On OSX/Carbon the arrow up/down don't work due to an eclipse bug so they need alternative keys.chargetCarbonArrowUpChar()On OSX/Carbon the arrow up/down don't work due to an eclipse bug so they need alternative keys.intgetCarbonButtonHeight()Returns the height of the "Today" and "None" buttons for Carbon.intgetCarbonButtonsHorizontalSpace()Returns the horizontal spacing between the "Today" and the "None" button.intgetCarbonButtonVerticalSpace()Returns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are.intgetCarbonButtonWidth()Returns the arrow width of the combo button itself for Carbon.org.eclipse.swt.graphics.FontgetCarbonDrawFont()Returns the font to draw on Carbon.java.lang.StringgetDateFormat()Returns the date format to be used in the text display area.intgetDatesLeftMargin()Returns the left margin size where the dates are shown.intgetDatesRightMargin()Returns the right margin size where the dates are shown.intgetGTKButtonWidth()Returns the arrow width of the combo button itself for GTK.intgetHeaderHeight()Returns the height of the header.intgetHeaderLeftMargin()Returns the left margin size of the header.intgetHeaderRightMargin()Returns the right margin size of the header.intgetHeaderTopMargin()Returns the top margin size of the header.java.util.LocalegetLocale()Returns the Locale that the calendar should use when calculating dates etc.java.lang.StringgetNoDateSetText()Returns the text shown in the text area of the combo when there is no date selected.java.lang.StringgetNoneText()Returns the text written on the "None" buttonintgetOneDateBoxSize()Returns the size (width) of the box that one date is contained in.java.lang.StringgetTodayText()Returns the text written on the "Today" buttonintgetWindowsButtonWidth()Returns the arrow width of the combo button itself for Windows.org.eclipse.swt.graphics.FontgetWindowsMonthPopupDrawFont()Returns the font used to draw the month selector text on Windows.booleanisWindows7()booleankeyboardNavigatesCalendar()If it returns true, keyboard down key etc will open the calendar and navigate the calendar through the keyboard.booleanshowCalendarInRightCorner()True if the calendar should be drawn with the right hand side of the calendar aligned with the drop down button.booleanshowMonthPickerOnMonthNameMousePress()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:ISettingsReturns the left spacing before the arrow.- Specified by:
getArrowLeftSpacingin interfaceISettings- Returns:
- Left arrow spacing
-
getArrowTopSpacing
public int getArrowTopSpacing()Description copied from interface:ISettingsReturns the top margin size of the arrows.- Specified by:
getArrowTopSpacingin interfaceISettings- Returns:
- Top arrow spacing
-
getOneDateBoxSize
public int getOneDateBoxSize()Description copied from interface:ISettingsReturns the size (width) of the box that one date is contained in.- Specified by:
getOneDateBoxSizein interfaceISettings- Returns:
- Calendar day box size
-
getBoxSpacer
public int getBoxSpacer()Description copied from interface:ISettingsReturns the width between each calendar date.- Specified by:
getBoxSpacerin interfaceISettings- Returns:
- Calendar date spacer width
-
getCalendarHeight
public int getCalendarHeight()Description copied from interface:ISettingsReturns the height of the calendar.- Specified by:
getCalendarHeightin interfaceISettings- Returns:
- Calendar height
-
getCalendarWidth
public int getCalendarWidth()Description copied from interface:ISettingsReturns the width of the calendar.- Specified by:
getCalendarWidthin interfaceISettings- Returns:
- Calendar width
-
getCalendarWidthMacintosh
public int getCalendarWidthMacintosh()Description copied from interface:ISettingsCALLED ON MACINTOSH ONLY! Returns the width of the calendar.- Specified by:
getCalendarWidthMacintoshin interfaceISettings- Returns:
- Calendar width
-
getCalendarHeightMacintosh
public int getCalendarHeightMacintosh()Description copied from interface:ISettingsCALLED ON MACINTOSH ONLY! Returns the height of the calendar.- Specified by:
getCalendarHeightMacintoshin interfaceISettings- Returns:
- Calendar height
-
getDatesLeftMargin
public int getDatesLeftMargin()Description copied from interface:ISettingsReturns the left margin size where the dates are shown.- Specified by:
getDatesLeftMarginin interfaceISettings- Returns:
- Dates left margin width
-
getDatesRightMargin
public int getDatesRightMargin()Description copied from interface:ISettingsReturns the right margin size where the dates are shown.- Specified by:
getDatesRightMarginin interfaceISettings- Returns:
- Dates right margin width
-
getHeaderHeight
public int getHeaderHeight()Description copied from interface:ISettingsReturns the height of the header.- Specified by:
getHeaderHeightin interfaceISettings- Returns:
- Header height
-
getHeaderLeftMargin
public int getHeaderLeftMargin()Description copied from interface:ISettingsReturns the left margin size of the header.- Specified by:
getHeaderLeftMarginin interfaceISettings- Returns:
- Left margin width
-
getHeaderRightMargin
public int getHeaderRightMargin()Description copied from interface:ISettingsReturns the right margin size of the header.- Specified by:
getHeaderRightMarginin interfaceISettings- Returns:
- Right margin width
-
getHeaderTopMargin
public int getHeaderTopMargin()Description copied from interface:ISettingsReturns the top margin size of the header.- Specified by:
getHeaderTopMarginin interfaceISettings- Returns:
- Top margin width
-
showCalendarInRightCorner
public boolean showCalendarInRightCorner()Description copied from interface:ISettingsTrue 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:
showCalendarInRightCornerin interfaceISettings- Returns:
- True to align in right corner
-
getDateFormat
public java.lang.String getDateFormat()Description copied from interface:ISettingsReturns 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:
getDateFormatin interfaceISettings- Returns:
- Date format string
- See Also:
DateFormat
-
getButtonHeight
public int getButtonHeight()Description copied from interface:ISettingsReturns the height of the "Today" and "None" buttons.- Specified by:
getButtonHeightin interfaceISettings- Returns:
- Height
-
getButtonsHorizontalSpace
public int getButtonsHorizontalSpace()Description copied from interface:ISettingsReturns the horizontal spacing between the "Today" and the "None" button.- Specified by:
getButtonsHorizontalSpacein interfaceISettings- Returns:
- Space size
-
getCarbonButtonsHorizontalSpace
public int getCarbonButtonsHorizontalSpace()Description copied from interface:ISettingsReturns the horizontal spacing between the "Today" and the "None" button. Used on Carbon only.- Specified by:
getCarbonButtonsHorizontalSpacein interfaceISettings- Returns:
- Space size
-
getButtonVerticalSpace
public int getButtonVerticalSpace()Description copied from interface:ISettingsReturns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are.- Specified by:
getButtonVerticalSpacein interfaceISettings- Returns:
- Spacer size
-
getCarbonButtonVerticalSpace
public int getCarbonButtonVerticalSpace()Description copied from interface:ISettingsReturns the spacing between the bottom of the calendar dates and where the "Today" and "None" buttons are. Used on Carbon only.- Specified by:
getCarbonButtonVerticalSpacein interfaceISettings- Returns:
- Spacer size
-
getButtonWidth
public int getButtonWidth()Description copied from interface:ISettingsReturns the width of the "Today" and "None" buttons.- Specified by:
getButtonWidthin interfaceISettings- Returns:
- Width
-
getButtonWidthCarbon
public int getButtonWidthCarbon()Description copied from interface:ISettingsReturns the width of the "Today" and "None" buttons for Carbon.- Specified by:
getButtonWidthCarbonin interfaceISettings- Returns:
- Width
-
getNoneText
public java.lang.String getNoneText()Description copied from interface:ISettingsReturns the text written on the "None" button- Specified by:
getNoneTextin interfaceISettings- Returns:
- String
-
getTodayText
public java.lang.String getTodayText()Description copied from interface:ISettingsReturns the text written on the "Today" button- Specified by:
getTodayTextin interfaceISettings- Returns:
- String
-
getNoDateSetText
public java.lang.String getNoDateSetText()Description copied from interface:ISettingsReturns 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:
getNoDateSetTextin interfaceISettings- Returns:
- String (never null!)
-
showMonthPickerOnMonthNameMousePress
public boolean showMonthPickerOnMonthNameMousePress()Description copied from interface:ISettingsWhether 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:
showMonthPickerOnMonthNameMousePressin interfaceISettings- Returns:
- true if to show the dialog. Default is true.
-
getCarbonButtonHeight
public int getCarbonButtonHeight()Description copied from interface:ISettingsReturns the height of the "Today" and "None" buttons for Carbon.- Specified by:
getCarbonButtonHeightin interfaceISettings- Returns:
- Height
-
getCarbonButtonWidth
public int getCarbonButtonWidth()Description copied from interface:ISettingsReturns 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:
getCarbonButtonWidthin interfaceISettings- Returns:
- size that the current OS. Defaults are: OSX: 25, Windows: 19, GTK: 25.
-
getGTKButtonWidth
public int getGTKButtonWidth()Description copied from interface:ISettingsReturns 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:
getGTKButtonWidthin interfaceISettings- Returns:
- size that the current OS. Defaults are: OSX: 25, Windows: 19, GTK: 25.
-
getWindowsButtonWidth
public int getWindowsButtonWidth()Description copied from interface:ISettingsReturns 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:
getWindowsButtonWidthin 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:ISettingsReturns the Locale that the calendar should use when calculating dates etc. -
getCarbonDrawFont
public org.eclipse.swt.graphics.Font getCarbonDrawFont()Description copied from interface:ISettingsReturns 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:
getCarbonDrawFontin interfaceISettings- Returns:
- Font to be used on Carbon.
-
getWindowsMonthPopupDrawFont
public org.eclipse.swt.graphics.Font getWindowsMonthPopupDrawFont()Description copied from interface:ISettingsReturns the font used to draw the month selector text on Windows. It is not advised to change this setting.- Specified by:
getWindowsMonthPopupDrawFontin interfaceISettings- Returns:
- Font to be used in the month popup on Windows.
-
getAdditionalDateFormats
public java.util.List getAdditionalDateFormats()Description copied from interface:ISettingsReturns 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:
getAdditionalDateFormatsin interfaceISettings- Returns:
- List of dateformats. Default is an empty list.
- See Also:
DateFormat,ISettings.getDateFormat()
-
keyboardNavigatesCalendar
public boolean keyboardNavigatesCalendar()Description copied from interface:ISettingsIf 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:
keyboardNavigatesCalendarin interfaceISettings
-
getAcceptedDateSeparatorChars
public char[] getAcceptedDateSeparatorChars()Description copied from interface:ISettingsReturns 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:
getAcceptedDateSeparatorCharsin interfaceISettings- Returns:
- char array, default is '/', '.', '-'
-
getCarbonArrowUpChar
public char getCarbonArrowUpChar()Description copied from interface:ISettingsOn 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:
getCarbonArrowUpCharin interfaceISettings- Returns:
- Arrow up replacement for carbon. Default is '-'.
-
getCarbonArrowDownChar
public char getCarbonArrowDownChar()Description copied from interface:ISettingsOn 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:
getCarbonArrowDownCharin interfaceISettings- Returns:
- Arrow down replacement for carbon. Default is '+'.
-