| com.sun.rave.designtime.DesignProject
DesignProject | public interface DesignProject extends DisplayItem(Code) | | A DesignProject is a top-level container for DesignContexts at design-time. The DesignProject
represents the project in the Creator IDE. Not much can be done with Projects in the Creator
Design-Time API, except for accessing other DesignContexts, listening to project-level events,
and storing project-level data.
IMPLEMENTED BY CREATOR - This interface is implemented by Creator for use by the
component (bean) author.
author: Joe Nuxoll version: 1.0 See Also: DesignContext.getProject |
addDesignProjectListener | public void addDesignProjectListener(DesignProjectListener listener)(Code) | | Adds a listener to this DesignProject
Parameters: listener - The desired listener to add |
addResource | public URI addResource(URL sourceUrl, URI targetUri) throws IOException(Code) | | Copies a resource into this project, and converts the external URL into a local URI
(resource identifier string).
Parameters: sourceUrl - A URL pointing to the desired external resource Parameters: targetUri - The desired resource URI (path) within the project directory The resulting project relative resource uri (resourceUri) throws: IOException - if the resource cannot be copied |
createDesignContext | public DesignContext createDesignContext(String className, Class baseClass, Map contextData)(Code) | | Creates a new DesignContext (backing file) in this project.
Parameters: className - The desired fully-qualified class name for the file Parameters: baseClass - The desired base class for the file Parameters: contextData - A Map of context data to apply to the newly created context file The newly created DesignContext, or null if the operation was unsuccessful |
getDesignContexts | public DesignContext[] getDesignContexts()(Code) | | Returns all the DesignContexts in this project. There will be one DesignContext for each
designable file in the project. Note that for JSF, this means one DesignContext for each
combination of "PageX.java" and "PageX.jsp" file, as well as one for each of the non-page
beans, like "SessionBeanX.java", "ApplicationBeanX.java", etc.
An array of DesignContext objects - one for each designable file in the project |
getDesignProjectListeners | public DesignProjectListener[] getDesignProjectListeners()(Code) | | Returns the array of current listeners to this DesignProject
An array of listeners currently listening to this DesignProject |
getGlobalData | public Object getGlobalData(String key)(Code) | | Retrieves the value for a global name-value pair of data. This name-value pair will be
stored in the associated user settings file (as text), 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 IDE state and will be associated with this IDE.
When the IDE state 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 'getGlobalData' returns a String. Though a complex object was stored
via the 'setGlobalData' method, a component author *may* get back a String from
'getGlobalData' if the IDE has been closed and reopened since the previous call to
'setGlobalData'. 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
'setGlobalData' method passing the newly constructed object in. This way, all subsequent
calls to 'getGlobalData' with that key will return the complex object instance - until the
IDE is closed and restored.
Parameters: key - The desired String key to retrieve the data object for The data object that is currently stored under this key - this may be a String oran Object, based on what was stored using 'setGlobalData'. NOTE: This will alwaysbe a String after the project file is read from disk, even if the stored object wasnot a String - it will have been converted using the 'toString()' method. See Also: DesignProject.setGlobalData(StringObject)DesignIde.setIdeData(StringObject) |
getProjectData | public Object getProjectData(String key)(Code) | | Retrieves the value for a name-value pair of data on this DesignProject. This name-value
pair is stored in the project file, so this data is retrievable in any IDE session once it
has been set. Some custom pre-defined keys can be found in
Constants.ProjectData .
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 project.
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 'getProjectData' returns a String. Though a complex object was stored
via the 'setProjectData' method, a component author *may* get back a String from
'getProjectData' if the project has been saved and reopened since the previous call to
'setProjectData'. 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
'setProjectData' method passing the newly constructed object in. This way, all subsequent
calls to 'getProjectData' with that key will return the complex object instance - until the
project is closed and restored.
Parameters: key - The desired String key to retrieve the data object for The data object that is currently stored under this key - this may be a String oran Object, based on what was stored using 'setProjectData'. NOTE: This will alwaysbe a String after the project file is read from disk, even if the stored object wasnot a String - it will have been converted using the 'toString()' method. See Also: DesignProject.setProjectData(String,Object) See Also: Constants.ProjectData |
getResourceFile | public File getResourceFile(URI resourceUri)(Code) | | Returns a File object containing the specified resource.
Parameters: resourceUri - The desired project relative resource uri to fetch a file object A File object containing the project resource |
getResources | public URI[] getResources(URI rootPath, boolean recurseFolders)(Code) | | Returns the set of project root relative resources in this project as an array of local
resource identifiers. The returned URIs will always be paths from the project root,
including folder hiearchy within the project. The specified rootPath is used
as a filter, to allow drilling-in to directories as desired. Use
URI.relativize() to make relative URIs when needed. Use
getResourceFile(URI) to retrieve a File object for a particular resource in
the project.
Parameters: rootPath - The root path to fetch resources underneath. Passing null willstart at the root of the project. Parameters: recurseFolders - true to include the sub-resources inside of any folders A project root relative array of URIs representing all the resource files under thespecified root path |
removeDesignContext | public boolean removeDesignContext(DesignContext context)(Code) | | Removes an existing DesignContext (backing file) from this project.
Parameters: context - The desired DesignContext to remove from the project true if the operation was successful, false if not |
removeDesignProjectListener | public void removeDesignProjectListener(DesignProjectListener listener)(Code) | | Removes a listener from this DesignProject
Parameters: listener - The desired listener to remove |
removeResource | public boolean removeResource(URI resourceUri)(Code) | | Removes a resource from the project directory.
Parameters: resourceUri - The desired resource to remove from the project boolean true if the resource was successfully removed,false if not |
setGlobalData | public void setGlobalData(String key, Object data)(Code) | | Sets a global name-value pair of data. This name-value pair will be stored in the
associated user settings file (as text), 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 IDE state and will be associated with this IDE.
When the IDE state 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 'getGlobalData' returns a String. Though a complex object was stored
via the 'setGlobalData' method, a component author *may* get back a String from
'getGlobalData' if the IDE has been closed and reopened since the previous call to
'setGlobalData'. 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
'setGlobalData' method passing the newly constructed object in. This way, all subsequent
calls to 'getGlobalData' with that key will return the complex object instance - until the
IDE is closed and restored.
Parameters: key - The String key to store the data object under Parameters: data - The data object to store - this may be a String or any complex object, but itwill be stored as a string using the 'toString()' method when the project file iswritten to disk. See Also: DesignProject.getGlobalData(String)DesignIde.getIdeData(String) |
setProjectData | public void setProjectData(String key, Object data)(Code) | | Sets a name-value pair of data on this DesignProject. This name-value pair will be stored
in the associated project file, 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 project.
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 'getProjectData' returns a String. Though a complex object was stored
via the 'setProjectData' method, a component author *may* get back a String from
'getProjectData' if the project has been saved and reopened since the previous call to
'setProjectData'. 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
'setProjectData' method passing the newly constructed object in. This way, all subsequent
calls to 'getProjectData' with that key will return the complex object instance - until the
project is closed and restored.
Parameters: key - The String key to store the data object under Parameters: data - The data object to store - this may be a String or any complex object, but itwill be stored as a string using the 'toString()' method when the project file iswritten to disk. See Also: DesignProject.getProjectData(String) |
|
|