|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
projectviewer.vpt.VPTNode
projectviewer.vpt.VPTProject
Models a project. A project is a container for files and directories. It also provides interfaces for event notification and custom properties, so that other plugins can interact with projects.
Note: this class is not thread safe!
Field Summary | |
protected java.util.HashMap |
openableNodes
|
Fields inherited from class projectviewer.vpt.VPTNode |
name, treeNoSelectionBackground, treeNoSelectionForeground, treeSelectionBackground, treeSelectionForeground |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
VPTProject(java.lang.String name)
|
Method Summary | |
void |
addFilter(VPTFilterData filterData)
|
void |
addOpenFile(java.lang.String path)
Adds a file to the list of the project's opened files. |
void |
addProjectListener(ProjectListener lstnr)
Adds a new listener to the list. |
void |
clearOpenFiles()
Clears the list of open files. |
int |
compareToNode(VPTNode node)
Projects have precedence over everything but groups. |
void |
fireFileAdded(VPTFile file)
Notifies the listeners that a single file has been added to the project. |
void |
fireFileRemoved(VPTFile file)
Notifies the listeners that a single file has been added to the project. |
void |
fireFilesChanged(java.util.ArrayList added,
java.util.ArrayList removed)
Notifies the listeners that a group of files has been added to and/or removed from the project. |
void |
firePropertiesChanged()
Notifies the listeners that a single file has been added to the project. |
VPTNode |
getChildNode(java.lang.String path)
Returns the node that matches the given path. |
VPTFile |
getFile(java.lang.String path)
Deprecated. Use getChildNode(String)
instead. |
java.util.Collection |
getFiles()
Deprecated. Use getOpenableNodes() instead. |
java.util.List |
getFilterList()
Returns the list of filters set for this project, or Collections.EMPTY_LIST if no filters are set. |
javax.swing.Icon |
getIcon(boolean expanded)
Returns the icon to be shown on the tree next to the node name. |
java.lang.String |
getNodePath()
Returns the path to the file represented by this node. |
java.lang.Object |
getObjectProperty(java.lang.String property)
Returns the property stored for the given key. |
java.util.Collection |
getOpenableNodes()
Returns a read-only collection of the nodes that can be opened contained in this project. |
java.util.Iterator |
getOpenFiles()
Returns an iterator to the list of open files that this project remembers. |
java.util.Properties |
getProperties()
Return the project's property set. |
java.lang.String |
getProperty(java.lang.String property)
Returns the property stored for the given key, as a String. |
java.util.Set |
getPropertyNames()
Returns a set containing all property names for this project. |
java.lang.String |
getRootPath()
Returns the path to the root of the project. |
java.lang.String |
getURL()
Returns the project's URL. |
boolean |
hasListeners()
Returns whether there are any listeners registered. |
boolean |
isInProject(java.lang.String path)
Returns whether the project contains a node that can be opened that matches the given path. |
boolean |
isProjectFile(java.lang.String path)
Deprecated. Use isInProject(String) instead. |
void |
registerFile(VPTFile file)
Register a file in the project, adding it to the list of files that belong to the project |
void |
registerNodePath(VPTNode node)
Register a node in the project, adding it to the mapping of paths to nodes kept internally. |
void |
removeAllChildren()
Removes all children from the project, and unregisters all files. |
void |
removeOpenFile(java.lang.String path)
Remove an open file from the list. |
void |
removeProjectListener(ProjectListener lstnr)
Removes a listener from the list. |
java.lang.Object |
removeProperty(java.lang.String property)
Removes the given property from the project. |
void |
setFilterList(java.util.List filterList)
Sets the list of filters particular to this project. |
java.lang.Object |
setProperty(java.lang.String name,
java.lang.Object value)
Sets a property. |
java.lang.String |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property. |
void |
setRootPath(java.lang.String path)
Sets the path to the root of the project. |
void |
setURL(java.lang.String url)
Sets the project's URL. |
java.lang.String |
toString()
Returns a string representation of the current node. |
void |
unloadProperties()
This method will take all properties that are not Strings and serialize them into "DeferredProperty" instances. |
void |
unregisterNodePath(java.lang.String path)
Unegister a node path from the project. |
void |
unregisterNodePath(VPTNode node)
Unegister a node from the project. |
Methods inherited from class projectviewer.vpt.VPTNode |
canOpen, canWrite, close, compareName, compareTo, delete, findIndexForChild, findProjectFor, getBackgroundColor, getChildWithName, getClipType, getForegroundColor, getName, isDirectory, isFile, isGroup, isOpened, isProject, isRoot, open, persistChildren, setName, setParent, sortChildren, sortChildren |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeFromParent, setAllowsChildren, setUserObject |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.HashMap openableNodes
Constructor Detail |
public VPTProject(java.lang.String name)
Method Detail |
public VPTFile getFile(java.lang.String path)
getChildNode(String)
instead.
public VPTNode getChildNode(java.lang.String path)
public java.util.Collection getFiles()
getOpenableNodes()
instead.
public java.util.Collection getOpenableNodes()
public java.lang.String getURL()
public void setURL(java.lang.String url)
public java.lang.String getProperty(java.lang.String property)
public java.lang.Object getObjectProperty(java.lang.String property)
public java.lang.String setProperty(java.lang.String name, java.lang.String value)
public java.lang.Object setProperty(java.lang.String name, java.lang.Object value)
public java.util.Set getPropertyNames()
public java.lang.Object removeProperty(java.lang.String property)
public java.util.Properties getProperties()
public java.util.Iterator getOpenFiles()
public void addOpenFile(java.lang.String path)
public void removeOpenFile(java.lang.String path)
public void clearOpenFiles()
public boolean isProjectFile(java.lang.String path)
isInProject(String)
instead.
public boolean isInProject(java.lang.String path)
public javax.swing.Icon getIcon(boolean expanded)
getIcon
in class VPTNode
expanded
- If the node is currently expanded or not.public java.lang.String toString()
toString
in class VPTNode
public java.lang.String getRootPath()
public void setRootPath(java.lang.String path)
public void registerFile(VPTFile file)
public void registerNodePath(VPTNode node)
public void removeAllChildren()
public void unregisterNodePath(VPTNode node)
public void unregisterNodePath(java.lang.String path)
public java.lang.String getNodePath()
getNodePath
in class VPTNode
public int compareToNode(VPTNode node)
compareToNode
in class VPTNode
public void unloadProperties()
public void addFilter(VPTFilterData filterData)
public void setFilterList(java.util.List filterList)
public java.util.List getFilterList()
public void addProjectListener(ProjectListener lstnr)
public void removeProjectListener(ProjectListener lstnr)
public boolean hasListeners()
public void fireFilesChanged(java.util.ArrayList added, java.util.ArrayList removed)
public void fireFileAdded(VPTFile file)
public void fireFileRemoved(VPTFile file)
public void firePropertiesChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |