public class DefaultSwingWindowManager extends AbstractWindowManager<java.awt.Window> implements SwingWindowManager
ERROR_NAME_BLANK, ERROR_WINDOW_NULL
Constructor and Description |
---|
DefaultSwingWindowManager(GriffonApplication application,
SwingWindowDisplayHandler windowDisplayHandler) |
Modifier and Type | Method and Description |
---|---|
void |
attach(java.lang.String name,
javax.swing.JInternalFrame internalFrame)
Registers an internal frame on this manager if an only if the internal frame is not null
and it's not registered already.
|
void |
detach(java.lang.String name)
Removes the internal frame from the list of manages internal frames if and only if it
is registered with this manager.
|
protected void |
doAttach(javax.swing.JInternalFrame internalFrame) |
protected void |
doAttach(java.awt.Window window) |
protected void |
doDetach(javax.swing.JInternalFrame internalFrame) |
protected void |
doDetach(java.awt.Window window) |
javax.swing.JInternalFrame |
findInternalFrame(java.lang.String name)
Finds a JInternalFrame by name.
|
java.lang.String |
findInternalWindowName(javax.swing.JInternalFrame window)
Lookups a name related to a JInternalFrame.
|
java.util.Collection<javax.swing.JInternalFrame> |
getInternalFrames()
Returns the list of internal frames managed by this manager.
|
java.util.Set<java.lang.String> |
getInternalWindowNames()
Returns a set of names related to all JInternalFrames managed by this manager.
|
void |
hide(javax.swing.JInternalFrame internalFrame)
Hides the internal frame.
|
int |
indexOfInternal(javax.swing.JInternalFrame window)
Lookups the index related to a JInternalFrame.
|
boolean |
isHideBeforeHandler()
Should the window be hidden before all ShutdownHandlers be called ?
|
protected boolean |
isWindowVisible(java.awt.Window window) |
protected SwingWindowDisplayHandler |
resolveSwingWindowDisplayHandler() |
void |
setHideBeforeHandler(boolean hideBeforeHandler)
Set if the window should be hidden before all ShutdownHandler be called.
|
void |
show(javax.swing.JInternalFrame internalFrame)
Shows the internal frame.
|
attach, canShutdown, countVisibleWindows, event, event, findWindow, findWindowName, getApplication, getAt, getStartingWindow, getWindowNames, getWindows, hide, hide, indexOf, isAutoShutdown, onShutdown, resolveStartingWindowFromConfiguration, resolveWindowDisplayHandler, show, show
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attach, canShutdown, countVisibleWindows, findWindow, findWindowName, getAt, getStartingWindow, getWindowNames, getWindows, hide, hide, indexOf, isAutoShutdown, onShutdown, show, show
@Inject @Nonnull public DefaultSwingWindowManager(@Nonnull GriffonApplication application, @Nonnull @Named(value="windowDisplayHandler") SwingWindowDisplayHandler windowDisplayHandler)
public javax.swing.JInternalFrame findInternalFrame(java.lang.String name)
name
- the value of the name: property@Nonnull public java.util.Set<java.lang.String> getInternalWindowNames()
SwingWindowManager
getInternalWindowNames
in interface SwingWindowManager
@Nullable public java.lang.String findInternalWindowName(@Nonnull javax.swing.JInternalFrame window)
SwingWindowManager
findInternalWindowName
in interface SwingWindowManager
window
- the window to be looked uppublic int indexOfInternal(@Nonnull javax.swing.JInternalFrame window)
SwingWindowManager
indexOfInternal
in interface SwingWindowManager
window
- the window to be looked uppublic java.util.Collection<javax.swing.JInternalFrame> getInternalFrames()
public void attach(@Nonnull java.lang.String name, @Nonnull javax.swing.JInternalFrame internalFrame)
name
- the value of the of the Window's nameinternalFrame
- the internal frame to be added to the list of managed internal framesprotected void doAttach(@Nonnull javax.swing.JInternalFrame internalFrame)
public void detach(@Nonnull java.lang.String name)
detach
in interface WindowManager<java.awt.Window>
detach
in class AbstractWindowManager<java.awt.Window>
name
- the value of the of the Window's nameprotected void doDetach(@Nonnull javax.swing.JInternalFrame internalFrame)
public void show(@Nonnull javax.swing.JInternalFrame internalFrame)
This method is executed SYNCHRONOUSLY in the UI thread.
internalFrame
- the internal frame to showpublic void hide(@Nonnull javax.swing.JInternalFrame internalFrame)
This method is executed SYNCHRONOUSLY in the UI thread.
internalFrame
- the internal frame to hidepublic boolean isHideBeforeHandler()
public void setHideBeforeHandler(boolean hideBeforeHandler)
hideBeforeHandler
- new value@Nonnull protected SwingWindowDisplayHandler resolveSwingWindowDisplayHandler()
protected void doAttach(@Nonnull java.awt.Window window)
doAttach
in class AbstractWindowManager<java.awt.Window>
protected void doDetach(@Nonnull java.awt.Window window)
doDetach
in class AbstractWindowManager<java.awt.Window>
protected boolean isWindowVisible(@Nonnull java.awt.Window window)
isWindowVisible
in class AbstractWindowManager<java.awt.Window>