Interface WindowClosingStrategy
-
- All Known Implementing Classes:
InvariantWindowClosingStrategy
public interface WindowClosingStrategy
Definition of an interface used to control whether a window can be closed.
A
object can be passed an implementation of this interface. Whenever the user wants to close the window (by clicking the close button or using a similar mechanism) theWindow
canClose()
method will be invoked to check if closing the window is allowed. If this method returns false the close operation will be aborted.A typical use case for this interface is displaying a confirmation message if there is unsaved data: Only if the user confirms that changed data can be thrown away, the window will be closed.
- Version:
- $Id: WindowClosingStrategy.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canClose(Window window)
Checks if the window can be closed.
-
-
-
Method Detail
-
canClose
boolean canClose(Window window)
Checks if the window can be closed. An implementation can perform any necessary operation to find out if closing the window at this moment is allowed. Only if true is returned, the window will be closed; otherwise it will remain open.- Parameters:
window
- a reference to the associated window- Returns:
- a flag whether the window can be closed
-
-