Package com.iizix

Interface IComponent

    • Method Detail

      • getStyles

        Styles getStyles()
        Gets the styles container.
        Returns:
        The styles container (never null).
      • setEnabled

        boolean setEnabled​(boolean on)
        Sets the enabled state of the component.
        Parameters:
        on - the enabled state.
        Returns:
        true when this property has been changed, false otherwise (or for error).
      • isEnabled

        boolean isEnabled()
        Get the enabled state of the component.
        Returns:
        true if component is enabled, false otherwise.
      • setReadOnly

        boolean setReadOnly​(boolean on)
        Sets the read-only state of the component.

        Note: certain components are always in a "kind of read-only" mode, thus this property doesn't really apply to them.

        Parameters:
        on - the read-only state.
        Returns:
        true when this property has been changed, false otherwise (or for error).
      • isReadOnly

        boolean isReadOnly()
        Get the read-only state of the component.

        Note: certain components are always in a "kind of read-only" mode, thus this property doesn't really apply to them.

        Returns:
        true if component is read-only, false otherwise.
      • setVisible

        boolean setVisible​(boolean on)
        Sets the visibility state of the component.
        Parameters:
        on - the visibility state.
        Returns:
        true when this property has been changed, false otherwise (or for error).
      • isVisible

        boolean isVisible()
        Get the visibility state of the component.
        Returns:
        true if component is visible, false otherwise.
      • requestFocus

        java.lang.String requestFocus()
        Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.

        This method is less precise than requestFocusEx(), but avoids try-catching.

        Returns:
        null for success, otherwise an error message indicating why focus was not able to be changed.
      • requestFocusEx

        boolean requestFocusEx()
                        throws FocusException
        Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.
        Returns:
        true if focus was changed, false otherwise.
        Throws:
        FocusException - If focus could not be changed.
      • requestFocus

        java.lang.String requestFocus​(boolean doAnimate)
        Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.

        This method is less precise than requestFocusEx(), but avoids try-catching.

        Parameters:
        doAnimate - Flag to enable animation when selection is changed for e.g. accordion, swap or tab containers.
        Returns:
        null for success, otherwise an error message indicating why focus was not able to be changed.
      • requestFocusEx

        boolean requestFocusEx​(boolean doAnimate)
                        throws FocusException
        Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.
        Parameters:
        doAnimate - Flag to enable animation when selection is changed for e.g. accordion, swap or tab containers.
        Returns:
        true if focus was changed, false otherwise.
        Throws:
        FocusException - If focus could not be changed.
      • setLayoutMgr

        LayoutMgr<?> setLayoutMgr​(LayoutMgr<?> layoutManager)
        Sets the UI LayoutManager for the component. If the same layout manager is set twice, there will be no change and the return value is the instance of the layoutManager parameter passed into this method.
        Parameters:
        layoutManager - the layout manager instance, or null to remove the layout manager.
        Returns:
        the previous layout manager instance, or null if none was set.
      • getLayoutMgr

        LayoutMgr<?> getLayoutMgr()
        Gets the UI LayoutManager for the component.
        Returns:
        the layout manager instance, or null if none is set.
      • getText

        java.lang.String getText()
        Gets the text. The string is retrieved from the Atom.TEXT ($text) property and can be either StringProp or KStringProp.

        If it's a KString, the plain string is returned. It is recommended to use the more accurate text methods getPlainText() or getHTMLText() to have better control.

        Returns:
        The plain text string or null if not supported.
      • getKStringText

        KString getKStringText()
        Gets the text from the control as a KString. This KString can be plain or in HTML depending on the input, but KString provides methods to get text in different ways.

        Components implementing KString support implements the IUIHTMLTextComponent interface.

        Returns:
        The KString of the text if available, or null if none is present or KString is not supported by the component.
      • setText

        boolean setText​(java.lang.String text)
        Sets the plain text property without tags processing.

        If the component is connected to a VirtualSpace Field, that text is set instead of the UI component's text.

        Parameters:
        text - The text to set in plain text (no tags and no HTML tags will be processed).
        Returns:
        true for change of text, false for no change or not supported.
      • setText

        boolean setText​(KString text)
        Sets the HTML text property KStringProp Atom.TEXT ($text).

        Components implementing KString support implements the IUIHTMLTextComponent interface.

        Parameters:
        text - The text to set.
        Returns:
        true for change of text, false for no change or not supported.
      • setHTMLText

        boolean setHTMLText​(java.lang.String text)
        Sets the HTML text property KStringProp without tags processing.

        The KStringException is caught in case of invalid HTML text and logs a warning message.

        Components implementing KString support implements the IUIHTMLTextComponent interface.

        Parameters:
        text - The text to set.
        Returns:
        true for change of text, false for no change or not supported.
      • setTooltip

        boolean setTooltip​(KTooltip tooltip)
        Sets (or removes) the tooltip for the component.
        Parameters:
        tooltip - The tooltip, or null to remove it.
        Returns:
        true for changed, false for no change.
      • setTooltip

        boolean setTooltip​(java.lang.String text)
        Sets (or removes) the plain tooltip text for the component.
        Parameters:
        text - The plain tooltip text, or null to remove it.
        Returns:
        true for changed, false for no change.
      • getTooltip

        KTooltip getTooltip()
        Gets the current tooltip for the component.
        Returns:
        The tooltip, or null for none.
      • getTooltipText

        java.lang.String getTooltipText()
        Gets the current tooltip text for the component as a plain string.
        Returns:
        The tooltip as a plain string, or null for none.
      • setMessage

        boolean setMessage​(KTooltip message)
        Sets (or removes) the message for the component.
        Parameters:
        message - The message, or null to remove it.
        Returns:
        true for changed, false for no change.
      • setMessage

        boolean setMessage​(java.lang.String message,
                           int category)
        Sets (or removes) a plain message string for the component with specified category.
        Parameters:
        message - The message to set, or null to clear it.
        category - The category of the message: NONE, INFORMATION, WARNING or ERROR.
        Returns:
        true for changed, false for no change.
      • setErrorMessage

        boolean setErrorMessage​(java.lang.String errorMessage)
        Sets (or removes) the ERROR message for the component.
        Parameters:
        errorMessage - The ERROR message, or null to remove it.
        Returns:
        true for changed, false for no change.
      • setErrorMessage

        boolean setErrorMessage​(KString errorMessage)
        Sets (or removes) the ERROR message for the component.
        Parameters:
        errorMessage - The ERROR message, or null to remove it.
        Returns:
        true for changed, false for no change.
      • clearErrorMessage

        boolean clearErrorMessage()
        Clears the error message, if any.
        Returns:
        true if changed, false otherwise.
      • getMessage

        KTooltip getMessage()
        Gets the current message for the component.
        Returns:
        The message, or null for none.
      • getMessageText

        java.lang.String getMessageText()
        Gets the current message text for the component as a plain string.
        Returns:
        The message as a plain string, or null for none.
      • setBadge

        boolean setBadge​(java.lang.String text)
        Sets a red badge text with default font size for the component as a plain string.
        Parameters:
        text - The plain text string, or null to clear it.
        Returns:
        true for changed, false for no change.
      • setBadge

        boolean setBadge​(GBadge badge)
        Sets or clears the badge of the component.
        Parameters:
        badge - The badge to set, or null to clear it.
        Returns:
        true for changed, false for no change.
      • getBadge

        GBadge getBadge()
        Gets the badge for the component.
        Returns:
        The badge, or null if undefined.
      • getUIParent

        UIContainer getUIParent()
        Gets the parent container of this component.
        Returns:
        null if none is present.
      • getUIPanel

        UIPanelBase getUIPanel()
        Gets the UIPanelBase (that is a file saved to disk).
        Returns:
        null if none is present.
      • messageBox

        default void messageBox​(IMessageBoxReply reply,
                                IMessageBox.Icon icon,
                                KString title,
                                KString message,
                                KString... buttons)
        Displays a message box with the specified title and message.

        The message box is displayed on the client session that displays this panel component.

        Specified by:
        messageBox in interface IMessageBox
        Parameters:
        reply - The reply callback that is called when the user chooses a button or session is closed, null for none.
        icon - Icon to display, see the ICON_* values, e.g. IMessageBox.ICON_INFORMATION.
        title - The title string, must be non-null.
        message - The message to display, must be non-null.
        buttons - The strings for the buttons to display, if none, just an OK button is displayed. This array of buttons defined the index value returned by this method.
        Throws:
        java.lang.NullPointerException - If icon or message is null, or if any of the elements in buttons array is null.
        java.lang.IllegalStateException - If the client session is not found or the client session is disposed of.