Class MaximizeToggleButtonPresenter
- java.lang.Object
-
- org.uberfire.client.workbench.panels.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMaximizeToggleButtonPresenter.View
-
Constructor Summary
Constructors Constructor Description MaximizeToggleButtonPresenter(MaximizeToggleButtonPresenter.View view)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable()voidenable()org.uberfire.mvp.CommandgetMaximizeCommand()Returns the currently registered maximize command.org.uberfire.mvp.CommandgetUnmaximizeCommand()Returns the currently registered unmaximize command.MaximizeToggleButtonPresenter.ViewgetView()Returns the view for this presenter.voidhandleClick()Handles a click event from the view.booleanisMaximized()Reports whether this button is currently in the maximized state.voidsetMaximizeCommand(org.uberfire.mvp.Command maximizeCommand)Sets the command to invoke upon each transition from unmaximized to maximized.voidsetMaximized(boolean maximized)Changes the maximized state of this button without calling the commands.voidsetUnmaximizeCommand(org.uberfire.mvp.Command unmaximizeCommand)Sets the command to invoke upon each transition from maximized to unmaximized.voidsetVisible(boolean b)
-
-
-
Constructor Detail
-
MaximizeToggleButtonPresenter
public MaximizeToggleButtonPresenter(MaximizeToggleButtonPresenter.View view)
-
-
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.
-
getView
public MaximizeToggleButtonPresenter.View getView()
Returns the view for this presenter.- Returns:
-
setVisible
public void setVisible(boolean b)
-
enable
public void enable()
-
disable
public void disable()
-
-