bibliothek.gui.dock.event
Class VetoableDockFrontendEvent

java.lang.Object
  extended by bibliothek.gui.dock.event.VetoableDockFrontendEvent

public class VetoableDockFrontendEvent
extends Object

Event that is received by a VetoableDockFrontendListener.

Author:
Benjamin Sigg

Constructor Summary
VetoableDockFrontendEvent(DockFrontend frontend, Dockable dockable, boolean cancelable, boolean expected)
          Creates a new event
 
Method Summary
 void cancel()
          Aborts the operation.
 Dockable getDockable()
          Gets the element which will be or is hidden.
 DockFrontend getFrontend()
          Gets the source of the event.
 boolean isCancelable()
          Tells whether the operation can be canceled or not.
 boolean isCanceled()
          Whether the operation is aborted or not.
 boolean isExpected()
          Tells whether VetoableDockFrontendListener.hiding(VetoableDockFrontendEvent) or VetoableDockFrontendListener.showing(VetoableDockFrontendEvent) was called for this event or not.
If true then this is a standard expected event that either happens when the user clicks onto the close-action delivered by DockFrontend, or if the client calls DockFrontend.hide(Dockable, boolean) or DockFrontend.show(Dockable, boolean).
If false then this is an unexpected event that can have any cause, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VetoableDockFrontendEvent

public VetoableDockFrontendEvent(DockFrontend frontend,
                                 Dockable dockable,
                                 boolean cancelable,
                                 boolean expected)
Creates a new event

Parameters:
frontend - the source of the event
dockable - the element which will be or is hidden
cancelable - whether the operation can be aborted
expected - whether the event is expected or unexpected
Method Detail

getFrontend

public DockFrontend getFrontend()
Gets the source of the event.

Returns:
the source, never null

getDockable

public Dockable getDockable()
Gets the element which will be or is hidden.

Returns:
the element, never null

isCancelable

public boolean isCancelable()
Tells whether the operation can be canceled or not. If not, then the result of VetoableDockFrontendListener.hiding(VetoableDockFrontendEvent) will be ignored.

Returns:
true if the operation can be stopped

cancel

public void cancel()
Aborts the operation. Has no effect if isCancelable() returns false or the operation is already executed.


isCanceled

public boolean isCanceled()
Whether the operation is aborted or not.

Returns:
true if the operation is aborted

isExpected

public boolean isExpected()
Tells whether VetoableDockFrontendListener.hiding(VetoableDockFrontendEvent) or VetoableDockFrontendListener.showing(VetoableDockFrontendEvent) was called for this event or not.
If true then this is a standard expected event that either happens when the user clicks onto the close-action delivered by DockFrontend, or if the client calls DockFrontend.hide(Dockable, boolean) or DockFrontend.show(Dockable, boolean).
If false then this is an unexpected event that can have any cause, i.e. loading a new layout.

Returns:
whether the event is expected or unexpected