com.levigo.jadice.appbase.commands
Class AddOnContextWindowAdapter

java.lang.Object
  extended by java.awt.event.WindowAdapter
      extended by com.levigo.jadice.appbase.commands.AddOnContextWindowAdapter
All Implemented Interfaces:
WindowFocusListener, WindowListener, WindowStateListener, EventListener

public class AddOnContextWindowAdapter
extends WindowAdapter

This class ensures a correct context update and command state for window embedded AddOns.


Constructor Summary
AddOnContextWindowAdapter(Context context)
          Creates a window adapter which should be attached to addon windows, if its visibility or active state is controlled by a command.
 
Method Summary
 Context getContext()
          Returns the associated context reference.
 void windowClosed(WindowEvent e)
           
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosing, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddOnContextWindowAdapter

public AddOnContextWindowAdapter(Context context)
Creates a window adapter which should be attached to addon windows, if its visibility or active state is controlled by a command. It initiates a context update whenever the associated window is closed which causes a command state update. To avoid memory leak problems the given context reference is hold weakly. If the context reference is cleared by program or garbage collector this adapter removes itself as window listener.

Parameters:
context - the context to be updated, when addon window is closed
Method Detail

getContext

public Context getContext()
Returns the associated context reference. To avoid memory leak problems the given context reference is hold weakly. If the context reference is cleared by program or garbage collector this method will return null.

Returns:
Context or null if the context object has been garbage collected.

windowClosed

public void windowClosed(WindowEvent e)
Specified by:
windowClosed in interface WindowListener
Overrides:
windowClosed in class WindowAdapter
See Also:
WindowAdapter.windowClosed(java.awt.event.WindowEvent)


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.