public class VPTProject extends VPTNode
Note: this class is not thread safe!
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,VPTNode> |
openableNodes |
protected static javax.swing.Icon |
projectIcon |
name, treeNoSelectionBackground, treeNoSelectionForeground, treeSelectionBackground, treeSelectionForeground
Constructor and Description |
---|
VPTProject(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addFilter(VPTFilterData filter)
Adds a "filtered tree" filter to the project's filter list.
|
void |
addOpenFile(java.lang.String path)
Adds a file to the list of the project's opened files.
|
void |
clearOpenFiles()
Clears the list of open files.
|
void |
closeFiles(org.gjt.sp.jedit.View view,
boolean bRemember)
Closes open files belonging to the project.
|
int |
compareTo(VPTNode node)
Projects have precedence over everything but groups.
|
void |
fireFilesChanged(java.util.Collection<VPTFile> added,
java.util.Collection<VPTFile> 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.
|
java.util.List<VPTFilterData> |
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 |
getIconPath()
Returns the custom icon path of this project.
|
protected java.util.concurrent.locks.ReadWriteLock |
getLock()
Returns the read-write lock used to project the project.
|
java.lang.String |
getNodePath()
Returns the path to the file represented by this node.
|
java.util.Collection<VPTNode> |
getOpenableNodes()
Returns a collection of the nodes that can be opened contained
in this project.
|
java.util.List<java.lang.String> |
getOpenFiles()
Returns the list of open files the project knows about.
|
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 |
isInProject(java.lang.String path)
Returns whether the project contains a node that can be opened that
matches the given path.
|
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.
|
java.lang.Object |
removeProperty(java.lang.String property)
Removes the given property from the project.
|
void |
setFilterList(java.util.List<VPTFilterData> filterList)
Sets the list of filters particular to this project.
|
void |
setIconPath(java.lang.String path)
Sets the icon to be shown on the tree next to the project name.
|
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 |
unregisterNodePath(java.lang.String path)
Unegister a node path from the project.
|
void |
unregisterNodePath(VPTNode node)
Unegister a node from the project.
|
canOpen, canRename, canWrite, changed, close, compareName, delete, findIndexForChild, findProjectFor, getBackgroundColor, getChildWithName, getClipType, getForegroundColor, getGroup, getName, getVersionControlState, insert, isDirectory, isFile, isGroup, isOpened, isProject, isRoot, lock, open, persistChildren, remove, remove, removeFromParent, setName, setParent, setVersionControlState, sortChildren, sortChildren, unlock
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, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, setAllowsChildren, setUserObject
protected static final javax.swing.Icon projectIcon
protected java.util.Map<java.lang.String,VPTNode> openableNodes
public VPTNode getChildNode(java.lang.String path)
public java.util.Collection<VPTNode> 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.String setProperty(java.lang.String name, java.lang.String value)
public java.util.Set getPropertyNames()
public java.lang.Object removeProperty(java.lang.String property)
public java.util.Properties getProperties()
public java.util.List<java.lang.String> getOpenFiles()
public void addOpenFile(java.lang.String path)
public void removeOpenFile(java.lang.String path)
public void clearOpenFiles()
public void closeFiles(org.gjt.sp.jedit.View view, boolean bRemember)
bRemember
- Whether to remember the files to open them next time.
Current buffer is remembered last. This behaviour is copied from
ProjectViewer.closeProject
which previously was closing files.public boolean isInProject(java.lang.String path)
public javax.swing.Icon getIcon(boolean expanded)
public void setIconPath(java.lang.String path)
path
- The path to the new icon (null for default).public java.lang.String getIconPath()
public java.lang.String toString()
public java.lang.String getRootPath()
public void setRootPath(java.lang.String path)
public void registerNodePath(VPTNode node)
public void removeAllChildren()
removeAllChildren
in class VPTNode
public void unregisterNodePath(VPTNode node)
public void unregisterNodePath(java.lang.String path)
public java.lang.String getNodePath()
getNodePath
in class VPTNode
public int compareTo(VPTNode node)
public void addFilter(VPTFilterData filter)
public void setFilterList(java.util.List<VPTFilterData> filterList)
public java.util.List<VPTFilterData> getFilterList()
protected java.util.concurrent.locks.ReadWriteLock getLock()
public void fireFilesChanged(java.util.Collection<VPTFile> added, java.util.Collection<VPTFile> removed)
public void firePropertiesChanged()