com.alee.laf.filechooser
Class WebFileChooserUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.FileChooserUI
          extended by com.alee.laf.filechooser.WebFileChooserUI

public class WebFileChooserUI
extends javax.swing.plaf.FileChooserUI

Custom UI for JFileChooser component.

Author:
Mikle Garin

Nested Class Summary
protected  class WebFileChooserUI.WebFileView
          Special FileView for file chooser.
 
Constructor Summary
WebFileChooserUI()
          Constructs new WebFileChooserUI.
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the WebFileChooserUI for the specified component.
 void ensureFileIsVisible(javax.swing.JFileChooser fc, java.io.File f)
          
 javax.swing.filechooser.FileFilter getAcceptAllFileFilter(javax.swing.JFileChooser fc)
          
 AbstractFileFilter getActiveFileFilter()
          Returns currenly active file filter.
 java.lang.String getApproveButtonText(javax.swing.JFileChooser fc)
          
 java.util.List<AbstractFileFilter> getAvailableFilters()
          Returns list of available file filters.
 java.lang.String getDialogTitle(javax.swing.JFileChooser fc)
          
 WebFileChooserPanel getFileChooserPanel()
          Returns file chooser panel.
 FileChooserType getFileChooserType()
          Returns JFileChooser type converted into FileChooserType form.
 javax.swing.filechooser.FileView getFileView(javax.swing.JFileChooser fc)
          
 void installUI(javax.swing.JComponent c)
          Installs UI in the specified component.
 boolean isGenerateThumbnails()
          Returns whether file thumbnails are generated or not.
protected  void propertyChanged(java.beans.PropertyChangeEvent event)
          Fired when some of JFileChooser properties changes.
 void rescanCurrentDirectory(javax.swing.JFileChooser fc)
          
 void setApproveButtonLanguage(java.lang.String key)
          Sets approve button language key.
 void setApproveButtonText(FileApproveText approveText)
          Sets approve button text type.
 void setFileView(WebFileChooserUI.WebFileView fileView)
           
 void setGenerateThumbnails(boolean generate)
          Sets whether file thumbnails should be generated or not.
 void uninstallUI(javax.swing.JComponent c)
          Uninstalls UI from the specified component.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebFileChooserUI

public WebFileChooserUI()
Constructs new WebFileChooserUI.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Returns an instance of the WebFileChooserUI for the specified component. This tricky method is used by UIManager to create component UIs when needed.

Parameters:
c - component that will use UI instance
Returns:
instance of the WebFileChooserUI

installUI

public void installUI(javax.swing.JComponent c)
Installs UI in the specified component.

Overrides:
installUI in class javax.swing.plaf.ComponentUI
Parameters:
c - component for this UI

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Uninstalls UI from the specified component.

Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI
Parameters:
c - component with this UI

getFileChooserPanel

public WebFileChooserPanel getFileChooserPanel()
Returns file chooser panel.

Returns:
file chooser panel

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

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

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

propertyChanged

protected void propertyChanged(java.beans.PropertyChangeEvent event)
Fired when some of JFileChooser properties changes.

Parameters:
event - property change event

getAcceptAllFileFilter

public javax.swing.filechooser.FileFilter getAcceptAllFileFilter(javax.swing.JFileChooser fc)

Specified by:
getAcceptAllFileFilter in class javax.swing.plaf.FileChooserUI

getFileView

public javax.swing.filechooser.FileView getFileView(javax.swing.JFileChooser fc)

Specified by:
getFileView in class javax.swing.plaf.FileChooserUI

setFileView

public void setFileView(WebFileChooserUI.WebFileView fileView)
Parameters:
fileView -

getApproveButtonText

public java.lang.String getApproveButtonText(javax.swing.JFileChooser fc)

Specified by:
getApproveButtonText in class javax.swing.plaf.FileChooserUI

getDialogTitle

public java.lang.String getDialogTitle(javax.swing.JFileChooser fc)

Specified by:
getDialogTitle in class javax.swing.plaf.FileChooserUI

rescanCurrentDirectory

public void rescanCurrentDirectory(javax.swing.JFileChooser fc)

Specified by:
rescanCurrentDirectory in class javax.swing.plaf.FileChooserUI

ensureFileIsVisible

public void ensureFileIsVisible(javax.swing.JFileChooser fc,
                                java.io.File f)

Specified by:
ensureFileIsVisible in class javax.swing.plaf.FileChooserUI

getFileChooserType

public FileChooserType getFileChooserType()
Returns JFileChooser type converted into FileChooserType form.

Returns:
JFileChooser type converted into FileChooserType form