|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A DesignContext is a 'host' for DesignBean instances at design-time. The DesignContext represents the 'backing file' or 'persistence model' for a design-time session. A DesignContext is the container (instance host) for a set of DesignBeans. For example, in a JSF application, the DesignContext represents the logical backing file which is the combination of the 'Page1.jsp' and the 'Page1.java' files.
IMPLEMENTED BY CREATOR - This interface is implemented by Creator for use by the component (bean) author.
| Method Summary | |
void |
addDesignContextListener(DesignContextListener listener)
Adds a listener to this DesignContext |
java.lang.String |
addResource(java.net.URL resource,
boolean copy)
Adds a resource reference to this DesignContext, and converts the external URL into a local resource identifyer String. |
boolean |
canCreateBean(java.lang.String classname,
DesignBean parent,
Position position)
Returns true if the specified type (classname) of JavaBean can be created as a child of the specified parent DesignBean at the specified position. |
boolean |
canMoveBean(DesignBean designBean,
DesignBean newParent,
Position position)
Returns true if the specified DesignBean can be can be moved to be a child of the specified parent DesignBean at the specified position. |
java.awt.datatransfer.Transferable |
copyBeans(DesignBean[] beans)
Copies a set of DesignBean instances into a clipboard-like format. |
DesignBean |
createBean(java.lang.String classname,
DesignBean parent,
Position position)
Creates an instance of a JavaBean of the specified type (classname), as a child of the specified parent DesignBean at the specified position. |
boolean |
deleteBean(DesignBean designBean)
Deletes a DesignBean object (and removes all persistence). |
DesignBean |
getBeanByName(java.lang.String instanceName)
Returns a DesignBean (design-time proxy) to represent the JavaBean with the specified instance name. |
DesignBean |
getBeanForInstance(java.lang.Object beanInstance)
Returns a DesignBean (design-time proxy) to represent the specified JavaBean instance. |
DesignBean[] |
getBeans()
Returns an array of all the DesignBeans within the scope of this DesignContext. |
DesignBean[] |
getBeansOfType(java.lang.Class beanClass)
Returns a DesignBean array (design-time proxies) representing the JavaBeans within the scope of this DesignContext that are assignable from the specified class type. |
java.lang.Object |
getContextData(java.lang.String key)
Retrieves the value for a name-value pair of data on this DesignContext. |
DesignContextListener[] |
getDesignContextListeners()
Returns the array of current listeners to this DesignContext |
IdeProject |
getProject()
Returns the project, which is the top-level container for all contexts. |
DesignBean |
getRootContainer()
Returns the root container DesignBean for this DesignContext. |
boolean |
moveBean(DesignBean designBean,
DesignBean newParent,
Position position)
Moves a DesignBean, to become a child of the specified parent DesignBean at the specified position. |
DesignBean[] |
pasteBeans(java.awt.datatransfer.Transferable persistData,
DesignBean newParent,
Position position)
Pastes a set of DesignBean instances (acquired via copyBeans) into the specified parent DesignBean at the specified position. |
void |
removeDesignContextListener(DesignContextListener listener)
Removes a listener from this DesignContext |
java.net.URL |
resolveResource(java.lang.String localResource)
Resolves a local resource identifyer String into a fully-qualified URL. |
void |
setContextData(java.lang.String key,
java.lang.Object data)
Sets a name-value pair of data on this DesignContext. |
| Methods inherited from interface com.sun.rave.designtime.DisplayItem |
getDescription, getDisplayName, getHelpKey, getLargeIcon, getSmallIcon |
| Method Detail |
public void addDesignContextListener(DesignContextListener listener)
listener - The desired listener to add
public java.lang.String addResource(java.net.URL resource,
boolean copy)
throws java.io.IOException
resource - A URL pointing to the desired external resourcecopy - true if the resource should be copied into the project, false if not
java.io.IOException
public boolean canCreateBean(java.lang.String classname,
DesignBean parent,
Position position)
classname - The fully qualified class name of the JavaBean to be createdparent - The DesignBean parent for the JavaBean to be createdposition - The desired position for the JavaBean to be created
createBean(String, DesignBean, Position)
public boolean canMoveBean(DesignBean designBean,
DesignBean newParent,
Position position)
designBean - The DesignBean to be movednewParent - The new DesignBean parent for the DesignBeanposition - The desired position for the DesignBean to be moved
moveBean(DesignBean, DesignBean, Position)public java.awt.datatransfer.Transferable copyBeans(DesignBean[] beans)
pasteBeans(java.awt.datatransfer.Transferable, DesignBean, Position)
public DesignBean createBean(java.lang.String classname,
DesignBean parent,
Position position)
classname - The fully qualified class name of the JavaBean to be createdparent - The DesignBean parent for the JavaBean to be createdposition - The desired position for the JavaBean to be created
canCreateBean(String, DesignBean, Position)public boolean deleteBean(DesignBean designBean)
designBean - The desired DesignBean to delete
public DesignBean getBeanByName(java.lang.String instanceName)
instanceName - The String instance name of the desired JavaBean
public DesignBean getBeanForInstance(java.lang.Object beanInstance)
beanInstance - A live instance of a JavaBean
public DesignBean[] getBeans()
getRootContainer()public DesignBean[] getBeansOfType(java.lang.Class beanClass)
beanClass - The desired class type
Class.isAssignableFrom(Class)public java.lang.Object getContextData(java.lang.String key)
Retrieves the value for a name-value pair of data on this DesignContext. This name-value pair is stored in the associated project file (as text) that contains this DesignContext, so this data is retrievable in any IDE session once it has been set.
NOTE: The 'data' Object can be a simple String or a complex (non-String) Object. Either way, it will be stored as text in the project file and will be associated with this DesignContext. When the project file is written to disk, any complex (non-String) objects will be converted to String using the 'toString()' method. If a component author wishes to store a complex (non-String) object, they must be sure to override the 'toString()' method on their object to serialize out enough information to be able to restore the object when a subsequent call to 'getContextData' returns a String. Though a complex object was stored via the 'setContextData' method, a component author *may* get back a String from 'getContextData' if the project has been saved and reopened since the previous call to 'setContextData'. It is the responsibility of the component author to reconstruct the complex object from the String, and if desired, put it back into the context using the 'setContextData' method passing the newly constructed object in. This way, all subsequent calls to 'getContextData' with that key will return the complex object instance - until the project is closed and restored.
key - The desired String key to retrieve the data object for
setContextData(String, Object)public DesignContextListener[] getDesignContextListeners()
public IdeProject getProject()
public DesignBean getRootContainer()
getBeans()
public boolean moveBean(DesignBean designBean,
DesignBean newParent,
Position position)
designBean - The DesignBean to movenewParent - The new DesignBean parent for the DesignBeanposition - The desired position for the DesignBean to be moved
canMoveBean(DesignBean, DesignBean, Position)
public DesignBean[] pasteBeans(java.awt.datatransfer.Transferable persistData,
DesignBean newParent,
Position position)
persistData - The Transferable object acquired via 'copyBeans' that contains the data
representing the DesignBean(s) to be pastednewParent - The desired new parent DesignBean to paste the DesignBean(s) intoposition - The desired new position for the pasted DesignBean(s)
copyBeans(DesignBean[])public void removeDesignContextListener(DesignContextListener listener)
listener - The desired listener to removepublic java.net.URL resolveResource(java.lang.String localResource)
localResource - A local resource identifier string
public void setContextData(java.lang.String key,
java.lang.Object data)
Sets a name-value pair of data on this DesignContext. This name-value pair will be stored in the associated project file (as text) that contains this DesignContext, so this data is retrievable in a future IDE session.
NOTE: The 'data' Object can be a simple String or a complex (non-String) Object. Either way, it will be stored as text in the project file and will be associated with this DesignContext. When the project file is written to disk, any complex (non-String) objects will be converted to String using the 'toString()' method. If a component author wishes to store a complex (non-String) object, they must be sure to override the 'toString()' method on their object to serialize out enough information to be able to restore the object when a subsequent call to 'getContextData' returns a String. Though a complex object was stored via the 'setContextData' method, a component author *may* get back a String from 'getContextData' if the project has been saved and reopened since the previous call to 'setContextData'. It is the responsibility of the component author to reconstruct the complex object from the String, and if desired, put it back into the context using the 'setContextData' method passing the newly constructed object in. This way, all subsequent calls to 'getContextData' with that key will return the complex object instance - until the project is closed and restored.
key - The String key to store the data object underdata - The data object to store - this may be a String or any complex object, but it
will be stored as a string using the 'toString()' method when the project file is
written to disk.getContextData(String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||