Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gjt.sp.jedit.browser
Class VFSBrowser  view VFSBrowser download VFSBrowser.java

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

public class VFSBrowser
extends javax.swing.JPanel
implements org.gjt.sp.jedit.EBComponent, org.gjt.sp.jedit.gui.DefaultFocusComponent

The main class of the VFS browser.

Version:
$Id: VFSBrowser.java,v 1.101 2003/11/22 20:32:28 spestov Exp $

Nested Class Summary
(package private)  class VFSBrowser.ActionHandler
           
(package private)  class VFSBrowser.CommandsMenuButton
           
(package private)  class VFSBrowser.DirectoryLoadedAWTRequest
           
(package private)  class VFSBrowser.FavoritesMenuButton
           
(package private)  class VFSBrowser.PluginsMenuButton
           
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private static org.gjt.sp.jedit.ActionContext actionContext
           
(package private)  boolean autoDetectEncoding
           
static int BROWSER
          Stand-alone browser mode.
static int BROWSER_DIALOG
          Choose directory dialog mode.
private  BrowserView browserView
           
static int CHOOSE_DIRECTORY_DIALOG
          Choose directory dialog mode.
(package private)  java.lang.String currentEncoding
           
private  boolean doubleClickClose
           
private  VFSBrowser.FavoritesMenuButton favorites
           
private  gnu.regexp.RE filenameFilter
           
private  javax.swing.JCheckBox filterCheckbox
           
private  org.gjt.sp.jedit.gui.HistoryTextField filterField
           
private  boolean floating
           
private  boolean horizontalLayout
           
private  javax.swing.event.EventListenerList listenerList
           
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
           
private  boolean maybeReloadRequestRunning
           
private  int mode
           
private  boolean multipleSelection
           
static java.lang.String NAME
           
static int OPEN_DIALOG
          Open file dialog mode.
private  java.lang.String path
           
private  org.gjt.sp.jedit.gui.HistoryTextField pathField
           
private  VFSBrowser.PluginsMenuButton plugins
           
private  boolean requestRunning
           
static int SAVE_DIALOG
          Save file dialog mode.
private  boolean showHiddenFiles
           
private  boolean sortIgnoreCase
           
private  boolean sortMixFilesAndDirs
           
private  javax.swing.Box toolbarBox
           
private  org.gjt.sp.jedit.View view
           
 
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.Container
 
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(org.gjt.sp.jedit.View view, java.lang.String position)
          Creates a new VFS browser.
VFSBrowser(org.gjt.sp.jedit.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()
          Receives notification if this component is added to a parent component.
static void browseDirectory(org.gjt.sp.jedit.View view, java.lang.String path)
          Opens the specified directory in a file system browser.
static void browseDirectoryInNewWindow(org.gjt.sp.jedit.View view, java.lang.String path)
          Opens the specified directory in a new, floating, file system browser.
private  javax.swing.JPanel createMenuBar()
           
private  javax.swing.Box createToolBar()
           
 void delete(org.gjt.sp.jedit.io.VFS.DirectoryEntry[] files)
          Note that all files must be on the same VFS.
(package private)  void directoryLoaded(java.lang.Object node, java.lang.Object[] loadInfo)
           
(package private)  void endRequest()
           
 void filesActivated(int mode, boolean canDoubleClickClose)
          This method does the "double-click" handling.
(package private)  void filesSelected()
           
 void focusOnDefaultComponent()
          Sets focus on the default component.
static org.gjt.sp.jedit.ActionContext getActionContext()
          Returns the browser action context.
 BrowserView getBrowserView()
           
 java.lang.String getDirectory()
           
 org.gjt.sp.jedit.gui.HistoryTextField getDirectoryField()
           
 java.lang.String getFilenameFilter()
          Returns the file name filter glob.
 int getMode()
           
 org.gjt.sp.jedit.io.VFS.DirectoryEntry[] getSelectedFiles()
           
 boolean getShowHiddenFiles()
           
 org.gjt.sp.jedit.View getView()
           
 void handleMessage(org.gjt.sp.jedit.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.
private  void maybeReloadDirectory(java.lang.String dir)
           
 void mkdir()
           
 void newFile()
          Creates a new file in the current directory.
(package private) static boolean pathsEqual(java.lang.String p1, java.lang.String p2)
          This will be made public at some stage, in the io package, but not yet.
private  void propertiesChanged()
           
 void reloadDirectory()
           
 void removeBrowserListener(BrowserListener l)
           
 void removeNotify()
          Receives notification that this component no longer has a parent.
 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)
           
private  boolean startRequest()
           
(package private)  void updateFilenameFilter()
           
private  void updateFilterEnabled()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, 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, processMouseEvent, 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
 
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

currentEncoding

java.lang.String currentEncoding

autoDetectEncoding

boolean autoDetectEncoding

actionContext

private static org.gjt.sp.jedit.ActionContext actionContext

listenerList

private javax.swing.event.EventListenerList listenerList

view

private org.gjt.sp.jedit.View view

floating

private boolean floating

horizontalLayout

private boolean horizontalLayout

path

private java.lang.String path

pathField

private org.gjt.sp.jedit.gui.HistoryTextField pathField

filterCheckbox

private javax.swing.JCheckBox filterCheckbox

filterField

private org.gjt.sp.jedit.gui.HistoryTextField filterField

toolbarBox

private javax.swing.Box toolbarBox

favorites

private VFSBrowser.FavoritesMenuButton favorites

plugins

private VFSBrowser.PluginsMenuButton plugins

browserView

private BrowserView browserView

filenameFilter

private gnu.regexp.RE filenameFilter

mode

private int mode

multipleSelection

private boolean multipleSelection

showHiddenFiles

private boolean showHiddenFiles

sortMixFilesAndDirs

private boolean sortMixFilesAndDirs

sortIgnoreCase

private boolean sortIgnoreCase

doubleClickClose

private boolean doubleClickClose

requestRunning

private boolean requestRunning

maybeReloadRequestRunning

private boolean maybeReloadRequestRunning
Constructor Detail

VFSBrowser

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


VFSBrowser

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

Since:
jEdit 4.2pre1
Method Detail

browseDirectoryInNewWindow

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

Since:
jEdit 4.1pre2

browseDirectory

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

Since:
jEdit 4.0pre3

getActionContext

public static org.gjt.sp.jedit.ActionContext getActionContext()
Returns the browser action context.

Since:
jEdit 4.2pre1

focusOnDefaultComponent

public void focusOnDefaultComponent()
Description copied from interface: org.gjt.sp.jedit.gui.DefaultFocusComponent
Sets focus on the default component.

Specified by:
focusOnDefaultComponent in interface org.gjt.sp.jedit.gui.DefaultFocusComponent

addNotify

public void addNotify()
Description copied from class: javax.swing.JComponent
Receives notification if this component is added to a parent component. Notification is sent to all registered AncestorListeners about the new parent. This method sets up ActionListeners for all registered KeyStrokes of this component in the chain of parent components. A PropertyChange event is fired to indicate that the ancestor property has changed. This method is used internally and should not be used in applications.


removeNotify

public void removeNotify()
Description copied from class: javax.swing.JComponent
Receives notification that this component no longer has a parent. This method sends an AncestorEvent to all registered AncestorListeners, notifying them that the parent is gone. The keybord actions of this component are removed from the parent and its ancestors. A PropertyChangeEvent is fired to indicate that the 'ancestor' property has changed. This method is called before the component is actually removed from its parent, so the parent is still visible through Component.getParent()>Component.getParent() 55 .


handleMessage

public void handleMessage(org.gjt.sp.jedit.EBMessage msg)
Description copied from interface: org.gjt.sp.jedit.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 org.gjt.sp.jedit.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 org.gjt.sp.jedit.EBComponent

getView

public org.gjt.sp.jedit.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 org.gjt.sp.jedit.gui.HistoryTextField getDirectoryField()

getDirectory

public java.lang.String getDirectory()

setDirectory

public void setDirectory(java.lang.String path)

rootDirectory

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

Since:
jEdit 4.0pre4

reloadDirectory

public void reloadDirectory()

delete

public void delete(org.gjt.sp.jedit.io.VFS.DirectoryEntry[] files)
Note that all files must be on the same VFS.


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.

Since:
jEdit 4.2pre1

getBrowserView

public BrowserView getBrowserView()

getSelectedFiles

public org.gjt.sp.jedit.io.VFS.DirectoryEntry[] getSelectedFiles()

locateFile

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

Since:
jEdit 4.2pre2

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

pathsEqual

static boolean pathsEqual(java.lang.String p1,
                          java.lang.String p2)
This will be made public at some stage, in the io package, but not yet.


updateFilenameFilter

void updateFilenameFilter()

directoryLoaded

void directoryLoaded(java.lang.Object node,
                     java.lang.Object[] loadInfo)

filesSelected

void filesSelected()

endRequest

void endRequest()

createMenuBar

private javax.swing.JPanel createMenuBar()

createToolBar

private javax.swing.Box createToolBar()

propertiesChanged

private void propertiesChanged()

startRequest

private boolean startRequest()

updateFilterEnabled

private void updateFilterEnabled()

maybeReloadDirectory

private void maybeReloadDirectory(java.lang.String dir)