|
WebObjects 5.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.webobjects.eoapplication.EOController
The EOController class defines basic behavior for controller objects that are responsible for managing and sometimes generating the user interface for the client side of a Java Client application. An application's controllers are arranged in a hierarchy which describes the complete functionality of an application.
The controller hierarchy mirrors the hierarchy of windows and widgets that make up the client application's user interface. The root of the hierarchy is an EOApplication object. The EOApplication's subcontrollers are usually window or applet controllers, which themselves have subcontrollers.
The most significant functionality provided by the EOController class is managing the controller hierarchy (building, connecting, and traversing the hierarchy) and handling actions.
ConstructorsAll controller classes need to implement the no-argument constructor. In addition, if they may be instantiated from an XML description, they need to implement a constructor taking a single EOXMLUnarchiver argument. The no-argument constructor is used for all programmatic creation of controllers.
Controllers should avoid complex initialization procedures in the constructor. Instead they should attempt to create all the objects they need to perform their task lazily, only when they are needed. Controllers are usually used in various types of situations and there is no guarantee that they are ever used, even if they are in the controller hierarchy. For example the user interface managed by a controller might be placed in a tab view and never be activated by the user. By creating objects and user interfaces lazily, the response time of average applications gets much better.
Traversing the Controller HierarchyEOController defines numerous methods for traversing the controller
hierarchy, but a single method provides the basic traversal functionality.
The method controllerEnumeration creates and returns an enumeration that
includes all the subcontrollers of a controller (not including the controller),
all the supercontrollers of a controller (not including the controller), or a
controller and its subcontrollers. You can further restrict the controllers
included in an enumeration by specifying an interface the controllers must
implement in order to be included. For more information, see the
EOController.Enumeration interface specification and the method description
for controllerEnumeration.
Other methods that traverse the controller hierarchy use a controller
enumeration to perform the traversal. There are methods that return
controllers in an enumeration that match one or more key-value pairs and
methods that use key-value coding on the controllers in an enumeration,
returning the first controller that has a specified key or returning the
value for that key. Also, there's a method invokeMethod that
invokes a particular method on the controllers in an enumeration.
A controller in the controller hierarchy can be connected to its supercontroller or not. Controllers are connected when they're performing their duties, and they are disconnected when they become idle. Generally controllers are connected only when their user interface is visible. For example, the controllers associated with a window are connected when the window is visible, and they're disconnected when the window becomes invisible.
When a controller connects to its supercontroller, it gets from its supercontroller whatever resources or information it needs, and it prepares itself in whatever way necessary to perform its duties (for example, setting delegates). Similarly, when a controller breaks its connection to its supercontroller, it cleans up its resources for an idle period.
The EOController class defines methods for connecting controllers. There are
methods for connecting and disconnecting a controller from its supercontroller
(establishConnection and breakConnection), and also
methods that make connections all the way up the controller hierarchy
(establishConnectionToSupercontrollers) and break connections all
the way down (breakConnectionToSubcontrollers). Generally you use
the latter methods that connect or disconnect an entire branch of a tree.
EOController's implementations of all these methods is generally sufficient
for subclasses. They set the connection status of a controller (setConnected),
and notify the controller that its connection has been established or broken.
You shouldn't have to override these methods.
If you do need to do something when a controller is connected or
disconnected, you should override the methods connectionWasEstablished and
connectionWasBroken. These methods are invoked automatically by
establishConnection and breakConnection.
Controllers define actions that users can perform (such as quitting the application or saving a document) and they know how to respond to those actions when they're performed. EOController defines methods that manage a controllers actions.
A controller has a set of actions. It also keeps track of which of those
actions are enabled and which are disabled. For performance reasons,
EOController's method implementations cache some of this information. Thus,
whenever you do something that changes a controller's actions
(such as adding a new subcontroller or enabling or disabling an action),
the caches must be reset. Most of the time they're reset automatically, but
subclasses might need to explicitly reset them with the method resetActions.
To specify the actions a subclass understands, override the method
defaultActions. However, to find out what actions a controller
understands, use actions. This method simply manages and returns a
cache of the methods returned by defaultActions. Some implementations
of a defaultActions method are potentially costly to invoke over and
over again, because they dynamically build their collections of actions. The
actions method is simply an optimization. EOController's implementation
of actions should be sufficient for subclasses; you should never need to override it.
To find out what actions a controller can perform at a specific point in
time, use the method enabledActions. This method returns only the
controller's actions that aren't explicitly disabled. As with actions,
enabledActions manages and returns a cache of methods, and
EOController's implemenation should be sufficient for subclasses.
Some controllers are needed only to dynamically generate the user interface
and don't serve any purpose after the user interface has been created and
connected. For example, an EOTextFieldController creates a widget and a
corresponding association and then is no longer needed. Controllers such as
EOTextFieldController can be transient, because after their work is done,
they can usually be removed from the controller hierarchy and disposed of
(with disposeIfTransient). This keeps the controller hierarchy
simple, which makes user interface management more efficient.
Controllers specify whether or not they can be transient by overriding the
method canBeTransient. Some controllers can be transient sometimes
and not other times, so not all implementations simply return true or false. For
example, an EOTableController can be transient if the double click action is
unassigned. If the action is assigned, however, the controller must listen
for a double click and react when one occurs.
Subclasses that can be transient should invoke the method
disposeIfTransient as soon as their work is done and they can be
disposed of. Sometimes a controller's supercontroller doesn't allow the controller
to be disposed of. For example, the EOTabSwitchComponent doesn't allow its
subcontrollers to become transient.
| Inner Class Summary | |
static interface |
EOController.Enumeration
EOController.Enumeration is an interface that defines an enumeration
that iterates over a set of EOController objects. |
| Inner classes inherited from class com.webobjects.foundation.NSKeyValueCoding |
NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor |
| Inner classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions |
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility |
| Field Summary | |
static int |
ControllerAndSubcontrollersEnumeration
The constant describing enumerations that enumerate over a controller and its subcontrollers. |
static int |
SubcontrollersEnumeration
The constant describing enumerations that enumerate over a controller's subcontrollers, not including the controller itself. |
static int |
SupercontrollersEnumeration
The constant describing enumerations that enumerate over a controller's supercontrollers, not including the controller itself. |
| Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
NullValue |
| Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
KeyPathSeparator |
| Constructor Summary | |
EOController()
Creates a new controller. |
|
EOController(EOXMLUnarchiver unarchiver)
Creates a new controller. |
|
| Method Summary | |
NSArray |
actionNames()
Returns an array of action method names the controller defines and responds to. |
NSArray |
actions()
Returns a cached array containing the receiver's actions. |
EOAction |
actionWithName(String actionName)
If the receiver has an action for a method with name actionName,
this method returns that action; otherwise, the method returns null. |
void |
addSubcontroller(EOController controller)
Adds controller as a subcontroller of the receiver and
sets the receiver as controller's supercontroller - first removing
controller from its supercontroller if it already has one. |
void |
breakConnection()
Breaks the receiver's connection to its supercontroller. |
void |
breakConnectionToSubcontrollers()
Breaks the connections the receiver's subcontrollers have to their subcontrollers, and then breaks the receiver's connections to its subcontrollers. |
static boolean |
canAccessFieldsDirectly()
Conformance to NSKeyValueCoding. |
boolean |
canBeTransient()
Returns whether the controller can be transient. |
boolean |
canPerformActionNamed(String actionName)
Conformance to EOAction.Enabling. |
protected void |
connectionWasBroken()
Invoked from breakConnection to notify the receiver that its
connection to its supercontroller has been broken, giving the receiver the
opportunity to clean up after its become idle. |
protected void |
connectionWasEstablished()
Invoked from establishConnection to notify the receiver that its
connection to the controller hierarchy has been established, giving the
receiver the opportunity to prepare itself (for example, setting delegates). |
EOController.Enumeration |
controllerEnumeration(int enumerationType,
Class controllerInterface)
Returns an EOController.Enumeration object you can use to
traverse the controller hierarchy. |
NSArray |
controllersInEnumeration(int enumerationType,
Class controllerInterface)
Returns all the controllers in an enumeration as an array. |
NSArray |
controllersWithKeyValuePair(int enumerationType,
Class controllerInterface,
String key,
Object value)
Traverses the controller hierarchy, and returns all controllers in the hierarchy whose value for key matches value. |
NSArray |
controllersWithKeyValuePairs(int enumerationType,
Class controllerInterface,
NSDictionary keyValuePairs)
Traverses the controller hierarchy, and returns all controllers in the hierarchy which match all key/value pairs in keyValuePairs. |
EOController |
controllerWithKeyValuePair(int enumerationType,
Class controllerInterface,
String key,
Object value)
Traverses the controller hierarchy, and returns the first controller in the hierarchy whose value for key matches value. |
EOController |
controllerWithKeyValuePairs(int enumerationType,
Class controllerInterface,
NSDictionary keyValuePairs)
Traverses the controller hierarchy, and returns the first controller in the hierarchy which matches all key-value pairs in keyValuePairs. |
protected NSArray |
defaultActions()
Returns an array of the receiver's default actions (EOAction objects). |
void |
disableActionNamed(String actionName)
Explicitly disables the action method actionName and resets the receiver's actions. |
NSDisposableRegistry |
disposableRegistry()
Returns the receiver's disposable registry. |
void |
dispose()
Prepares the receiver so it is disposed when Java performs garbage collection. |
protected boolean |
disposeIfTransient()
Disposes the receiver if it's transient, first removing it from its supercontroller with removeTransientSubcontroller If the
receiver's supercontroller is non-null, this method also attempts to
dispose of the supercontroller if it's transient. |
void |
enableActionNamed(String actionName)
Enables the action method actionName and resets the receiver's actions. |
NSArray |
enabledActions()
Returns an array of the receiver's actions which are not explicitly disabled. |
void |
establishConnection()
Connects the receiver to the controller hierarchy. |
void |
establishConnectionToSupercontrollers()
Connects the receiver's supercontroller to the controller hierarchy, and then establishes the receiver's connection to the controller hierarchy. |
Object |
handleQueryWithUnboundKey(String key)
Conformance to NSKeyValueCoding.ErrorHandling. |
void |
handleTakeValueForUnboundKey(Object value,
String key)
Conformance to NSKeyValueCoding.ErrorHandling. |
EOController |
hierarchicalControllerForKey(Class controllerInterface,
String key)
Starting at the receiver, searches up the controller hierarchy for the first controller that implements the interface controllerInterface and
has a non-null value for key and returns that controller. |
Object |
hierarchicalValueForKey(Class controllerInterface,
String key)
Starting at the receiver, searches up the controller hierarchy for the first controller that implements the interface controllerInterface and
has a non-null value for key and returns that value. |
void |
invokeMethod(int enumerationType,
Class controllerInterface,
String methodName,
Class[] parameterTypes,
Object[] parameters)
Traverses the controller hierarchy, invoking the method specified by methodName and parameterTypes on the
appropriate controllers. |
boolean |
isActionNamedEnabled(String actionName)
Returns whether the action method actionName isn't explicitly disabled. |
boolean |
isAncestorOfController(EOController controller)
Returns whether controller is a subcontroller of the receiver,
of the receiver's subcontrollers, or their subcontrollers, and so on. |
boolean |
isConnected()
Returns the receiver's connection status. |
boolean |
isSupercontrollerOfController(EOController controller)
Returns whether controller is a direct subcontroller of the receiver. |
protected boolean |
isTransientExplicitlyForbidden()
Returns whether transience is explicitly forbidden for this controller. |
void |
prepareForNewTask(boolean prepareSubcontrollersForNewTask)
Prepares the receiver for performing a new task by resetting any data. |
void |
removeFromSupercontroller()
Removes the receiver from its supercontroller's set of subcontrollers. |
protected void |
removeSubcontroller(EOController controller)
Removes controller from the controller hierarchy. |
protected boolean |
removeTransientSubcontroller(EOController controller)
Removes controller from the controller hierarchy if controller
can be transient and if the receiver allows it. |
void |
resetActions()
Destroys the receiver's cache of actions and enabled actions, and destroys the action caches of the receiver's supercontrollers. |
protected void |
setConnected(boolean flag)
Sets the receiver's connection status. |
protected boolean |
setSupercontroller(EOController controller)
Sets the receiver's supercontroller to controller and resets
the receiver's actions. |
protected void |
setTransientExplicitlyForbidden(boolean flag)
Sets whether transience is explicitly forbidden for this controller. |
void |
setTypeName(String typeName)
Sets the receiver's type name. |
NSArray |
subcontrollers()
Returns the receiver's direct subcontrollers. |
protected void |
subcontrollerWasAdded(EOController controller)
Invoked from addSubcontroller to notify the receiver that a
subcontroller has been added to the controller hierarchy, giving
the receiver the opportunity to prepare the subcontroller for use. |
protected void |
subcontrollerWasRemoved(EOController controller)
Invoked from removeSubcontroller to notify the receiver that a
subcontroller has been removed from the controller hierarchy, giving
the receiver the opportunity to perform any necessary clean up. |
EOController |
supercontroller()
Returns the receiver's supercontroller, or null
if the receiver has no supercontroller. |
EOController |
supercontroller(Class controllerInterface)
Searching from the receiver's direct supercontroller, returns the first supercontroller that implements the interface controllerInterface. |
void |
takeValueForKey(Object value,
String key)
Conformance to NSKeyValueCoding. |
void |
takeValueForKeyPath(Object value,
String keyPath)
Conformance to NSKeyValueCodingAdditions. |
String |
toString()
Returns the receiver as a string that states the receiver's class name and type name, whether the receiver is connected, and the number of subcontrollers. |
String |
typeName()
Returns the receiver's type name a string that uniquely identifies the receiver as a node in the controller hierarchy. |
void |
unableToSetNullForKey(String key)
Conformance to NSKeyValueCoding.ErrorHandling. |
Object |
valueForKey(String key)
Conformance to NSKeyValueCoding. |
Object |
valueForKeyPath(String keyPath)
Conformance to NSKeyValueCodingAdditions. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int ControllerAndSubcontrollersEnumeration
public static final int SubcontrollersEnumeration
public static final int SupercontrollersEnumeration
| Constructor Detail |
public EOController()
public EOController(EOXMLUnarchiver unarchiver)
unarchiver - the unarchiver providing XML attributes| Method Detail |
public NSArray actionNames()
public EOAction actionWithName(String actionName)
actionName,
this method returns that action; otherwise, the method returns null.actionName - the action method namenull otherwisepublic NSArray actions()
defaultActions and returns that.
The cache is cleared with the method resetActions.defaultActions(),
enabledActions(),
resetActions()public void addSubcontroller(EOController controller)
Adds controller as a subcontroller of the receiver and
sets the receiver as controller's supercontroller - first removing
controller from its supercontroller if it already has one.
Invoke this method to add a subcontroller to the hierarchy.
EOController's implementation sets subcontroller's supercontroller
and notifies the receiver that a subcontroller was added. It does nothing
if the receiver is already a supercontroller of controller.
The default implementation of this method should be sufficient for most
subclasses; you shouldn't have to override it. If you need to do something
special when a subcontroller is added, override subcontrollerWasAdded.
controller - the controller to be addedsubcontrollerWasAdded(EOController)public void breakConnection()
connectionWasBroken to give the receiver a chance to clean
up, and informs all its supercontrolllers that a subcontroller's connection
status has changed so the supercontrolllers can react appropriately. Use this
method to programmatically disconnect a single controller (and not its
supercontrollers). EOController's implementation is sufficient for most
subclasses, so you don't ordinarily override this method.connectionWasBroken(),
breakConnectionToSubcontrollers()public void breakConnectionToSubcontrollers()
breakConnection()public static boolean canAccessFieldsDirectly()
false.falseNSKeyValueCodingpublic boolean canBeTransient()
false.true if the controller can be transient; false otherwisepublic boolean canPerformActionNamed(String actionName)
EOAction.Enabling. See the method description
of canPerformActionNamed in the interface specification for
EOAction.Enabling.canPerformActionNamed in interface EOAction.EnablingactionName - the action method nametrue if the action should be enabled; false otherwiseEOAction.Enablingprotected void connectionWasBroken()
breakConnection to notify the receiver that its
connection to its supercontroller has been broken, giving the receiver the
opportunity to clean up after its become idle.breakConnection()protected void connectionWasEstablished()
establishConnection to notify the receiver that its
connection to the controller hierarchy has been established, giving the
receiver the opportunity to prepare itself (for example, setting delegates).establishConnection()
public EOController.Enumeration controllerEnumeration(int enumerationType,
Class controllerInterface)
EOController.Enumeration object you can use to
traverse the controller hierarchy. enumerationType determines
how to traverse the hiearchy. The enumeration will only contain controllers
implementing the interface controllerInterface. If
controllerInterface is null, the enumeration will contain all
controllers for the specified enumeration type.enumerationType - the type of the enumeration, one of
EOController.SubcontrollersEnumeration,
EOController.SupercontrollersEnumeration, or
EOController.ControllerAndSubcontrollersEnumerationcontrollerInterface - the interface to filter controllers outEOController.Enumeration
public EOController controllerWithKeyValuePair(int enumerationType,
Class controllerInterface,
String key,
Object value)
key matches value. This
method uses a controller enumeration specified by enumerationType
and controllerInterface to find the controller. The method tests
the controllers returned by the enumeration for a match and returns
the first one that matches. Matches are determined with the method
valueForKeyPath.enumerationType - the type of the enumeration, one of
EOController.SubcontrollersEnumeration,
EOController.SupercontrollersEnumeration, or
EOController.ControllerAndSubcontrollersEnumerationcontrollerInterface - the interface to filter controllers outkey - the key to matchvalue - the value to matchcontrollerWithKeyValuePairs(int, Class, NSDictionary),
controllerEnumeration(int, Class),
valueForKeyPath(String)
public EOController controllerWithKeyValuePairs(int enumerationType,
Class controllerInterface,
NSDictionary keyValuePairs)
keyValuePairs. This
method uses a controller enumeration specified by enumerationType
and controllerInterface to find the controller. The method tests
the controllers returned by the enumeration for a match and returns
the first one that matches. Matches are determined with the method
valueForKeyPath.enumerationType - the type of the enumeration, one of
EOController.SubcontrollersEnumeration,
EOController.SupercontrollersEnumeration, or
EOController.ControllerAndSubcontrollersEnumerationcontrollerInterface - the interface to filter controllers outkeyValuePairs - the key-value pairs to matchcontrollerWithKeyValuePair(int, Class, String, Object),
controllerEnumeration(int, Class),
valueForKeyPath(String)
public NSArray controllersInEnumeration(int enumerationType,
Class controllerInterface)
enumerationType - the type of the enumeration, one of
EOController.SubcontrollersEnumeration,
EOController.SupercontrollersEnumeration, or
EOController.ControllerAndSubcontrollersEnumerationcontrollerInterface - the interface to filter controllers outcontrollerEnumeration(int, Class)
public NSArray controllersWithKeyValuePair(int enumerationType,
Class controllerInterface,
String key,
Object value)
key matches value. This
method uses a controller enumeration specified by enumerationType
and controllerInterface to find the controllers. The method tests
the controllers returned by the enumeration for a match and returns all the ones
which match the key-value pair. Matches are determined with the method
valueForKeyPath.enumerationType - the type of the enumeration, one of
EOController.SubcontrollersEnumeration,
EOController.SupercontrollersEnumeration, or
EOController.ControllerAndSubcontrollersEnumeration.controllerInterface - the interface to filter controllers outkey - the key to matchvalue - the value to matchcontrollersWithKeyValuePairs(int, Class, NSDictionary),
controllerEnumeration(int, Class),
valueForKeyPath(String)
public NSArray controllersWithKeyValuePairs(int enumerationType,
Class controllerInterface,
NSDictionary keyValuePairs)
keyValuePairs. This
method uses a controller enumeration specified by enumerationType
and controllerInterface to find the controllers. The method tests
the controllers returned by the enumeration for a match and returns all the ones
which match the key-value pairs. Matches are determined with the method
valueForKeyPath.enumerationType - the type of the enumeration, one of
EOController.SubcontrollersEnumeration,
EOController.SupercontrollersEnumeration, or
EOController.ControllerAndSubcontrollersEnumeration.controllerInterface - the interface to filter controllers outkeyValuePairs - the key/value pairs to matchcontrollersWithKeyValuePair(int, Class, String, Object),
controllerEnumeration(int, Class),
valueForKeyPath(String)protected NSArray defaultActions()
actions, which caches the
results of defaultActions and is therefore more efficient.actions(),
resetActions()public void disableActionNamed(String actionName)
actionName and resets the receiver's actions.actionName - the action method namepublic NSDisposableRegistry disposableRegistry()
public void dispose()
dispose in interface NSDisposableprotected boolean disposeIfTransient()
removeTransientSubcontroller If the
receiver's supercontroller is non-null, this method also attempts to
dispose of the supercontroller if it's transient. Supercontrollers can
prevent a controller from becoming transient, in which case this method
returns false. Subclasses should first invoke the super
implementation and only continue disposing if the super implementation
returns true.true if the receiver can be transient and has been
disposed; false otherwiseremoveTransientSubcontroller(EOController)public void enableActionNamed(String actionName)
actionName and resets the receiver's actions.actionName - the action method namepublic NSArray enabledActions()
resetActions.defaultActions(),
actions(),
resetActions()public void establishConnection()
connectionWasEstablished to give the receiver a chance to
prepare the user interface. After connecting the receiver, this method
disposes of it if it's transient and is therefore no longer needed.
Use this method to connect a single controller (and not its supercontrollers).
EOController's implementation is sufficient for most subclasses,
so you don't ordinarily override this method.connectionWasEstablished(),
establishConnectionToSupercontrollers()public void establishConnectionToSupercontrollers()
establishConnection()public Object handleQueryWithUnboundKey(String key)
handleQueryWithUnboundKey in the interface specification for
NSKeyValueCoding.ErrorHandling.handleQueryWithUnboundKey in interface NSKeyValueCoding.ErrorHandlingNSKeyValueCoding.ErrorHandling
public void handleTakeValueForUnboundKey(Object value,
String key)
handleTakeValueForUnboundKey in the interface specification for
NSKeyValueCoding.ErrorHandling.handleTakeValueForUnboundKey in interface NSKeyValueCoding.ErrorHandlingNSKeyValueCoding.ErrorHandling
public EOController hierarchicalControllerForKey(Class controllerInterface,
String key)
controllerInterface and
has a non-null value for key and returns that controller. If
controllerInterface is null, tests all controllers.controllerInterface - the interface required by the controllers to be testedkey - the key to look upnull otherwise
public Object hierarchicalValueForKey(Class controllerInterface,
String key)
controllerInterface and
has a non-null value for key and returns that value. If
controllerInterface is null, tests all controllers.controllerInterface - the interface required by the controllers to be testedkey - the key to look upnull value for the key if one exists; null otherwise
public void invokeMethod(int enumerationType,
Class controllerInterface,
String methodName,
Class[] parameterTypes,
Object[] parameters)
methodName and parameterTypes on the
appropriate controllers. Uses a controller enumeration specified by
enumerationType and controllerInterface to find
the controllers on which to invoke the specified method. For each controller
in the enumeration, this method invokes the method methodName
with the values in parameters as arguments.enumerationType - the type of the enumeration, one of
EOController.SubcontrollersEnumeration,
EOController.SupercontrollersEnumeration, or
EOController.ControllerAndSubcontrollersEnumerationcontrollerInterface - the interface to filter controllers outmethodName - the name of the methodparameterTypes - the types of the parametersparameters - the parameterscontrollerEnumeration(int, Class)public boolean isActionNamedEnabled(String actionName)
actionName isn't explicitly disabled.actionName - the action method nametrue if the action isn't explicitly disabled; false otherwisepublic boolean isAncestorOfController(EOController controller)
controller is a subcontroller of the receiver,
of the receiver's subcontrollers, or their subcontrollers, and so on.controller - the controller to testtrue if controller is a subcontroller of the receiver, of the receiver's
subcontrollers, or their subcontrollers, and so on; false otherwisepublic boolean isConnected()
true if the controller is connected; false otherwisepublic boolean isSupercontrollerOfController(EOController controller)
controller is a direct subcontroller of the receiver.controller - the controller to testtrue if the controller is a direct subcontroller of the receiver; false otherwiseprotected boolean isTransientExplicitlyForbidden()
true if the controller cannot be transient; false otherwisepublic void prepareForNewTask(boolean prepareSubcontrollersForNewTask)
prepareSubcontrollersForNewTask is true,
this method also sends prepareForNewTask to each of the receiver's subcontrollers.
This method is usually invoked to prepare a branch of the controller
for reuse. Subclasses should override this method to get rid of data
and perform any additional clean up.prepareSubcontrollersForNewTask - true if the method should be forwarded
to all subcontrollers; false otherwisepublic void removeFromSupercontroller()
removeSubcontroller
on the receiver's supercontroller. This method is mostly a convenience
so you don't have to look up a controller's supercontroller.
The default implementation should be sufficient for subclasses;
you shouldn't have to override it.removeSubcontroller(EOController)protected void removeSubcontroller(EOController controller)
Removes controller from the controller hierarchy.
EOController's implementation disconnects controller
from the controller hierarchy, and invokes subcontrollerWasRemoved
on the receiver to give it a chance to react appropriately.
Never invoke this method directly; use removeFromSupercontroller
instead. The default implementation should be sufficient for subclasses;
you shouldn't have to override it. If you need to do something when a
subcontroller is removed, override subcontrollerWasRemoved.
controller - the controller to be removedsubcontrollerWasRemoved(EOController)protected boolean removeTransientSubcontroller(EOController controller)
controller from the controller hierarchy if controller
can be transient and if the receiver allows it. Returns whether the
controller can be removed. This method is invoked from
disposeIfTransient, which is invoked in various situations
to remove controllers as soon as they can become transient.controller - the controller to remove because it becomes transienttrue if the controller could be removed; false otherwisedisposeIfTransient()public void resetActions()
protected void setConnected(boolean flag)
establishConnection and
breakConnection set the controller's connection status automatically.flag - true if the controller is connected; false otherwiseestablishConnection(),
breakConnection()protected boolean setSupercontroller(EOController controller)
controller and resets
the receiver's actions. Returns whether the supercontroller accepted the
receiver as subcontroller. Also, controller can be null to unset the
receiver's supercontroller. EOController's implementation is sufficient
for most subclasses; you don't normally override this method. Nor should you
ever need to invoke it; addSubcontroller sets the supercontroller automatically.controller - the supercontrollertrue if the supercontroller accepted the controller as subcontroller; false otherwiseaddSubcontroller(EOController)protected void setTransientExplicitlyForbidden(boolean flag)
flag - true if the controller cannot be transient; false otherwisepublic void setTypeName(String typeName)
typeName - the controller's type nameprotected void subcontrollerWasAdded(EOController controller)
addSubcontroller to notify the receiver that a
subcontroller has been added to the controller hierarchy, giving
the receiver the opportunity to prepare the subcontroller for use.controller - the subcontroller just addedaddSubcontroller(EOController)protected void subcontrollerWasRemoved(EOController controller)
removeSubcontroller to notify the receiver that a
subcontroller has been removed from the controller hierarchy, giving
the receiver the opportunity to perform any necessary clean up.controller - the subcontroller just removedremoveSubcontroller(EOController)public NSArray subcontrollers()
controllerEnumeration
or controllersInEnumeration to return all the controllers in the
hierarchy under the receiver.controllerEnumeration(int, Class),
controllersInEnumeration(int, Class)public EOController supercontroller()
null
if the receiver has no supercontroller.public EOController supercontroller(Class controllerInterface)
controllerInterface.
Returns null if the receiver has no supercontroller or if
none of the supercontrollers implement the interface. Returns receiver's direct
supercontroller if controllerInterface is null.controllerInterface - the controller interface to look fornull otherwise
public void takeValueForKey(Object value,
String key)
takeValueForKey in the interface specification for
NSKeyValueCoding.takeValueForKey in interface NSKeyValueCodingNSKeyValueCoding
public void takeValueForKeyPath(Object value,
String keyPath)
takeValueForKeyPath in the interface specification for
NSKeyValueCodingAdditions.takeValueForKeyPath in interface NSKeyValueCodingAdditionsNSKeyValueCodingAdditionspublic String toString()
toString in class Objectpublic String typeName()
null. The type name is used to identify controllers that have the same
task. It is used to configure a controller with user defaults and also to
reuse controllers when possible.public void unableToSetNullForKey(String key)
unableToSetNullForKey in the interface specification for
NSKeyValueCoding.ErrorHandling.unableToSetNullForKey in interface NSKeyValueCoding.ErrorHandlingNSKeyValueCoding.ErrorHandlingpublic Object valueForKey(String key)
valueForKey in the interface specification for
NSKeyValueCoding.valueForKey in interface NSKeyValueCodingNSKeyValueCodingpublic Object valueForKeyPath(String keyPath)
valueForKeyPath in the interface specification for
NSKeyValueCodingAdditions.valueForKeyPath in interface NSKeyValueCodingAdditionsNSKeyValueCodingAdditions
|
Last updated Thu Jan 10 18:10:21 PST 2002. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||