org.beanfabrics.context
Class BnParentContext

java.lang.Object
  extended by org.beanfabrics.context.DefaultContext
      extended by org.beanfabrics.context.BnParentContext
All Implemented Interfaces:
Context, ModelSubscriber, View<PresentationModel>

public class BnParentContext
extends DefaultContext
implements View<PresentationModel>, ModelSubscriber

The BnParentContext is a context that dynamically adds itself as a parent context to the target's context.

Use this class if you want to dynamically provide access to a specific service only to PM objects that are members of this context.


Constructor Summary
BnParentContext()
           
 
Method Summary
 IModelProvider getModelProvider()
          Returns the provider.
 Path getPath()
          Returns the path.
 PresentationModel getPresentationModel()
          Returns the PresentationModel of this view.
 void setModelProvider(IModelProvider provider)
          Sets the provider.
 void setPath(Path path)
          Sets the path.
 void setPresentationModel(PresentationModel aPresentationModel)
          Sets the PresentationModel of this view.
 
Methods inherited from class org.beanfabrics.context.DefaultContext
addContextListener, addParent, addService, findService, fireParentAdded, fireParentRemoved, fireServiceAdded, fireServiceRemoved, getParents, getService, getServiceEntries, removeContextListener, removeParent, removeService, removeServiceEntry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BnParentContext

public BnParentContext()
Method Detail

getPresentationModel

public PresentationModel getPresentationModel()
Returns the PresentationModel of this view.

Specified by:
getPresentationModel in interface View<PresentationModel>
Returns:
the PresentationModel

setPresentationModel

public void setPresentationModel(PresentationModel aPresentationModel)
Sets the PresentationModel of this view.

Specified by:
setPresentationModel in interface View<PresentationModel>
Parameters:
aPresentationModel - the PresentationModel

getModelProvider

public IModelProvider getModelProvider()
Returns the provider.

Specified by:
getModelProvider in interface ModelSubscriber
Returns:
the ModelProvider

setModelProvider

public void setModelProvider(IModelProvider provider)
Sets the provider.

Specified by:
setModelProvider in interface ModelSubscriber
Parameters:
provider - the provider

getPath

public Path getPath()
Returns the path.

Specified by:
getPath in interface ModelSubscriber
Returns:
the path

setPath

public void setPath(Path path)
Sets the path. The Path is used to locate the model inside the provider.

Specified by:
setPath in interface ModelSubscriber
Parameters:
path - the path relative to the provider's root model