com.bbn.openmap.util.propertyEditor
Class FilePropertyEditor

java.lang.Object
  |
  +--java.beans.PropertyEditorSupport
        |
        +--com.bbn.openmap.util.propertyEditor.FilePropertyEditor
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.beans.PropertyEditor
Direct Known Subclasses:
DirectoryPropertyEditor, 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().
 
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.awt.Component getCustomEditor()
          Returns a JButton that will bring up a JFileChooser dialog.
 javax.swing.JFileChooser getFileChooser()
           
 java.lang.String getLastLocation()
           
 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().

Constructor Detail

FilePropertyEditor

public FilePropertyEditor()
Create FilePropertyEditor.

Method Detail

supportsCustomEditor

public boolean supportsCustomEditor()
PropertyEditor interface.

Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor
Overrides:
supportsCustomEditor in class java.beans.PropertyEditorSupport
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 a JButton that will bring up a JFileChooser dialog.

Specified by:
getCustomEditor in interface java.beans.PropertyEditor
Overrides:
getCustomEditor in class java.beans.PropertyEditorSupport
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
Overrides:
setValue in class java.beans.PropertyEditorSupport

getAsText

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

Specified by:
getAsText in interface java.beans.PropertyEditor
Overrides:
getAsText in class java.beans.PropertyEditorSupport

getLastLocation

public java.lang.String getLastLocation()


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