public class VPTFile extends VPTNode
name, treeNoSelectionBackground, treeNoSelectionForeground, treeSelectionBackground, treeSelectionForeground
Constructor and Description |
---|
VPTFile(java.lang.String url) |
Modifier and Type | Method and Description |
---|---|
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.
|
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
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
public boolean canWrite()
public boolean delete()
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()
public java.lang.String getURL()
public void setURL(java.lang.String url)
public javax.swing.Icon getIcon(boolean expanded)
public java.awt.Color getForegroundColor(boolean sel)
getForegroundColor
in class VPTNode
sel
- If the node is currently selected.public java.lang.String toString()
public boolean canOpen()
public boolean canRename()
public void open()
public void open(org.gjt.sp.jedit.View v)
v
- Where to open the file (null = active view).public void close()
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)