|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jbbres.lib.actions.tools.swing.JFileSelection
public class JFileSelection
This panel allow the user to select a file, either by choosing one of the variables of the workflow, either by choosing a file on the hard drive.
v1.1.0:
JXFileChooser
instead of JXFileChooser
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static int |
DIRECTORIES_ONLY
Instruction to display only directories. |
static int |
FILES_AND_DIRECTORIES
Instruction to display both files and directories. |
static int |
FILES_ONLY
Instruction to display only files. |
static int |
OPEN_DIALOG
Type value indicating that the JXFileChooser s associated to
this action support an "Open" file operation. |
static int |
SAVE_DIALOG
Type value indicating that the JXFileChooser s associated to
this action support a "Save" file operation. |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JFileSelection()
Create the JFileSelection . |
|
JFileSelection(java.io.File defaultFile)
Create the JFileSelection . |
|
JFileSelection(java.lang.String defaultPath)
Create the JFileSelection . |
|
JFileSelection(Workflow workflow)
Create the JFileSelection . |
|
JFileSelection(Workflow workflow,
java.io.File defaultFile)
Create the JFileSelection . |
|
JFileSelection(Workflow workflow,
java.io.File defaultFile,
boolean diplayPath)
Create the JFileSelection . |
|
JFileSelection(Workflow workflow,
java.lang.String defaultPath)
Create the JFileSelection . |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener l)
Add a file selection listener. |
void |
addChoosableFileFilter(javax.swing.filechooser.FileFilter filter)
Adds a filter to the list of user choosable file filters. |
void |
addStaticFile(java.io.File file)
Add a static file to the list. |
void |
displayPath(boolean d)
If TRUE the whole path of the file will be display. |
void |
fireActionPerformed()
Reports a file selection. |
javax.swing.filechooser.FileFilter[] |
getChoosableFileFilters()
Gets the list of user choosable file filters. |
java.io.File |
getCurrentDirectory()
Returns the current directory. |
int |
getDialogType()
Return the type of dialog window display when the user choose a file. |
int |
getFileSelectionMode()
Returns the current file-selection mode. |
java.util.Properties |
getProperties()
Returns an Properties object that can be used by an
Element for saving the selected file. |
java.io.File |
getSelectedFile()
Return the selected path. |
java.lang.String |
getSelectedFilePath()
Return the selected path. |
boolean |
isAcceptAllFileFilterUsed()
Returns whether the AcceptAll FileFilter is
used. |
boolean |
isPathDisplayed()
Return TRUE if the whole path of the file will be display. |
void |
refresh()
Refresh the panel: Display or hide the manually selected file depending on the value choosen in the combo box, and call validate . |
void |
removeActionListener(java.awt.event.ActionListener l)
Remove a file selection listener. |
boolean |
removeChoosableFileFilter(javax.swing.filechooser.FileFilter f)
Removes a filter from the list of user choosable file filters. |
void |
removeStaticFile(java.io.File file)
Remove a static file. |
void |
resetChoosableFileFilters()
Resets the choosable file filter list to its starting state. |
int |
selectFile()
Open a window to select a file. |
int |
selectFile(java.awt.Component parent,
java.lang.String title)
Open a window to select a file. |
void |
setAcceptAllFileFilterUsed(boolean b)
Determines whether the AcceptAll FileFilter is
used as an available choice in the choosable filter list. |
void |
setCurrentDirectory(java.io.File dir)
Sets the current directory. |
void |
setDialogType(int type)
Set the type of dialog window display when the user choose a file. |
boolean |
setEditable(boolean e)
Set the panel editable. |
void |
setEnabled(boolean e)
Set the panel enabled. |
void |
setFileSelectionMode(int mode)
Sets the JXFileChooser to allow the user to just select
files, just select directories, or select both files and directories. |
void |
setProperties(java.util.Properties properties)
Restore the selected file based on the properties provided. |
void |
setSelectedFile(java.io.File file)
Set the current file. |
void |
setSelectedFilePath(java.lang.String path)
Set the current path and the current selected file. |
void |
setSelectedItem(java.lang.Object object)
Sets the selected item in the combo box display area to the object in the argument. |
void |
setWorkflow(Workflow workflow)
Set the workflow that this panel is working on. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, hide, 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, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FILES_ONLY
public static final int DIRECTORIES_ONLY
public static final int FILES_AND_DIRECTORIES
public static final int OPEN_DIALOG
JXFileChooser
s associated to
this action support an "Open" file operation.
public static final int SAVE_DIALOG
JXFileChooser
s associated to
this action support a "Save" file operation.
Constructor Detail |
---|
public JFileSelection(Workflow workflow)
JFileSelection
.
workflow
- Associated workflow.public JFileSelection(Workflow workflow, java.io.File defaultFile)
JFileSelection
.
workflow
- Associated workflow.defaultFile
- Filepublic JFileSelection(Workflow workflow, java.lang.String defaultPath)
JFileSelection
.
workflow
- Associated workflow.defaultPath
- Stringpublic JFileSelection()
JFileSelection
.setWorkflow
method.
public JFileSelection(java.lang.String defaultPath)
JFileSelection
.setWorkflow
method.
defaultPath
- Stringpublic JFileSelection(java.io.File defaultFile)
JFileSelection
.setWorkflow
method.
defaultFile
- Filepublic JFileSelection(Workflow workflow, java.io.File defaultFile, boolean diplayPath)
JFileSelection
.
workflow
- Associated workflow.defaultFile
- FilediplayPath
- if TRUE
the whole path of the file is displayed.
Otherwise only the file name.Method Detail |
---|
public void addStaticFile(java.io.File file)
file
- - file to be addedremoveStaticFile(java.io.File)
public void removeStaticFile(java.io.File file)
file
- - file to be removed.addStaticFile(java.io.File)
public void setWorkflow(Workflow workflow)
workflow
- - Workflowpublic int selectFile(java.awt.Component parent, java.lang.String title)
parent
- - the parent component of the dialog, can be null; see
showDialog for detailstitle
- - the dialog title
Component.show()
public int selectFile()
public void setFileSelectionMode(int mode)
JXFileChooser
to allow the user to just select
files, just select directories, or select both files and directories. The
default is JFilesChooser.FILES_ONLY
.
mode
- the type of files to be displayed:
java.lang.IllegalArgumentException
- if mode
is an illegal file selection modegetFileSelectionMode()
public int getFileSelectionMode()
JFilesChooser.FILES_ONLY
.
setFileSelectionMode(int)
public int getDialogType()
public void setDialogType(int type)
type
- - he type of dialog window to be displayed, one of the
following:
public void setSelectedFilePath(java.lang.String path)
path
- (String) Path of the selected file.public java.lang.String getSelectedFilePath()
public void setSelectedFile(java.io.File file)
file
- the filepublic void setSelectedItem(java.lang.Object object)
If object is not in the list and the combo box is uneditable, it will not change the current selection.
object
- the new selected itempublic java.io.File getSelectedFile()
public void setAcceptAllFileFilterUsed(boolean b)
AcceptAll
FileFilter
is
used as an available choice in the choosable filter list. If false, the
AcceptAll
file filter is removed from the list of available
file filters. If true, the AcceptAll
file filter will become
the the actively used file filter.
b
- - If false, the AcceptAll
file filter is removed
from the list of available file filters. If true, the
AcceptAll
file filter will become the the
actively used file filterpublic boolean isAcceptAllFileFilterUsed()
AcceptAll
FileFilter
is
used.
AcceptAll
FileFilter
is
usedpublic void addChoosableFileFilter(javax.swing.filechooser.FileFilter filter)
filter
- the FileFilter
to add to the choosable file
filter listgetChoosableFileFilters()
,
removeChoosableFileFilter(javax.swing.filechooser.FileFilter)
,
resetChoosableFileFilters()
public javax.swing.filechooser.FileFilter[] getChoosableFileFilters()
FileFilter
array containing all the choosable file
filtersaddChoosableFileFilter(javax.swing.filechooser.FileFilter)
,
removeChoosableFileFilter(javax.swing.filechooser.FileFilter)
,
resetChoosableFileFilters()
public boolean removeChoosableFileFilter(javax.swing.filechooser.FileFilter f)
f
- the file filter
addChoosableFileFilter(javax.swing.filechooser.FileFilter)
,
getChoosableFileFilters()
,
resetChoosableFileFilters()
public void resetChoosableFileFilters()
AcceptAll
file filter.
addChoosableFileFilter(javax.swing.filechooser.FileFilter)
,
getChoosableFileFilters()
,
removeChoosableFileFilter(javax.swing.filechooser.FileFilter)
public void displayPath(boolean d)
TRUE
the whole path of the file will be display.
d
- - If TRUE
the whole path of the file will be
displaypublic boolean isPathDisplayed()
TRUE
if the whole path of the file will be display.
public void setCurrentDirectory(java.io.File dir)
dir
- - the current directory to point topublic java.io.File getCurrentDirectory()
public java.util.Properties getProperties()
Properties
object that can be used by an
Element
for saving the selected file.
getProperties
in interface com.jbbres.lib.PropertiesOwner
Properties
objectpublic void setProperties(java.util.Properties properties)
setProperties
in interface com.jbbres.lib.PropertiesOwner
properties
- - properties to applied.public boolean setEditable(boolean e)
e
- boolean
public void setEnabled(boolean e)
setEnabled
in class javax.swing.JComponent
e
- booleanpublic void refresh()
validate
.
public void addActionListener(java.awt.event.ActionListener l)
l
- - FilesSelectionListenerpublic void removeActionListener(java.awt.event.ActionListener l)
l
- - FilesSelectionListenerpublic void fireActionPerformed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |