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.10 $
Author:
Alexander Kandzior, Andreas Zahner

Method Summary
 java.lang.String button(java.lang.String href, java.lang.String target, java.lang.String image, java.lang.String label, int type)
          Generates a button for the widget dialog.
 java.lang.String buttonBar(int segment)
          Returns the html for a button bar.
 java.lang.String buttonBarHorizontalLine()
          Generates a horizontal button bar separator line with maximum width.
 java.lang.String buttonBarSeparator(int leftPixel, int rightPixel)
          Generates a button bar separator.
 java.lang.String buttonBarSpacer(int width)
          Returns the html for an invisible spacer between button bar contents like buttons, labels, etc.
 java.lang.String buttonBarStartTab(int leftPixel, int rightPixel)
          Generates a button bar starter tab.
 java.lang.String calendarIncludes()
          Displays a javascript calendar element with the standard "opencms" style.
 java.lang.String calendarInit(java.lang.String inputFieldId, java.lang.String triggerButtonId, java.lang.String align, boolean singleClick, boolean weekNumbers, boolean mondayFirst, java.lang.String dateStatusFunc, boolean showTime)
          Initializes a javascript calendar element to be shown on a page.
 java.lang.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(java.lang.String dateString, boolean useTime)
          Creates the time in milliseconds from the given parameter.
 java.lang.String getCalendarLocalizedTime(long timestamp)
          Returns the given timestamp as String formatted in a localized pattern.
 java.util.Set getHelpMessageIds()
          Returns a set of help messages ids that are already included on the widget dialog.
 java.util.Locale getLocale()
          Returns the current users locale setting.
 CmsMessages getMessages()
          Returns a messages object used to render localized keys for the widget dialog.
 java.lang.String getUserAgent()
          Returns the "user-agent" of the current request, or null in case no request is available.
 boolean useNewStyle()
          Tests if we are working with the new administration dialog style.
 

Method Detail

button

public java.lang.String button(java.lang.String href,
                               java.lang.String target,
                               java.lang.String image,
                               java.lang.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)

buttonBar

public java.lang.String buttonBar(int segment)
Returns the html for a button bar.

Parameters:
segment - the HTML segment (START / END)
Returns:
a button bar html start / end segment

buttonBarHorizontalLine

public java.lang.String buttonBarHorizontalLine()
Generates a horizontal button bar separator line with maximum width.

Returns:
a horizontal button bar separator line

buttonBarSeparator

public java.lang.String buttonBarSeparator(int leftPixel,
                                           int rightPixel)
Generates a button bar separator.

Parameters:
leftPixel - the amount of pixel left to the separator
rightPixel - the amount of pixel right to the separator
Returns:
a button bar separator

buttonBarSpacer

public java.lang.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)

buttonBarStartTab

public java.lang.String buttonBarStartTab(int leftPixel,
                                          int rightPixel)
Generates a button bar starter tab.

Parameters:
leftPixel - the amount of pixel left to the starter
rightPixel - the amount of pixel right to the starter
Returns:
a button bar starter tab

calendarIncludes

public java.lang.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 java.lang.String calendarInit(java.lang.String inputFieldId,
                                     java.lang.String triggerButtonId,
                                     java.lang.String align,
                                     boolean singleClick,
                                     boolean weekNumbers,
                                     boolean mondayFirst,
                                     java.lang.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 java.lang.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(java.lang.String dateString,
                            boolean useTime)
                     throws java.text.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:
java.text.ParseException - if something goes wrong

getCalendarLocalizedTime

public java.lang.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

getHelpMessageIds

public java.util.Set getHelpMessageIds()
Returns a set of help messages ids that are already included on the widget dialog.

This is used to prevent the occurence of multiple html div id's with the same value when generating the help texts. For valid html, each id can be used only once.

Returns:
a set of help messages ids that are already included on the widget dialog

getLocale

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

Returns:
the current users locale setting
See Also:
CmsWorkplace.getLocale(), CmsRequestContext.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

getUserAgent

public java.lang.String getUserAgent()
Returns the "user-agent" of the current request, or null in case no request is available.

Returns:
the "user-agent" of the current request

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