public class SwingFileWidget extends SwingInputWidget<File> implements FileWidget<JPanel>, ActionListener, DocumentListener
DIRECTORY_STYLE, OPEN_STYLE, SAVE_STYLE| Constructor and Description |
|---|
SwingFileWidget() |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e) |
void |
changedUpdate(DocumentEvent e) |
static FileFilter |
createFileFilter(String widgetStyle)
Creates a
FileFilter that filters files and/or directories
according to the given widget style. |
void |
doRefresh() |
static List<File> |
filterFiles(List<File> list,
FileFilter filter)
Filters the given list of files according to the specified
FileFilter. |
static List<File> |
getFiles(TransferHandler.TransferSupport support)
Gets the list of files associated with the given drag and drop operation.
|
static String |
getText(TransferHandler.TransferSupport support)
Gets the String content of the current transfer support
|
File |
getValue() |
static boolean |
hasFiles(TransferHandler.TransferSupport support)
Checks whether the given drag and drop operation offers a list of files as
one of its flavors.
|
void |
insertUpdate(DocumentEvent e) |
void |
removeUpdate(DocumentEvent e) |
void |
set(WidgetModel model) |
boolean |
supports(WidgetModel model) |
getComponent, getComponentType, setToolTip, uirefreshWidget, uiget, updateModelgetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitget, getType, isLabeled, isMessage, refreshWidget, updateModelgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiongetComponent, getComponentTypepublic File getValue()
getValue in interface InputWidget<File,JPanel>public void set(WidgetModel model)
set in interface WrapperPlugin<WidgetModel>set in interface InputWidget<File,JPanel>set in class SwingInputWidget<File>public boolean supports(WidgetModel model)
supports in interface Typed<WidgetModel>supports in interface InputWidget<File,JPanel>supports in class AbstractInputWidget<File,JPanel>public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void changedUpdate(DocumentEvent e)
changedUpdate in interface DocumentListenerpublic void insertUpdate(DocumentEvent e)
insertUpdate in interface DocumentListenerpublic void removeUpdate(DocumentEvent e)
removeUpdate in interface DocumentListenerpublic void doRefresh()
doRefresh in class AbstractUIInputWidget<File,JPanel>public static FileFilter createFileFilter(String widgetStyle)
FileFilter that filters files and/or directories
according to the given widget style.
It supports filtering files by extension as specified by the syntax
extensions:ext1/ext2 where ext1, ext2, etc., are
extensions to accept. It also filters files and/or directories as specified
by the following styles:
widgetStyle - The style defining which files get accepted by the
filter.FileFilter that accepts files matching the given widget
style.public static boolean hasFiles(TransferHandler.TransferSupport support)
support - The drag and drop operation that should be checked.public static List<File> getFiles(TransferHandler.TransferSupport support)
support - The drag and drop operation from which files should be
extracted.File objects; or an exception is thrown.public static String getText(TransferHandler.TransferSupport support)
support - The paste (or drag and drop) operation from which text should
be extracted.public static List<File> filterFiles(List<File> list, FileFilter filter)
FileFilter.list - The list of files to filter.filter - The filter to use.Copyright © 2010–2022 SciJava. All rights reserved.