Package ptolemy.actor.gui
Class TextEditorTableau.Factory
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.gui.TableauFactory
-
- ptolemy.actor.gui.TextEditorTableau.Factory
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Configurable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Enclosing class:
- TextEditorTableau
public static class TextEditorTableau.Factory extends TableauFactory
A factory that creates text editor tableaux for Ptolemy models.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description StringAttribute
syntaxStyle
The 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 Factory(NamedObj container, java.lang.String name)
Create a factory with the given name and container.Factory(NamedObj container, java.lang.String name, java.lang.String style)
Create a factory with the given name and container and syntax style.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.actor.gui.TableauFactory
_configureTableau, configure, getConfigureSource, getConfigureText
-
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
-
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
-
Factory
public 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.
-
Factory
public Factory(NamedObj container, java.lang.String name, java.lang.String style) throws IllegalActionException, NameDuplicationException
Create a factory with the given name and container and syntax style.- Parameters:
container
- The container entity.name
- The name of the entity.style
- The syntax style.- 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 classTableauFactory
- 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.
-
-