public class

EditorImpl

extends AbstractGuiElement
implements Editor
java.lang.Object
   ↳ com.microstrategy.web.app.gui.AbstractGuiElement
     ↳ com.microstrategy.web.app.gui.EditorImpl

Class Overview

Title: EditorImpl.

Description: implementation of the Editor interface for the editor components in Microstrategy Web. The Editor GUI Element is responsible for producing a dialog like interface used by all the editors in the application. Its properties and methods allow the user to quiclky generate a dialog that follows the look and feel standards of Microstrategy Web. Instances of this interface are used by the AbstractEditorTransform to generate the application dialogs, but its usage is not limited to transform as any object capable of handling a MarkupOutput can use this component. Instances to this component must be obtained through the GuiElementFactory.

Summary

Nested Classes
class EditorImpl.Button  
[Expand]
Inherited Constants
From interface com.microstrategy.web.app.gui.Editor
Fields
protected Hashtable _bodyAttributes Hashtable property for holding the main editor body attributes
protected MarkupOutput _contents MarkupOutput property for holding the HTML contents of the editor.
protected String _contentsCss the content css class name for the editor
protected boolean _createForm Boolean property that determines whether the editor contains a form
protected MarkupOutput _extraProperties This field is deprecated. use setAttribute(String, String, int)
protected String _formAction String property for holding the form's action for the editor
protected String _formExtraAttributes String property for holding the form's extra attributes for the editor
protected String _formMethod String property for holding the form's method for the editor
protected String _formName String property for holding the form name for the editor
protected String _formOnSubmit String property for holding the form's onSubmit attribute for the editor
protected String _globalContentCss String property for holding the global contents css class name for the editor
protected String _globalCss String property for holding the global css class name for the editor
protected String _imagesFolder String property for holding the folder path of the images location
protected Hashtable _mainAttributes Hashtable property for holding the main editor body attributes
protected MarkupOutput _postButtonContents MarkupOutput property for holding the HTML contents to be placed after the button control on the editor.
protected String _title String property for holding the title of the editor
protected Hashtable _titleAttributes Hashtable property for holding the main editor title attributes
protected String _titleBarCss
protected String _titleCss String property for holding the title css class name for the editor
protected MarkupOutput _titleElements MarkupOutput property for holding the title elements of the editor.
protected String _titleElementsCss String property for holding the title elements css class name for the editor
[Expand]
Inherited Fields
From class com.microstrategy.web.app.gui.AbstractGuiElement
Public Constructors
EditorImpl()
Class constructor, initializes main properties.
Public Methods
void appendDisplayFlag(int flag)
Append a new display flag value
Tag getActionButtonsBar()
Returns the TR tag that will be used to render the action buttons bar
WebEvent getApplyEvent()
Get the WebEvent instance to be associated with the Apply button on the editor
String getApplyJS()
Get the JavaScript to be associated with the Apply button and should be executed if it is selected
boolean getCanAutoSize()
get the autosize property of the editor
WebEvent getCancelEvent()
Get the WebEvent instance to be associated with the Cancel button on the editor
String getCancelJS()
Get the JavaScript to be associated with the Cancel button and should be executed if it is selected
WebEvent getCloseEvent()
Get the WebEvent instance to be associated with the Close button on the editor
String getCloseJS()
Indicates JavaScript to be executed when closing current Editor.
MarkupOutput getContents()
Returns the content of the editor.
int getDisplayFlags()
Get the display flag value as specified for the editor
WebEvent getHelpEvent()
This method is deprecated. use getHelpEvent()
String getHelpToolTip()
Get the tooltip of the help button of the editor
String getHelpTopic()
String getHelpType()
get the type of the help file
WebEvent getOkEvent()
Get the WebEvent instance to be associated with the OK button on the editor
String getOkJS()
Get the JavaScript to be associated with the Ok button and should be executed if it is selected
MarkupOutput getPostButtonContents()
Get the content after the apply/ok/cancel buttons
String getTitle()
Get the title of the editor
MarkupOutput getTitleElements()
Get the title elements of the editor
boolean getUseDHTMLForEditorClose()
Returns if the editor should use DHTML (JavaScript) for closing the editor.
boolean hasSpaceAfterEditor()
Determine whether to display a blank space underneath the editor
boolean isHideFocus()
gets the hide focus property of the buttons in the editor
void renderCloseButton(MarkupOutput spanOut, WebEvent closeEvent, String closeJS)
Generate the Close button for this editor
MarkupOutput renderElement()
render the gui element in a MarkupOutput object
MarkupOutput renderElement(String cssClass)
Generate the output of the editor according to the information used for initializing its properties, in particular, the editor contents.
void renderHelpButton(MarkupOutput out)
Generate the Help button for this editor
void renderHelpButton(MarkupOutput spanOut, WebEvent helpEvent, String helpTopic)
This method is deprecated. use renderHelpButton(MarkupOutput)
void setActionButtonsBar(Tag ab)
Set the TR tag that will be used to render the action buttons bar
void setApplyEvent(WebEvent event)
Set the WebEvent instance to be associated with the Apply button on the editor
void setApplyJS(String value)
Define the JavaScript to be associated with the Apply button and should be executed if it is selected
void setApplyLabel(String applyLabel)
Set the apply label, which is displayed as the text of the apply button
void setApplyTooltip(String applyTooltip)
Set the apply tooltip, which is displayed as the text of the ok button
void setAttribute(String attributeName, String value, int location)
Set attributes for the location specified (EnumEditorSectionTypes.EditorMainDiv, EnumEditorSectionTypes.EditorTitleDiv, EnumEditorSectionTypes.EditorBodyDiv).
void setButtonDisabled(int button, boolean disableValue)
Set the disabled property of the specified button.
void setButtonsCss(String css)
Set the button css class name for the editor
void setCanAutoSize(boolean value)
Set the autosize property of the editor
void setCancelEvent(WebEvent event)
Set the WebEvent instance to be associated with the Cancel button on the editor
void setCancelJS(String value)
Define the JavaScript to be associated with the Cancel button and should be executed if it is selected
void setCancelLabel(String cancelLabel)
Set the cancel label, which is displayed as the text of the cancel button
void setCancelTooltip(String cancelTooltip)
Set the cancel tooltip, which is displayed as the text of the cancel button
void setCloseEvent(WebEvent event)
Set the WebEvent instance to be associated with the Close button on the editor
void setCloseJS(String value)
Specifies JavaScript function to be invoked when closing Editor in DHTML mode only.
void setCloseLabel(String closeLabel)
Set the close label, which is displayed as the tooltip of the close icon
void setContents(MarkupOutput out)
This method is deprecated. Don't create a MarkupOutput and create it, instead call getContents and populate this instance.
void setContentsCss(String css)
Set the content css class name for the editor
void setCssPrefix(String value)
Define the prefix the css classes will have for the HTML contents generated by this editor component.
void setDisplayFlags(int flags)
Set the display flag to use for the editor
void setEditorDefinitionLayout(String fileName)
Sets the definition layout for the editor.
void setExtraProperties(MarkupOutput mo)
This method is deprecated. replaced by setAttribute(String, String, int)
void setForm(String action, String method, String formName, String extraAttributes)
Set the form information for the editor
void setForm(String action, String method, String formName)
Set the form information for the editor
void setForm(String action, String method, String formName, String extraAttributes, String onSubmitInfo)
Set the form information for the editor
void setFormId(String value)
This method is deprecated. Unused Method
void setGlobalContentCss(String css)
Set the global content css class name for the editor
void setGlobalCss(String css)
Set the global css class name for the editor
void setHelpEvent(WebEvent event)
This method is deprecated. use setHelpType(String)
void setHelpLabel(String helpLabel)
set the help label, which is displayed as the tooltip of the help icon
void setHelpToolTip(String tooltip)
Set the tooltip of the editor
void setHelpTopic(String topic)
Set the help topic of the editor
void setHelpType(String type)
set the help type for the editor
void setHideFocus(boolean value)
set the hide focus property of the buttons in the editor
void setImageBasePath(String path)
Set the folder path to be used as base for all the images to use while displaying menus
void setOKLabel(String OKLabel)
Set the ok label, which is displayed as the text of the ok button
void setOKTooltip(String OKTooltip)
Set the ok tooltip, which is displayed as the text of the ok button
void setOkEvent(WebEvent event)
Set the WebEvent instance to be associated with the OK button on the editor
void setOkJS(String value)
Define the JavaScript to be associated with the Ok button and should be executed if it is selected
void setPostButtonContents(MarkupOutput out)
Set the content after the apply/ok/cancel buttons
void setSpaceAfterEditor(boolean spaceAfterEditor)
Set whether display a blank space underneath the editor
void setTitle(String title)
Set the title of the editor
void setTitleCss(String css)
Set the title css class name for the editor
void setTitleElements(MarkupOutput out)
Set the title elements of the editor
void setTitleElementsCss(String css)
Set the title elements' css class name for the editor
void setUseDHTMLForEditorClose(boolean value)
Define if the editor should use JavaScript (DHTML) for closing the editor or not.
Protected Methods
void initializeEditor()
Utility method for initializing properties of the editor such as images, labels events with default values.
void renderActionButtons(MarkupOutput out)
Generate the action buttons (ie apply, ok, cancel buttons) this editor will provide.
void renderStatusBar(MarkupOutput out)
void renderTitleButtons(MarkupOutput out)
Generate the title buttons (ie help, close buttons) this editor will provide.
void renderToolbar(MarkupOutput out)
Generates the toolbar HTML as specified on the toolbar configuration for this editor
[Expand]
Inherited Methods
From class com.microstrategy.web.app.gui.AbstractGuiElement
From class java.lang.Object
From interface com.microstrategy.web.app.gui.Editor
From interface com.microstrategy.web.app.gui.GuiElement

Fields

protected Hashtable _bodyAttributes

Hashtable property for holding the main editor body attributes

protected MarkupOutput _contents

MarkupOutput property for holding the HTML contents of the editor.

protected String _contentsCss

the content css class name for the editor

protected boolean _createForm

Boolean property that determines whether the editor contains a form

protected MarkupOutput _extraProperties

This field is deprecated.
use setAttribute(String, String, int)

MarkupOutput property for holding the extra properties of the editor.

protected String _formAction

String property for holding the form's action for the editor

protected String _formExtraAttributes

String property for holding the form's extra attributes for the editor

protected String _formMethod

String property for holding the form's method for the editor

protected String _formName

String property for holding the form name for the editor

protected String _formOnSubmit

String property for holding the form's onSubmit attribute for the editor

protected String _globalContentCss

String property for holding the global contents css class name for the editor

protected String _globalCss

String property for holding the global css class name for the editor

protected String _imagesFolder

String property for holding the folder path of the images location

protected Hashtable _mainAttributes

Hashtable property for holding the main editor body attributes

protected MarkupOutput _postButtonContents

MarkupOutput property for holding the HTML contents to be placed after the button control on the editor.

protected String _title

String property for holding the title of the editor

protected Hashtable _titleAttributes

Hashtable property for holding the main editor title attributes

protected String _titleBarCss

protected String _titleCss

String property for holding the title css class name for the editor

protected MarkupOutput _titleElements

MarkupOutput property for holding the title elements of the editor.

protected String _titleElementsCss

String property for holding the title elements css class name for the editor

Public Constructors

public EditorImpl ()

Class constructor, initializes main properties.

Public Methods

public void appendDisplayFlag (int flag)

Append a new display flag value

Parameters
flag value of the flag to append, from the EnumEditorDisplayFlags enumeration

public Tag getActionButtonsBar ()

Returns the TR tag that will be used to render the action buttons bar

public WebEvent getApplyEvent ()

Get the WebEvent instance to be associated with the Apply button on the editor

Returns
  • the WebEvent initialized instance with the information of the event to trigger if the Apply button is selected.

public String getApplyJS ()

Get the JavaScript to be associated with the Apply button and should be executed if it is selected

Returns
  • String with the JavaScript code to associate with the Apply button.

public boolean getCanAutoSize ()

get the autosize property of the editor

Returns
  • The boolean value that specifies if the editor can autosize or not

public WebEvent getCancelEvent ()

Get the WebEvent instance to be associated with the Cancel button on the editor

Returns
  • the WebEvent initialized instance with the information of the event to trigger if the Cancel button is selected.

public String getCancelJS ()

Get the JavaScript to be associated with the Cancel button and should be executed if it is selected

Returns
  • String with the JavaScript code to associate with the Cancel button.

public WebEvent getCloseEvent ()

Get the WebEvent instance to be associated with the Close button on the editor

Returns
  • WebEvent initialized instance with the information of the event to trigger if the Close button is selected.

public String getCloseJS ()

Indicates JavaScript to be executed when closing current Editor.

Returns
  • String with the JavaScript function information to be triggered when closing the editor

public MarkupOutput getContents ()

Returns the content of the editor. This is the MarkupOutput clients users should manipulate to generate the body of the editor.

Returns
  • the content as a MarkupOutput object used for the body section

public int getDisplayFlags ()

Get the display flag value as specified for the editor

Returns
  • the display flag value as defined for the editor

public WebEvent getHelpEvent ()

This method is deprecated.
use getHelpEvent()

Get the WebEvent instance to be associated with the Help button on the editor

Returns
  • WebEvent initialized instance with the information of the event to trigger if the Help button is selected.

public String getHelpToolTip ()

Get the tooltip of the help button of the editor

Returns
  • the tooltip of the help button on the editor

public String getHelpTopic ()

public String getHelpType ()

get the type of the help file

Returns

public WebEvent getOkEvent ()

Get the WebEvent instance to be associated with the OK button on the editor

Returns
  • the WebEvent initialized instance with the information of the event to trigger if the Ok button is selected.

public String getOkJS ()

Get the JavaScript to be associated with the Ok button and should be executed if it is selected

Returns
  • String with the JavaScript code to associate with the Ok button.

public MarkupOutput getPostButtonContents ()

Get the content after the apply/ok/cancel buttons

Returns

public String getTitle ()

Get the title of the editor

Returns
  • the title of the editor

public MarkupOutput getTitleElements ()

Get the title elements of the editor

Returns
  • the title elements as a MarkupOutput object

public boolean getUseDHTMLForEditorClose ()

Returns if the editor should use DHTML (JavaScript) for closing the editor.

Returns
  • true if the editor will use DHTML code to close the editor or not.

public boolean hasSpaceAfterEditor ()

Determine whether to display a blank space underneath the editor

Returns
  • whether display a blank space underneath the editor

public boolean isHideFocus ()

gets the hide focus property of the buttons in the editor

Returns
  • the value of the hide focus property

public void renderCloseButton (MarkupOutput spanOut, WebEvent closeEvent, String closeJS)

Generate the Close button for this editor

Parameters
spanOut the MarkupOutput object where the HTML output should be saved.
closeEvent WebEvent that will be triggered by the close button if selected
closeJS String with the JavaScript to be triggered if the close button is selected

public MarkupOutput renderElement ()

render the gui element in a MarkupOutput object

Returns

public MarkupOutput renderElement (String cssClass)

Generate the output of the editor according to the information used for initializing its properties, in particular, the editor contents.

Parameters
cssClass the css class of target object
Returns
  • a new MarkupOutput instance with the generated HTML output of this method.

public void renderHelpButton (MarkupOutput out)

Generate the Help button for this editor

Parameters
out the MarkupOutput object where the HTML output should be saved.

public void renderHelpButton (MarkupOutput spanOut, WebEvent helpEvent, String helpTopic)

This method is deprecated.
use renderHelpButton(MarkupOutput)

Generate the Help button for this editor

Parameters
spanOut the MarkupOutput object where the HTML output should be saved.
helpEvent WebEvent that will be triggered by the help button if selected
helpTopic String with the topic the help button will access if selected

public void setActionButtonsBar (Tag ab)

Set the TR tag that will be used to render the action buttons bar

public void setApplyEvent (WebEvent event)

Set the WebEvent instance to be associated with the Apply button on the editor

Parameters
event WebEvent initialized instance with the information of the event to trigger if the Apply button is selected.

public void setApplyJS (String value)

Define the JavaScript to be associated with the Apply button and should be executed if it is selected

Parameters
value String with the JavaScript code to associate with the Apply button.

public void setApplyLabel (String applyLabel)

Set the apply label, which is displayed as the text of the apply button

Parameters
applyLabel the apply label

public void setApplyTooltip (String applyTooltip)

Set the apply tooltip, which is displayed as the text of the ok button

Parameters
applyTooltip the apply label

public void setAttribute (String attributeName, String value, int location)

Set attributes for the location specified (EnumEditorSectionTypes.EditorMainDiv, EnumEditorSectionTypes.EditorTitleDiv, EnumEditorSectionTypes.EditorBodyDiv). We use it for setting bone properties.

Parameters
attributeName the name of the attribute to set
value the value of the attribute
location the location to add the properties as EnumEditorSectionTypes

public void setButtonDisabled (int button, boolean disableValue)

Set the disabled property of the specified button. The button which needs to be disabled is one of APPLY_BUTTON, OK_BUTTON or CANCEL_BUTTON

Parameters
button The actual button whose disabled property needs to be changed.
disableValue boolean value set to true to disable the apply button.

public void setButtonsCss (String css)

Set the button css class name for the editor

Parameters
css the css class name

public void setCanAutoSize (boolean value)

Set the autosize property of the editor

Parameters
value The boolean value that specifies if the editor can autosize or not

public void setCancelEvent (WebEvent event)

Set the WebEvent instance to be associated with the Cancel button on the editor

Parameters
event WebEvent initialized instance with the information of the event to trigger if the Cancel button is selected.

public void setCancelJS (String value)

Define the JavaScript to be associated with the Cancel button and should be executed if it is selected

Parameters
value String with the JavaScript code to associate with the Cancel button.

public void setCancelLabel (String cancelLabel)

Set the cancel label, which is displayed as the text of the cancel button

Parameters
cancelLabel the cancel label

public void setCancelTooltip (String cancelTooltip)

Set the cancel tooltip, which is displayed as the text of the cancel button

Parameters
cancelTooltip the cancel label

public void setCloseEvent (WebEvent event)

Set the WebEvent instance to be associated with the Close button on the editor

Parameters
event WebEvent initialized instance with the information of the event to trigger if the Close button is selected.

public void setCloseJS (String value)

Specifies JavaScript function to be invoked when closing Editor in DHTML mode only.

Parameters
value String Array consisted of function name and parameters.

public void setCloseLabel (String closeLabel)

Set the close label, which is displayed as the tooltip of the close icon

Parameters
closeLabel the close label

public void setContents (MarkupOutput out)

This method is deprecated.
Don't create a MarkupOutput and create it, instead call getContents and populate this instance.

Registers the content of the editor. This is the body section. Users can provide their own populated MarkupOutput which will be appended to the editor's output in the body section.

Is not recommeneded to use this method (in fact, it has been deprecated). Users should instead call the getContents method which returns a MarkupOutput and populate this object.

Parameters
out the content as a MarkupOutput object

public void setContentsCss (String css)

Set the content css class name for the editor

Parameters
css the css class name

public void setCssPrefix (String value)

Define the prefix the css classes will have for the HTML contents generated by this editor component.

Parameters
value String with the css prefix value to use.

public void setDisplayFlags (int flags)

Set the display flag to use for the editor

Parameters
flags value of the display flag to use on the editor, which should be a bit-wise value from the EnumEditorDisplayFlags enumeration.

public void setEditorDefinitionLayout (String fileName)

Sets the definition layout for the editor. The definition layout indicates what section of the editor to display i.e. the buttons to include in the footer.

Parameters
fileName the definition of the editor

public void setExtraProperties (MarkupOutput mo)

This method is deprecated.
replaced by setAttribute(String, String, int)

Set extra information to the whole editor. We use it for setting the drag and drop properties.

Parameters
mo the MarkupOutput object

public void setForm (String action, String method, String formName, String extraAttributes)

Set the form information for the editor

Parameters
action the action attribute of the form
method the method attribute of the form
formName the name attribute of the form
extraAttributes extra attributes in the form definition

public void setForm (String action, String method, String formName)

Set the form information for the editor

Parameters
action the action attribute of the form
method the method attribute of the form
formName the name attribute of the form

public void setForm (String action, String method, String formName, String extraAttributes, String onSubmitInfo)

Set the form information for the editor

Parameters
action the action attribute of the form
method the method attribute of the form
formName the name attribute of the form
extraAttributes extra attributes in the form definition
onSubmitInfo a String with the name and value of the ONSUBMIT attribute for the form tag. If providing this property, any default ONSUBMIT value that is generated (ie. appendState() call) will not be generated. It's responsibility of the developer to add it on its value.

public void setFormId (String value)

This method is deprecated.
Unused Method

Set the if of the form to use in XHR partial update

Parameters
value String the value+"_form" forms the actual id of the form that should be submitted

public void setGlobalContentCss (String css)

Set the global content css class name for the editor

Parameters
css the css class name

public void setGlobalCss (String css)

Set the global css class name for the editor

Parameters
css the css class name

public void setHelpEvent (WebEvent event)

This method is deprecated.
use setHelpType(String)

Set the WebEvent instance to be associated with the Help button on the editor

Parameters
event WebEvent initialized instance with the information of the event to trigger if the Help button is selected.

public void setHelpLabel (String helpLabel)

set the help label, which is displayed as the tooltip of the help icon

Parameters
helpLabel the help label

public void setHelpToolTip (String tooltip)

Set the tooltip of the editor

Parameters
tooltip String with the tooltip of the editor

public void setHelpTopic (String topic)

Set the help topic of the editor

Parameters
topic the help topic

public void setHelpType (String type)

set the help type for the editor

Parameters
type String is one of HELP_TYPE_ADMIN,HELP_TYPE_USER,HELP_TYPE_CUSTOM

public void setHideFocus (boolean value)

set the hide focus property of the buttons in the editor

Parameters
value the value of the hide focus property

public void setImageBasePath (String path)

Set the folder path to be used as base for all the images to use while displaying menus

Parameters
path the folder path

public void setOKLabel (String OKLabel)

Set the ok label, which is displayed as the text of the ok button

Parameters
OKLabel the ok label

public void setOKTooltip (String OKTooltip)

Set the ok tooltip, which is displayed as the text of the ok button

Parameters
OKTooltip the ok label

public void setOkEvent (WebEvent event)

Set the WebEvent instance to be associated with the OK button on the editor

Parameters
event WebEvent initialized instance with the information of the event to trigger if the Ok button is selected.

public void setOkJS (String value)

Define the JavaScript to be associated with the Ok button and should be executed if it is selected

Parameters
value String with the JavaScript code to associate with the Ok button.

public void setPostButtonContents (MarkupOutput out)

Set the content after the apply/ok/cancel buttons

Parameters
out the content as a MarkupOutput object

public void setSpaceAfterEditor (boolean spaceAfterEditor)

Set whether display a blank space underneath the editor

Parameters
spaceAfterEditor whether display a blank space underneath the editor

public void setTitle (String title)

Set the title of the editor

Parameters
title String with the title of the editor

public void setTitleCss (String css)

Set the title css class name for the editor

Parameters
css the css class name

public void setTitleElements (MarkupOutput out)

Set the title elements of the editor

Parameters
out the title elements as a MarkupOutput object

public void setTitleElementsCss (String css)

Set the title elements' css class name for the editor

Parameters
css the css class name

public void setUseDHTMLForEditorClose (boolean value)

Define if the editor should use JavaScript (DHTML) for closing the editor or not.

Parameters
value The boolean value set to true if we want to use DHTML code to close the editor

Protected Methods

protected void initializeEditor ()

Utility method for initializing properties of the editor such as images, labels events with default values.

protected void renderActionButtons (MarkupOutput out)

Generate the action buttons (ie apply, ok, cancel buttons) this editor will provide.

Parameters
out the MarkupOutput object where the HTML output should be saved.

protected void renderStatusBar (MarkupOutput out)

protected void renderTitleButtons (MarkupOutput out)

Generate the title buttons (ie help, close buttons) this editor will provide.

Parameters
out the MarkupOutput object where the HTML output should be saved.

protected void renderToolbar (MarkupOutput out)

Generates the toolbar HTML as specified on the toolbar configuration for this editor

Parameters
out the MarkupOutput object where the HTML output should be saved.