Package org.jppf.ui.options
Class CodeEditorOption
java.lang.Object
org.jppf.ui.options.AbstractOptionProperties
org.jppf.ui.options.AbstractOptionElement
org.jppf.ui.options.AbstractOption
org.jppf.ui.options.CodeEditorOption
- All Implemented Interfaces:
Serializable,Option,OptionElement,OptionProperties
An option that uses a code editor to edit its value.
See also: the code editor is provided by the RSyntaxTextArea project.
- Since:
- 5.2
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
Fields inherited from class org.jppf.ui.options.AbstractOption
listeners, persistent, valueFields inherited from class org.jppf.ui.options.AbstractOptionElement
parent, rootFields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, detachable, eventsEnabled, finalizer, horizontalScrollbar, iconPath, initializer, label, layoutConstraints, mouseListener, name, scripts, scrollable, toolTipText, UIComponent, verticalScrollbar -
Constructor Summary
ConstructorsConstructorDescriptionConstructor provided as a convenience to facilitate the creation of option elements through reflexion. -
Method Summary
Modifier and TypeMethodDescriptionvoidSet the current value for this option.voidcreateUI()Create the UI components for this option.Get the language used by the code editor.org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaGet the underlyingJTextArea.getValue()Get the current value for this option.booleanDetermine whether the text area is editable.voidsetEditable(boolean editable) Specify whether the text area is editable.voidsetEnabled(boolean enabled) Enable or disable this option.voidsetLanguage(String language) Set the language used by the code editor.protected voidAdd a listener to the underlying text document, to receive and propagate change events.voidSet the current value for this option.Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistent, toStringMethods inherited from class org.jppf.ui.options.AbstractOptionElement
findAll, findAllWithName, findElement, findFirstWithName, findLastWithName, getChildForName, getParent, getPath, getRoot, getStringPath, setParentMethods inherited from class org.jppf.ui.options.AbstractOptionProperties
createScrollPane, getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isHorizontalScrollbar, isScrollable, isVerticalScrollbar, setBordered, setComponentConstraints, setDetachable, setEventsEnabled, setFinalizer, setHorizontalScrollbar, setIconPath, setInitializer, setLabel, setLayoutConstraints, setMouseListener, setName, setScrollable, setToolTipText, setUIComponent, setVerticalScrollbarMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.ui.options.OptionElement
findAllWithName, findElement, findFirstWithName, findLastWithName, getParent, getPath, getRoot, getStringPathMethods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isScrollable, setComponentConstraints, setEventsEnabled, setLayoutConstraints, setMouseListener
-
Constructor Details
-
CodeEditorOption
public CodeEditorOption()Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
-
-
Method Details
-
createUI
public void createUI()Create the UI components for this option.- Specified by:
createUIin classAbstractOptionProperties
-
getValue
Get the current value for this option.- Specified by:
getValuein interfaceOption- Overrides:
getValuein classAbstractOption- Returns:
- a
Stringinstance.
-
setValue
Set the current value for this option.- Overrides:
setValuein classAbstractOption- Parameters:
value- aStringinstance.
-
append
Set the current value for this option.- Parameters:
value- aStringinstance.
-
setupValueChangeNotifications
protected void setupValueChangeNotifications()Add a listener to the underlying text document, to receive and propagate change events.- Specified by:
setupValueChangeNotificationsin classAbstractOption
-
isEditable
public boolean isEditable()Determine whether the text area is editable.- Returns:
- true if the text area is editable, false otherwise.
-
setEditable
public void setEditable(boolean editable) Specify whether the text area is editable.- Specified by:
setEditablein interfaceOptionProperties- Overrides:
setEditablein classAbstractOptionProperties- Parameters:
editable- true if the text area is editable, false otherwise.
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:OptionPropertiesEnable or disable this option.- Parameters:
enabled- true to enable this option, false to disable it.
-
getTextArea
public org.fife.ui.rsyntaxtextarea.RSyntaxTextArea getTextArea()Get the underlyingJTextArea.- Returns:
- an instance of
JTextArea.
-
getLanguage
Get the language used by the code editor.- Returns:
- the language in mime type format, e.g. "text/java".
-
setLanguage
Set the language used by the code editor.- Parameters:
language- the language in mime type format, e.g. "text/java".
-