public class VFSBrowser extends javax.swing.JPanel implements DefaultFocusComponent, DockableWindow
Modifier and Type | Class and Description |
---|---|
static class |
VFSBrowser.DirectoriesOnlyFilter |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
BROWSER
Stand-alone dockable browser mode.
|
static int |
BROWSER_DIALOG
File Open Dialog with extra context menu actions like the BROWSER mode.
|
static int |
CHOOSE_DIRECTORY_DIALOG
Choose directory dialog mode.
|
static int |
M_INSERT |
static int |
M_OPEN |
static int |
M_OPEN_NEW_PLAIN_VIEW |
static int |
M_OPEN_NEW_SPLIT |
static int |
M_OPEN_NEW_VIEW |
static java.lang.String |
NAME |
static int |
OPEN_DIALOG
Open file dialog mode.
|
static int |
SAVE_DIALOG
Save file dialog mode.
|
TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
VFSBrowser(View view,
java.lang.String position)
Creates a new VFS browser.
|
VFSBrowser(View view,
java.lang.String path,
int mode,
boolean multipleSelection,
java.lang.String position)
Creates a new VFS browser.
|
Modifier and Type | Method and Description |
---|---|
void |
addBrowserListener(BrowserListener l) |
void |
addNotify() |
void |
addVFSFileFilter(VFSFileFilter filter)
Adds a file filter to the browser.
|
static void |
browseDirectory(View view,
java.lang.String path)
Opens the specified directory in a file system browser.
|
static void |
browseDirectoryInNewWindow(View view,
java.lang.String path)
Opens the specified directory in a new, floating, file system browser.
|
javax.swing.JComponent |
createPluginsMenu(javax.swing.JComponent pluginMenu,
boolean showManagerOptions) |
void |
delete(VFSFile[] files)
Note that all files must be on the same VFS.
|
void |
dispose()
Disposes the browser, regardless of whether it is a dialog or a dockable
|
void |
fileProperties(VFSFile[] files)
Show selected file's properties.
|
void |
filesActivated(int mode,
boolean canDoubleClickClose)
This method does the "double-click" handling.
|
void |
focusOnDefaultComponent()
Sets focus on the default component.
|
static ActionContext |
getActionContext()
Returns the browser action context.
|
java.lang.String |
getDirectory() |
HistoryTextField |
getDirectoryField() |
static java.lang.String |
getLastVisitedPath()
Returns the last path visited by VFSBrowser.
|
int |
getMode() |
static java.lang.String |
getRootDirectory() |
VFSFile[] |
getSelectedFiles()
Return the selected files in the lower browser tree.
|
VFSFile[] |
getSelectedFiles(java.awt.Component source)
Return the selected files from the point of view of the
given component.
|
boolean |
getShowHiddenFiles() |
VFSFileFilter |
getVFSFileFilter()
Returns the currently active VFSFileFilter.
|
View |
getView() |
void |
handleBufferUpdate(BufferUpdate bmsg) |
void |
handlePluginUpdate(PluginUpdate pmsg) |
void |
handlePropertiesChanged(PropertiesChanged msg) |
void |
handleVFSUpdate(VFSUpdate msg) |
boolean |
isHorizontalLayout() |
boolean |
isMultipleSelectionEnabled() |
void |
locateFile(java.lang.String path)
Goes to the given file's directory and selects the file in the list.
|
void |
mkdir() |
void |
move(java.lang.String newPosition)
Notifies a dockable window before its docking position is changed.
|
void |
newFile()
Creates a new file in the current directory.
|
void |
nextDirectory() |
void |
paste(VFSFile file)
Paste the file contained in the clipboard.
|
void |
previousDirectory() |
void |
reloadDirectory() |
void |
removeBrowserListener(BrowserListener l) |
void |
removeNotify() |
void |
rename(java.lang.String from) |
void |
rename(java.lang.String from,
java.lang.String newname)
Rename a file
|
void |
rename(VFSFile from)
Rename a file.
|
void |
rename(VFSFile from,
java.lang.String to)
Rename a file.
|
void |
rootDirectory()
Goes to the local drives directory.
|
void |
searchInDirectory()
Opens a directory search in the current directory.
|
void |
searchInDirectory(java.lang.String path,
boolean directory)
Opens a directory search in the specified directory.
|
void |
setDirectory(java.lang.String path) |
void |
setFilenameFilter(java.lang.String filter) |
void |
setShowHiddenFiles(boolean showHiddenFiles) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String NAME
public static final int OPEN_DIALOG
public static final int SAVE_DIALOG
public static final int BROWSER_DIALOG
public static final int CHOOSE_DIRECTORY_DIALOG
public static final int BROWSER
public static final int M_OPEN
public static final int M_OPEN_NEW_VIEW
public static final int M_OPEN_NEW_PLAIN_VIEW
public static final int M_OPEN_NEW_SPLIT
public static final int M_INSERT
public VFSBrowser(View view, java.lang.String position)
view
- The view to open buffers in by defaultpublic VFSBrowser(View view, java.lang.String path, int mode, boolean multipleSelection, java.lang.String position)
view
- The view to open buffers in by defaultpath
- The path to displaymode
- The browser modemultipleSelection
- True if multiple selection should be allowedposition
- Where the browser is locatedpublic static void browseDirectoryInNewWindow(View view, java.lang.String path)
view
- The viewpath
- The directory's pathpublic static void browseDirectory(View view, java.lang.String path)
view
- The viewpath
- The directory's pathpublic static ActionContext getActionContext()
public void focusOnDefaultComponent()
DefaultFocusComponent
focusOnDefaultComponent
in interface DefaultFocusComponent
public void addNotify()
addNotify
in class javax.swing.JComponent
public void removeNotify()
removeNotify
in class javax.swing.JComponent
public void handlePropertiesChanged(PropertiesChanged msg)
public void handleBufferUpdate(BufferUpdate bmsg)
public void handlePluginUpdate(PluginUpdate pmsg)
public void handleVFSUpdate(VFSUpdate msg)
public View getView()
public int getMode()
public boolean isMultipleSelectionEnabled()
public boolean isHorizontalLayout()
public boolean getShowHiddenFiles()
public void setShowHiddenFiles(boolean showHiddenFiles)
public VFSFileFilter getVFSFileFilter()
public void addVFSFileFilter(VFSFileFilter filter)
public void setFilenameFilter(java.lang.String filter)
public HistoryTextField getDirectoryField()
public java.lang.String getDirectory()
public void previousDirectory()
public void nextDirectory()
public static java.lang.String getLastVisitedPath()
null
,public void setDirectory(java.lang.String path)
public static java.lang.String getRootDirectory()
public void rootDirectory()
public void reloadDirectory()
public void delete(VFSFile[] files)
public void rename(VFSFile from)
from
- the file to renamepublic void rename(VFSFile from, java.lang.String to)
from
- the file to renameto
- the target namepublic void rename(java.lang.String from)
public void rename(java.lang.String from, java.lang.String newname)
from
- the full path name of the file to be renamednewname
- the new name (only filename, not full path)public void mkdir()
public void newFile()
public void fileProperties(VFSFile[] files)
public void searchInDirectory()
public void searchInDirectory(java.lang.String path, boolean directory)
path
- The path namedirectory
- True if the path is a directory, false if it is a filepublic VFSFile[] getSelectedFiles()
public VFSFile[] getSelectedFiles(java.awt.Component source)
BrowserView.ParentDirectoryList
to get
the list of currently selected files from there. Otherwise, it
returns what getSelectedFiles()
would return.source
- the source component to start from when
navigating the component hierarchypublic void paste(VFSFile file) throws java.io.IOException, java.awt.datatransfer.UnsupportedFlavorException
file
- the target, it can be a file, in that case it will be pasted to
the parent directory, or a directory.java.io.IOException
java.awt.datatransfer.UnsupportedFlavorException
public void locateFile(java.lang.String path)
path
- The filepublic javax.swing.JComponent createPluginsMenu(javax.swing.JComponent pluginMenu, boolean showManagerOptions)
public void addBrowserListener(BrowserListener l)
public void removeBrowserListener(BrowserListener l)
public void filesActivated(int mode, boolean canDoubleClickClose)
browser.actions.xml
can bind to it.public void dispose()
public void move(java.lang.String newPosition)
DockableWindow
move
in interface DockableWindow
newPosition
- The docking position to which the window is moving.