net.sf.doolin.gui.swing
Class JFile

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by net.sf.doolin.gui.swing.JFile
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class JFile
extends JComponent

File selection component.

Author:
Damien Coraboeuf
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String PROPERTY_FILE
          file property that contains the selected File.
 
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
JFile()
          Constructor with a TextFilePath implementation for the file path.
JFile(GUIPreferences preferences)
          Constructor for a JFile that interacts with the preferences
JFile(GUIPreferences preferences, IFilePath filePath)
          Constructor for a JFile that interacts with the preferences and which is based on a given file path implementation
JFile(IFilePath filePath)
          Constructor based on a given file path implementation
 
Method Summary
 File getFile()
          Gets the file.
 String getFilter()
          Gets the filter.
 String getFilterDescription()
          Gets the filter description.
 FileBrowsingMode getMode()
          Gets the mode.
 boolean isDirectory()
          Checks if is directory.
protected  void onBrowse()
          This method is called when the user has clicked on the browse button.
protected  void onPathEdited()
          This method is called when the path editor has lost its focus.
 void setDirectory(boolean directory)
          Sets the directory.
 void setEnabled(boolean enabled)
          Sets if the component is enabled or not.
 void setFile(File f)
          Sets the file.
 void setFilter(String filter)
          Sets the filter.
 void setFilterDescription(String filterDescription)
          Sets the filter description.
 void setMode(FileBrowsingMode mode)
          Sets the mode.
protected  void updateFile(File f)
          Update file.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, setToolTipText, 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, 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, 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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_FILE

public static final String PROPERTY_FILE
file property that contains the selected File.

See Also:
Constant Field Values
Constructor Detail

JFile

public JFile()
Constructor with a TextFilePath implementation for the file path.


JFile

public JFile(GUIPreferences preferences)
Constructor for a JFile that interacts with the preferences

Parameters:
preferences - Preferences

JFile

public JFile(GUIPreferences preferences,
             IFilePath filePath)
Constructor for a JFile that interacts with the preferences and which is based on a given file path implementation

Parameters:
preferences - Preferences
filePath - File path implementation

JFile

public JFile(IFilePath filePath)
Constructor based on a given file path implementation

Parameters:
filePath - File path implementation
Method Detail

getFile

public File getFile()
Gets the file.

Returns:
the file

getFilter

public String getFilter()
Gets the filter.

Returns:
the filter

getFilterDescription

public String getFilterDescription()
Gets the filter description.

Returns:
the filter description

getMode

public FileBrowsingMode getMode()
Gets the mode.

Returns:
the mode

isDirectory

public boolean isDirectory()
Checks if is directory.

Returns:
true, if is directory

onBrowse

protected void onBrowse()
This method is called when the user has clicked on the browse button.


onPathEdited

protected void onPathEdited()
This method is called when the path editor has lost its focus.


setDirectory

public void setDirectory(boolean directory)
Sets the directory.

Parameters:
directory - the new directory

setFile

public void setFile(File f)
Sets the file.

Parameters:
f - the new file

setEnabled

public void setEnabled(boolean enabled)
Sets if the component is enabled or not.

Overrides:
setEnabled in class JComponent
Parameters:
enabled - Enabled flag

setFilter

public void setFilter(String filter)
Sets the filter.

Parameters:
filter - the new filter

setFilterDescription

public void setFilterDescription(String filterDescription)
Sets the filter description.

Parameters:
filterDescription - the new filter description

setMode

public void setMode(FileBrowsingMode mode)
Sets the mode.

Parameters:
mode - the new mode

updateFile

protected void updateFile(File f)
Update file.

Parameters:
f - the f


Copyright © 2011. All Rights Reserved.