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 Details

  • 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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      Returns:
      Calendar date spacer width
    • getCalendarHeight

      public int getCalendarHeight()
      Description copied from interface: ISettings
      Returns the height of the calendar.
      Specified by:
      getCalendarHeight in interface ISettings
      Returns:
      Calendar height
    • getCalendarWidth

      public int getCalendarWidth()
      Description copied from interface: ISettings
      Returns the width of the calendar.
      Specified by:
      getCalendarWidth in interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      Returns:
      Dates right margin width
    • getHeaderHeight

      public int getHeaderHeight()
      Description copied from interface: ISettings
      Returns the height of the header.
      Specified by:
      getHeaderHeight in interface ISettings
      Returns:
      Header height
    • getHeaderLeftMargin

      public int getHeaderLeftMargin()
      Description copied from interface: ISettings
      Returns the left margin size of the header.
      Specified by:
      getHeaderLeftMargin in interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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.
      Specified by:
      getLocale in interface ISettings
      Returns:
      Locale to use. Default is Locale.getDefault(). Return value may not be null.
    • 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 interface ISettings
      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 interface ISettings
      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 interface ISettings
      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 interface ISettings
    • 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 interface ISettings
      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 if ISettings.keyboardNavigatesCalendar() returns true.
      Specified by:
      getCarbonArrowUpChar in interface ISettings
      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 if ISettings.keyboardNavigatesCalendar() returns true.
      Specified by:
      getCarbonArrowDownChar in interface ISettings
      Returns:
      Arrow down replacement for carbon. Default is '+'.