Package adams.gui.goe
Class BaseMarkdownEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- adams.gui.goe.AbstractPropertyEditorSupport
-
- adams.gui.goe.BaseMarkdownEditor
-
- All Implemented Interfaces:
adams.core.HelpProvider,adams.gui.goe.CustomStringRepresentationHandler,adams.gui.goe.InlineEditorSupport,PropertyEditor
public class BaseMarkdownEditor extends adams.gui.goe.AbstractPropertyEditorSupport implements adams.gui.goe.CustomStringRepresentationHandler, adams.gui.goe.InlineEditorSupportA PropertyEditor for BaseMarkdown objects.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
BaseMarkdown
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.gui.core.BaseCheckBoxm_CheckLineWrapThe checkbox for the line wrap.protected MarkdownTextAreaWithPreviewm_TextValueThe text area with the value.
-
Constructor Summary
Constructors Constructor Description BaseMarkdownEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JComponentcreateCustomEditor()Gets the custom editor component.ObjectfromCustomStringRepresentation(String str)Returns an object created from the custom string representation.StringgetInlineValue()Returns the current value.StringgetJavaInitializationString()Returns a representation of the current property value as java source.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_TextValue
protected MarkdownTextAreaWithPreview m_TextValue
The text area with the value.
-
m_CheckLineWrap
protected adams.gui.core.BaseCheckBox m_CheckLineWrap
The checkbox for the line wrap.
-
-
Method Detail
-
toCustomStringRepresentation
public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.- Specified by:
toCustomStringRepresentationin interfaceadams.gui.goe.CustomStringRepresentationHandler- 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 interfaceadams.gui.goe.CustomStringRepresentationHandler- 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'
-
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
-
createCustomEditor
protected JComponent createCustomEditor()
Gets the custom editor component.- Specified by:
createCustomEditorin classadams.gui.goe.AbstractPropertyEditorSupport- Returns:
- the editor
-
initForDisplay
protected void initForDisplay()
Initializes the display of the value.- Overrides:
initForDisplayin classadams.gui.goe.AbstractPropertyEditorSupport
-
isInlineEditingAvailable
public boolean isInlineEditingAvailable()
Checks whether inline editing is available.- Specified by:
isInlineEditingAvailablein interfaceadams.gui.goe.InlineEditorSupport- Returns:
- always true
-
setInlineValue
public void setInlineValue(String value)
Sets the value to use.- Specified by:
setInlineValuein interfaceadams.gui.goe.InlineEditorSupport- Parameters:
value- the value to use
-
getInlineValue
public String getInlineValue()
Returns the current value.- Specified by:
getInlineValuein interfaceadams.gui.goe.InlineEditorSupport- Returns:
- the current value
-
isInlineValueValid
public boolean isInlineValueValid(String value)
Checks whether the value id valid.- Specified by:
isInlineValueValidin interfaceadams.gui.goe.InlineEditorSupport- Parameters:
value- the value to check- Returns:
- always true
-
-