Class EditorImpl

  • All Implemented Interfaces:
    Editor, GuiElement

    public class EditorImpl
    extends AbstractGuiElement
    implements Editor

    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.

    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Field Detail

      • _title

        protected java.lang.String _title
        String property for holding the title of the editor
      • _postButtonContents

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

        protected MarkupOutput _titleElements
        MarkupOutput property for holding the title elements of the editor.
      • _mainAttributes

        protected java.util.Hashtable _mainAttributes
        Hashtable property for holding the main editor body attributes
        Since:
        MicroStrategy Web 8.0.0
      • _titleAttributes

        protected java.util.Hashtable _titleAttributes
        Hashtable property for holding the main editor title attributes
        Since:
        MicroStrategy Web 8.0.0
      • _bodyAttributes

        protected java.util.Hashtable _bodyAttributes
        Hashtable property for holding the main editor body attributes
        Since:
        MicroStrategy Web 8.0.0
      • _globalCss

        protected java.lang.String _globalCss
        String property for holding the global css class name for the editor
      • _globalContentCss

        protected java.lang.String _globalContentCss
        String property for holding the global contents css class name for the editor
      • _contentsCss

        protected java.lang.String _contentsCss
        the content css class name for the editor
      • _titleCss

        protected java.lang.String _titleCss
        String property for holding the title css class name for the editor
      • _titleBarCss

        protected java.lang.String _titleBarCss
        Since:
        MicroStrategy Web 9.0.0
      • _titleElementsCss

        protected java.lang.String _titleElementsCss
        String property for holding the title elements css class name for the editor
      • _formName

        protected java.lang.String _formName
        String property for holding the form name for the editor
      • _formAction

        protected java.lang.String _formAction
        String property for holding the form's action for the editor
      • _formMethod

        protected java.lang.String _formMethod
        String property for holding the form's method for the editor
      • _formOnSubmit

        protected java.lang.String _formOnSubmit
        String property for holding the form's onSubmit attribute for the editor
      • _formExtraAttributes

        protected java.lang.String _formExtraAttributes
        String property for holding the form's extra attributes for the editor
      • _createForm

        protected boolean _createForm
        Boolean property that determines whether the editor contains a form
      • _imagesFolder

        protected java.lang.String _imagesFolder
        String property for holding the folder path of the images location
        Since:
        MicroStrategy Web 8.0.0
    • Constructor Detail

      • EditorImpl

        public EditorImpl()
        Class constructor, initializes main properties.
    • Method Detail

      • initializeEditor

        protected void initializeEditor()
        Utility method for initializing properties of the editor such as images, labels events with default values.
        Since:
        MicroStrategy Web 8.0.0
      • renderElement

        public MarkupOutput renderElement​(java.lang.String cssClass)
        Generate the output of the editor according to the information used for initializing its properties, in particular, the editor contents.
        Specified by:
        renderElement in interface Editor
        Parameters:
        cssClass - the css class of target object
        Returns:
        a new MarkupOutput instance with the generated HTML output of this method.
      • renderToolbar

        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.
        Since:
        MicroStrategy Web 8.0.0
      • renderStatusBar

        protected void renderStatusBar​(MarkupOutput out)
        Since:
        MicroStrategy Web 9.0.0
      • renderActionButtons

        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.
      • renderTitleButtons

        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.
      • renderCloseButton

        public void renderCloseButton​(MarkupOutput spanOut,
                                      WebEvent closeEvent,
                                      java.lang.String closeJS)
        Generate the Close button for this editor
        Specified by:
        renderCloseButton in interface 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
        Since:
        MicroStrategy Web 8.0.0
      • renderHelpButton

        public void renderHelpButton​(MarkupOutput out)
        Generate the Help button for this editor
        Specified by:
        renderHelpButton in interface Editor
        Parameters:
        out - the MarkupOutput object where the HTML output should be saved.
        Since:
        MicroStrategy Web 9.0.0
      • renderHelpButton

        public void renderHelpButton​(MarkupOutput spanOut,
                                     WebEvent helpEvent,
                                     java.lang.String helpTopic)
        Generate the Help button for this editor
        Specified by:
        renderHelpButton in interface 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
        Since:
        MicroStrategy Web 8.0.0
      • getActionButtonsBar

        public Tag getActionButtonsBar()
        Returns the TR tag that will be used to render the action buttons bar
        Specified by:
        getActionButtonsBar in interface Editor
        Since:
        MicroStrategy Web 9.0.0
      • setActionButtonsBar

        public void setActionButtonsBar​(Tag ab)
        Set the TR tag that will be used to render the action buttons bar
        Specified by:
        setActionButtonsBar in interface Editor
        Since:
        MicroStrategy Web 9.0.0
      • setTitle

        public void setTitle​(java.lang.String title)
        Set the title of the editor
        Specified by:
        setTitle in interface Editor
        Parameters:
        title - String with the title of the editor
      • setHelpToolTip

        public void setHelpToolTip​(java.lang.String tooltip)
        Set the tooltip of the editor
        Specified by:
        setHelpToolTip in interface Editor
        Parameters:
        tooltip - String with the tooltip of the editor
        Since:
        MicroStrategy Web 8.0.0
      • getTitle

        public java.lang.String getTitle()
        Get the title of the editor
        Specified by:
        getTitle in interface Editor
        Returns:
        the title of the editor
      • setHideFocus

        public void setHideFocus​(boolean value)
        set the hide focus property of the buttons in the editor
        Specified by:
        setHideFocus in interface Editor
        Parameters:
        value - the value of the hide focus property
        Since:
        MicroStrategy Web 8.1.0
      • isHideFocus

        public boolean isHideFocus()
        gets the hide focus property of the buttons in the editor
        Specified by:
        isHideFocus in interface Editor
        Returns:
        the value of the hide focus property
        Since:
        MicroStrategy Web 8.1.0
      • getHelpToolTip

        public java.lang.String getHelpToolTip()
        Get the tooltip of the help button of the editor
        Specified by:
        getHelpToolTip in interface Editor
        Returns:
        the tooltip of the help button on the editor
        Since:
        MicroStrategy Web 8.0.0
      • setUseDHTMLForEditorClose

        public void setUseDHTMLForEditorClose​(boolean value)
        Define if the editor should use JavaScript (DHTML) for closing the editor or not.
        Specified by:
        setUseDHTMLForEditorClose in interface Editor
        Parameters:
        value - The boolean value set to true if we want to use DHTML code to close the editor
      • getUseDHTMLForEditorClose

        public boolean getUseDHTMLForEditorClose()
        Returns if the editor should use DHTML (JavaScript) for closing the editor.
        Specified by:
        getUseDHTMLForEditorClose in interface Editor
        Returns:
        true if the editor will use DHTML code to close the editor or not.
      • appendDisplayFlag

        public void appendDisplayFlag​(int flag)
        Append a new display flag value
        Specified by:
        appendDisplayFlag in interface Editor
        Parameters:
        flag - value of the flag to append, from the EnumEditorDisplayFlags enumeration
      • getDisplayFlags

        public int getDisplayFlags()
        Get the display flag value as specified for the editor
        Specified by:
        getDisplayFlags in interface Editor
        Returns:
        the display flag value as defined for the editor
      • setDisplayFlags

        public void setDisplayFlags​(int flags)
        Set the display flag to use for the editor
        Specified by:
        setDisplayFlags in interface Editor
        Parameters:
        flags - value of the display flag to use on the editor, which should be a bit-wise value from the EnumEditorDisplayFlags enumeration.
      • setOkEvent

        public void setOkEvent​(WebEvent event)
        Set the WebEvent instance to be associated with the OK button on the editor
        Specified by:
        setOkEvent in interface Editor
        Parameters:
        event - WebEvent initialized instance with the information of the event to trigger if the Ok button is selected.
      • getOkEvent

        public WebEvent getOkEvent()
        Get the WebEvent instance to be associated with the OK button on the editor
        Specified by:
        getOkEvent in interface Editor
        Returns:
        the WebEvent initialized instance with the information of the event to trigger if the Ok button is selected.
      • setCancelEvent

        public void setCancelEvent​(WebEvent event)
        Set the WebEvent instance to be associated with the Cancel button on the editor
        Specified by:
        setCancelEvent in interface Editor
        Parameters:
        event - WebEvent initialized instance with the information of the event to trigger if the Cancel button is selected.
      • getCancelEvent

        public WebEvent getCancelEvent()
        Get the WebEvent instance to be associated with the Cancel button on the editor
        Specified by:
        getCancelEvent in interface Editor
        Returns:
        the WebEvent initialized instance with the information of the event to trigger if the Cancel button is selected.
      • setApplyEvent

        public void setApplyEvent​(WebEvent event)
        Set the WebEvent instance to be associated with the Apply button on the editor
        Specified by:
        setApplyEvent in interface Editor
        Parameters:
        event - WebEvent initialized instance with the information of the event to trigger if the Apply button is selected.
      • getApplyEvent

        public WebEvent getApplyEvent()
        Get the WebEvent instance to be associated with the Apply button on the editor
        Specified by:
        getApplyEvent in interface Editor
        Returns:
        the WebEvent initialized instance with the information of the event to trigger if the Apply button is selected.
      • setApplyJS

        public void setApplyJS​(java.lang.String value)
        Define the JavaScript to be associated with the Apply button and should be executed if it is selected
        Specified by:
        setApplyJS in interface Editor
        Parameters:
        value - String with the JavaScript code to associate with the Apply button.
        Since:
        MicroStrategy Web 8.0.0
      • getApplyJS

        public java.lang.String getApplyJS()
        Get the JavaScript to be associated with the Apply button and should be executed if it is selected
        Specified by:
        getApplyJS in interface Editor
        Returns:
        String with the JavaScript code to associate with the Apply button.
        Since:
        MicroStrategy Web 8.0.0
      • setOkJS

        public void setOkJS​(java.lang.String value)
        Define the JavaScript to be associated with the Ok button and should be executed if it is selected
        Specified by:
        setOkJS in interface Editor
        Parameters:
        value - String with the JavaScript code to associate with the Ok button.
        Since:
        MicroStrategy Web 8.0.0
      • getOkJS

        public java.lang.String getOkJS()
        Get the JavaScript to be associated with the Ok button and should be executed if it is selected
        Specified by:
        getOkJS in interface Editor
        Returns:
        String with the JavaScript code to associate with the Ok button.
        Since:
        MicroStrategy Web 8.0.0
      • setCancelJS

        public void setCancelJS​(java.lang.String value)
        Define the JavaScript to be associated with the Cancel button and should be executed if it is selected
        Specified by:
        setCancelJS in interface Editor
        Parameters:
        value - String with the JavaScript code to associate with the Cancel button.
        Since:
        MicroStrategy Web 8.0.0
      • getCancelJS

        public java.lang.String getCancelJS()
        Get the JavaScript to be associated with the Cancel button and should be executed if it is selected
        Specified by:
        getCancelJS in interface Editor
        Returns:
        String with the JavaScript code to associate with the Cancel button.
        Since:
        MicroStrategy Web 8.0.0
      • setCloseJS

        public void setCloseJS​(java.lang.String value)
        Specifies JavaScript function to be invoked when closing Editor in DHTML mode only.
        Specified by:
        setCloseJS in interface Editor
        Parameters:
        value - String Array consisted of function name and parameters.
        Since:
        MicroStrategy Web 8.0.0
      • getCloseJS

        public java.lang.String getCloseJS()
        Indicates JavaScript to be executed when closing current Editor.
        Specified by:
        getCloseJS in interface Editor
        Returns:
        String with the JavaScript function information to be triggered when closing the editor
        Since:
        MicroStrategy Web 8.0.0
      • setHelpEvent

        public void setHelpEvent​(WebEvent event)
        Deprecated.
        Set the WebEvent instance to be associated with the Help button on the editor
        Specified by:
        setHelpEvent in interface Editor
        Parameters:
        event - WebEvent initialized instance with the information of the event to trigger if the Help button is selected.
      • getHelpEvent

        public WebEvent getHelpEvent()
        Deprecated.
        Get the WebEvent instance to be associated with the Help button on the editor
        Specified by:
        getHelpEvent in interface Editor
        Returns:
        WebEvent initialized instance with the information of the event to trigger if the Help button is selected.
      • setCloseEvent

        public void setCloseEvent​(WebEvent event)
        Set the WebEvent instance to be associated with the Close button on the editor
        Specified by:
        setCloseEvent in interface Editor
        Parameters:
        event - WebEvent initialized instance with the information of the event to trigger if the Close button is selected.
      • getCloseEvent

        public WebEvent getCloseEvent()
        Get the WebEvent instance to be associated with the Close button on the editor
        Specified by:
        getCloseEvent in interface Editor
        Returns:
        WebEvent initialized instance with the information of the event to trigger if the Close button is selected.
      • setContents

        public void setContents​(MarkupOutput out)
        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.
        Specified by:
        setContents in interface Editor
        Parameters:
        out - the content as a MarkupOutput object
      • getContents

        public MarkupOutput getContents()
        Returns the content of the editor. This is the MarkupOutput clients users should manipulate to generate the body of the editor.
        Specified by:
        getContents in interface Editor
        Returns:
        the content as a MarkupOutput object used for the body section
      • setTitleElements

        public void setTitleElements​(MarkupOutput out)
        Set the title elements of the editor
        Specified by:
        setTitleElements in interface Editor
        Parameters:
        out - the title elements as a MarkupOutput object
      • getTitleElements

        public MarkupOutput getTitleElements()
        Get the title elements of the editor
        Specified by:
        getTitleElements in interface Editor
        Returns:
        the title elements as a MarkupOutput object
      • setGlobalCss

        public void setGlobalCss​(java.lang.String css)
        Set the global css class name for the editor
        Specified by:
        setGlobalCss in interface Editor
        Parameters:
        css - the css class name
      • setGlobalContentCss

        public void setGlobalContentCss​(java.lang.String css)
        Set the global content css class name for the editor
        Specified by:
        setGlobalContentCss in interface Editor
        Parameters:
        css - the css class name
      • setContentsCss

        public void setContentsCss​(java.lang.String css)
        Set the content css class name for the editor
        Specified by:
        setContentsCss in interface Editor
        Parameters:
        css - the css class name
      • setButtonsCss

        public void setButtonsCss​(java.lang.String css)
        Set the button css class name for the editor
        Specified by:
        setButtonsCss in interface Editor
        Parameters:
        css - the css class name
      • setTitleCss

        public void setTitleCss​(java.lang.String css)
        Set the title css class name for the editor
        Specified by:
        setTitleCss in interface Editor
        Parameters:
        css - the css class name
      • setTitleElementsCss

        public void setTitleElementsCss​(java.lang.String css)
        Set the title elements' css class name for the editor
        Specified by:
        setTitleElementsCss in interface Editor
        Parameters:
        css - the css class name
      • setApplyLabel

        public void setApplyLabel​(java.lang.String applyLabel)
        Set the apply label, which is displayed as the text of the apply button
        Specified by:
        setApplyLabel in interface Editor
        Parameters:
        applyLabel - the apply label
      • setOKLabel

        public void setOKLabel​(java.lang.String OKLabel)
        Set the ok label, which is displayed as the text of the ok button
        Specified by:
        setOKLabel in interface Editor
        Parameters:
        OKLabel - the ok label
      • setCancelLabel

        public void setCancelLabel​(java.lang.String cancelLabel)
        Set the cancel label, which is displayed as the text of the cancel button
        Specified by:
        setCancelLabel in interface Editor
        Parameters:
        cancelLabel - the cancel label
      • setApplyTooltip

        public void setApplyTooltip​(java.lang.String applyTooltip)
        Set the apply tooltip, which is displayed as the text of the ok button
        Specified by:
        setApplyTooltip in interface Editor
        Parameters:
        applyTooltip - the apply label
        Since:
        MicroStrategy Web 8.1.0
      • setOKTooltip

        public void setOKTooltip​(java.lang.String OKTooltip)
        Set the ok tooltip, which is displayed as the text of the ok button
        Specified by:
        setOKTooltip in interface Editor
        Parameters:
        OKTooltip - the ok label
        Since:
        MicroStrategy Web 8.1.0
      • setCancelTooltip

        public void setCancelTooltip​(java.lang.String cancelTooltip)
        Set the cancel tooltip, which is displayed as the text of the cancel button
        Specified by:
        setCancelTooltip in interface Editor
        Parameters:
        cancelTooltip - the cancel label
        Since:
        MicroStrategy Web 8.1.0
      • setCloseLabel

        public void setCloseLabel​(java.lang.String closeLabel)
        Set the close label, which is displayed as the tooltip of the close icon
        Specified by:
        setCloseLabel in interface Editor
        Parameters:
        closeLabel - the close label
      • setHelpLabel

        public void setHelpLabel​(java.lang.String helpLabel)
        set the help label, which is displayed as the tooltip of the help icon
        Specified by:
        setHelpLabel in interface Editor
        Parameters:
        helpLabel - the help label
      • setForm

        public void setForm​(java.lang.String action,
                            java.lang.String method,
                            java.lang.String formName)
        Set the form information for the editor
        Specified by:
        setForm in interface Editor
        Parameters:
        action - the action attribute of the form
        method - the method attribute of the form
        formName - the name attribute of the form
      • setForm

        public void setForm​(java.lang.String action,
                            java.lang.String method,
                            java.lang.String formName,
                            java.lang.String extraAttributes)
        Set the form information for the editor
        Specified by:
        setForm in interface 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
      • setForm

        public void setForm​(java.lang.String action,
                            java.lang.String method,
                            java.lang.String formName,
                            java.lang.String extraAttributes,
                            java.lang.String onSubmitInfo)
        Set the form information for the editor
        Specified by:
        setForm in interface 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.
      • setImageBasePath

        public void setImageBasePath​(java.lang.String path)
        Set the folder path to be used as base for all the images to use while displaying menus
        Specified by:
        setImageBasePath in interface Editor
        Parameters:
        path - the folder path
      • setAttribute

        public void setAttribute​(java.lang.String attributeName,
                                 java.lang.String value,
                                 int location)
        Set attributes for the location specified (EnumEditorSectionTypes.EditorMainDiv, EnumEditorSectionTypes.EditorTitleDiv, EnumEditorSectionTypes.EditorBodyDiv). We use it for setting bone properties.
        Specified by:
        setAttribute in interface Editor
        Parameters:
        attributeName - the name of the attribute to set
        value - the value of the attribute
        location - the location to add the properties as EnumEditorSectionTypes
        Since:
        MicroStrategy Web 8.0.0
      • setHelpTopic

        public void setHelpTopic​(java.lang.String topic)
        Set the help topic of the editor
        Specified by:
        setHelpTopic in interface Editor
        Parameters:
        topic - the help topic
      • getHelpTopic

        public java.lang.String getHelpTopic()
        Since:
        MicroStrategy Web 9.0.0
      • hasSpaceAfterEditor

        public boolean hasSpaceAfterEditor()
        Determine whether to display a blank space underneath the editor
        Specified by:
        hasSpaceAfterEditor in interface Editor
        Returns:
        whether display a blank space underneath the editor
      • setSpaceAfterEditor

        public void setSpaceAfterEditor​(boolean spaceAfterEditor)
        Set whether display a blank space underneath the editor
        Specified by:
        setSpaceAfterEditor in interface Editor
        Parameters:
        spaceAfterEditor - whether display a blank space underneath the editor
      • setCanAutoSize

        public void setCanAutoSize​(boolean value)
        Set the autosize property of the editor
        Specified by:
        setCanAutoSize in interface Editor
        Parameters:
        value - The boolean value that specifies if the editor can autosize or not
        Since:
        MicroStrategy Web 8.0.0
      • getCanAutoSize

        public boolean getCanAutoSize()
        get the autosize property of the editor
        Specified by:
        getCanAutoSize in interface Editor
        Returns:
        The boolean value that specifies if the editor can autosize or not
        Since:
        MicroStrategy Web 8.0.0
      • setCssPrefix

        public void setCssPrefix​(java.lang.String value)
        Define the prefix the css classes will have for the HTML contents generated by this editor component.
        Specified by:
        setCssPrefix in interface Editor
        Parameters:
        value - String with the css prefix value to use.
        Since:
        MicroStrategy Web 8.0.0
      • setEditorDefinitionLayout

        public void setEditorDefinitionLayout​(java.lang.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.
        Specified by:
        setEditorDefinitionLayout in interface Editor
        Parameters:
        fileName - the definition of the editor
        Since:
        MicroStrategy Web 8.0.0
      • setFormId

        public void setFormId​(java.lang.String value)
        Deprecated.
        Unused Method
        Description copied from interface: Editor
        Set the if of the form to use in XHR partial update
        Specified by:
        setFormId in interface Editor
        Parameters:
        value - String the value+"_form" forms the actual id of the form that should be submitted
        Since:
        MicroStrategy Web 9.0.1