Package ptolemy.vergil.basic
Class DocAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.SingletonAttribute
-
- ptolemy.vergil.basic.DocAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Singleton
public class DocAttribute extends SingletonAttribute
An attribute containing documentation for a Ptolemy II object.- Since:
- Ptolemy II 5.2
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description StringAttribute
author
The author field.StringAttribute
description
The description.StringAttribute
since
The since field.StringAttribute
version
The version field.-
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 DocAttribute()
Construct an empty DocAttribute.DocAttribute(NamedObj container, java.lang.String name)
Construct a documentation attribute with the given name contained by the specified entity.DocAttribute(Workspace workspace)
Construct a DocAttribute in a given workspace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getParameterDoc(java.lang.String name)
Return the documentation for the given parameter, or null if there none.java.lang.String
getPortDoc(java.lang.String name)
Return the documentation for the given port, or null if there none.void
refreshParametersAndPorts()
For each parameter and port in the container, create a parameter with the same name appended with either " (port)", " (port-parameter)", or " (parameter)".-
Methods inherited from class ptolemy.kernel.util.SingletonAttribute
setContainer
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, 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
-
author
public StringAttribute author
The author field.
-
description
public StringAttribute description
The description.
-
since
public StringAttribute since
The since field.
-
version
public StringAttribute version
The version field.
-
-
Constructor Detail
-
DocAttribute
public DocAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a documentation attribute with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This attribute will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.- Parameters:
container
- The container.name
- The name of this attribute.- Throws:
IllegalActionException
- If the attribute is not of an acceptable class for the container, or if the name contains a period.NameDuplicationException
- If the name coincides with an attribute already in the container.
-
DocAttribute
public DocAttribute()
Construct an empty DocAttribute.
-
DocAttribute
public DocAttribute(Workspace workspace)
Construct a DocAttribute in a given workspace.- Parameters:
workspace
- The workspace in which to construct the DocAttribute.
-
-
Method Detail
-
getParameterDoc
public java.lang.String getParameterDoc(java.lang.String name)
Return the documentation for the given parameter, or null if there none.- Parameters:
name
- The name of the parameter.- Returns:
- The documentation for the given parameter, or null if there is none.
-
getPortDoc
public java.lang.String getPortDoc(java.lang.String name)
Return the documentation for the given port, or null if there none.- Parameters:
name
- The name of the port.- Returns:
- The documentation for the given port, or null if there is none.
-
refreshParametersAndPorts
public void refreshParametersAndPorts()
For each parameter and port in the container, create a parameter with the same name appended with either " (port)", " (port-parameter)", or " (parameter)". For parameters, only those that are settable are shown, and only if the visibility is "FULL". This method also removes any parameters that have no corresponding parameter or port in the container. Since this method modifies the model by adding or removing parameters to this attribute, it should be called from inside a change request.
-
-