com.alee.laf.filechooser
Class WebFileChooserPanel

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 com.alee.laf.panel.WebPanel
                      extended by com.alee.laf.filechooser.WebFileChooserPanel
All Implemented Interfaces:
PartialDecoration, LanguageContainerMethods, ShapeProvider, Styleable, SizeMethods<WebPanel>, SwingMethods, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class WebFileChooserPanel
extends WebPanel

File chooser panel component. Basically used to provide WebFileChooserUI with all required UI elements.

Author:
Mikle Garin
See Also:
Serialized Form

Nested Class Summary
protected  class WebFileChooserPanel.FilesLocateDropHandler
          FileDragAndDropHandler extension to provide drop-to-find-file functionality.
protected  class WebFileChooserPanel.HiddenFilesFilter
          Custom hidden/non-hidden files filter.
protected static class WebFileChooserPanel.UpdateSource
          This enumeration represents the type of source that caused view update.
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static javax.swing.ImageIcon APPROVE_ICON
           
protected  WebButton approveButton
           
protected  java.awt.event.ActionListener approveListener
          Custom approve button listener.
protected  java.util.List<AbstractFileFilter> availableFilters
          All available file filters for this file chooser panel.
protected  WebButton backward
          North panel components.
static javax.swing.ImageIcon BACKWARD_ICON
          Used icons.
static javax.swing.ImageIcon CANCEL_ICON
           
protected  WebButton cancelButton
           
protected  java.awt.event.ActionListener cancelListener
          Custom cancel button listener.
protected  WebSplitPane centralSplit
           
protected  java.util.List<FileChooserListener> chooserListeners
          File chooser listeners.
protected  FileChooserType chooserType
          File chooser type.
protected  WebPanel controlsPanel
           
protected  java.io.File currentFolder
          Currently viewed folder.
protected  int currentHistoryIndex
          Current view history index.
protected  AbstractFileFilter fileFilter
          Default file filter for this file chooser panel.
protected  WebComboBox fileFilters
           
protected  WebFileList fileList
           
protected  WebScrollPane fileListScroll
           
protected  WebFileTable fileTable
           
protected  WebScrollPane fileTableScroll
           
protected  WebFileTree fileTree
          Center panel components.
protected  javax.swing.event.TreeSelectionListener fileTreeListener
           
static javax.swing.ImageIcon FOLDER_HOME_ICON
           
static javax.swing.ImageIcon FOLDER_NEW_ICON
           
static javax.swing.ImageIcon FOLDER_UP_ICON
           
protected  WebButton folderHome
           
protected  WebButton folderNew
           
protected  WebButton folderUp
           
protected  WebButton forward
           
static javax.swing.ImageIcon FORWARD_ICON
           
protected  WebFileChooserPanel.HiddenFilesFilter hiddenFilesFilter
          Hidden files filter attached to this panel.
protected  WebButton history
           
static javax.swing.ImageIcon HISTORY_ICON
           
protected  DataProvider<java.lang.Boolean> hotkeysAllowed
          Editing state provider.
protected  boolean multiSelectionEnabled
          Whether multiply files selection allowed or not.
protected  java.util.List<java.io.File> navigationHistory
          Current view history.
protected  WebPathField pathField
           
protected  PathFieldListener pathFieldListener
           
static FileNameProvider quotedFileNameProvider
          File name provider.
protected  WebButton refresh
           
static javax.swing.ImageIcon REFRESH_ICON
           
protected  WebButton remove
           
static javax.swing.ImageIcon REMOVE_ICON
           
protected  WebPanel selectedFilesPanel
           
protected  WebTextField selectedFilesTextField
           
protected  WebFileChooserField selectedFilesViewField
          South panel components.
static javax.swing.ImageIcon SETTINGS_ICON
           
protected  boolean showControlButtons
          Whether to show control buttons or not.
protected  boolean showHiddenFiles
          Whether should display hidden files or not.
protected  WebScrollPane treeScroll
           
protected  WebButton view
           
static javax.swing.ImageIcon VIEW_ICON
           
static javax.swing.ImageIcon VIEW_ICONS_ICON
           
static javax.swing.ImageIcon VIEW_TABLE_ICON
           
static javax.swing.ImageIcon VIEW_TILES_ICON
           
protected  FileChooserViewType viewType
          Directory files view type.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, 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
WebFileChooserPanel()
          Constructs new file chooser panel without contol buttons.
WebFileChooserPanel(boolean showControlButtons)
          Constructs new file chooser panel with or without contol buttons.
WebFileChooserPanel(FileChooserType chooserType)
          Constructs new file chooser panel with or without contol buttons.
WebFileChooserPanel(FileChooserType chooserType, boolean showControlButtons)
          Constructs new file chooser panel with or without contol buttons.
 
Method Summary
 void addFileChooserListener(FileChooserListener listener)
          Adds file chooser listener.
protected  GroupedFileFilter applyHiddenFilesFilter(AbstractFileFilter fileFilter)
          Adds hidden files filter condition to the specified files filter.
protected  GroupedFileFilter applyOrDirectoriesFilter(AbstractFileFilter fileFilter)
          Adds "isDirectory" as one of filter OR conditions.
protected  java.awt.Component createCenterContent()
          Returns center panel content.
protected  void createFileList()
          Creates file list and all related components.
protected  void createFileTable()
          Creates file table and all related components.
protected  void createFileTree()
          Creates file tree and all related components.
protected  java.awt.Component createNorthContent()
          Returns north panel content.
protected  java.awt.Component createSouthContent()
          Returns south panel content.
 void deleteSelectedFiles()
          Delete all selected in view files.
 void editSelectedFileName()
          Starts editing name of selected file in currently visible view.
protected  void fireApproveAction(java.awt.event.ActionEvent e)
          Fires approve action.
protected  void fireCancelAction(java.awt.event.ActionEvent e)
          Fires cancel action.
protected  void fireDirectoryChanged(java.io.File newDirectory)
          Fired when displayed in file chooser directory changes.
protected  void fireFileSelectionChanged(java.util.List<java.io.File> selectedFiles)
          Fired when selected in file chooser files change.
 AbstractFileFilter getActiveFileFilter()
          Returns currenly active file filter.
protected  java.util.List<java.io.File> getAllSelectedFiles()
          Returns list of selected files.
 java.lang.String getApproveButtonText()
          Returns approve button text.
 java.awt.event.ActionListener getApproveListener()
          Returns approve button listener.
 java.util.List<AbstractFileFilter> getAvailableFilters()
          Returns list of available file filters.
 java.awt.event.ActionListener getCancelListener()
          Returns cancel button listener.
 FileChooserType getChooserType()
          Returns chooser type.
protected  java.util.List<java.io.File> getFilteredSelectedFiles(java.util.Collection<java.io.File> allFiles)
          Returns list of filtered selected files.
protected  java.lang.String getMultiFilesView(java.util.List<java.io.File> files)
          Returns text representtation for multiply files.
 java.util.List<java.io.File> getSelectedFiles()
          Returns list of selected files which are accepted by active filter.
protected  java.lang.String getSingleFileView(java.io.File file)
          Returns text representtation for single file.
 FileChooserViewType getViewType()
          Returns directory files view type.
 boolean isGenerateThumbnails()
          Returns whether file thumbnails are generated or not.
 boolean isMultiSelectionEnabled()
          Returns whether multiply files selection is allowed or not.
 boolean isShowControlButtons()
          Returns whether control buttons are displayed or not.
 boolean isShowHiddenFiles()
          Sets whether should display hidden files or not.
 void reloadCurrentFolder()
          Reloads files from currently opened folder into all available view components.
 void removeFileChooserListener(FileChooserListener listener)
          Removes file chooser listener.
 void restoreButtonText()
          Restores default approve button text for the specified chooser type.
 void setActiveFileFilter(AbstractFileFilter fileFilter)
          Sets currently active file filter.
protected  void setActiveFileFilter(AbstractFileFilter fileFilter, boolean select)
          Sets currently active file filter.
 void setApproveButtonLanguage(java.lang.String key)
          Sets approve button language key.
 void setApproveButtonText(FileApproveText approveText)
          Sets approve button text type.
 void setApproveButtonText(java.lang.String text)
          Sets approve button text.
 void setApproveListener(java.awt.event.ActionListener approveListener)
          Sets approve button listener.
 void setCancelListener(java.awt.event.ActionListener cancelListener)
          Sets cancel button listener.
 void setChooserType(FileChooserType chooserType)
          Sets chooser type.
 void setCurrentFolder(java.io.File folder)
          Sets currently opened folder.
 void setFileFilter(AbstractFileFilter fileFilter)
          Sets the specified file filter as the only one avaiable.
 void setFileFilter(java.io.FileFilter fileFilter)
          Sets the specified file filter as the only one avaiable.
 void setFileFilter(javax.swing.filechooser.FileFilter fileFilter)
          Sets the specified file filter as the only one avaiable.
 void setFileFilters(AbstractFileFilter[] fileFilters)
          Sets available file filters.
 void setFileFilters(java.io.FileFilter[] fileFilters)
          Sets available file filters.
 void setFileFilters(javax.swing.filechooser.FileFilter[] fileFilters)
          Sets available file filters.
 void setFileFilters(int index, AbstractFileFilter[] fileFilters)
          Sets available file filters.
 void setFileFilters(int index, java.io.FileFilter[] fileFilters)
          Sets available file filters.
 void setFileFilters(int index, javax.swing.filechooser.FileFilter[] fileFilters)
          Sets available file filters.
 void setFileFilters(int index, java.util.List<AbstractFileFilter> fileFilters)
          Sets available file filters.
 void setFileFilters(java.util.List<AbstractFileFilter> fileFilters)
          Sets available file filters.
 void setGenerateThumbnails(boolean generate)
          Sets whether file thumbnails should be generated or not.
 void setMultiSelectionEnabled(boolean multiSelectionEnabled)
          Sets whether multiply files selection is allowed or not.
 void setSelectedFile(java.io.File file)
          Sets file selected in currently displayed directory.
 void setSelectedFiles(java.util.Collection<java.io.File> files)
          Sets files selected in currently displayed directory.
 void setSelectedFiles(java.io.File[] files)
          Sets files selected in currently displayed directory.
 void setShowControlButtons(boolean showControlButtons)
          Sets whether to display control buttons or not.
 void setShowHiddenFiles(boolean showHiddenFiles)
          Sets whether should display hidden files or not.
 void setViewType(FileChooserViewType viewType)
          Sets directory files view type
protected  void updateApproveButtonState(java.util.List<java.io.File> files)
          Updates approve button state.
protected  void updateControls()
          Updates controls display.
protected  void updateControlsState()
          Updates toolbar controls state.
protected  void updateCurrentFolder(java.io.File file, WebFileChooserPanel.UpdateSource updateSource)
          Updates currently opened folder.
protected  void updateDirectoryComponentFilters()
          Updates directory selection components filters.
protected  void updateFileComponentFilters()
          Updates files selection components filters.
protected  void updateFiltersComboBox()
          Updates file filters combobox view.
protected  void updateHistoryState(int historyIndex)
          Updates current history state.
protected  void updateList(java.io.File file)
          Updates files list view.
protected  void updatePath(java.io.File file)
          Updates path field view.
protected  void updateSelectedFilesField()
          Updates currently selected files field.
protected  void updateSelectedFilesFieldImpl(java.util.Collection<java.io.File> selected)
          Updates currently selected files field.
protected  void updateSelectedFilesFieldPanel()
          Updates selected files field panel content.
protected  void updateSelectionMode()
          Updates view components selection modes.
protected  void updateTable(java.io.File file)
          Updates files table view.
protected  void updateTree(java.io.File file)
          Updates files tree view.
 
Methods inherited from class com.alee.laf.panel.WebPanel
add, add, add, add, add, add, getBorderColor, getBorderStroke, getDisabledBorderColor, getFirstComponent, getLanguageContainerKey, getLastComponent, getMargin, getMinimumHeight, getMinimumWidth, getPainter, getPreferredHeight, getPreferredSize, getPreferredWidth, getRound, getShadeTransparency, getShadeWidth, getStyleId, getWebUI, isPaintBackground, isPaintBottom, isPaintBottomLine, isPaintFocus, isPaintLeft, isPaintLeftLine, isPaintRight, isPaintRightLine, isPaintTop, isPaintTopLine, isUndecorated, isWebColoredBackground, provideShape, removeLanguageContainerKey, setBorderColor, setBorderStroke, setDisabledBorderColor, setLanguageContainerKey, setMargin, setMargin, setMargin, setMinimumHeight, setMinimumWidth, setPaintBackground, setPaintBottom, setPaintBottomLine, setPainter, setPaintFocus, setPaintLeft, setPaintLeftLine, setPaintRight, setPaintRightLine, setPaintSideLines, setPaintSides, setPaintTop, setPaintTopLine, setPreferredHeight, setPreferredWidth, setRound, setShadeTransparency, setShadeWidth, setStyleId, setUndecorated, setWebColoredBackground, updateUI
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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

BACKWARD_ICON

public static final javax.swing.ImageIcon BACKWARD_ICON
Used icons.


FORWARD_ICON

public static final javax.swing.ImageIcon FORWARD_ICON

HISTORY_ICON

public static final javax.swing.ImageIcon HISTORY_ICON

FOLDER_UP_ICON

public static final javax.swing.ImageIcon FOLDER_UP_ICON

FOLDER_HOME_ICON

public static final javax.swing.ImageIcon FOLDER_HOME_ICON

FOLDER_NEW_ICON

public static final javax.swing.ImageIcon FOLDER_NEW_ICON

REFRESH_ICON

public static final javax.swing.ImageIcon REFRESH_ICON

REMOVE_ICON

public static final javax.swing.ImageIcon REMOVE_ICON

VIEW_ICON

public static final javax.swing.ImageIcon VIEW_ICON

VIEW_ICONS_ICON

public static final javax.swing.ImageIcon VIEW_ICONS_ICON

VIEW_TILES_ICON

public static final javax.swing.ImageIcon VIEW_TILES_ICON

VIEW_TABLE_ICON

public static final javax.swing.ImageIcon VIEW_TABLE_ICON

SETTINGS_ICON

public static final javax.swing.ImageIcon SETTINGS_ICON

APPROVE_ICON

public static final javax.swing.ImageIcon APPROVE_ICON

CANCEL_ICON

public static final javax.swing.ImageIcon CANCEL_ICON

quotedFileNameProvider

public static final FileNameProvider quotedFileNameProvider
File name provider.


showControlButtons

protected boolean showControlButtons
Whether to show control buttons or not.


chooserType

protected FileChooserType chooserType
File chooser type.


showHiddenFiles

protected boolean showHiddenFiles
Whether should display hidden files or not.


fileFilter

protected AbstractFileFilter fileFilter
Default file filter for this file chooser panel.


availableFilters

protected java.util.List<AbstractFileFilter> availableFilters
All available file filters for this file chooser panel.


viewType

protected FileChooserViewType viewType
Directory files view type.


multiSelectionEnabled

protected boolean multiSelectionEnabled
Whether multiply files selection allowed or not.


currentFolder

protected java.io.File currentFolder
Currently viewed folder.


currentHistoryIndex

protected int currentHistoryIndex
Current view history index.


navigationHistory

protected java.util.List<java.io.File> navigationHistory
Current view history.


approveListener

protected java.awt.event.ActionListener approveListener
Custom approve button listener. By default panel does nothing on approve button press.


cancelListener

protected java.awt.event.ActionListener cancelListener
Custom cancel button listener. By default panel does nothing on cancel button press.


chooserListeners

protected java.util.List<FileChooserListener> chooserListeners
File chooser listeners.


backward

protected WebButton backward
North panel components.


forward

protected WebButton forward

history

protected WebButton history

pathField

protected WebPathField pathField

pathFieldListener

protected PathFieldListener pathFieldListener

folderUp

protected WebButton folderUp

folderHome

protected WebButton folderHome

folderNew

protected WebButton folderNew

refresh

protected WebButton refresh

remove

protected WebButton remove

view

protected WebButton view

fileTree

protected WebFileTree fileTree
Center panel components.


fileTreeListener

protected javax.swing.event.TreeSelectionListener fileTreeListener

treeScroll

protected WebScrollPane treeScroll

fileList

protected WebFileList fileList

fileListScroll

protected WebScrollPane fileListScroll

fileTable

protected WebFileTable fileTable

fileTableScroll

protected WebScrollPane fileTableScroll

centralSplit

protected WebSplitPane centralSplit

selectedFilesViewField

protected WebFileChooserField selectedFilesViewField
South panel components.


selectedFilesTextField

protected WebTextField selectedFilesTextField

selectedFilesPanel

protected WebPanel selectedFilesPanel

controlsPanel

protected WebPanel controlsPanel

fileFilters

protected WebComboBox fileFilters

approveButton

protected WebButton approveButton

cancelButton

protected WebButton cancelButton

hotkeysAllowed

protected DataProvider<java.lang.Boolean> hotkeysAllowed
Editing state provider. todo This is a temporary workaround for HotkeysManager actions


hiddenFilesFilter

protected WebFileChooserPanel.HiddenFilesFilter hiddenFilesFilter
Hidden files filter attached to this panel.

Constructor Detail

WebFileChooserPanel

public WebFileChooserPanel()
Constructs new file chooser panel without contol buttons.


WebFileChooserPanel

public WebFileChooserPanel(FileChooserType chooserType)
Constructs new file chooser panel with or without contol buttons.

Parameters:
chooserType - file chooser type

WebFileChooserPanel

public WebFileChooserPanel(boolean showControlButtons)
Constructs new file chooser panel with or without contol buttons.

Parameters:
showControlButtons - whether to add control buttons or not

WebFileChooserPanel

public WebFileChooserPanel(FileChooserType chooserType,
                           boolean showControlButtons)
Constructs new file chooser panel with or without contol buttons.

Parameters:
chooserType - file chooser type
showControlButtons - whether to add control buttons or not
Method Detail

createNorthContent

protected java.awt.Component createNorthContent()
Returns north panel content.

Returns:
north panel content

updateHistoryState

protected void updateHistoryState(int historyIndex)
Updates current history state.

Parameters:
historyIndex - new history index

createCenterContent

protected java.awt.Component createCenterContent()
Returns center panel content.

Returns:
center panel content

createFileTree

protected void createFileTree()
Creates file tree and all related components.


createFileList

protected void createFileList()
Creates file list and all related components.


createFileTable

protected void createFileTable()
Creates file table and all related components.


createSouthContent

protected java.awt.Component createSouthContent()
Returns south panel content.

Returns:
south panel content

getViewType

public FileChooserViewType getViewType()
Returns directory files view type.

Returns:
directory files view type

setViewType

public void setViewType(FileChooserViewType viewType)
Sets directory files view type

Parameters:
viewType - directory files view type

setCurrentFolder

public void setCurrentFolder(java.io.File folder)
Sets currently opened folder.

Parameters:
folder - folder to be opened

updateCurrentFolder

protected void updateCurrentFolder(java.io.File file,
                                   WebFileChooserPanel.UpdateSource updateSource)
Updates currently opened folder.

Parameters:
file - folder to be opened or file to be displayed
updateSource - update call source

updateControlsState

protected void updateControlsState()
Updates toolbar controls state.


getSelectedFiles

public java.util.List<java.io.File> getSelectedFiles()
Returns list of selected files which are accepted by active filter.

Returns:
list of selected files which are accepted by active filter

getFilteredSelectedFiles

protected java.util.List<java.io.File> getFilteredSelectedFiles(java.util.Collection<java.io.File> allFiles)
Returns list of filtered selected files.

Parameters:
allFiles - files to filter
Returns:
list of filtered selected files

getAllSelectedFiles

protected java.util.List<java.io.File> getAllSelectedFiles()
Returns list of selected files.

Returns:
list of selected files

setSelectedFile

public void setSelectedFile(java.io.File file)
Sets file selected in currently displayed directory.

Parameters:
file - file to select

setSelectedFiles

public void setSelectedFiles(java.io.File[] files)
Sets files selected in currently displayed directory.

Parameters:
files - files to select

setSelectedFiles

public void setSelectedFiles(java.util.Collection<java.io.File> files)
Sets files selected in currently displayed directory.

Parameters:
files - files to select

updateSelectedFilesField

protected void updateSelectedFilesField()
Updates currently selected files field.


updateSelectedFilesFieldImpl

protected void updateSelectedFilesFieldImpl(java.util.Collection<java.io.File> selected)
Updates currently selected files field.

Parameters:
selected - selected files

getSingleFileView

protected java.lang.String getSingleFileView(java.io.File file)
Returns text representtation for single file.

Parameters:
file - file
Returns:
text representtation for single file

getMultiFilesView

protected java.lang.String getMultiFilesView(java.util.List<java.io.File> files)
Returns text representtation for multiply files.

Parameters:
files - files list
Returns:
text representtation for multiply files

updateApproveButtonState

protected void updateApproveButtonState(java.util.List<java.io.File> files)
Updates approve button state.

Parameters:
files - filtered selected files

updateSelectedFilesFieldPanel

protected void updateSelectedFilesFieldPanel()
Updates selected files field panel content.


updatePath

protected void updatePath(java.io.File file)
Updates path field view.

Parameters:
file - new current folder

updateTree

protected void updateTree(java.io.File file)
Updates files tree view.

Parameters:
file - new current folder

updateList

protected void updateList(java.io.File file)
Updates files list view.

Parameters:
file - new current folder

updateTable

protected void updateTable(java.io.File file)
Updates files table view.

Parameters:
file - new current folder

updateFiltersComboBox

protected void updateFiltersComboBox()
Updates file filters combobox view.


setActiveFileFilter

public void setActiveFileFilter(AbstractFileFilter fileFilter)
Sets currently active file filter. Notice that this filter must be in the filters list to be activated.

Parameters:
fileFilter - file filter to make active

setActiveFileFilter

protected void setActiveFileFilter(AbstractFileFilter fileFilter,
                                   boolean select)
Sets currently active file filter. Notice that this filter must be in the filters list to be activated.

Parameters:
fileFilter - file filter to make active
select - whether to select active file filter in combobox or not

updateFileComponentFilters

protected void updateFileComponentFilters()
Updates files selection components filters.


updateDirectoryComponentFilters

protected void updateDirectoryComponentFilters()
Updates directory selection components filters.


applyOrDirectoriesFilter

protected GroupedFileFilter applyOrDirectoriesFilter(AbstractFileFilter fileFilter)
Adds "isDirectory" as one of filter OR conditions.

Parameters:
fileFilter - filter to process
Returns:
new file filter with additional condition

applyHiddenFilesFilter

protected GroupedFileFilter applyHiddenFilesFilter(AbstractFileFilter fileFilter)
Adds hidden files filter condition to the specified files filter.

Parameters:
fileFilter - filter to process
Returns:
new file filter with additional condition

reloadCurrentFolder

public void reloadCurrentFolder()
Reloads files from currently opened folder into all available view components.


editSelectedFileName

public void editSelectedFileName()
Starts editing name of selected file in currently visible view.


deleteSelectedFiles

public void deleteSelectedFiles()
Delete all selected in view files.


getApproveListener

public java.awt.event.ActionListener getApproveListener()
Returns approve button listener.

Returns:
approve button listener

setApproveListener

public void setApproveListener(java.awt.event.ActionListener approveListener)
Sets approve button listener.

Parameters:
approveListener - approve button listener

getCancelListener

public java.awt.event.ActionListener getCancelListener()
Returns cancel button listener.

Returns:
cancel button listener

setCancelListener

public void setCancelListener(java.awt.event.ActionListener cancelListener)
Sets cancel button listener.

Parameters:
cancelListener - cancel button listener

fireApproveAction

protected void fireApproveAction(java.awt.event.ActionEvent e)
Fires approve action.

Parameters:
e - action event

fireCancelAction

protected void fireCancelAction(java.awt.event.ActionEvent e)
Fires cancel action.

Parameters:
e - action event

getAvailableFilters

public java.util.List<AbstractFileFilter> getAvailableFilters()
Returns list of available file filters.

Returns:
list of available file filters

getActiveFileFilter

public AbstractFileFilter getActiveFileFilter()
Returns currenly active file filter.

Returns:
currenly active file filter

setFileFilter

public void setFileFilter(java.io.FileFilter fileFilter)
Sets the specified file filter as the only one avaiable.

Parameters:
fileFilter - file filter to set

setFileFilter

public void setFileFilter(javax.swing.filechooser.FileFilter fileFilter)
Sets the specified file filter as the only one avaiable.

Parameters:
fileFilter - file filter to set

setFileFilter

public void setFileFilter(AbstractFileFilter fileFilter)
Sets the specified file filter as the only one avaiable.

Parameters:
fileFilter - file filter to set

setFileFilters

public void setFileFilters(java.io.FileFilter[] fileFilters)
Sets available file filters. The first one specified will be the default selected file filter.

Parameters:
fileFilters - available file filters

setFileFilters

public void setFileFilters(int index,
                           java.io.FileFilter[] fileFilters)
Sets available file filters.

Parameters:
index - default filter index
fileFilters - available file filters

setFileFilters

public void setFileFilters(javax.swing.filechooser.FileFilter[] fileFilters)
Sets available file filters. The first one specified will be the default selected file filter.

Parameters:
fileFilters - available file filters

setFileFilters

public void setFileFilters(int index,
                           javax.swing.filechooser.FileFilter[] fileFilters)
Sets available file filters.

Parameters:
index - default filter index
fileFilters - available file filters

setFileFilters

public void setFileFilters(AbstractFileFilter[] fileFilters)
Sets available file filters. The first one specified will be the default selected file filter.

Parameters:
fileFilters - available file filters

setFileFilters

public void setFileFilters(int index,
                           AbstractFileFilter[] fileFilters)
Sets available file filters.

Parameters:
index - default filter index
fileFilters - available file filters

setFileFilters

public void setFileFilters(java.util.List<AbstractFileFilter> fileFilters)
Sets available file filters. The first one specified will be the default selected file filter.

Parameters:
fileFilters - available file filters

setFileFilters

public void setFileFilters(int index,
                           java.util.List<AbstractFileFilter> fileFilters)
Sets available file filters.

Parameters:
index - default filter index
fileFilters - available file filters

isShowControlButtons

public boolean isShowControlButtons()
Returns whether control buttons are displayed or not.

Returns:
true if control buttons are displayed, false otherwise

setShowControlButtons

public void setShowControlButtons(boolean showControlButtons)
Sets whether to display control buttons or not.

Parameters:
showControlButtons - whether to display control buttons or not

updateControls

protected void updateControls()
Updates controls display.


getApproveButtonText

public java.lang.String getApproveButtonText()
Returns approve button text.

Returns:
approve button text

restoreButtonText

public void restoreButtonText()
Restores default approve button text for the specified chooser type.


setApproveButtonText

public void setApproveButtonText(java.lang.String text)
Sets approve button text. You can specify null to reset text to default value.

Parameters:
text - approve button text

setApproveButtonText

public void setApproveButtonText(FileApproveText approveText)
Sets approve button text type.

Parameters:
approveText - approve button text type

setApproveButtonLanguage

public void setApproveButtonLanguage(java.lang.String key)
Sets approve button language key.

Parameters:
key - approve button language key

getChooserType

public FileChooserType getChooserType()
Returns chooser type.

Returns:
chooser type

setChooserType

public void setChooserType(FileChooserType chooserType)
Sets chooser type.

Parameters:
chooserType - new chooser type

isShowHiddenFiles

public boolean isShowHiddenFiles()
Sets whether should display hidden files or not.

Returns:
true if should display hidden files, false otherwise

setShowHiddenFiles

public void setShowHiddenFiles(boolean showHiddenFiles)
Sets whether should display hidden files or not.

Parameters:
showHiddenFiles - whether should display hidden files or not

addFileChooserListener

public void addFileChooserListener(FileChooserListener listener)
Adds file chooser listener.

Parameters:
listener - new file chooser listener

removeFileChooserListener

public void removeFileChooserListener(FileChooserListener listener)
Removes file chooser listener.

Parameters:
listener - file chooser listener to remove

fireDirectoryChanged

protected void fireDirectoryChanged(java.io.File newDirectory)
Fired when displayed in file chooser directory changes.

Parameters:
newDirectory - newly displayed directory

fireFileSelectionChanged

protected void fireFileSelectionChanged(java.util.List<java.io.File> selectedFiles)
Fired when selected in file chooser files change.

Parameters:
selectedFiles - newly selected files

isMultiSelectionEnabled

public boolean isMultiSelectionEnabled()
Returns whether multiply files selection is allowed or not.

Returns:
true if multiply files selection is allowed, false otherwise

setMultiSelectionEnabled

public void setMultiSelectionEnabled(boolean multiSelectionEnabled)
Sets whether multiply files selection is allowed or not.

Parameters:
multiSelectionEnabled - whether multiply files selection is allowed or not

updateSelectionMode

protected void updateSelectionMode()
Updates view components selection modes.


isGenerateThumbnails

public boolean isGenerateThumbnails()
Returns whether file thumbnails are generated or not.

Returns:
true if file thumbnails are generated, false otherwise

setGenerateThumbnails

public void setGenerateThumbnails(boolean generate)
Sets whether file thumbnails should be generated or not.

Parameters:
generate - whether file thumbnails should be generated or not