WebObjects 5.2

com.webobjects.directtoweb
Class D2WSwitchComponent

java.lang.Object
  |
  +--com.webobjects.appserver.WOElement
        |
        +--com.webobjects.appserver.WOComponent
              |
              +--com.webobjects.directtoweb.D2WSwitchComponent
All Implemented Interfaces:
Cloneable, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, WOActionResults

public class D2WSwitchComponent
extends WOComponent

The D2WSwitchComponent class gives a reusable Direct to Web component the option to choose which D2WComponent to use in a given context.

See Also:
Serialized Form

Inner classes inherited from class com.webobjects.appserver.WOComponent
WOComponent.Event
 
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
 
Inner classes inherited from class com.webobjects.foundation.NSValidation
NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected static Vector possibleBindings
          The set of possible bindings.
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
KeyPathSeparator
 
Constructor Summary
D2WSwitchComponent(WOContext aContext)
          Creates an instance of D2WSwitchComponent with the specified context.
 
Method Summary
static void addToPossibleBindings(String newBinding)
          Adds the specified binding to the set of possible bindings.
 void awake()
          Throws an exception if any of the required bindings are missing.
 String componentName()
          Gets the name of the component.
 String entityName()
          Gets the name of the entity.
 NSDictionary extraBindings()
          Gets the extra bindings.
 String lookFromSettings()
          Gets the name of the look from the settings.
 void setExtraBindings(Object newValue)
          Sets the extra bindings to the specified value.
 void setSubContext(Object newValue)
          Sets the sub-context.
 NSDictionary settings()
          Gets the settings with the display properties.
 void sleep()
          Clears the local settings.
 D2WContext subContext()
          Gets the sub-context.
 boolean synchronizesVariablesWithBindings()
          Indicates that the component does not synchronize variables with bindings.
 String task()
          Gets the name of the task.
 
Methods inherited from class com.webobjects.appserver.WOComponent
appendToResponse, application, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, invokeAction, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

possibleBindings

protected static Vector possibleBindings
The set of possible bindings.

In the current implementation, the bindings include: nextPageDelegate, dataSource, queryDataSource, nextPage, object, masterObjectAndRelationshipKey, selectedObject, fetchSpecificationName, action, and menu.

The implementation is subject to change in future releases.

Constructor Detail

D2WSwitchComponent

public D2WSwitchComponent(WOContext aContext)
Creates an instance of D2WSwitchComponent with the specified context.
Parameters:
aContext - instance of WOContext
See Also:
WOComponent.WOComponent(WOContext)
Method Detail

addToPossibleBindings

public static void addToPossibleBindings(String newBinding)
Adds the specified binding to the set of possible bindings.
Parameters:
newBinding - instance of String
See Also:
possibleBindings

awake

public void awake()
Throws an exception if any of the required bindings are missing.

The current implementation requires the following bindings: _dynamicPage, _task, _entityName.

The implementation is subject to change in future releases.

Overrides:
awake in class WOComponent
Throws:
IllegalArgumentException - if required bindings are missing
See Also:
subContext(), task(), entityName(), WOComponent.awake()

componentName

public String componentName()
Gets the name of the component.

Throws an exception if no rule can be found to decide which page to embed in the parent to display in the sub-context.

Returns:
component name
Throws:
D2WModelException - if name cannot be determined
See Also:
subContext(), D2WContext.pageName(), D2WContext.rawSystemPageName(), WOComponent.parent()

entityName

public String entityName()
Gets the name of the entity.

The current implementation uses the binding _entityName.

The implementation is subject to change in future releases.

Returns:
entity name

extraBindings

public NSDictionary extraBindings()
Gets the extra bindings.

The current implementation removes all objects and copies the values for the possible bindings.

The implementation is subject to change in future releases.

Returns:
instance of NSDictionary
See Also:
possibleBindings, setExtraBindings(Object), WOComponent.valueForBinding(String)

lookFromSettings

public String lookFromSettings()
Gets the name of the look from the settings.
Returns:
look name
See Also:
settings()

setExtraBindings

public void setExtraBindings(Object newValue)
Sets the extra bindings to the specified value.

The current implementation expects the new value to be an instance of NSMutableDictionary and sets the values for the bindings.

The implementation is subject to change in future releases.

Parameters:
newValue - instance of NSMutableDictionary - expected
See Also:
possibleBindings, extraBindings(), WOComponent.setValueForBinding(Object, String)

setSubContext

public void setSubContext(Object newValue)
Sets the sub-context.

The current implementation does nothing.

The implementation is subject to change in future releases.

Parameters:
newValue - instance of Object - ignored

settings

public NSDictionary settings()
Gets the settings with the display properties.

The current implementation uses the bindings _settings and displayKeys. Parses a property list if the value for settings is a String.

The implementation is subject to change in future releases.

Returns:
instance of NSDictionary

sleep

public void sleep()
Clears the local settings.
Overrides:
sleep in class WOComponent
See Also:
settings(), WOComponent.sleep()

subContext

public D2WContext subContext()
Gets the sub-context.

The current implementation uses the binding _dynamicPage. Takes value from the settings and the look from settings.

The implementation is subject to change in future releases.

Returns:
instance of D2WContext
See Also:
lookFromSettings(), settings(), D2WContext.takeValueForInferrableKey(Object, String)

synchronizesVariablesWithBindings

public boolean synchronizesVariablesWithBindings()
Indicates that the component does not synchronize variables with bindings.
Overrides:
synchronizesVariablesWithBindings in class WOComponent
Returns:
false
See Also:
WOComponent.synchronizesVariablesWithBindings()

task

public String task()
Gets the name of the task.

The current implementation uses the binding _task.

The implementation is subject to change in future releases.

Returns:
task name

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.