Package ptolemy.vergil.toolbox
Class TextEditorConfigureFactory
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.gui.EditorFactory
-
- ptolemy.vergil.toolbox.TextEditorConfigureFactory
-
- All Implemented Interfaces:
java.lang.Cloneable,Editable,Changeable,Debuggable,DebugListener,Derivable,ModelErrorHandler,MoMLExportable,Moveable,Nameable,TextEditorFactory
public class TextEditorConfigureFactory extends EditorFactory implements TextEditorFactory
If this class is contained by a actor, then double clicking on that actor will invoke a text editor that edits the value of a specified string attribute. The string attribute must be contained by the same container as this factory; its name is given by the attributeName attribute of this factory. The number of rows and columns displayed are given by the rowsDisplayed and columnsDisplayed parameters. The default is 80 columns and 40 rows.This attribute is similar to TextEditorTableauFactory, except that it opens the text editor when the containing actor is configured (edit parameters), whereas TextEditorTableauFactory opens the text editor when the user looks inside.
- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Edward A. Lee, contributor: Daniel Crawl
- See Also:
TextEditorTableauFactory- Pt.AcceptedRating:
- Red (ptolemy)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description StringAttributeattributeNameThe name of the string attribute that is to be edited.ParametercolumnsDisplayedThe horizontal size of the display, in columns.ParameterrowsDisplayedThe vertical size of the display, in rows.StringAttributesyntaxStyleThe style of the text to be edited.-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description TextEditorConfigureFactory(NamedObj container, java.lang.String name)Construct a factory with the specified container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Remove any editor that may have been associated with this object by a previous call to createEditor().voidcreateEditor(NamedObj object, java.awt.Frame parent)Create an editor for editing the string attribute specified by the attributeName parameter.java.lang.StringgetText()Return the current text of the text editor.-
Methods inherited from class ptolemy.actor.gui.EditorFactory
createEditor, createEditor
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Field Detail
-
attributeName
public StringAttribute attributeName
The name of the string attribute that is to be edited.
-
columnsDisplayed
public Parameter columnsDisplayed
The horizontal size of the display, in columns. This contains an integer, and defaults to 40.
-
rowsDisplayed
public Parameter rowsDisplayed
The vertical size of the display, in rows. This contains an integer, and defaults to 10.
-
syntaxStyle
public StringAttribute syntaxStyle
The style of the text to be edited. This may or may not be supported. If the package "org.fife.ui.rsyntaxtextarea" is found in the classpath, then the supported styles include "text/plain", "text/c", "text/clojure", "text/cpp", "text/cs", "text/css", "text/dtd", "text/fortran", "text/groovy", "text/html", "text/java", "text/javascript", "text/json", "text/jsp", "text/latex", "text/makefile", "text/perl", "text/php", "text/properties", "text/python", "text/ruby", "text/sas", "text/scala", "text/sql", "text/tcl", "text/unix", "text/vb", "text/bat", and "text/xml".
-
-
Constructor Detail
-
TextEditorConfigureFactory
public TextEditorConfigureFactory(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a factory with the specified container and name.- Parameters:
container- The container.name- The name of the factory.- Throws:
IllegalActionException- If the factory is not of an acceptable attribute for the container.NameDuplicationException- If the name coincides with an attribute already in the container.
-
-
Method Detail
-
clear
public void clear()
Remove any editor that may have been associated with this object by a previous call to createEditor().- Specified by:
clearin interfaceTextEditorFactory
-
createEditor
public void createEditor(NamedObj object, java.awt.Frame parent)
Create an editor for editing the string attribute specified by the attributeName parameter.- Specified by:
createEditorin interfaceEditable- Specified by:
createEditorin classEditorFactory- Parameters:
object- The object to configure (which is expected to be the same as the container of this attribute).parent- The frame with respect to which to define the editor.
-
getText
public java.lang.String getText()
Return the current text of the text editor.- Specified by:
getTextin interfaceTextEditorFactory- Returns:
- The current text of the text editor, or null if there is none.
-
-