|
|||||||||
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.VPTFile
public class VPTFile
Models a file that is part of a project.
Field Summary |
---|
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 | |
---|---|
VPTFile(java.lang.String url)
|
Method Summary | |
---|---|
boolean |
canOpen()
File nodes can be opened, so return true. |
boolean |
canRename()
Returns whether the VFS of the file allows renaming. |
boolean |
canWrite()
Returns is the underlying file is writable. |
protected void |
changed()
Flush the internal VFSFile instance, and force retrieval of a new one. |
void |
close()
Globally closes the jEdit buffer that contains the file. |
void |
close(org.gjt.sp.jedit.View view,
org.gjt.sp.jedit.bufferset.BufferSet.Scope scope)
Closes the jEdit buffer that contains the file. |
int |
compareTo(VPTNode node)
Files are at the same level of every leaf node. |
boolean |
delete()
Deletes the file from the VFS. |
org.gjt.sp.jedit.io.VFSFile |
getFile()
Return the VFS file associated with this node. |
protected org.gjt.sp.jedit.io.VFSFile |
getFile(boolean lazy)
Returns the VFS file associated with this node. |
java.awt.Color |
getForegroundColor(boolean sel)
Returns the node's foreground color. |
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.String |
getURL()
Returns the VFS URL for this file. |
boolean |
isOpened()
Returns "true" if the node is a file and is currently opened in jEdit. |
void |
open()
Opens a new buffer in jEdit with the file pointed by this node. |
void |
open(org.gjt.sp.jedit.View v)
Opens the file in the specified view, if it's not yet open. |
void |
setURL(java.lang.String url)
Changes this file's URL. |
java.lang.String |
toString()
Returns a string representation of the current node. |
Methods inherited from class projectviewer.vpt.VPTNode |
---|
compareName, findIndexForChild, findProjectFor, getBackgroundColor, getChildWithName, getClipType, getGroup, getLock, getName, getVersionControlState, insert, isDirectory, isFile, isGroup, isProject, isRoot, lock, persistChildren, remove, remove, removeAllChildren, removeFromParent, setName, setParent, setVersionControlState, sortChildren, sortChildren, unlock |
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, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, setAllowsChildren, setUserObject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VPTFile(java.lang.String url)
Method Detail |
---|
public boolean canWrite()
canWrite
in class VPTNode
public boolean delete()
delete
in class VPTNode
public org.gjt.sp.jedit.io.VFSFile getFile()
Should not be called from outside ProjectViewer.
protected org.gjt.sp.jedit.io.VFSFile getFile(boolean lazy)
Should not be called from outside ProjectViewer. The "lazy" flag is for use by code that cannot cope with the possibility of instantiating the VFS file causing any interaction with the UI (e.g., an FTP login dialog). For VFS instances that have the LOW_LATENCY_CAP capability, the file is always retrieved from the VFS so that updates to the filesystem are reflected in the project tree. An example of non-low latency vfs is one provided by FTP plugin.
lazy
- Whether to use lazy initialization of the file.
public boolean isOpened()
isOpened
in class VPTNode
public java.lang.String getURL()
public void setURL(java.lang.String url)
public javax.swing.Icon getIcon(boolean expanded)
getIcon
in class VPTNode
expanded
- If the node is currently expanded or not.public java.awt.Color getForegroundColor(boolean sel)
getForegroundColor
in class VPTNode
sel
- If the node is currently selected.public java.lang.String toString()
toString
in class VPTNode
public boolean canOpen()
canOpen
in class VPTNode
public boolean canRename()
canRename
in class VPTNode
public void open()
open
in class VPTNode
public void open(org.gjt.sp.jedit.View v)
v
- Where to open the file (null = active view).public void close()
close
in class VPTNode
public void close(org.gjt.sp.jedit.View view, org.gjt.sp.jedit.bufferset.BufferSet.Scope scope)
scope
- Scope to use. Null defaults to current jEdit scope.
EditPane scope is treated as View scope, because PV manages the whole
view.public java.lang.String getNodePath()
getNodePath
in class VPTNode
public int compareTo(VPTNode node)
compareTo
in interface java.lang.Comparable<VPTNode>
compareTo
in class VPTNode
protected void changed()
changed
in class VPTNode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |