org.gjt.sp.jedit.browser
Class VFSBrowser

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.gjt.sp.jedit.browser.VFSBrowser
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, EBComponent, DefaultFocusComponent

public class VFSBrowser
extends javax.swing.JPanel
implements EBComponent, DefaultFocusComponent

The main class of the VFS browser.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int BROWSER
          Stand-alone browser mode.
static int BROWSER_DIALOG
          Choose directory dialog 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.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
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.
 
Method Summary
 void addBrowserListener(BrowserListener l)
           
 void addNotify()
           
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 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.
 org.gjt.sp.jedit.browser.BrowserView getBrowserView()
           
 java.lang.String getDirectory()
           
 HistoryTextField getDirectoryField()
           
 java.lang.String getFilenameFilter()
          Returns the file name filter glob.
 int getMode()
           
static java.lang.String getRootDirectory()
           
 VFSFile[] getSelectedFiles()
           
 boolean getShowHiddenFiles()
           
 View getView()
           
 void handleMessage(EBMessage msg)
          Handles a message sent on the EditBus.
 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 newFile()
          Creates a new file in the current directory.
 void reloadDirectory()
           
 void removeBrowserListener(BrowserListener l)
           
 void removeNotify()
           
 void rename(java.lang.String from)
           
 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)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

OPEN_DIALOG

public static final int OPEN_DIALOG
Open file dialog mode. Equals JFileChooser.OPEN_DIALOG for backwards compatibility.

See Also:
Constant Field Values

SAVE_DIALOG

public static final int SAVE_DIALOG
Save file dialog mode. Equals JFileChooser.SAVE_DIALOG for backwards compatibility.

See Also:
Constant Field Values

BROWSER_DIALOG

public static final int BROWSER_DIALOG
Choose directory dialog mode.

See Also:
Constant Field Values

CHOOSE_DIRECTORY_DIALOG

public static final int CHOOSE_DIRECTORY_DIALOG
Choose directory dialog mode.

See Also:
Constant Field Values

BROWSER

public static final int BROWSER
Stand-alone browser mode.

See Also:
Constant Field Values

M_OPEN

public static final int M_OPEN
See Also:
Constant Field Values

M_OPEN_NEW_VIEW

public static final int M_OPEN_NEW_VIEW
See Also:
Constant Field Values

M_OPEN_NEW_PLAIN_VIEW

public static final int M_OPEN_NEW_PLAIN_VIEW
See Also:
Constant Field Values

M_OPEN_NEW_SPLIT

public static final int M_OPEN_NEW_SPLIT
See Also:
Constant Field Values

M_INSERT

public static final int M_INSERT
See Also:
Constant Field Values
Constructor Detail

VFSBrowser

public VFSBrowser(View view,
                  java.lang.String position)
Creates a new VFS browser.

Parameters:
view - The view to open buffers in by default

VFSBrowser

public VFSBrowser(View view,
                  java.lang.String path,
                  int mode,
                  boolean multipleSelection,
                  java.lang.String position)
Creates a new VFS browser.

Parameters:
view - The view to open buffers in by default
path - The path to display
mode - The browser mode
multipleSelection - True if multiple selection should be allowed
position - Where the browser is located
Since:
jEdit 4.2pre1
Method Detail

browseDirectoryInNewWindow

public static void browseDirectoryInNewWindow(View view,
                                              java.lang.String path)
Opens the specified directory in a new, floating, file system browser.

Parameters:
view - The view
path - The directory's path
Since:
jEdit 4.1pre2

browseDirectory

public static void browseDirectory(View view,
                                   java.lang.String path)
Opens the specified directory in a file system browser.

Parameters:
view - The view
path - The directory's path
Since:
jEdit 4.0pre3

getActionContext

public static ActionContext getActionContext()
Returns the browser action context.

Since:
jEdit 4.2pre1

focusOnDefaultComponent

public void focusOnDefaultComponent()
Description copied from interface: DefaultFocusComponent
Sets focus on the default component.

Specified by:
focusOnDefaultComponent in interface DefaultFocusComponent

addNotify

public void addNotify()
Overrides:
addNotify in class javax.swing.JComponent

removeNotify

public void removeNotify()
Overrides:
removeNotify in class javax.swing.JComponent

handleMessage

public void handleMessage(EBMessage msg)
Description copied from interface: EBComponent
Handles a message sent on the EditBus. This method must specify the type of responses the plugin will have for various subclasses of the EBMessage class. Typically this is done with one or more if blocks that test whether the message is an instance of a derived message class in which the component has an interest. For example:
 if(msg instanceof BufferUpdate) {
     // a buffer's state has changed!
 }
 else if(msg instanceof ViewUpdate) {
     // a view's state has changed!
 }
 // ... and so on

Specified by:
handleMessage in interface EBComponent
Parameters:
msg - The message

getView

public View getView()

getMode

public int getMode()

isMultipleSelectionEnabled

public boolean isMultipleSelectionEnabled()

isHorizontalLayout

public boolean isHorizontalLayout()

getShowHiddenFiles

public boolean getShowHiddenFiles()

setShowHiddenFiles

public void setShowHiddenFiles(boolean showHiddenFiles)

getFilenameFilter

public java.lang.String getFilenameFilter()
Returns the file name filter glob.

Since:
jEdit 3.2pre2

setFilenameFilter

public void setFilenameFilter(java.lang.String filter)

getDirectoryField

public HistoryTextField getDirectoryField()

getDirectory

public java.lang.String getDirectory()

setDirectory

public void setDirectory(java.lang.String path)

getRootDirectory

public static java.lang.String getRootDirectory()

rootDirectory

public void rootDirectory()
Goes to the local drives directory.

Since:
jEdit 4.0pre4

reloadDirectory

public void reloadDirectory()

delete

public void delete(VFSFile[] files)
Note that all files must be on the same VFS.

Since:
jEdit 4.3pre2

rename

public void rename(java.lang.String from)

mkdir

public void mkdir()

newFile

public void newFile()
Creates a new file in the current directory.

Since:
jEdit 4.0pre2

searchInDirectory

public void searchInDirectory()
Opens a directory search in the current directory.

Since:
jEdit 4.0pre2

searchInDirectory

public void searchInDirectory(java.lang.String path,
                              boolean directory)
Opens a directory search in the specified directory.

Parameters:
path - The path name
directory - True if the path is a directory, false if it is a file
Since:
jEdit 4.2pre1

getBrowserView

public org.gjt.sp.jedit.browser.BrowserView getBrowserView()

getSelectedFiles

public VFSFile[] getSelectedFiles()
Since:
jEdit 4.3pre2

locateFile

public void locateFile(java.lang.String path)
Goes to the given file's directory and selects the file in the list.

Parameters:
path - The file
Since:
jEdit 4.2pre2

createPluginsMenu

public javax.swing.JComponent createPluginsMenu(javax.swing.JComponent pluginMenu,
                                                boolean showManagerOptions)

addBrowserListener

public void addBrowserListener(BrowserListener l)

removeBrowserListener

public void removeBrowserListener(BrowserListener l)

filesActivated

public void filesActivated(int mode,
                           boolean canDoubleClickClose)
This method does the "double-click" handling. It is public so that browser.actions.xml can bind to it.

Since:
jEdit 4.2pre2