public class FileNameField extends StringField
MAX_COLUMNS, myProps
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
FileNameField(java.lang.String labelText,
java.io.File file,
int ncols)
Creates a FileNameField with specified label text and initial value.
|
FileNameField(java.lang.String labelText,
int ncols)
Creates a FileNameField with specified label text and an empty file name.
|
FileNameField(java.lang.String labelText,
java.lang.String initialValue,
int ncols)
Creates a FileNameField with specified label text and initial value.
|
Modifier and Type | Method and Description |
---|---|
javax.swing.JButton |
getBrowseButton()
Returns the JButton used to initiate file browsing on this control.
|
java.io.File |
getChooserDirectory() |
java.io.File |
getFile()
Returns the file associated with this widget's value, or
null
if no file is selected. |
javax.swing.JFileChooser |
getFileChooser()
Returns the JFileChooser associated with this control.
|
boolean |
getFileMustBeReadable() |
boolean |
getFileMustExist() |
FileSearchPath |
getSearchPath() |
void |
setChooserDirectory(java.io.File file) |
void |
setFile(java.io.File file)
Sets the file associated with this widget's value.
|
void |
setFileMustBeReadable(boolean enable) |
void |
setFileMustExist(boolean enable) |
void |
setSearchPath(FileSearchPath path)
Sets a search path to use for finding files that don't have absolute path
names.
|
void |
setValue(java.lang.Object value)
Sets a new value for this control.
|
java.lang.Object |
validateValue(java.lang.Object value,
StringHolder errMsg)
Validates a specified value for this control.
|
getResultHolder, getStringValue, setResultHolder, valueIsEmpty
getAllPropertyInfo, getColumns, getDefaultFormat, getEnterValueOnFocusLost, getFormat, getFormatRange, getText, getTextField, lastEntryWasAccepted, setColumns, setEnterValueOnFocusLost, setFormat, setFormat
addValueChangeListener, addValueCheckListener, clearValueChangeListeners, dispose, getGUIVoidEnabled, getNullValueEnabled, getValue, getValueChangeListeners, getValueCheckListeners, getVoidValueEnabled, isEnabledAll, maskValueChangeListeners, maskValueChecks, removeValueChangeListener, setBackgroundAll, setEnabledAll, setVoidValueEnabled, valueChangeListenersMasked, valueChecksMasked, valueIsNull, valueIsVoid
actionPerformed, addMajorComponent, addMajorComponent, getActions, getLabel, getLabelSpacing, getMainComponent, getMajorComponent, getMaximumSize, getMinimumSize, getPreferredLabelSpacing, getSpacing, indexOfMajor, isLabelStretchable, isStretchable, numMajorComponents, removeMajorComponent, setLabelSpacing, setLabelStretchable, setLabelText, setSpacing, setStretchable
getBackgroundColor, getLabelFontColor, getLabelText, getLeftInset, getProperty, isScanning, isSelected, setBackgroundColor, setLabelFontColor, setLabelFontColor, setScanning, setSelected
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
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, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, transferFocusDownCycle, validate
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, 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, transferFocusBackward, transferFocusUpCycle
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getToolTipText, setToolTipText
public FileNameField(java.lang.String labelText, int ncols)
labelText
- text for the control labelncols
- approximate width of the text field in columnspublic FileNameField(java.lang.String labelText, java.lang.String initialValue, int ncols)
labelText
- text for the control labelinitialValue
- initial value for the file namencols
- approximate width of the text field in columnspublic FileNameField(java.lang.String labelText, java.io.File file, int ncols)
labelText
- text for the control labelfile
- initial file valuencols
- approximate width of the text field in columnspublic FileSearchPath getSearchPath()
public void setSearchPath(FileSearchPath path)
public boolean getFileMustBeReadable()
public void setFileMustBeReadable(boolean enable)
public boolean getFileMustExist()
public void setFileMustExist(boolean enable)
public java.lang.Object validateValue(java.lang.Object value, StringHolder errMsg)
LabeledControl
Property.IllegalValue
should be returned. The optional variable errMsg is used to return an
error message describing the problem with any invalid value. The errMsg
setting is undefined for valid values.
Note in particularly that contract of this method provides that if the
returned value is the same object as the supplied value, then the original
value is valid. Implementations of this method may use support methods
such as validateType
and validateBasic
value
- value to be testederrMsg
- optional argument for holding an error messageProperty.IllegalValue
if
no correction is possible.public javax.swing.JFileChooser getFileChooser()
public java.io.File getChooserDirectory()
public void setChooserDirectory(java.io.File file)
public javax.swing.JButton getBrowseButton()
public java.io.File getFile()
null
if no file is selected.public void setFile(java.io.File file)
file
- associated with widget valuepublic void setValue(java.lang.Object value)
LabeledControl
setValue
in class LabeledControl
value
- new value for this control