org.apache.pivot.wtk.skin.terra
Class TerraFileBrowserSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ContainerSkin
          extended by org.apache.pivot.wtk.skin.FileBrowserSkin
              extended by org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, ContainerListener, ContainerMouseListener, FileBrowser.Skin, FileBrowserListener, Skin, Visual

public class TerraFileBrowserSkin
extends FileBrowserSkin

Terra file browser skin.


Nested Class Summary
static class TerraFileBrowserSkin.DriveRenderer
          Abstract base class for drive renderers.
static class TerraFileBrowserSkin.FileComparator
           
static class TerraFileBrowserSkin.FileDateAscendingComparator
           
static class TerraFileBrowserSkin.FileDateDescendingComparator
           
static class TerraFileBrowserSkin.FileNameAscendingComparator
           
static class TerraFileBrowserSkin.FileNameDescendingComparator
           
static class TerraFileBrowserSkin.FileRenderer
          Abstract renderer for displaying file system contents.
static class TerraFileBrowserSkin.FileSizeAscendingComparator
           
static class TerraFileBrowserSkin.FileSizeDescendingComparator
           
static class TerraFileBrowserSkin.FullFileFilter
           
static class TerraFileBrowserSkin.IncludeFileFilter
          Include file filter.
static class TerraFileBrowserSkin.ListButtonDriveRenderer
          List button drive renderer.
static class TerraFileBrowserSkin.ListButtonFileRenderer
          List button file renderer.
static class TerraFileBrowserSkin.ListViewDriveRenderer
          List view drive renderer.
static class TerraFileBrowserSkin.ListViewFileRenderer
          List view file renderer.
static class TerraFileBrowserSkin.TableViewFileRenderer
          Table view file renderer.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.FileBrowserListener
FileBrowserListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
static File HOME_DIRECTORY
           
 
Constructor Summary
TerraFileBrowserSkin()
           
 
Method Summary
 void disabledFileFilterChanged(FileBrowser fileBrowser, Filter<File> previousDisabledFileFilter)
          Called when a file browser's file filter has changed.
 File getFileAt(int x, int y)
           
static TerraFileBrowserSkin.FileComparator getFileComparator(String columnName, SortDirection sortDirection)
          File comparator.
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 Dimensions getPreferredSize()
          Returns the visual's unconstrained preferred size.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 void install(Component component)
          Associates a skin with a component.
 boolean isHideDisabledFiles()
           
 boolean isKeyboardFolderTraversalEnabled()
           
 boolean isShowHiddenFiles()
           
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          ENTER Change into the selected directory if keyboardFolderTraversalEnabled is true.
 boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          CommandModifier + F Transfers focus to the search TextInput.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void multiSelectChanged(FileBrowser fileBrowser)
          Called when a file browser's multi-select flag has changed.
 void rootDirectoryChanged(FileBrowser fileBrowser, File previousRootDirectory)
          Called when a file browser's root directory has changed.
 void selectedFileAdded(FileBrowser fileBrowser, File file)
          Called when a file has been added to a file browser's selection.
 void selectedFileRemoved(FileBrowser fileBrowser, File file)
          Called when a file has been removed from a file browser's selection.
 void selectedFilesChanged(FileBrowser fileBrowser, Sequence<File> previousSelectedFiles)
          Called when a file browser's selection state has been reset.
 void setHideDisabledFiles(boolean hideDisabledFiles)
           
 void setKeyboardFolderTraversalEnabled(boolean keyboardFolderTraversalEnabled)
           
 void setShowHiddenFiles(boolean showHiddenFiles)
          Set to determine if hidden files should be shown.
 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, paint, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.pivot.wtk.Skin
getComponent, isFocusable, isOpaque
 
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, setSize
 
Methods inherited from interface org.apache.pivot.wtk.Visual
getBaseline, getHeight, getWidth, paint
 

Field Detail

HOME_DIRECTORY

public static final File HOME_DIRECTORY
Constructor Detail

TerraFileBrowserSkin

public TerraFileBrowserSkin()
Method Detail

getFileComparator

public static TerraFileBrowserSkin.FileComparator getFileComparator(String columnName,
                                                                    SortDirection sortDirection)
File comparator.


install

public void install(Component component)
Description copied from interface: Skin
Associates a skin with a component.

Specified by:
install in interface Skin
Overrides:
install in class FileBrowserSkin
Parameters:
component - The component to which the skin is being attached.

getPreferredWidth

public int getPreferredWidth(int height)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.

Specified by:
getPreferredWidth in interface ConstrainedVisual
Overrides:
getPreferredWidth in class ContainerSkin
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

getPreferredHeight

public int getPreferredHeight(int width)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.

Specified by:
getPreferredHeight in interface ConstrainedVisual
Overrides:
getPreferredHeight in class ContainerSkin
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getPreferredSize

public Dimensions getPreferredSize()
Description copied from interface: ConstrainedVisual
Returns the visual's unconstrained preferred size.

Specified by:
getPreferredSize in interface ConstrainedVisual
Overrides:
getPreferredSize in class ComponentSkin

layout

public void layout()
Description copied from interface: Skin
If the component on which the skin is installed is a container, lays out the container's children.


getFileAt

public File getFileAt(int x,
                      int y)

isKeyboardFolderTraversalEnabled

public boolean isKeyboardFolderTraversalEnabled()

setKeyboardFolderTraversalEnabled

public void setKeyboardFolderTraversalEnabled(boolean keyboardFolderTraversalEnabled)

isHideDisabledFiles

public boolean isHideDisabledFiles()

setHideDisabledFiles

public void setHideDisabledFiles(boolean hideDisabledFiles)

isShowHiddenFiles

public boolean isShowHiddenFiles()
Returns:
Whether hidden files will be shown in the browser.

setShowHiddenFiles

public void setShowHiddenFiles(boolean showHiddenFiles)
Set to determine if hidden files should be shown.

Parameters:
showHiddenFiles - Whether to show hidden files.

keyPressed

public boolean keyPressed(Component component,
                          int keyCode,
                          Keyboard.KeyLocation keyLocation)
ENTER Change into the selected directory if keyboardFolderTraversalEnabled is true.
DELETE or BACKSPACE Change into the parent of the current directory.
F5 Refresh the file list.

Specified by:
keyPressed in interface ComponentKeyListener
Overrides:
keyPressed in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

keyReleased

public boolean keyReleased(Component component,
                           int keyCode,
                           Keyboard.KeyLocation keyLocation)
CommandModifier + F Transfers focus to the search TextInput.

Specified by:
keyReleased in interface ComponentKeyListener
Overrides:
keyReleased in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.
See Also:
Platform.getCommandModifier()

rootDirectoryChanged

public void rootDirectoryChanged(FileBrowser fileBrowser,
                                 File previousRootDirectory)
Description copied from interface: FileBrowserListener
Called when a file browser's root directory has changed.


selectedFileAdded

public void selectedFileAdded(FileBrowser fileBrowser,
                              File file)
Description copied from interface: FileBrowserListener
Called when a file has been added to a file browser's selection.


selectedFileRemoved

public void selectedFileRemoved(FileBrowser fileBrowser,
                                File file)
Description copied from interface: FileBrowserListener
Called when a file has been removed from a file browser's selection.


selectedFilesChanged

public void selectedFilesChanged(FileBrowser fileBrowser,
                                 Sequence<File> previousSelectedFiles)
Description copied from interface: FileBrowserListener
Called when a file browser's selection state has been reset.


multiSelectChanged

public void multiSelectChanged(FileBrowser fileBrowser)
Description copied from interface: FileBrowserListener
Called when a file browser's multi-select flag has changed.


disabledFileFilterChanged

public void disabledFileFilterChanged(FileBrowser fileBrowser,
                                      Filter<File> previousDisabledFileFilter)
Description copied from interface: FileBrowserListener
Called when a file browser's file filter has changed.