|
|||||||||
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.text.JTextComponent javax.swing.JTextField org.fife.ui.FSATextField
public class FSATextField
A "File System-Aware" text field. When the user is typing into this text field, it automagically locates all files that begin with the text typed in, and populates a text field-style list with file choices. This is similar to the text field found in the "Run" dialog in Microsoft Windows.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTextField |
---|
javax.swing.JTextField.AccessibleJTextField |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
---|
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBinding |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JTextField |
---|
notifyAction |
Fields inherited from class javax.swing.text.JTextComponent |
---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
FSATextField()
Creates a new FSATextField that previews both files and directories, and whose current directory is the program's current directory. |
|
FSATextField(boolean directoriesOnly,
java.io.File currentDirectory)
Creates a new FSATextField. |
|
FSATextField(boolean directoriesOnly,
java.lang.String currentDirectory)
Creates a new FSATextField. |
|
FSATextField(int cols)
Creates a new FSATextField that previews both files and directories, and whose current directory is the program's current directory. |
Method Summary | |
---|---|
void |
addItem(java.lang.String item)
Adds an item to the file list. |
void |
addNotify()
|
void |
changedUpdate(javax.swing.event.DocumentEvent e)
Called when the text component's document receives a style change. |
void |
componentHidden(java.awt.event.ComponentEvent e)
Called when the parent dialog/frame of this text field is hidden. |
void |
componentMoved(java.awt.event.ComponentEvent e)
Called when the parent dialog/frame of this text field is moved. |
void |
componentResized(java.awt.event.ComponentEvent e)
Called when the parent dialog/frame of this text field is resized. |
void |
componentShown(java.awt.event.ComponentEvent e)
Called when the parent dialog/frame of this text field is shown. |
boolean |
getAutoCompleteFileName()
Returns whether this text field auto-completes the next matching filename when the drop-down list is visible. |
java.lang.String |
getCurrentDirectory()
Returns the current directory for this text field. |
boolean |
getFileSystemAware()
Returns whether or not this text field is file-system-aware. |
void |
hidePopup()
Hides the popup window, if it is visible. |
void |
insertUpdate(javax.swing.event.DocumentEvent e)
Called when text is inserted into this text component. |
boolean |
isDirectoriesOnly()
Returns whether or not this text field previews both files and directories or just directories. |
void |
processFocusEvent(java.awt.event.FocusEvent e)
Process the focus events of this text field. |
void |
removeAllItems()
Removes all items from the file list. |
void |
removeNotify()
|
void |
removeUpdate(javax.swing.event.DocumentEvent e)
Called when text is removed from the text component's document. |
void |
setAutoCompleteFileName(boolean auto)
Sets whether this text field auto-completes the next matching filename when the drop-down list is visible. |
void |
setCurrentDirectory(java.io.File currentDirectory)
Sets the current directory for this text field. |
void |
setCurrentDirectory(java.lang.String currentDirectory)
Sets the current directory for this text field. |
void |
setDirectoriesOnly(boolean directoriesOnly)
Sets whether or not this text field previews both files and directories or just directories. |
void |
setDocument(javax.swing.text.Document document)
Sets the document for this text field. |
void |
setFileSystemAware(boolean aware)
Toggles whether or not this dialog is file-system-aware. |
void |
setListCellRenderer(javax.swing.ListCellRenderer renderer)
Sets the cell renderer for the drop-down file list. |
void |
setUI(javax.swing.plaf.TextUI ui)
Overridden so that we always have a document listener on the text field. |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
Called when the user manually selects a popup menu list item with the mouse. |
Methods inherited from class javax.swing.JTextField |
---|
actionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setFont, setHorizontalAlignment, setScrollOffset |
Methods inherited from class javax.swing.text.JTextComponent |
---|
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, updateUI, viewToModel, write |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, 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, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FSATextField()
public FSATextField(int cols)
cols
- The number of columns to display in this text field.public FSATextField(boolean directoriesOnly, java.io.File currentDirectory)
directoriesOnly
- Whether this text field should preview only
directories (or both files and directories).currentDirectory
- The directory for which the text field should
assume relative filenames are in.public FSATextField(boolean directoriesOnly, java.lang.String currentDirectory)
directoriesOnly
- Whether this text field should preview only
directories (or both files and directories).currentDirectory
- The directory for which the text field should
assume relative filenames are in.Method Detail |
---|
public void addItem(java.lang.String item)
item
- The item to add to the file list.removeAllItems()
public void addNotify()
addNotify
in class javax.swing.JComponent
public void changedUpdate(javax.swing.event.DocumentEvent e)
changedUpdate
in interface javax.swing.event.DocumentListener
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public boolean getAutoCompleteFileName()
setAutoCompleteFileName(boolean)
public java.lang.String getCurrentDirectory()
setCurrentDirectory(java.io.File)
public boolean getFileSystemAware()
setFileSystemAware(boolean)
public void hidePopup()
public void insertUpdate(javax.swing.event.DocumentEvent e)
insertUpdate
in interface javax.swing.event.DocumentListener
public boolean isDirectoriesOnly()
setDirectoriesOnly(boolean)
public void processFocusEvent(java.awt.event.FocusEvent e)
processFocusEvent
in class java.awt.Component
e
- The focus event fired by this text field.public void removeAllItems()
addItem(java.lang.String)
public void removeNotify()
removeNotify
in class javax.swing.text.JTextComponent
public void removeUpdate(javax.swing.event.DocumentEvent e)
removeUpdate
in interface javax.swing.event.DocumentListener
public void setAutoCompleteFileName(boolean auto)
auto
- Whether the next matching filename is auto-inserted.getAutoCompleteFileName()
public void setCurrentDirectory(java.io.File currentDirectory)
currentDirectory
- The new "current directory" for this combo
box. This value should be an absolute pathname.getCurrentDirectory()
public void setCurrentDirectory(java.lang.String currentDirectory)
currentDirectory
- The new "current directory" for this combo
box. This value should be an absolute pathname.getCurrentDirectory()
public void setDirectoriesOnly(boolean directoriesOnly)
directoriesOnly
- Whether or not to preview only directories.isDirectoriesOnly()
public void setDocument(javax.swing.text.Document document)
setDocument
in class javax.swing.JTextField
public void setFileSystemAware(boolean aware)
false
when programmatically
inserting text into the text field; otherwise, it has a bad habit of
stealing the focus from the currently focused component, etc.
aware
- Whether or not this text field should be file-system
aware.getFileSystemAware()
public void setListCellRenderer(javax.swing.ListCellRenderer renderer)
renderer
- The cell renderer to use.public void setUI(javax.swing.plaf.TextUI ui)
setUI
in class javax.swing.text.JTextComponent
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
e
- The event.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |