Interface CockpitAdminService

  • All Known Implementing Classes:
    DefaultCockpitAdminService

    public interface CockpitAdminService
    Provides functionality for cockpitNG admin mode.
    • Field Detail

      • ADMINMODE_SYMBOLIC_SCLASS

        static final java.lang.String ADMINMODE_SYMBOLIC_SCLASS
        See Also:
        Constant Field Values
    • Method Detail

      • setAdminMode

        void setAdminMode​(boolean adminMode,
                          org.zkoss.zk.ui.Component ref)
        Enable or disable the admin mode.
        Parameters:
        adminMode - True, if adminmode should be enable, false otherwise.
        ref - An arbitrary Component which is attached to the current page.
      • isAdminMode

        boolean isAdminMode()
        Returns:
        true, if adminmode is currently enabled.
      • isAdminModePermitted

        boolean isAdminModePermitted()
        Returns:
        true, if adminmode is allowed for current session user.
      • isSymbolicAdminMode

        boolean isSymbolicAdminMode()
        Returns:
        true, if symbolic adminmode is currently enabled.
      • isSymbolicAdminFlagEnabled

        boolean isSymbolicAdminFlagEnabled()
        Returns:
        true, if symbolic adminmode flag is true.
      • setSymbolicAdminFlag

        void setSymbolicAdminFlag​(boolean enabled)
        Sets symbolic adminmode flag.
        Parameters:
        enabled - indicates whether symbolic admin mode should be enabled
      • removeWidgetFromClipboard

        void removeWidgetFromClipboard​(Widget widget)
        Removes a widget from the widget clipboard, if it's present there.
        Parameters:
        widget - The widget that should be removed.
      • isInClipboard

        boolean isInClipboard​(Widget widget)
        Checks if given widget is already in the clipboard
        Parameters:
        widget - The widget that should be checked
        Returns:
        true, if the specified widget is in clipboard.
      • moveWidgetToClipboard

        void moveWidgetToClipboard​(Widget widget)
        Adds the specified widget to the clipboard and removes it from the widget tree.
        Parameters:
        widget - which should be moved to clipboard
      • getWidgetToolbarColor

        java.lang.String getWidgetToolbarColor()
        Returns:
        the current color string used for the widget toolbars in a CSS readable RGB representation.
      • showAddWidgetWizard

        void showAddWidgetWizard​(org.zkoss.zk.ui.Component ref,
                                 org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> selectListener)
        Opens a wizard for adding a widget to a slot. Shows all widgets in the repository.
        Parameters:
        ref - An arbitrary Component which is attached to the current page.
        selectListener - An EventListener which is called when a widget has been selected in the wizard.
      • renderWidgetClipboard

        void renderWidgetClipboard​(org.zkoss.zk.ui.Component clipboardComponent,
                                   org.zkoss.zul.Caption caption)
        Render content of widget clipboard.
        Parameters:
        clipboardComponent - clipborad component
        caption - clipborad caption
      • showGroupWidgetWizard

        void showGroupWidgetWizard​(Widget widget,
                                   org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> onCloseListener)
        Opens a wizard where the admin user can group a widget and its children into one single widget.
        Parameters:
        widget - The root widget of the new widget group.
        onCloseListener - An EventListener which is called when the wizard is closed by the user.
      • showWidgetConnectionWizard

        void showWidgetConnectionWizard​(Widget source,
                                        Widget target,
                                        org.zkoss.zk.ui.Component ref)
        Opens a wizard where a user can connect two widgets.
        Parameters:
        source - The source widget, i.e. the widget that may fire the event.
        target - The target widget, i.e. the widget that should receive the event.
        ref - An arbitrary Component which is attached to the current page.
      • setWidgetToolbarColor

        void setWidgetToolbarColor​(java.lang.String color,
                                   org.zkoss.zk.ui.Component ref)
        Sets a new Color to the toolbar.
        Parameters:
        color - the new color
        ref - An arbitrary Component which is attached to the current page.
      • canReceiveFrom

        boolean canReceiveFrom​(WidgetSocket inputSocket,
                               Widget targetWidget,
                               WidgetSocket outputSocket,
                               Widget srcWidget)
        Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.
        Parameters:
        inputSocket - - WidgetSocket represents input socket
        outputSocket - - WidgetSocket represents output socket
        srcWidget - - (@link Widget represents source widget
        targetWidget - - (@link Widget represents target widget
        Returns:
        true, if the targetWidget.
      • canReceiveFrom

        boolean canReceiveFrom​(WidgetSocket inputSocket,
                               WidgetSocket outputSocket)
        Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.
        Parameters:
        inputSocket - - WidgetSocket represents input socket
        outputSocket - - WidgetSocket represents output socket
        Returns:
        true, if the targetWidget.
      • refreshCockpit

        void refreshCockpit()
        Clears the widget session cache, which results in recalculating the widget tree after the next page refresh.
      • createSettingsWizard

        org.zkoss.zul.Window createSettingsWizard​(org.zkoss.zk.ui.Component parent,
                                                  Widgetslot widgetslot,
                                                  Widget widget,
                                                  org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> closeCallback)
        Creates a popup of settings for given widget
        Parameters:
        parent - a component parent to which a component is appended
        widgetslot - a slot of the widget
        widget - a widget from which settings to display are taken
        closeCallback - a function which is called when settings popup is being close
        Returns:
        created Window
      • showWidgetMultiConnectionWizard

        void showWidgetMultiConnectionWizard​(Widget widget,
                                             org.zkoss.zk.ui.Component ref)
        Shows a wizard for configuration of input/output sockets.
        Parameters:
        widget - widget under configuration
        ref - parent component
      • renderWidgetDefinitionInfo

        org.zkoss.zk.ui.Component renderWidgetDefinitionInfo​(org.zkoss.zk.ui.Component parent,
                                                             WidgetDefinition wiDef)
        Renders an area of widget definition information
        Parameters:
        parent - a component parent to which a component is appended
        wiDef - a widget definition containing information to display
        Returns:
        created Component
      • setShowConnectionsFlagEnabled

        void setShowConnectionsFlagEnabled​(boolean enabled)
        Sets showConnections flag.
        Parameters:
        enabled - - value for showConnections flag
      • isShowConnectionsFlagEnabled

        boolean isShowConnectionsFlagEnabled()
        Checks showConnections flag status
        Returns:
        true, if showConnections flag is true.
      • toggleAdminMode

        void toggleAdminMode​(org.zkoss.zk.ui.Component ref)
        Toggles backoffice's admin mode
        Parameters:
        ref - parent component