weka.gui
Class FileEditor

java.lang.Object
  |
  +--java.beans.PropertyEditorSupport
        |
        +--weka.gui.FileEditor
All Implemented Interfaces:
java.beans.PropertyEditor

public class FileEditor
extends java.beans.PropertyEditorSupport

A PropertyEditor for File objects that lets the user select a file.

Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Field Summary
protected  javax.swing.JFileChooser m_FileChooser
          The file chooser used for selecting files
 
Constructor Summary
FileEditor()
           
 
Method Summary
 java.awt.Component getCustomEditor()
          Gets the custom editor component.
 java.lang.String getJavaInitializationString()
          Returns a representation of the current property value as java source.
 boolean isPaintable()
          Returns true since this editor is paintable.
 void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box)
          Paints a representation of the current Object.
 boolean supportsCustomEditor()
          Returns true because we do support a custom editor.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getTags, getValue, removePropertyChangeListener, setAsText, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_FileChooser

protected javax.swing.JFileChooser m_FileChooser
The file chooser used for selecting files
Constructor Detail

FileEditor

public FileEditor()
Method Detail

getJavaInitializationString

public java.lang.String getJavaInitializationString()
Returns a representation of the current property value as java source.
Overrides:
getJavaInitializationString in class java.beans.PropertyEditorSupport
Returns:
a value of type 'String'

supportsCustomEditor

public boolean supportsCustomEditor()
Returns true because we do support a custom editor.
Overrides:
supportsCustomEditor in class java.beans.PropertyEditorSupport
Returns:
true

getCustomEditor

public java.awt.Component getCustomEditor()
Gets the custom editor component.
Overrides:
getCustomEditor in class java.beans.PropertyEditorSupport
Returns:
a value of type 'java.awt.Component'

isPaintable

public boolean isPaintable()
Returns true since this editor is paintable.
Overrides:
isPaintable in class java.beans.PropertyEditorSupport
Returns:
true.

paintValue

public void paintValue(java.awt.Graphics gfx,
                       java.awt.Rectangle box)
Paints a representation of the current Object.
Overrides:
paintValue in class java.beans.PropertyEditorSupport
Parameters:
gfx - the graphics context to use
box - the area we are allowed to paint into