public class AWTWindowClosingProtocol extends Object implements WindowClosingProtocol
WindowClosingProtocol.WindowClosingMode
Constructor and Description |
---|
AWTWindowClosingProtocol(Component comp,
Runnable closingOperationClose,
Runnable closingOperationNOP) |
Modifier and Type | Method and Description |
---|---|
boolean |
addClosingListener()
Adds this closing listener to the components Window if exist and only one time.
|
WindowClosingProtocol.WindowClosingMode |
getDefaultCloseOperation() |
boolean |
removeClosingListener() |
WindowClosingProtocol.WindowClosingMode |
setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode op) |
public AWTWindowClosingProtocol(Component comp, Runnable closingOperationClose, Runnable closingOperationNOP)
comp
- mandatory AWT component which AWT Window is being queried by parent traversalclosingOperationClose
- mandatory closing operation, triggered if windowClosing and WindowClosingMode#DISPOSE_ON_CLOSE
closingOperationNOP
- optional closing operation, triggered if windowClosing and WindowClosingMode#DO_NOTHING_ON_CLOSE
public final boolean addClosingListener() throws IllegalStateException
If the closing listener is already added, and IllegalStateException
is thrown.
IllegalStateException
public final boolean removeClosingListener()
public final WindowClosingProtocol.WindowClosingMode getDefaultCloseOperation()
getDefaultCloseOperation
in interface WindowClosingProtocol
setDefaultCloseOperation(int)
,
otherwise return the AWT/Swing close operation value translated to
a WindowClosingProtocol
value .WindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE
,
WindowClosingProtocol.WindowClosingMode.DO_NOTHING_ON_CLOSE
public final WindowClosingProtocol.WindowClosingMode setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode op)
setDefaultCloseOperation
in interface WindowClosingProtocol
op
- the new close operation valueWindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE
,
WindowClosingProtocol.WindowClosingMode.DO_NOTHING_ON_CLOSE
Copyright 2010 JogAmp Community.