org.opencms.widgets
Interface I_CmsWidgetDialog

All Known Implementing Classes:
CmsWidgetDialog, CmsXmlContentEditor

public interface I_CmsWidgetDialog

Describes a widget enabled dialog.

Since:
6.0.0
Version:
$Revision: 1.8 $
Author:
Alexander Kandzior, Andreas Zahner

Method Summary
 String button(String href, String target, String image, String label, int type)
          Generates a button for the widget dialog.
 String buttonBarSpacer(int width)
          Returns the html for an invisible spacer between button bar contents like buttons, labels, etc.
 String calendarIncludes()
          Displays a javascript calendar element with the standard "opencms" style.
 String calendarInit(String inputFieldId, String triggerButtonId, String align, boolean singleClick, boolean weekNumbers, boolean mondayFirst, String dateStatusFunc, boolean showTime)
          Initializes a javascript calendar element to be shown on a page.
 String dialogHorizontalSpacer(int width)
          Builds an invisible horiziontal spacer with the specified width.
 int getButtonStyle()
          Returns the style setting to use when generating buttons for this widget dialog.
 long getCalendarDate(String dateString, boolean useTime)
          Creates the time in milliseconds from the given parameter.
 String getCalendarLocalizedTime(long timestamp)
          Returns the given timestamp as String formatted in a localized pattern.
 Locale getLocale()
          Returns the current users locale setting.
 CmsMessages getMessages()
          Returns a messages object used to render localized keys for the widget dialog.
 boolean useNewStyle()
          Tests if we are working with the new administration dialog style.
 

Method Detail

button

public String button(String href,
                     String target,
                     String image,
                     String label,
                     int type)
Generates a button for the widget dialog.

Parameters:
href - the href link for the button, if none is given the button will be disabled
target - the href link target for the button, if none is given the target will be same window
image - the image name for the button, skin path will be automattically added as prefix
label - the label for the text of the button
type - 0: image only (default), 1: image and text, 2: text only
Returns:
a button for the OpenCms workplace
See Also:
CmsWorkplace.button(String, String, String, String, int)

buttonBarSpacer

public String buttonBarSpacer(int width)
Returns the html for an invisible spacer between button bar contents like buttons, labels, etc.

Parameters:
width - the width of the invisible spacer
Returns:
the html for the invisible spacer
See Also:
CmsWorkplace.buttonBarSpacer(int)

calendarIncludes

public String calendarIncludes()
Displays a javascript calendar element with the standard "opencms" style.

Creates the HTML javascript and stylesheet includes for the head of the page.

Returns:
the necessary HTML code for the js and stylesheet includes

calendarInit

public String calendarInit(String inputFieldId,
                           String triggerButtonId,
                           String align,
                           boolean singleClick,
                           boolean weekNumbers,
                           boolean mondayFirst,
                           String dateStatusFunc,
                           boolean showTime)
Initializes a javascript calendar element to be shown on a page.

This method must be called at the end of a HTML page, e.g. before the closing <body> tag.

Parameters:
inputFieldId - the ID of the input field where the date is pasted to
triggerButtonId - the ID of the button which triggers the calendar
align - initial position of the calendar popup element
singleClick - if true, a single click selects a date and closes the calendar, otherwise calendar is closed by doubleclick
weekNumbers - show the week numbers in the calendar or not
mondayFirst - show monday as first day of week
dateStatusFunc - name of the function which determines if/how a date should be disabled
showTime - true if the time selector should be shown, otherwise false
Returns:
the HTML code to initialize a calendar poup element

dialogHorizontalSpacer

public String dialogHorizontalSpacer(int width)
Builds an invisible horiziontal spacer with the specified width.

Parameters:
width - the width of the spacer in pixels
Returns:
an invisible horiziontal spacer with the specified width
See Also:
CmsDialog.dialogHorizontalSpacer(int)

getButtonStyle

public int getButtonStyle()
Returns the style setting to use when generating buttons for this widget dialog.

Returns:
the style setting to use when generating buttons for this widget dialog
See Also:
CmsUserSettings.getEditorButtonStyle()

getCalendarDate

public long getCalendarDate(String dateString,
                            boolean useTime)
                     throws ParseException
Creates the time in milliseconds from the given parameter.

Parameters:
dateString - the String representation of the date
useTime - true if the time should be parsed, too, otherwise false
Returns:
the time in milliseconds
Throws:
ParseException - if something goes wrong

getCalendarLocalizedTime

public String getCalendarLocalizedTime(long timestamp)
Returns the given timestamp as String formatted in a localized pattern.

Parameters:
timestamp - the time to format
Returns:
the given timestamp as String formatted in a localized pattern

getLocale

public Locale getLocale()
Returns the current users locale setting.

Returns:
the current users locale setting
See Also:
CmsWorkplace.getLocale()

getMessages

public CmsMessages getMessages()
Returns a messages object used to render localized keys for the widget dialog.

Returns:
a messages object used to render localized keys for the widget dialog

useNewStyle

public boolean useNewStyle()
Tests if we are working with the new administration dialog style.

This param is not intended for external use.

Returns:
true if using the new style