ptolemy.vergil.toolbox
Class TextEditorConfigureFactory

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.actor.gui.EditorFactory
              extended by ptolemy.vergil.toolbox.TextEditorConfigureFactory
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, 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: TextEditorConfigureFactory.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee
See Also:
TextEditorTableauFactory, Serialized Form
Accepted Rating:
Red (ptolemy)
Proposed Rating:
Yellow (eal)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  TextEditorForStringAttributes _editor
           
 StringAttribute attributeName
          The name of the string attribute that is to be edited.
 Parameter columnsDisplayed
          The horizontal size of the display, in columns.
 Parameter rowsDisplayed
          The vertical size of the display, in rows.
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
TextEditorConfigureFactory(NamedObj container, java.lang.String name)
          Construct a factory with the specified container and name.
 
Method Summary
 void clear()
          Remove any editor that may have been associated with this object by a previous call to createEditor().
 void createEditor(NamedObj object, java.awt.Frame parent)
          Create an editor for editing the string attribute specified by the attributeName parameter.
 java.lang.String getText()
          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, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, 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, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.


_editor

private TextEditorForStringAttributes _editor
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:
clear in interface TextEditorFactory

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:
createEditor in class EditorFactory
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:
getText in interface TextEditorFactory
Returns:
The current text of the text editor, or null if there is none.