public class PathBuilder
extends javax.swing.JPanel
implements java.awt.event.ActionListener, javax.swing.event.ListSelectionListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
PathBuilder()
Creates a new PathBuilder.
|
PathBuilder(java.lang.String title)
Creates a new PathBuilder.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
Listen to specific GUI events.
|
void |
addActionListener(java.awt.event.ActionListener listener)
Users of this class may add action listeners to be notified when
paths are changed.
|
java.lang.String |
getPath()
Returns the path built using this PathBuilder as a single String,
with the elements of the path separated by File.pathSeparator.
|
java.lang.String[] |
getPathArray()
Returns the path built using this PathBuilder as an array of
Strings.
|
java.lang.String |
getStartDirectory()
Returns the last directory selected in the file chooser dialog
|
void |
setAddButtonText(java.lang.String text)
Set the text of the add element button.
|
void |
setFileDialogAction(java.lang.String fileDialogAction)
Sets the label of the file dialog "approve" button.
|
void |
setFileDialogTitle(java.lang.String fileDialogTitle)
Sets the title of the file dialog.
|
void |
setFileFilter(javax.swing.filechooser.FileFilter filter)
Set a filter to customise what files are displayed.
|
void |
setFileSelectionMode(int fsm)
Set a file selection mode to customise type of files can be selected.
|
void |
setMoveButtonsEnabled(boolean enabled)
Enable or disable the move buttons.
|
void |
setMoveDownButtonText(java.lang.String text)
Set the text of the move down button.
|
void |
setMoveUpButtonText(java.lang.String text)
Set the text of the move up button.
|
void |
setMultiSelectionEnabled(boolean multiSelectionEnabled)
Enable or disable multiple file selection in the file chooser.
|
void |
setPath(java.lang.String path)
Set the path to be displayed in the list box.
|
void |
setPathArray(java.lang.String[] path)
Set the path to be displayed in the list box.
|
void |
setRemoveButtonText(java.lang.String text)
Set the text of the remove element button.
|
void |
setStartDirectory(java.lang.String startDirectory)
Sets the initial directory to be displayed by the file dialog.
|
void |
valueChanged(javax.swing.event.ListSelectionEvent evt)
Handle list selection events.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, 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
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, 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
public PathBuilder()
public PathBuilder(java.lang.String title)
title
- The title to display at the top of the path table.public void setAddButtonText(java.lang.String text)
text
- the String to display on the add element button.public void setRemoveButtonText(java.lang.String text)
text
- the String to display on the remove element button.public void setMoveUpButtonText(java.lang.String text)
text
- the String to display on the move up button.public void setMoveDownButtonText(java.lang.String text)
text
- the String to display on the move down button.public void setFileSelectionMode(int fsm)
filter
- the filter to use.public void setFileFilter(javax.swing.filechooser.FileFilter filter)
filter
- the filter to use.public void setStartDirectory(java.lang.String startDirectory)
startDirectory
- the initial directory to be displayed by the
file dialog.public void setFileDialogTitle(java.lang.String fileDialogTitle)
fileDialogTitle
- the title of the file dialog.public void setFileDialogAction(java.lang.String fileDialogAction)
fileDialogAction
- the label of the file dialog "approve" button.public void setPath(java.lang.String path)
path
- the current path elements, separated by
File.pathSeparator.public void setPathArray(java.lang.String[] path)
path
- an array of the current path elements.public java.lang.String getPath()
public java.lang.String[] getPathArray()
public java.lang.String getStartDirectory()
public void setMoveButtonsEnabled(boolean enabled)
enabled
- true to enabled the move up and move down buttons,
false to hide them.public void setMultiSelectionEnabled(boolean multiSelectionEnabled)
multiSelectionEnabled
- true to enable multiple file selection,
false to disable it.public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
evt
- the GUI event.public void valueChanged(javax.swing.event.ListSelectionEvent evt)
valueChanged
in interface javax.swing.event.ListSelectionListener
evt
- the list selection event.public void addActionListener(java.awt.event.ActionListener listener)