com.bbn.openmap.util.propertyEditor
Class FilePropertyEditor

java.lang.Object
  extended byjava.beans.PropertyEditorSupport
      extended bycom.bbn.openmap.util.propertyEditor.FilePropertyEditor
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.beans.PropertyEditor
Direct Known Subclasses:
DirectoryPropertyEditor, FDUPropertyEditor, FUPropertyEditor, MultiDirectoryPropertyEditor

public class FilePropertyEditor
extends java.beans.PropertyEditorSupport
implements java.awt.event.ActionListener

A PropertyEditor that brings up a JFileChooser panel to select a file. A single file choice can be made, and only choices that reside on the local file system.


Field Summary
protected  javax.swing.JButton button
          The Component returned by getCustomEditor().
protected  javax.swing.JTextField textField
           
 
Constructor Summary
FilePropertyEditor()
          Create FilePropertyEditor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  java.lang.String cleanUpName(java.lang.String name)
          Change double backslashes to forward slash, OK for java world.
 java.lang.String getAsText()
          Implement PropertyEditor interface.
 java.lang.String getButtonTitle()
          Internal callback method that can be overridden by subclasses.
 java.awt.Component getCustomEditor()
          Returns an uneditable text area with a JButton that will bring up a JFileChooser dialog.
 javax.swing.JFileChooser getFileChooser()
           
 int getFileSelectionMode()
          Internal callback method that can be overridden by subclasses.
 java.lang.String getLastLocation()
           
 boolean isMultiSelectEnabled()
          Internal callback method that can be overridden by subclasses.
 boolean isTextFieldEditable()
          Internal callback method that can be overridden by subclasses.
 void setValue(java.lang.Object someObj)
          Implement PropertyEditor interface.
 boolean supportsCustomEditor()
          PropertyEditor interface.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

button

protected javax.swing.JButton button
The Component returned by getCustomEditor().


textField

protected javax.swing.JTextField textField
Constructor Detail

FilePropertyEditor

public FilePropertyEditor()
Create FilePropertyEditor.

Method Detail

getButtonTitle

public java.lang.String getButtonTitle()
Internal callback method that can be overridden by subclasses.

Returns:
"Set" for FilePropertyEditor.

isTextFieldEditable

public boolean isTextFieldEditable()
Internal callback method that can be overridden by subclasses.

Returns:
false for FilePropertyEditor.

getFileSelectionMode

public int getFileSelectionMode()
Internal callback method that can be overridden by subclasses.

Returns:
JFileChooser.FILES_ONLY for FilePropertyEditor.

isMultiSelectEnabled

public boolean isMultiSelectEnabled()
Internal callback method that can be overridden by subclasses.

Returns:
false for FilePropertyEditor.

supportsCustomEditor

public boolean supportsCustomEditor()
PropertyEditor interface.

Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor
Returns:
true

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

cleanUpName

protected java.lang.String cleanUpName(java.lang.String name)
Change double backslashes to forward slash, OK for java world.


getCustomEditor

public java.awt.Component getCustomEditor()
Returns an uneditable text area with a JButton that will bring up a JFileChooser dialog.

Specified by:
getCustomEditor in interface java.beans.PropertyEditor
Returns:
JButton button

getFileChooser

public javax.swing.JFileChooser getFileChooser()

setValue

public void setValue(java.lang.Object someObj)
Implement PropertyEditor interface.

Specified by:
setValue in interface java.beans.PropertyEditor

getAsText

public java.lang.String getAsText()
Implement PropertyEditor interface.

Specified by:
getAsText in interface java.beans.PropertyEditor

getLastLocation

public java.lang.String getLastLocation()


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details