com.jaxfront.swing.ui.editor
Class FileNameChooserModern

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jaxfront.swing.ui.editor.FileNameChooserModern
All Implemented Interfaces:
FileLocationChooser, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class FileNameChooserModern
extends javax.swing.JPanel
implements java.awt.event.ActionListener, java.awt.event.FocusListener, FileLocationChooser

An instance of FileNameChooser shows several locations of resources in a combo box that are xml files eq. po.xsd, po.xml, po.xui.

Version:
1.60
See Also:
com.jaxfront.core.ui.editor.FileLocationChooser, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String SUFFIX_XML
           
static java.lang.String SUFFIX_XSD
           
static java.lang.String SUFFIX_XUI
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
FileNameChooserModern(java.lang.String name, java.lang.String fileName, java.util.Vector lastFiles, java.lang.String suffix, boolean useFileDeselector)
          Creates an instance of FileNameChooser with the specified name, fileName, suffix and the last loaded files.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when an action occurs.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to this class.
 void focusGained(java.awt.event.FocusEvent e)
          Invoked when a component gains the keyboard focus.
 void focusLost(java.awt.event.FocusEvent e)
          Invoked when a component loses the keyboard focus.
 javax.swing.JComboBox getComboField()
           
 java.io.File getDefaultDirectory()
          Returns the default directory for the file dialog.
 org.w3c.dom.Document getDOM()
          Returns the current DOM.
 java.lang.String getSelectedItem()
          Returns the location of the selected ressource.
 java.lang.String getText()
          Returns the text of the item
 java.net.URL getURL()
          Returns the location of the ressource as URL.
 void setDefaultDirectory(java.io.File directory)
          Sets the default directory for the file dialog.
 void setEnabled(boolean enabled)
          Sets the resource chooser enabled or disabled.
 void setFileFilter(java.lang.String fileFilter)
           
 void setItems(java.lang.String[] items)
          Set the items to the combo box.
 void setSelectedItem(java.lang.String name)
          Select an item in the resource chooser.
 void setText(java.lang.String text)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SUFFIX_XSD

public static final java.lang.String SUFFIX_XSD
See Also:
Constant Field Values

SUFFIX_XML

public static final java.lang.String SUFFIX_XML
See Also:
Constant Field Values

SUFFIX_XUI

public static final java.lang.String SUFFIX_XUI
See Also:
Constant Field Values
Constructor Detail

FileNameChooserModern

public FileNameChooserModern(java.lang.String name,
                             java.lang.String fileName,
                             java.util.Vector lastFiles,
                             java.lang.String suffix,
                             boolean useFileDeselector)
Creates an instance of FileNameChooser with the specified name, fileName, suffix and the last loaded files.

Parameters:
name - name of the chooser (label text)
fileName - the name that has to be selected
lastFiles - a list with the last loaded files
suffix - the suffix of the files eq. *.xsd, *.xml, *.xui
Method Detail

getComboField

public javax.swing.JComboBox getComboField()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - an action event that occured

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: FileLocationChooser
Sets the resource chooser enabled or disabled.

Specified by:
setEnabled in interface FileLocationChooser
Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
enabled - true or false

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this class.

Specified by:
addPropertyChangeListener in interface FileLocationChooser
Overrides:
addPropertyChangeListener in class java.awt.Container
Parameters:
listener - the listener which get the events.

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus.

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
e - a focus event that occured

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus.

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
e - a focus event that occured

getDOM

public org.w3c.dom.Document getDOM()
Returns the current DOM. (Null in this case). Note that a FileNameChooser returns null, because we need in this case only the location of the file as URL.

Specified by:
getDOM in interface FileLocationChooser

getSelectedItem

public java.lang.String getSelectedItem()
Returns the location of the selected ressource.

Specified by:
getSelectedItem in interface FileLocationChooser

getText

public java.lang.String getText()
Returns the text of the item

Returns:
String the text

setText

public void setText(java.lang.String text)

setFileFilter

public void setFileFilter(java.lang.String fileFilter)

getURL

public java.net.URL getURL()
Returns the location of the ressource as URL.

Specified by:
getURL in interface FileLocationChooser
Returns:
the location as URL

setItems

public void setItems(java.lang.String[] items)
Set the items to the combo box.

Specified by:
setItems in interface FileLocationChooser
Parameters:
items - a list of items.

setSelectedItem

public void setSelectedItem(java.lang.String name)
Description copied from interface: FileLocationChooser
Select an item in the resource chooser.

Specified by:
setSelectedItem in interface FileLocationChooser
Parameters:
name - name of the selected item
See Also:
com.jaxfront.core.ui.editor.FileLocationChooser#setSelectedItem(java.lang.String)

setDefaultDirectory

public void setDefaultDirectory(java.io.File directory)
Description copied from interface: FileLocationChooser
Sets the default directory for the file dialog.

Specified by:
setDefaultDirectory in interface FileLocationChooser
Parameters:
directory - the default directory

getDefaultDirectory

public java.io.File getDefaultDirectory()
Description copied from interface: FileLocationChooser
Returns the default directory for the file dialog.

Specified by:
getDefaultDirectory in interface FileLocationChooser
Returns:
File the default directory