Package org.apache.pivot.wtk
Class FileBrowserSheet
- java.lang.Object
-
- org.apache.pivot.wtk.Component
-
- org.apache.pivot.wtk.Container
-
- org.apache.pivot.wtk.Window
-
- org.apache.pivot.wtk.Sheet
-
- org.apache.pivot.wtk.FileBrowserSheet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileBrowserSheet.Mode
Enumeration defining supported modes.-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Window
Window.ActionMapping, Window.ActionMappingSequence, Window.IconImageSequence, Window.Skin
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container
Container.EDTChecker
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
-
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
Sequence.Tree<T>
-
-
Constructor Summary
Constructors Constructor Description FileBrowserSheet()
Creates a new FileBrowserSheetFileBrowserSheet(java.lang.String rootFolder)
Creates a new FileBrowserSheetFileBrowserSheet(FileBrowserSheet.Mode mode)
Creates a new FileBrowserSheetFileBrowserSheet(FileBrowserSheet.Mode mode, java.lang.String rootFolder)
Creates a new FileBrowserSheet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearSelection()
Clears the selection.Filter<java.io.File>
getDisabledFileFilter()
ListenerList<FileBrowserSheetListener>
getFileBrowserSheetListeners()
FileBrowserSheet.Mode
getMode()
java.io.File
getRootDirectory()
java.io.File
getSelectedFile()
When in single-select mode, returns the currently selected file.ImmutableList<java.io.File>
getSelectedFiles()
Returns the currently selected files.void
setDisabledFileFilter(Filter<java.io.File> disabledFileFilter)
void
setMode(FileBrowserSheet.Mode mode)
void
setRootDirectory(java.io.File rootDirectory)
void
setRootFolder(java.lang.String rootFolder)
Set the root folder but without firing events.void
setSelectedFile(java.io.File file)
Sets the selection to a single file.Sequence<java.io.File>
setSelectedFiles(Sequence<java.io.File> selectedFiles)
Sets the selected files.-
Methods inherited from class org.apache.pivot.wtk.Sheet
close, close, getResult, getSheetCloseListener, getSheetStateListeners, isClosing, open, open, open
-
Methods inherited from class org.apache.pivot.wtk.Window
align, align, clearActive, clearFocusDescendant, descendantGainedFocus, descendantRemoved, getActionMappings, getActiveWindow, getClientArea, getContent, getFocusDescendant, getIcons, getOwnedWindow, getOwnedWindowCount, getOwner, getRootOwner, getTitle, getWindowActionMappingListeners, getWindowClassListeners, getWindowListeners, getWindowStateListeners, isActive, isBottomMost, isClosed, isMaximized, isOpen, isOpening, isOwner, isTopMost, keyPressed, moveToBack, moveToFront, open, open, remove, requestActive, setActive, setContent, setEnabled, setIcon, setIcon, setMaximized, setParent, setTitle, setVisible
-
Methods inherited from class org.apache.pivot.wtk.Container
add, assertEventDispatchThread, assertEventDispatchThread, clear, containsFocus, descendantAdded, descendantLostFocus, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getDescendantAt, getFocusTraversalPolicy, getGraphics, getLength, getNamedComponent, indexOf, insert, invalidate, isAncestor, isDoubleBuffered, iterator, layout, load, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, removeAll, repaint, requestFocus, setDoubleBuffered, setEventDispatchThreadChecker, setFocusTraversalPolicy, store, transferFocus, update
-
Methods inherited from class org.apache.pivot.wtk.Component
checkSkin, clearFocus, contains, copyStyle, copyStyle, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getScreenBounds, getSize, getSkin, getStyle, getStyle, getStyleBoolean, getStyleBoolean, getStyleColor, getStyleColor, getStyleFont, getStyleFont, getStyleInt, getStyleInt, getStyles, getTextInputMethodListener, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyReleased, keyTyped, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseOver, offsetToScreen, putStyle, putStyle, reenterMouse, repaint, repaint, repaint, repaint, repaint, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setAutomationID, setCursor, setDragSource, setDropTarget, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setSkin, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
-
-
-
-
Constructor Detail
-
FileBrowserSheet
public FileBrowserSheet()
Creates a new FileBrowserSheetNote that this version set by default mode to open and user home as root folder.
-
FileBrowserSheet
public FileBrowserSheet(FileBrowserSheet.Mode mode)
Creates a new FileBrowserSheetNote that this version set by default the user home as root folder.
- Parameters:
mode
- The mode for opening the sheet.- See Also:
FileBrowserSheet.Mode
-
FileBrowserSheet
public FileBrowserSheet(java.lang.String rootFolder)
Creates a new FileBrowserSheetNote that this version of the constructor can be used when a custom root folder has to be set, and uses the default mode.
- Parameters:
rootFolder
- The root folder full name.
-
FileBrowserSheet
public FileBrowserSheet(FileBrowserSheet.Mode mode, java.lang.String rootFolder)
Creates a new FileBrowserSheetNote that this version of the constructor must be used when a custom root folder has to be set.
- Parameters:
mode
- The mode for opening the sheet.rootFolder
- The root folder full name.- See Also:
FileBrowserSheet.Mode
-
-
Method Detail
-
getMode
public FileBrowserSheet.Mode getMode()
-
setMode
public void setMode(FileBrowserSheet.Mode mode)
-
getRootDirectory
public java.io.File getRootDirectory()
-
setRootFolder
public void setRootFolder(java.lang.String rootFolder)
Set the root folder but without firing events.- Parameters:
rootFolder
- The new root directory to browse.- Throws:
java.lang.IllegalArgumentException
- if the folder argument isnull
.
-
setRootDirectory
public void setRootDirectory(java.io.File rootDirectory)
-
getSelectedFile
public java.io.File getSelectedFile()
When in single-select mode, returns the currently selected file.- Returns:
- The currently selected file or
null
if nothing is selected. - Throws:
java.lang.IllegalStateException
- if not in single-select mode.
-
setSelectedFile
public void setSelectedFile(java.io.File file)
Sets the selection to a single file.- Parameters:
file
- The single file to be selected ornull
to select nothing.
-
getSelectedFiles
public ImmutableList<java.io.File> getSelectedFiles()
Returns the currently selected files.- Returns:
- An immutable list containing the currently selected files. Note that the returned list is a wrapper around the actual selection, not a copy. Any changes made to the selection state will be reflected in the list, but events will not be fired.
-
setSelectedFiles
public Sequence<java.io.File> setSelectedFiles(Sequence<java.io.File> selectedFiles)
Sets the selected files.- Parameters:
selectedFiles
- The files to select.- Returns:
- The files that were selected, with duplicates eliminated.
- Throws:
java.lang.IllegalArgumentException
- if the selected files sequence isnull
or if the sequence is longer than one file and multi-select is not enabled, or if any entry is the sequence isnull
or whose parent is not the current root directory.
-
clearSelection
public void clearSelection()
Clears the selection.
-
getDisabledFileFilter
public Filter<java.io.File> getDisabledFileFilter()
-
setDisabledFileFilter
public void setDisabledFileFilter(Filter<java.io.File> disabledFileFilter)
-
getFileBrowserSheetListeners
public ListenerList<FileBrowserSheetListener> getFileBrowserSheetListeners()
-
-