Package com.sun.javatest.tool
Class EditableFileList
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- com.sun.javatest.tool.EditableList
-
- com.sun.javatest.tool.EditableFileList
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
public class EditableFileList extends EditableList
A component that displays an editable list of filenames.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.sun.javatest.tool.EditableList
listModel, uif
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description EditableFileList()
Create an empty component.EditableFileList(javax.swing.JFileChooser c)
Create an empty component, that uses a given file chooser to allow the user to specify new filenames to be added.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File[]
getFiles()
Get the files currently in the list.protected java.lang.Object
getNewItem()
Invoked to get a new item to put in the list, when the user clicks the "Add" button".void
setBaseDirectory(java.io.File dir)
Set the base directory to be displayed by the file chooser.void
setChooser(javax.swing.JFileChooser c)
Set the file chooser used to display filenames when the user wants to add another file to the list.void
setFiles(java.io.File[] files)
Set the files in the list, replacing any files currently there.void
setItems(java.lang.Object[] items)
Set the items in the list.-
Methods inherited from class com.sun.javatest.tool.EditableList
addListDataListener, clear, getAccessibleContext, getDisplayValue, getItems, getItems, getNewItem, getToolTipText, isDuplicatesAllowed, removeListDataListener, setDuplicatesAllowed, setEnabled, setToolTipText
-
Methods inherited from class javax.swing.JComponent
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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
-
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, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
EditableFileList
public EditableFileList()
Create an empty component.
-
EditableFileList
public EditableFileList(javax.swing.JFileChooser c)
Create an empty component, that uses a given file chooser to allow the user to specify new filenames to be added.- Parameters:
c
- the file chooser to be used- See Also:
setChooser(javax.swing.JFileChooser)
-
-
Method Detail
-
setBaseDirectory
public void setBaseDirectory(java.io.File dir)
Set the base directory to be displayed by the file chooser. "null" may be used to mean "the user's current directory".- Parameters:
dir
- the directory to be displayed by the file chooser
-
setChooser
public void setChooser(javax.swing.JFileChooser c)
Set the file chooser used to display filenames when the user wants to add another file to the list.- Parameters:
c
- the chooser to be used
-
setItems
public void setItems(java.lang.Object[] items)
Set the items in the list. Any previous items are removed first. The items should be files, or strings (which will be turned into files.)- Overrides:
setItems
in classEditableList
- Parameters:
items
- the array of strings or files to be put in the list.- See Also:
EditableList.getItems()
-
getFiles
public java.io.File[] getFiles()
Get the files currently in the list.- Returns:
- the files currently in the list
- See Also:
setFiles(java.io.File[])
-
setFiles
public void setFiles(java.io.File[] files)
Set the files in the list, replacing any files currently there.- Parameters:
files
- the files to be put in the list- See Also:
getFiles()
-
getNewItem
protected java.lang.Object getNewItem()
Invoked to get a new item to put in the list, when the user clicks the "Add" button". The current file chooser will be shown. If the user selects a file, it will be returned as the result of this method; otherwise, the result will be null, to indicate that no file was selected.- Overrides:
getNewItem
in classEditableList
- Returns:
- a file to be added to the list, or null if none
-
-