public class JMultipleFileSelector extends JComponent
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected FileSelectorRenderer |
fileRenderer
The file renderer.
|
protected String |
title
The Dialog title.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JMultipleFileSelector()
Create a new JFileMultipleSelector.
|
JMultipleFileSelector(String title)
Create a new JFileMultipleSelector.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
Add an ActionListener to this FileSelector.
|
void |
addChoosableFileFilter(FileFilter filter)
Add a Filefilter to this MultipleFileSelector.
|
void |
doLayout() |
File |
getCurrentDirectory()
Return the current Directory of this FileSelector.
|
String |
getDialogTitle()
Return the dialog title.
|
int |
getFileSelectionMode()
Return the associated FileChooser file selection mode.
|
FileSelectorRenderer |
getFileSelectorRenderer()
Return the class responsible to render to text associated to the selected files.
|
Dimension |
getPreferredSize() |
File[] |
getSelectedFiles()
Return the current selected Files of this File Selector.
|
String |
getUnselectFilesText()
Return the text to show on the button for the "Unselect files" option.
|
boolean |
hasOptionalFiles()
Return true if the dialog support optional files.
|
boolean |
isForcingFileExtension()
Return true if the file extension is forced.
|
boolean |
isUnselected()
Return true for a selection which unselected the files.
|
static void |
main(String[] arg) |
void |
removeActionListener(ActionListener listener)
Remove an ActionListener to this FileSelector.
|
void |
removeChoosableFileFilter(FileFilter filter)
Remove a Filefilter to this MultipleFileSelector.
|
boolean |
setCurrentDirectory(File f)
Set the current Directory of this FileSelector.
|
void |
setDialogTitle(String title)
Set the dialog title.
|
void |
setFileSelectionMode(int mode)
Set the associated FileChooser file selection mode.
|
void |
setFileSelectorRenderer(FileSelectorRenderer fileRenderer)
Set the class responsible to render to text associated to the selected files.
|
void |
setForceFileExtension(boolean forceFileExtension)
Set if the file extension is forced.
|
void |
setHasOptionalFiles(boolean hasOptionalFiles)
Set if the dialog support optional files.
|
void |
setSelectedFiles(File[] f)
Set the current selected Files of this File Selector.
|
protected void |
setText(File[] fs)
Set the text to show for a list of files.
|
protected void |
setTextAfterFileSelection(String text)
Set the text to show after the files selection.
|
void |
setUnselectFilesText(String unselectFilesText)
Set the text to show on the button for the "Unselect files" option.
|
void |
updateUI() |
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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, transferFocusDownCycle, validate, validateTree
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, getAccessibleContext, 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, 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, transferFocusBackward, transferFocusUpCycle
protected String title
protected FileSelectorRenderer fileRenderer
public JMultipleFileSelector()
public JMultipleFileSelector(String title)
title
- the FileChooser titlepublic void setForceFileExtension(boolean forceFileExtension)
forceFileExtension
- true if the file extension is forcedpublic boolean isForcingFileExtension()
public void setHasOptionalFiles(boolean hasOptionalFiles)
hasOptionalFiles
- true if the dialog support optional filespublic boolean hasOptionalFiles()
public void setUnselectFilesText(String unselectFilesText)
unselectFilesText
- the textpublic String getUnselectFilesText()
public void updateUI()
updateUI
in class JComponent
public void setDialogTitle(String title)
title
- the titlepublic String getDialogTitle()
public void setFileSelectorRenderer(FileSelectorRenderer fileRenderer)
DefaultFileSelectorRenderer
if the method argument is null.fileRenderer
- the file Rendererpublic FileSelectorRenderer getFileSelectorRenderer()
public void setFileSelectionMode(int mode)
mode
- the associated FileChooser file selection modeJFileChooser.setFileSelectionMode(int)
public int getFileSelectionMode()
JFileChooser.getFileSelectionMode()
public void addChoosableFileFilter(FileFilter filter)
filter
- the Filefilterpublic void removeChoosableFileFilter(FileFilter filter)
filter
- the Filefilterpublic void addActionListener(ActionListener listener)
listener
- the ActionListenerpublic void removeActionListener(ActionListener listener)
listener
- the ActionListenerpublic File[] getSelectedFiles()
public void setSelectedFiles(File[] f)
f
- the current selected Files of this File Selectorpublic boolean isUnselected()
protected void setText(File[] fs)
fs
- the filespublic Dimension getPreferredSize()
getPreferredSize
in class JComponent
protected final void setTextAfterFileSelection(String text)
text
- the text to showpublic File getCurrentDirectory()
public boolean setCurrentDirectory(File f)
f
- the current Directory to setpublic static void main(String[] arg)