ptolemy.actor.gui
Class TextEditorTableau.Factory

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.util.Attribute
          extended byptolemy.actor.gui.TableauFactory
              extended byptolemy.actor.gui.TextEditorTableau.Factory
All Implemented Interfaces:
Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable
Enclosing class:
TextEditorTableau

public static class TextEditorTableau.Factory
extends TableauFactory

A factory that creates text editor tableaux for Ptolemy models.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
TextEditorTableau.Factory(NamedObj container, java.lang.String name)
          Create a factory with the given name and container.
 
Method Summary
 Tableau createTableau(Effigy effigy)
          If the specified effigy is a TextEffigy and it already contains a tableau named "textTableau", then return that tableau; otherwise, create a new instance of TextEditorTableau in the specified effigy, and name it "textTableau" and return that tableau.
 
Methods inherited from class ptolemy.kernel.util.Attribute
_getContainedObject, _propagateExistence, clone, getContainer, setContainer, setName
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextEditorTableau.Factory

public TextEditorTableau.Factory(NamedObj container,
                                 java.lang.String name)
                          throws IllegalActionException,
                                 NameDuplicationException
Create a factory with the given name and container.

Parameters:
container - The container entity.
name - The name of the entity.
Throws:
IllegalActionException - If the container is incompatible with this attribute.
NameDuplicationException - If the name coincides with an attribute already in the container.
Method Detail

createTableau

public Tableau createTableau(Effigy effigy)
                      throws java.lang.Exception
If the specified effigy is a TextEffigy and it already contains a tableau named "textTableau", then return that tableau; otherwise, create a new instance of TextEditorTableau in the specified effigy, and name it "textTableau" and return that tableau. If the specified effigy is not an instance of TextEffigy, but contains an instance of TextEffigy, then open a tableau for that effigy. If it is a PtolemyEffigy, then create a text effigy with the MoML representation of the model. Finally, if is not a TextEffigy or a PtolemyEffigy, and it does not contain a TextEffigy, then attempt to open its URL and display its date by creating a text effigy, which will then be contained by the specified effigy. If all of this fails, then do not create a tableau and return null. It is the responsibility of callers of this method to check the return value and call show().

Overrides:
createTableau in class TableauFactory
Parameters:
effigy - The effigy.
Returns:
A text editor tableau, or null if one cannot be found or created.
Throws:
java.lang.Exception - If the factory should be able to create a tableau for the effigy, but something goes wrong.