|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alveole.studio.web.data.Project
public class Project
This represents the whole project. A project contains some properties, some features, and a list of linked nodes, organized in packages.
Nested Class Summary | |
---|---|
static class |
Project.MyNamespaceContext
Namespace context. |
Field Summary | |
---|---|
protected java.lang.String |
description
Contains project description. |
protected java.util.ArrayList<java.lang.String> |
enabledFeatures
List of enables features on this project. |
protected java.util.ArrayList<NodeLink> |
links
The list of all links. |
protected java.util.ArrayList<ProjectChangeListener> |
listeners
List of all project listeners. |
protected java.lang.String |
name
The project name. |
protected ProjectContext |
projectContext
Reference to this project's context. |
protected org.w3c.dom.Document |
projectProperties
Contains project properties. |
protected NodePackage |
rootPackage
Root package. |
static java.lang.String |
version
Current version. |
static java.lang.String[] |
versions
All managed versions. |
static java.lang.String |
xmlns
Default namespace. |
Constructor Summary | |
---|---|
Project(ProjectContext projectContext)
Project's contructor. |
Method Summary | |
---|---|
void |
addFeature(java.lang.String feature)
Add a feature on this project. |
void |
addLink(NodeLink link)
Add a new link in project. |
void |
addProjectChangeListener(ProjectChangeListener pcl)
Add a project's listener. |
static org.w3c.dom.Element |
copyNode(org.w3c.dom.Element source)
Copy DOM nodes from document. |
static void |
copyTree(org.w3c.dom.Element source,
org.w3c.dom.Node target)
Copy DOM nodes from one document to another. |
static ProjectContext |
createEmptyProject(org.eclipse.core.resources.IResource resource,
java.lang.String projectName,
java.lang.String description)
Create a new project. |
void |
fireChangeEvent(ProjectChangeListener.EventType eventType,
java.lang.Object evt)
Fire change event. |
void |
fireChangeEvent(ProjectChangeListener.EventType eventType,
java.lang.Object evt,
java.lang.Object parameter)
Fire change event. |
java.util.ArrayList<NodeAction> |
getAllActions()
This method returns ALL actions from this project. |
void |
getAllActions(java.util.ArrayList<NodeAction> retOut,
NodePackage pack)
This method returns ALL actions from this package. |
java.util.ArrayList<NodePackage> |
getAllPackages()
This method returns ALL packages from this project. |
void |
getAllPackages(java.util.ArrayList<NodePackage> retOut,
NodePackage pack)
This method returns ALL packages from this package excluding this pack. |
java.util.ArrayList<NodeView> |
getAllViews()
This method returns ALL actions from this project. |
void |
getAllViews(java.util.ArrayList<NodeView> retOut,
NodePackage pack)
This method returns ALL views from this package. |
static java.lang.String |
getAttributeNS(org.w3c.dom.Element elt,
java.lang.String ns,
java.lang.String localname)
Tool to get an attribute, with its namespace. |
java.lang.String |
getDescription()
Get project's description. |
java.util.ArrayList<java.lang.String> |
getEnabledFeatures()
Get a list of enabled features. |
java.util.Collection<NodeLink> |
getLinks()
Get all links. |
java.util.ArrayList<NodeLink> |
getLinksFrom(NodeContainer container)
Get all links from a node. |
java.util.ArrayList<NodeLink> |
getLinksTo(NodeContainer container)
Get all links to a node. |
java.lang.String |
getName()
Get project's name. |
NodeContainer |
getNodeByID(java.lang.String id)
Find a node given its ID. |
static javax.xml.namespace.NamespaceContext |
getNSContext()
Get default NS resolver. |
org.w3c.dom.Element |
getPluginProperties(java.lang.String id)
Get the plugin properties' root node. |
ProjectContext |
getProjectContext()
Get this project's context. |
NodePackage |
getRootPackage()
Get root package for thid project. |
boolean |
isChildNode(NodeContainer child)
Check if a node is inside this project. |
protected void |
loadLinks(org.w3c.dom.Document document)
Load links. |
static Project |
loadProject(ProjectContext ctx,
org.eclipse.core.resources.IFile file)
Loads a project. |
static Project |
loadProject(ProjectContext ctx,
java.io.InputStream is)
Loads a project. |
void |
performCopy(java.util.List<NodeContainer> selection,
NodePackage target)
Performs a copy from a selection of nodes, to a new package. |
void |
removeLink(NodeLink link)
Remove a new link in project. |
void |
removeProjectChangeListener(ProjectChangeListener pcl)
Remove project's listener. |
byte[] |
saveProject(org.w3c.dom.Document document)
Converts this project to bytes array (to store it in a file). |
org.w3c.dom.Document |
saveProject(org.eclipse.core.resources.IFile projectFile,
org.eclipse.core.runtime.IProgressMonitor monitor)
Save project to file. |
org.w3c.dom.Document |
saveProject(org.eclipse.core.resources.IFile projectFile,
org.eclipse.core.runtime.IProgressMonitor monitor,
boolean fireEvent)
Save project to file. |
org.w3c.dom.Document |
saveProjectToXML()
Save document to XML. |
static void |
setAttributeNS(org.w3c.dom.Element elt,
java.lang.String attributeNS,
java.lang.String attributePrefix,
java.lang.String attributeName,
java.lang.String value)
Sets an attribute with NS and prefix. |
void |
setDescription(java.lang.String description)
Set project's description. |
void |
setEnabledFeatures(java.util.ArrayList<java.lang.String> enabledFeatures)
Set a list of enabled features. |
void |
setName(java.lang.String name)
Set project's name. |
void |
setProjectContext(ProjectContext projectContext)
Set this project's context. |
void |
setRootPackage(NodePackage rootPackage)
Sets root package for this project. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String xmlns
public static final java.lang.String[] versions
public static final java.lang.String version
protected java.lang.String name
protected java.lang.String description
protected org.w3c.dom.Document projectProperties
protected NodePackage rootPackage
protected ProjectContext projectContext
protected java.util.ArrayList<NodeLink> links
protected java.util.ArrayList<ProjectChangeListener> listeners
protected java.util.ArrayList<java.lang.String> enabledFeatures
Constructor Detail |
---|
public Project(ProjectContext projectContext)
projectContext
- The associated context.Method Detail |
---|
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- The description.public java.lang.String getName()
public void setName(java.lang.String name)
name
- The project name.public NodeContainer getNodeByID(java.lang.String id)
id
- The Node ID.
public boolean isChildNode(NodeContainer child)
child
- The node to search.
public org.w3c.dom.Document saveProject(org.eclipse.core.resources.IFile projectFile, org.eclipse.core.runtime.IProgressMonitor monitor, boolean fireEvent)
projectFile
- The file where XML DOM must be stored.monitor
- A monitor.public org.w3c.dom.Document saveProject(org.eclipse.core.resources.IFile projectFile, org.eclipse.core.runtime.IProgressMonitor monitor)
projectFile
- The file where XML DOM must be stored.monitor
- A monitor.public org.w3c.dom.Document saveProjectToXML()
public byte[] saveProject(org.w3c.dom.Document document)
document
- The XML document.
public static Project loadProject(ProjectContext ctx, org.eclipse.core.resources.IFile file)
ctx
- The context.file
- The project's file.
public static ProjectContext createEmptyProject(org.eclipse.core.resources.IResource resource, java.lang.String projectName, java.lang.String description)
resource
- The target IResource.projectName
- The project's name.description
- The project's description.
public static void copyTree(org.w3c.dom.Element source, org.w3c.dom.Node target)
source
- The DOM element source.target
- The target DOM Node.public static org.w3c.dom.Element copyNode(org.w3c.dom.Element source)
source
- The DOM element source.public static Project loadProject(ProjectContext ctx, java.io.InputStream is)
ctx
- The project context.is
- The input Stream for reading data.public static final javax.xml.namespace.NamespaceContext getNSContext()
protected void loadLinks(org.w3c.dom.Document document) throws java.lang.Exception
document
- The XML DOM document.
java.lang.Exception
public java.util.ArrayList<NodeLink> getLinksFrom(NodeContainer container)
container
- The node.
public java.util.ArrayList<NodeLink> getLinksTo(NodeContainer container)
container
- The node.
public java.util.Collection<NodeLink> getLinks()
public NodePackage getRootPackage()
public void setRootPackage(NodePackage rootPackage)
rootPackage
- The root package.public void fireChangeEvent(ProjectChangeListener.EventType eventType, java.lang.Object evt)
eventType
- The event type.evt
- A specific object on which the event applies.public void fireChangeEvent(ProjectChangeListener.EventType eventType, java.lang.Object evt, java.lang.Object parameter)
eventType
- The event type.evt
- A specific object on which the event applies.parameter
- A specific parameter for this events.public void addProjectChangeListener(ProjectChangeListener pcl)
pcl
- the listener.public void removeProjectChangeListener(ProjectChangeListener pcl)
pcl
- The listener.public void addLink(NodeLink link)
link
- The link.public void removeLink(NodeLink link)
link
- The removed link.public ProjectContext getProjectContext()
public void setProjectContext(ProjectContext projectContext)
projectContext
- The context.public org.w3c.dom.Element getPluginProperties(java.lang.String id)
id
- A plugin ID.
public void performCopy(java.util.List<NodeContainer> selection, NodePackage target)
selection
- A selection of nodes.target
- The target package where to drop nodes.public java.util.ArrayList<java.lang.String> getEnabledFeatures()
public void setEnabledFeatures(java.util.ArrayList<java.lang.String> enabledFeatures)
enabledFeatures
- List of features.public void addFeature(java.lang.String feature)
feature
- The feature to be added.public static void setAttributeNS(org.w3c.dom.Element elt, java.lang.String attributeNS, java.lang.String attributePrefix, java.lang.String attributeName, java.lang.String value)
elt
- The target element.attributeNS
- The namespace.attributePrefix
- The attribute prefix (must belong to namespace).attributeName
- The attribute localname.value
- The attribute value;public static java.lang.String getAttributeNS(org.w3c.dom.Element elt, java.lang.String ns, java.lang.String localname)
public void getAllActions(java.util.ArrayList<NodeAction> retOut, NodePackage pack)
public java.util.ArrayList<NodeAction> getAllActions()
public void getAllViews(java.util.ArrayList<NodeView> retOut, NodePackage pack)
public java.util.ArrayList<NodeView> getAllViews()
public void getAllPackages(java.util.ArrayList<NodePackage> retOut, NodePackage pack)
public java.util.ArrayList<NodePackage> getAllPackages()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |