WebObjects 5.2.3

com.webobjects.eoapplication
Class EOArchiveController

java.lang.Object
  extended bycom.webobjects.eoapplication.EOController
      extended bycom.webobjects.eoapplication.EOComponentController
          extended bycom.webobjects.eoapplication.EOArchiveController
All Implemented Interfaces:
EOAction.Enabling, EOComponentController.EndEditing, EOObserving, NSDisposable, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions
Direct Known Subclasses:
EOEntityController

public abstract class EOArchiveController
extends EOComponentController
implements EOObserving, EOComponentController.EndEditing

As a subclass of EOComponentController, EOArchiveController manages a user interface component (which be default is just an empty view to hold subcontroller components). However, whereas most component controllers dynamically generate their components, archive controllers have the ability to load their components from an archive (an interface file created in Interface Builder). An archive controller has an archive name, which specifies the archive from which to load the controller's component. If, however, a controller doesn't have an archive name, the controller simply uses its default interface.

An additional feature of EOArchiveController, which is very useful for interface files, is the support of so-called controller display groups. Controller display groups contain the controller itsself as displayed object, so you can bind associations to keys implemented on the controller (typically your own subclass), for example to control the enabled aspect of associations.


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
EOArchiveController()
          Creates a new archive controller.
EOArchiveController(EOXMLUnarchiver unarchiver)
          Creates a new archive controller from an EOXMLUnarchiver.
 
Method Summary
 String archiveName()
          Returns the name of the interface file archive to be loaded by the controller instead of generating its component dynamically.
protected  void controllerDidLoadArchive(NSDictionary namedObjects)
          Invoked from loadArchive to notify the receiver that its interface file has been loaded completely.
 EODisplayGroup controllerDisplayGroup()
          Conformance to EOObjectDisplay.
protected  void controllerWillLoadArchive()
          Invoked from loadArchive to notify the receiver that its interface file is about to be loaded.
 boolean endEditing()
          Ensures that all editors of the receiver's display groups end editing (flush current user edits to the enterprise object graph if necessary).
 boolean hasControllerDisplayGroup()
          Returns whether the controller already has a controller display group.
protected  boolean loadArchive()
          If not already loaded, loads the interface file archive specified by the archiveName of the receiver.
 void objectWillChange(Object object)
          Change notification for the controller itsself if it's edited through an association of the controller display group.
protected  void prepareComponent()
          Overridden from the superclass to ensure that - if an archive name is specified for the receiver - the interface file archive is loaded before the component is prepared.
 void setArchiveName(String string)
          Sets the name of the interface file archive to be loaded by the controller instead of generating its component dynamically.
 void setControllerDisplayGroup(EODisplayGroup displayGroup)
          Sets and prepares the controller display group - the display group that contains the receiver itsself.
 String toString()
          Returns the receiver as a string describing the state of the controller.
 void willChange()
          Triggers EOObserverCenter change notifications for the controller itsself.
 
Methods inherited from class com.webobjects.eoapplication.EOComponentController
activateFirstFocusComponent, addComponentOfSubcontroller, alignsComponents, canBeTransient, canResizeHorizontally, canResizeVertically, component, componentDidBecomeInvisible, componentDidBecomeVisible, defaultComponentSize, dispose, ensureMinimumComponentSizeWithoutSubcontrollers, ensureMinimumSubcontrollerAreaSize, firstFocusComponent, generateComponent, handleTakeValueForUnboundKey, hideInSupercontroller, hideSubcontroller, icon, insets, integrationComponent, integrationComponentDidBecomeInvisible, integrationComponentDidBecomeVisible, isComponentPrepared, isRootComponentController, isVisible, label, lastFocusComponent, makeInvisible, makeVisible, minimumComponentSize, minimumComponentSizeWithoutSubcontrollers, minimumIntegrationComponentSize, minimumSubcontrollerAreaSize, prefersIconOnly, removeComponentOfSubcontroller, removeTransientSubcontroller, setAlignsComponents, setCanResizeHorizontally, setCanResizeVertically, setComponent, setDefaultComponentSize, setFirstFocusComponent, setIcon, setInsets, setLabel, setLastFocusComponent, setPrefersIconOnly, setSubcontrollerArea, setToolTip, setUsesHorizontalLayout, setVisible, showInSupercontroller, showSubcontroller, subcontrollerArea, subcontrollerMinimumSizeDidChange, subcontrollerWasAdded, subcontrollerWasRemoved, toolTip, toolTipComponent, 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, defaultActions, 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

EOArchiveController

public EOArchiveController()
Creates a new archive controller.


EOArchiveController

public EOArchiveController(EOXMLUnarchiver unarchiver)
Creates a new archive controller from an EOXMLUnarchiver.

Parameters:
unarchiver - the unarchiver providing XML attributes
Method Detail

archiveName

public String archiveName()
Returns the name of the interface file archive to be loaded by the controller instead of generating its component dynamically.

Returns:
the name of the interface file archive to be loaded by the controller

controllerDidLoadArchive

protected void controllerDidLoadArchive(NSDictionary namedObjects)
Invoked from loadArchive to notify the receiver that its interface file has been loaded completely. You can override this method to perform additional initialization for the objects loaded from the interface file archive.

Parameters:
namedObjects - dictionary with all named objects from the interface file archive (keys: names, values: objects)
See Also:
loadArchive()

controllerDisplayGroup

public EODisplayGroup controllerDisplayGroup()
Conformance to EOObjectDisplay. Returns the controller display group - the display group that contains the receiver itsself. The controller display group can be used to connect methods of the controller to the user interface through associations. If the controller is edited through associations of the controller display group, it can receive objectWillChange methods. If the controller display group has not been set so far, creates a new one and returns it.

Returns:
the controller display group of the receiver
See Also:
setControllerDisplayGroup(EODisplayGroup), objectWillChange(Object)

controllerWillLoadArchive

protected void controllerWillLoadArchive()
Invoked from loadArchive to notify the receiver that its interface file is about to be loaded. You can override this method to perform additional preparation for the archive loading process.

See Also:
loadArchive()

endEditing

public boolean endEditing()
Ensures that all editors of the receiver's display groups end editing (flush current user edits to the enterprise object graph if necessary). This method is invoked automatically before saving or reverting changes in subclasses.

Specified by:
endEditing in interface EOComponentController.EndEditing
Returns:
true if all uncommitted changes were successfully flushed; false otherwise

hasControllerDisplayGroup

public boolean hasControllerDisplayGroup()
Returns whether the controller already has a controller display group.

Returns:
true if the controller already has a controller display group; false otherwise

loadArchive

protected boolean loadArchive()
If not already loaded, loads the interface file archive specified by the archiveName of the receiver. While loading, controllers can substitute objects in objectForOutletPath. Afterwards, controllers can perform additional initialization for the objects loaded from the archive in controllerDidLoadArchive. If no archiveName is specified, this method returns false.

Returns:
true if the archive was successfully loaded; false otherwise
See Also:
controllerDidLoadArchive(NSDictionary), EOArchive#objectForOutletPath(EOArchive, String)

objectWillChange

public void objectWillChange(Object object)
Change notification for the controller itsself if it's edited through an association of the controller display group.

Specified by:
objectWillChange in interface EOObserving
Parameters:
object - the changed object (the controller itsself)
See Also:
willChange()

prepareComponent

protected void prepareComponent()
Overridden from the superclass to ensure that - if an archive name is specified for the receiver - the interface file archive is loaded before the component is prepared.

Overrides:
prepareComponent in class EOComponentController

setArchiveName

public void setArchiveName(String string)
Sets the name of the interface file archive to be loaded by the controller instead of generating its component dynamically. Throws an IllegalStateException if the receiver's archive is already loaded. In other words, you can only set the archive name before the component is generated.

Parameters:
string - the name of the interface file archive to be loaded by the controller

setControllerDisplayGroup

public void setControllerDisplayGroup(EODisplayGroup displayGroup)
Sets and prepares the controller display group - the display group that contains the receiver itsself. The controller display group can be used to connect methods of the controller to the user interface through associations. This method takes care of placing the receiver in the display group and registering the controller as observer for itsself in the EOObserverCenter, so that the controller can receive objectWillChange methods if its values are edited through associations of the controller display group.

Parameters:
displayGroup - the display group to be used as controller display group for the receiver
See Also:
controllerDisplayGroup(), objectWillChange(Object)

toString

public String toString()
Returns the receiver as a string describing the state of the controller.

Overrides:
toString in class EOComponentController
Returns:
the String representation of the receiver

willChange

public void willChange()
Triggers EOObserverCenter change notifications for the controller itsself. Invoke this method if you want to receive objectWillChange methods for the controller if it's edited through an association of the controller display group.

See Also:
objectWillChange(Object)

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

Copyright © 2004 Apple Computer, Inc.