common.gui.pathbuilder
Class PathBuilder

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycommon.gui.pathbuilder.PathBuilder
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, java.io.Serializable

public class PathBuilder
extends javax.swing.JPanel
implements java.awt.event.ActionListener, javax.swing.event.ListSelectionListener

The PathBuilder is a component that allows a user to build a classpath by selecting directories files using a filesystem browser.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PathBuilder()
          Creates a new PathBuilder.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Listen to specific GUI events.
 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.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathBuilder

public PathBuilder()
Creates a new PathBuilder.

Method Detail

setAddButtonText

public void setAddButtonText(java.lang.String text)
Set the text of the add element button.

Parameters:
text - the String to display on the add element button.

setRemoveButtonText

public void setRemoveButtonText(java.lang.String text)
Set the text of the remove element button.

Parameters:
text - the String to display on the remove element button.

setMoveUpButtonText

public void setMoveUpButtonText(java.lang.String text)
Set the text of the move up button.

Parameters:
text - the String to display on the move up button.

setMoveDownButtonText

public void setMoveDownButtonText(java.lang.String text)
Set the text of the move down button.

Parameters:
text - the String to display on the move down button.

setFileSelectionMode

public void setFileSelectionMode(int fsm)
Set a file selection mode to customise type of files can be selected.


setFileFilter

public void setFileFilter(javax.swing.filechooser.FileFilter filter)
Set a filter to customise what files are displayed.

Parameters:
filter - the filter to use.

setStartDirectory

public void setStartDirectory(java.lang.String startDirectory)
Sets the initial directory to be displayed by the file dialog.

Parameters:
startDirectory - the initial directory to be displayed by the file dialog.

setFileDialogTitle

public void setFileDialogTitle(java.lang.String fileDialogTitle)
Sets the title of the file dialog.

Parameters:
fileDialogTitle - the title of the file dialog.

setFileDialogAction

public void setFileDialogAction(java.lang.String fileDialogAction)
Sets the label of the file dialog "approve" button.

Parameters:
fileDialogAction - the label of the file dialog "approve" button.

setPath

public void setPath(java.lang.String path)
Set the path to be displayed in the list box.

Parameters:
path - the current path elements, separated by File.pathSeparator.

setPathArray

public void setPathArray(java.lang.String[] path)
Set the path to be displayed in the list box.

Parameters:
path - an array of the current path elements.

getPath

public 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.

Returns:
the path built using this PathBuilder.

getPathArray

public java.lang.String[] getPathArray()
Returns the path built using this PathBuilder as an array of Strings.

Returns:
the path built using this PathBuilder.

getStartDirectory

public java.lang.String getStartDirectory()
Returns the last directory selected in the file chooser dialog

Returns:
the last selected directory

setMoveButtonsEnabled

public void setMoveButtonsEnabled(boolean enabled)
Enable or disable the move buttons.

Parameters:
enabled - true to enabled the move up and move down buttons, false to hide them.

setMultiSelectionEnabled

public void setMultiSelectionEnabled(boolean multiSelectionEnabled)
Enable or disable multiple file selection in the file chooser.

Parameters:
multiSelectionEnabled - true to enable multiple file selection, false to disable it.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Listen to specific GUI events.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - the GUI event.

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent evt)
Handle list selection events.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
Parameters:
evt - the list selection event.