Package ptolemy.vergil.basic
Class KeplerDocumentationAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.vergil.basic.KeplerDocumentationAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Configurable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class KeplerDocumentationAttribute extends Attribute implements Configurable
A Documentation attribute for actors. This class is used by Kepler so that the DocViewer can access kepler specific actor metadata based documentation.- Since:
- Ptolemy II 6.1
- Version:
- $Id$
- Author:
- Chad Berkley
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
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 KeplerDocumentationAttribute()
Construct a Kepler documentation attribute.KeplerDocumentationAttribute(NamedObj container, java.lang.String name)
Construct a Kepler documentation attribute.KeplerDocumentationAttribute(Workspace workspace)
Construct a Kepler documentation attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPort(java.lang.String name, java.lang.String value)
Add port to the port hashtable.void
addProperty(java.lang.String name, java.lang.String value)
Add a property to the property hashtable.void
configure(java.net.URL base, java.lang.String source, java.lang.String text)
Configure this documentation attribute.void
createEmptyFields(NamedObj target)
Create empty fields for the main attribute as well as any params or ports that exist in the target.void
createInstanceFromExisting(KeplerDocumentationAttribute documentationAttribute)
Populate the members of KeplerDocumentationAttribute from another given KeplerDocumentationAttribute.void
exportMoML(java.io.Writer output, int depth, java.lang.String name)
Write a MoML description of this object with the specified indentation depth and with the specified name substituting for the name of this object.java.lang.String
getAuthor()
Return the author.java.lang.String
getConfigureSource()
Get the configuration source.java.lang.String
getConfigureText()
Get the configuration text.java.lang.String
getDescription()
Return the description.DocAttribute
getDocAttribute(NamedObj target)
Return a docAttribute with the available kepler documentation.java.lang.String
getDocClass()
Return the document class.java.lang.String
getDocName()
Return the document name.java.lang.String
getPort(java.lang.String name)
Return the port documentation.java.util.Hashtable
getPortHash()
Return the port hash.java.lang.String
getProperty(java.lang.String name)
Return the property documentation.java.util.Hashtable
getPropertyHash()
Return the property hash.java.lang.String
getUserLevelDocumentation()
Return the user level documentation.java.lang.String
getVersion()
Return the version.java.lang.String
removePort(java.lang.String name)
Remove a port from the port hashtable.java.lang.String
removeProperty(java.lang.String name)
Remove a property from the property hashtable.void
setAuthor(java.lang.String author)
Set the author.void
setDescription(java.lang.String description)
Set the description.void
setDocClass(java.lang.String className)
Set the name of this docClass.void
setDocName(java.lang.String name)
Set the name of this document.void
setPortHash(java.util.Hashtable portHash)
Set the port hash.void
setPropertyHash(java.util.Hashtable propertyHash)
Set the property hashtable.void
setUserLevelDocumentation(java.lang.String userLevelDocumentation)
Set the user level documentation.void
setVersion(java.lang.String version)
Set the version.java.lang.String
toDocML()
Exports this documentation attribute as docML.void
updateContent()
Method for configurable.void
updateFromExisting(KeplerDocumentationAttribute oldDoc, boolean printWhenReplacing)
Update the documentation fields of this object from another KeplerDocumentationAttribute.-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName
-
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, 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
-
-
-
-
Constructor Detail
-
KeplerDocumentationAttribute
public KeplerDocumentationAttribute()
Construct a Kepler documentation attribute.
-
KeplerDocumentationAttribute
public KeplerDocumentationAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a Kepler documentation attribute.- Parameters:
container
- The container.name
- The name of the Kepler documentation attribute.- Throws:
IllegalActionException
- If thrown by the superclass.NameDuplicationException
- If thrown by the superclass.
-
KeplerDocumentationAttribute
public KeplerDocumentationAttribute(Workspace workspace)
Construct a Kepler documentation attribute.- Parameters:
workspace
- The workspace in which the object is created.
-
-
Method Detail
-
addPort
public void addPort(java.lang.String name, java.lang.String value) throws NameDuplicationException, java.lang.Exception
Add port to the port hashtable.- Parameters:
name
- The name of the port.value
- A String representing the port.- Throws:
NameDuplicationException
- If thrown while creating the port.java.lang.Exception
- If thrown while configuring the port
-
addProperty
public void addProperty(java.lang.String name, java.lang.String value) throws NameDuplicationException, java.lang.Exception
Add a property to the property hashtable.- Parameters:
name
- The name of the property.value
- A string representing the property.- Throws:
NameDuplicationException
- If thrown while creating the propertyjava.lang.Exception
- If thrown while configuring the attribute- See Also:
getProperty(String)
-
configure
public void configure(java.net.URL base, java.lang.String source, java.lang.String text)
Configure this documentation attribute.- Specified by:
configure
in interfaceConfigurable
- Parameters:
base
- Currently ignored.source
- The source of this configuration.text
- The configuration text.
-
createEmptyFields
public void createEmptyFields(NamedObj target)
Create empty fields for the main attribute as well as any params or ports that exist in the target.- Parameters:
target
- the namedobj to create the empty attributes for
-
createInstanceFromExisting
public void createInstanceFromExisting(KeplerDocumentationAttribute documentationAttribute)
Populate the members of KeplerDocumentationAttribute from another given KeplerDocumentationAttribute.- Parameters:
documentationAttribute
- The DocumentationAttribute from which to copy attributes.
-
exportMoML
public void exportMoML(java.io.Writer output, int depth, java.lang.String name) throws java.io.IOException
Write a MoML description of this object with the specified indentation depth and with the specified name substituting for the name of this object.- Specified by:
exportMoML
in interfaceMoMLExportable
- Overrides:
exportMoML
in classNamedObj
- Parameters:
output
- The output stream to write to.depth
- The depth in the hierarchy, to determine indenting.name
- The name to use in the exported MoML.- Throws:
java.io.IOException
- If an I/O error occurs.- See Also:
MoMLExportable
,NamedObj.clone(Workspace)
,NamedObj.isPersistent()
,NamedObj.getDerivedLevel()
-
getAuthor
public java.lang.String getAuthor()
Return the author.- Returns:
- the author
- See Also:
setAuthor(String)
-
getConfigureSource
public java.lang.String getConfigureSource()
Get the configuration source.- Specified by:
getConfigureSource
in interfaceConfigurable
- Returns:
- The configuration source.
-
getConfigureText
public java.lang.String getConfigureText()
Get the configuration text.- Specified by:
getConfigureText
in interfaceConfigurable
- Returns:
- The configuration text
-
getDescription
public java.lang.String getDescription()
Return the description.- Returns:
- the description
- See Also:
setDescription(String)
-
getDocAttribute
public DocAttribute getDocAttribute(NamedObj target)
Return a docAttribute with the available kepler documentation. Returns null if an error prevents the doc attribute from being created.- Parameters:
target
- The container for the DocAttribute- Returns:
- The DocAttribute.
-
getDocClass
public java.lang.String getDocClass()
Return the document class.- Returns:
- the document class or the empty string.
- See Also:
setDocClass(String)
-
getDocName
public java.lang.String getDocName()
Return the document name.- Returns:
- the document name
- See Also:
setDocName(String)
-
getPort
public java.lang.String getPort(java.lang.String name)
Return the port documentation.- Parameters:
name
- The name of the port.- Returns:
- the port documentation.
-
getPortHash
public java.util.Hashtable getPortHash()
Return the port hash.- Returns:
- the port hash
- See Also:
setPortHash(Hashtable)
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Return the property documentation.- Parameters:
name
- The name of the property.- Returns:
- the property docs
- See Also:
addProperty(String, String)
-
getPropertyHash
public java.util.Hashtable getPropertyHash()
Return the property hash.- Returns:
- the property hash
- See Also:
setPropertyHash(Hashtable)
-
getUserLevelDocumentation
public java.lang.String getUserLevelDocumentation()
Return the user level documentation.- Returns:
- the user level documentation
- See Also:
setUserLevelDocumentation(String)
-
getVersion
public java.lang.String getVersion()
Return the version.- Returns:
- the version
- See Also:
setVersion(String)
-
removePort
public java.lang.String removePort(java.lang.String name) throws IllegalActionException, NameDuplicationException
Remove a port from the port hashtable.- Parameters:
name
- The name of the port.- Returns:
- The value of the port.
- Throws:
IllegalActionException
- If an error occurs removing the ConfigurableAttribute.NameDuplicationException
- If an error occurs removing the ConfigurableAttribute.- See Also:
addPort(String, String)
-
removeProperty
public java.lang.String removeProperty(java.lang.String name) throws IllegalActionException, NameDuplicationException
Remove a property from the property hashtable.- Parameters:
name
- The name of the property.- Returns:
- The value of the property.
- Throws:
IllegalActionException
- If an error occurs removing the ConfigurableAttribute.NameDuplicationException
- If an error occurs removing the ConfigurableAttribute.- See Also:
addProperty(String, String)
-
setAuthor
public void setAuthor(java.lang.String author)
Set the author.- Parameters:
author
- The author.- See Also:
getAuthor()
-
setDescription
public void setDescription(java.lang.String description)
Set the description.- Parameters:
description
- The description.- See Also:
getDescription()
-
setDocClass
public void setDocClass(java.lang.String className)
Set the name of this docClass.- Parameters:
className
- The name of this docClass.- See Also:
getDocClass()
-
setDocName
public void setDocName(java.lang.String name)
Set the name of this document.- Parameters:
name
- The name of this document.- See Also:
getDocName()
-
setPortHash
public void setPortHash(java.util.Hashtable portHash)
Set the port hash.- Parameters:
portHash
- The port hash.- See Also:
getPortHash()
-
setPropertyHash
public void setPropertyHash(java.util.Hashtable propertyHash)
Set the property hashtable.- Parameters:
propertyHash
- The property hashtable.- See Also:
FIXME: need to remove all existing ConfigurableAttributes for properties and add new ones for new hash table.
-
setUserLevelDocumentation
public void setUserLevelDocumentation(java.lang.String userLevelDocumentation)
Set the user level documentation.- Parameters:
userLevelDocumentation
- The user level documentation.- See Also:
getUserLevelDocumentation()
-
setVersion
public void setVersion(java.lang.String version)
Set the version.- Parameters:
version
- The version.- See Also:
getVersion()
-
toDocML
public java.lang.String toDocML()
Exports this documentation attribute as docML.- Returns:
- The docML
-
updateContent
public void updateContent() throws InternalErrorException
Method for configurable. In this class, we do nothing.- Overrides:
updateContent
in classAttribute
- Throws:
InternalErrorException
- Not thrown in this base class.
-
updateFromExisting
public void updateFromExisting(KeplerDocumentationAttribute oldDoc, boolean printWhenReplacing) throws java.lang.Exception
Update the documentation fields of this object from another KeplerDocumentationAttribute. A documentation field in this object is updated if it is empty and the corresponding field in the given object is not empty. However, if a field does not exist in this object, but is present in the given object, the field is *not* created in this object.- Parameters:
oldDoc
- The KeplerDocumentationAttribute from which to copy attributes.printWhenReplacing
- If true, print when the values are overwritten.- Throws:
java.lang.Exception
- if there is an error updating the fields.
-
-