WebObjects 5.2.3

com.webobjects.eoapplication
Class EOWindowController

java.lang.Object
  extended bycom.webobjects.eoapplication.EOController
      extended bycom.webobjects.eoapplication.EOComponentController
          extended bycom.webobjects.eoapplication.EOWindowController
All Implemented Interfaces:
ActionListener, EOAction.Enabling, EOComponentController.Activation, EventListener, NSDisposable, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions
Direct Known Subclasses:
EOInspectorController, EOSimpleWindowController

public abstract class EOWindowController
extends EOComponentController
implements ActionListener, EOComponentController.Activation

EOWindowController extends EOComponentController for windows and dialogs. It is a common superclass for more specific controllers, providing common behavior for controllers which handle different kinds of windows. There are methods to deal with the border size, the activation button, user defaults and others.


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eoapplication.EOComponentController
EOComponentController.ActionCollector, EOComponentController.Activation, EOComponentController.EndEditing, EOComponentController.Modal, EOComponentController.ResetUserInterface
 
Nested classes inherited from class com.webobjects.eoapplication.EOController
EOController.Enumeration
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Field Summary
 
Fields inherited from class com.webobjects.eoapplication.EOComponentController
Bottom, BottomLeft, BottomRight, Center, Left, Right, Top, TopLeft, TopRight
 
Fields inherited from class com.webobjects.eoapplication.EOController
ControllerAndSubcontrollersEnumeration, ControllerAndSupercontrollersEnumeration, SubcontrollersEnumeration, SupercontrollersEnumeration
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
KeyPathSeparator
 
Constructor Summary
EOWindowController()
          The (plain) constructor for EOWindowController.
EOWindowController(EOXMLUnarchiver unarchiver)
          A constructor for EOWindowController (re-)creating an EOWindowController from the definitions stored in an EOXMLUnarchiver.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Called to notify this controller that the specified ActionEvent has been handled.
 boolean activate()
          This implementation of activate calls activateWindow and returns true.
abstract  void activateWindow()
          Activates the controller's window.
 Dimension borderedSizeForComponentSize(Dimension componentSize)
          Returns the total size including the border for a specific component size.
 Dimension borderSize()
          
protected  void componentDidBecomeInvisible()
          Notification method which is called when this controller's component bomes invisible.
protected  boolean componentShouldBeResizable(JComponent component)
          Returns whether the component should be configured as being resizable.
 Dimension componentSizeForBorderedSize(Dimension componentSize)
          Calculates the component size implied by the specified size including the border.
protected  NSArray defaultActions()
          Returns the array of default actions.
 void dispose()
          Called when this controller isn't needed anymore.
protected static Dimension generateBorderSizeForRootPaneContainerClass(Class rootPaneContainerWindowClass, boolean useMenuBar)
          Returns the border size for a specific window class, which is the difference between the outer and inner size of the window.
protected  void generateComponent()
          Actually creates the component for this controller.
 JComponent integrationComponent()
          Returns the integeration component.
 Dimension minimumIntegrationComponentSize()
          Returns the minimum size for the integration component.
protected  boolean removeTransientSubcontroller(EOController controller)
          See the method description in the superclass EOController specification.
 void setUsesActivationAction(boolean flag)
          Sets whether the activation action is to be used The activation action usually appears within another window's toolbar or menu and will open a new window controlled by this controller.
 void setUsesActivationButton(boolean flag)
          Sets the flag whether an activation button is used for this window (controller).
 void setUsesUserDefaultsWindowLocation(boolean flag)
          Sets the flag whether this window will use user-defaults for its window location.
 void setUsesUserDefaultsWindowSize(boolean flag)
          Sets the flag whether this window will use user-defaults for its window size.
 void setWindowPosition(int position)
          Sets the window position, as defined by the constants in EOComponentController, for example Left or Center.
 boolean usesActivationAction()
          Returns whether the activation action is used The activation action usually appears within another window's toolbar or menu and will open a new window controlled by this controller.
 boolean usesActivationButton()
          Returns whether an activation button is used for this window (controller).
 boolean usesUserDefaultsWindowLocation()
          Returns whether this window uses user-defaults for its window location.
 boolean usesUserDefaultsWindowSize()
          Returns whether this window uses user-defaults for its window size.
protected  Dimension windowBorderSize()
          
 int windowPosition()
          Returns the window positionas defined by the constants in EOComponentController, for example Left or Center.
 
Methods inherited from class com.webobjects.eoapplication.EOComponentController
activateFirstFocusComponent, addComponentOfSubcontroller, alignsComponents, canBeTransient, canResizeHorizontally, canResizeVertically, component, componentDidBecomeVisible, defaultComponentSize, ensureMinimumComponentSizeWithoutSubcontrollers, ensureMinimumSubcontrollerAreaSize, firstFocusComponent, handleTakeValueForUnboundKey, hideInSupercontroller, hideSubcontroller, icon, insets, integrationComponentDidBecomeInvisible, integrationComponentDidBecomeVisible, isComponentPrepared, isRootComponentController, isVisible, label, lastFocusComponent, makeInvisible, makeVisible, minimumComponentSize, minimumComponentSizeWithoutSubcontrollers, minimumSubcontrollerAreaSize, prefersIconOnly, prepareComponent, removeComponentOfSubcontroller, setAlignsComponents, setCanResizeHorizontally, setCanResizeVertically, setComponent, setDefaultComponentSize, setFirstFocusComponent, setIcon, setInsets, setLabel, setLastFocusComponent, setPrefersIconOnly, setSubcontrollerArea, setToolTip, setUsesHorizontalLayout, setVisible, showInSupercontroller, showSubcontroller, subcontrollerArea, subcontrollerMinimumSizeDidChange, subcontrollerWasAdded, subcontrollerWasRemoved, toolTip, toolTipComponent, toString, usesHorizontalLayout
 
Methods inherited from class com.webobjects.eoapplication.EOController
actionNames, actions, actionWithName, additionalActions, additionalKeyValuePairs, addSubcontroller, breakConnection, breakConnectionToSubcontrollers, canAccessFieldsDirectly, canPerformActionNamed, connectionWasBroken, connectionWasEstablished, controllerEnumeration, controllersInEnumeration, controllersWithKeyValuePair, controllersWithKeyValuePairs, controllerWithKeyValuePair, controllerWithKeyValuePairs, disableActionNamed, disposableRegistry, disposeIfTransient, enableActionNamed, enabledActions, establishConnection, establishConnectionToSupercontrollers, handleQueryWithUnboundKey, hierarchicalControllerForKey, hierarchicalValueForKey, invokeMethod, isActionNamedEnabled, isAncestorOfController, isConnected, isSupercontrollerOfController, isTransientExplicitlyForbidden, prepareForNewTask, removeFromSupercontroller, removeSubcontroller, resetActions, setAdditionalActions, setAdditionalKeyValuePair, setAdditionalKeyValuePairs, setConnected, setSupercontroller, setTransientExplicitlyForbidden, setTypeName, subcontrollers, supercontroller, supercontroller, takeValueForKey, takeValueForKeyPath, typeName, unableToSetNullForKey, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EOWindowController

public EOWindowController()
The (plain) constructor for EOWindowController.


EOWindowController

public EOWindowController(EOXMLUnarchiver unarchiver)
A constructor for EOWindowController (re-)creating an EOWindowController from the definitions stored in an EOXMLUnarchiver.

Parameters:
unarchiver - the unarchiver with the stored definitions
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Called to notify this controller that the specified ActionEvent has been handled. It will activate the window and call EOSwingUtilities.eventEnded().

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - the action event that has been handled (performed)

activate

public boolean activate()
This implementation of activate calls activateWindow and returns true.

Specified by:
activate in interface EOComponentController.Activation
Returns:
always true
See Also:
activateWindow()

activateWindow

public abstract void activateWindow()
Activates the controller's window.


borderSize

public Dimension borderSize()

Returns:

borderedSizeForComponentSize

public Dimension borderedSizeForComponentSize(Dimension componentSize)
Returns the total size including the border for a specific component size.

Parameters:
componentSize - the component size
Returns:
the size including the border

componentDidBecomeInvisible

protected void componentDidBecomeInvisible()
Notification method which is called when this controller's component bomes invisible. Usually called and handled internally.

Overrides:
componentDidBecomeInvisible in class EOComponentController

componentShouldBeResizable

protected boolean componentShouldBeResizable(JComponent component)
Returns whether the component should be configured as being resizable.

Parameters:
component - The component in question
Returns:
true if resizable; false otherwise

componentSizeForBorderedSize

public Dimension componentSizeForBorderedSize(Dimension componentSize)
Calculates the component size implied by the specified size including the border.

Parameters:
componentSize - the borderd size (the component size including border)
Returns:
the calculated component size (without border)

defaultActions

protected NSArray defaultActions()
Returns the array of default actions.

Overrides:
defaultActions in class EOController
Returns:
the array of EOActions
See Also:
EOController.actions(), EOController.resetActions()

dispose

public void dispose()
Called when this controller isn't needed anymore. Removes any listeners in static lists, for example.

Specified by:
dispose in interface NSDisposable
Overrides:
dispose in class EOComponentController

generateBorderSizeForRootPaneContainerClass

protected static Dimension generateBorderSizeForRootPaneContainerClass(Class rootPaneContainerWindowClass,
                                                                       boolean useMenuBar)
Returns the border size for a specific window class, which is the difference between the outer and inner size of the window.

Parameters:
rootPaneContainerWindowClass - the window class, must be a subclass of java.awt.Window as well as implement the interface javax.swing.RootPaneContainer (as does, for example, javax.swing.JWindow)
useMenuBar - indicates whether the window will have a menu bar (inside the window)
Returns:
the dimension of the border

generateComponent

protected void generateComponent()
Actually creates the component for this controller.

Overrides:
generateComponent in class EOComponentController

integrationComponent

public JComponent integrationComponent()
Returns the integeration component. Often the same as the component.

Overrides:
integrationComponent in class EOComponentController
Returns:
the integration component

minimumIntegrationComponentSize

public Dimension minimumIntegrationComponentSize()
Returns the minimum size for the integration component.

Overrides:
minimumIntegrationComponentSize in class EOComponentController
Returns:
the minimum size

removeTransientSubcontroller

protected boolean removeTransientSubcontroller(EOController controller)
See the method description in the superclass EOController specification. EOWindowController's implementation simply returns false since its subcontroller is not allowed to become transient.

Overrides:
removeTransientSubcontroller in class EOComponentController
Parameters:
controller - The subcontroller becoming transient
Returns:
true if the subcontroller can be allowed to become transient; false otherwise

setUsesActivationAction

public void setUsesActivationAction(boolean flag)
Sets whether the activation action is to be used The activation action usually appears within another window's toolbar or menu and will open a new window controlled by this controller.

Parameters:
flag - true if the activation action is used; false otherwise

setUsesActivationButton

public void setUsesActivationButton(boolean flag)
Sets the flag whether an activation button is used for this window (controller). The activation button appears within another window and will open a new window controlled by this controller.

Parameters:
flag - if it uses the activation button

setUsesUserDefaultsWindowLocation

public void setUsesUserDefaultsWindowLocation(boolean flag)
Sets the flag whether this window will use user-defaults for its window location.

Parameters:
flag - if it uses user defaults; false otherwise

setUsesUserDefaultsWindowSize

public void setUsesUserDefaultsWindowSize(boolean flag)
Sets the flag whether this window will use user-defaults for its window size.

Parameters:
flag - if it uses user defaults; false otherwise

setWindowPosition

public void setWindowPosition(int position)
Sets the window position, as defined by the constants in EOComponentController, for example Left or Center.

Parameters:
position - the new position, one of the constants defined in EOComponentController
See Also:
EOComponentController

usesActivationAction

public boolean usesActivationAction()
Returns whether the activation action is used The activation action usually appears within another window's toolbar or menu and will open a new window controlled by this controller.

Returns:
true if the activation action is used; false otherwise

usesActivationButton

public boolean usesActivationButton()
Returns whether an activation button is used for this window (controller). The activation button appears within another window and will open a new window controlled by this controller.

Returns:
if it uses the activation button; false otherwise

usesUserDefaultsWindowLocation

public boolean usesUserDefaultsWindowLocation()
Returns whether this window uses user-defaults for its window location.

Returns:
if it uses user defaults; false otherwise

usesUserDefaultsWindowSize

public boolean usesUserDefaultsWindowSize()
Returns whether this window uses user-defaults for its window size.

Returns:
if it uses user defaults; false otherwise

windowBorderSize

protected Dimension windowBorderSize()

Returns:

windowPosition

public int windowPosition()
Returns the window positionas defined by the constants in EOComponentController, for example Left or Center.

Returns:
the window position, one of the constants defined in EOComponentController
See Also:
EOComponentController

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.