Class MaximizeToggleButtonPresenter


  • public class MaximizeToggleButtonPresenter
    extends Object
    Logic for a widget that allows toggling between a "maximized" and normal (unmaximized) state. This class keeps track of the current state on its own and changes its decoration depending on whether it's in the maximized or unmaximized state. The actions taken on each transition are supplied by the caller.
    • Method Detail

      • getMaximizeCommand

        public org.uberfire.mvp.Command getMaximizeCommand()
        Returns the currently registered maximize command. Can be used to check if there is currently a maximize command registered.
      • setMaximizeCommand

        public void setMaximizeCommand​(org.uberfire.mvp.Command maximizeCommand)
        Sets the command to invoke upon each transition from unmaximized to maximized.
      • getUnmaximizeCommand

        public org.uberfire.mvp.Command getUnmaximizeCommand()
        Returns the currently registered unmaximize command. Can be used to check if there is currently an unmaximize command registered.
      • setUnmaximizeCommand

        public void setUnmaximizeCommand​(org.uberfire.mvp.Command unmaximizeCommand)
        Sets the command to invoke upon each transition from maximized to unmaximized.
      • isMaximized

        public boolean isMaximized()
        Reports whether this button is currently in the maximized state. If true, the next click will return to the normal unmaximized state. If false, the next click will transition to the maximized state.
      • setMaximized

        public void setMaximized​(boolean maximized)
        Changes the maximized state of this button without calling the commands. This can be used to notify the button that some external process has already maximized the thing in question. It is permissible but not necessary to call this method from the maximizeCommand and unmaximizeCommand.
        Parameters:
        maximized - the new maximized state to set.
      • handleClick

        public void handleClick()
        Handles a click event from the view.
      • setVisible

        public void setVisible​(boolean b)
      • enable

        public void enable()
      • disable

        public void disable()