Package adams.gui.goe
Class PlaceholderFileEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- adams.gui.goe.AbstractPropertyEditorSupport
-
- adams.gui.goe.PlaceholderFileEditor
-
- All Implemented Interfaces:
HelpProvider,PopupMenuCustomizer<BasePanel>,CustomStringRepresentationHandler,InlineEditorSupport,MultiSelectionEditor,PropertyPanel.PopupMenuCustomizer,PropertyEditor
public class PlaceholderFileEditor extends AbstractPropertyEditorSupport implements PropertyPanel.PopupMenuCustomizer, CustomStringRepresentationHandler, MultiSelectionEditor, InlineEditorSupport
A PropertyEditor for FlowFile objects that lets the user select a file.
Based onweka.gui.FileEditor.- Author:
- Len Trigg ([email protected])
- See Also:
FileEditor
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseFileChooserm_FileChooserThe file chooser used for selecting files.-
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, EMPTY, m_ChosenOption, m_CustomEditor, m_WindowAdapter, NULL
-
-
Constructor Summary
Constructors Constructor Description PlaceholderFileEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JComponentcreateCustomEditor()Gets the custom editor component.voidcustomizePopupMenu(BasePanel owner, JPopupMenu menu)For customizing the popup menu.ObjectfromCustomStringRepresentation(String str)Returns an object created from the custom string representation.protected BaseFileChoosergetFileChooser()Returns the file chooser and creates it if necessary.StringgetInlineValue()Returns the current value.StringgetJavaInitializationString()Returns a representation of the current property value as java source.Object[]getSelectedObjects(Container parent)Returns the selected objects.protected voidinitForDisplay()Initializes the display of the value.booleanisInlineEditingAvailable()Checks whether inline editing is available.booleanisInlineValueValid(String value)Checks whether the value id valid.voidpaintValue(Graphics gfx, Rectangle box)Paints a representation of the current Object.voidsetInlineValue(String value)Sets the value to use.StringtoCustomStringRepresentation(Object obj)Returns a custom string representation of the object.-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getParentDialog, getParentFrame, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
-
-
-
-
Field Detail
-
m_FileChooser
protected transient BaseFileChooser m_FileChooser
The file chooser used for selecting files.
-
-
Method Detail
-
toCustomStringRepresentation
public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.- Specified by:
toCustomStringRepresentationin interfaceCustomStringRepresentationHandler- Parameters:
obj- the object to turn into a string- Returns:
- the string representation
-
fromCustomStringRepresentation
public Object fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.- Specified by:
fromCustomStringRepresentationin interfaceCustomStringRepresentationHandler- Parameters:
str- the string to turn into an object- Returns:
- the object
-
getJavaInitializationString
public String getJavaInitializationString()
Returns a representation of the current property value as java source.- Specified by:
getJavaInitializationStringin interfacePropertyEditor- Overrides:
getJavaInitializationStringin classPropertyEditorSupport- Returns:
- a value of type 'String'
-
getFileChooser
protected BaseFileChooser getFileChooser()
Returns the file chooser and creates it if necessary.
-
createCustomEditor
protected JComponent createCustomEditor()
Gets the custom editor component.- Specified by:
createCustomEditorin classAbstractPropertyEditorSupport- Returns:
- a value of type 'Component'
-
initForDisplay
protected void initForDisplay()
Initializes the display of the value.- Overrides:
initForDisplayin classAbstractPropertyEditorSupport
-
paintValue
public void paintValue(Graphics gfx, Rectangle box)
Paints a representation of the current Object.- Specified by:
paintValuein interfacePropertyEditor- Overrides:
paintValuein classPropertyEditorSupport- Parameters:
gfx- the graphics context to usebox- the area we are allowed to paint into
-
isInlineEditingAvailable
public boolean isInlineEditingAvailable()
Checks whether inline editing is available.- Specified by:
isInlineEditingAvailablein interfaceInlineEditorSupport- Returns:
- true if editing available
-
setInlineValue
public void setInlineValue(String value)
Sets the value to use.- Specified by:
setInlineValuein interfaceInlineEditorSupport- Parameters:
value- the value to use
-
getInlineValue
public String getInlineValue()
Returns the current value.- Specified by:
getInlineValuein interfaceInlineEditorSupport- Returns:
- the current value
-
isInlineValueValid
public boolean isInlineValueValid(String value)
Checks whether the value id valid.- Specified by:
isInlineValueValidin interfaceInlineEditorSupport- Parameters:
value- the value to check- Returns:
- true if valid
-
getSelectedObjects
public Object[] getSelectedObjects(Container parent)
Returns the selected objects.- Specified by:
getSelectedObjectsin interfaceMultiSelectionEditor- Parameters:
parent- the parent container- Returns:
- the objects
-
customizePopupMenu
public void customizePopupMenu(BasePanel owner, JPopupMenu menu)
For customizing the popup menu.- Specified by:
customizePopupMenuin interfacePopupMenuCustomizer<BasePanel>- Specified by:
customizePopupMenuin interfacePropertyPanel.PopupMenuCustomizer- Parameters:
owner- the property panel from where the menu originatesmenu- the menu to customize
-
-