Package ptolemy.vergil.basic.export.web
Class WebAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.AbstractSettableAttribute
-
- ptolemy.kernel.util.StringAttribute
-
- ptolemy.vergil.basic.export.web.WebAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Settable
public class WebAttribute extends StringAttribute
Class containing information and methods for properties for web content, for example, an HTML attribute that is part of an HTML element, as in the "href" attribute of <a href="http://www.w3schools.com">This is a link</a> The _elementName is used as the name of the attribute, e.g. "href" in <a href="http://www.w3schools.com">This is a link</a>. An object is not allowed to have two attributes with the same _elementName, since it is assumed that these attributes will belong to the same web element. For example, an HTML tag with two href elements should not be allowed, since it is unclear what behavior occurs (first takes precedence? second? both?) <a href="http://site1.com" href="http://site2.com">This is a link</a>- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Elizabeth Latronico
- Pt.AcceptedRating:
- Red (ltrnc)
- Pt.ProposedRating:
- Red (ltrnc)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable
Settable.Visibility
-
-
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
-
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
-
-
Constructor Summary
Constructors Constructor Description WebAttribute(NamedObj container, java.lang.String name)
Create an instance of this parameter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WebAttribute
appendToWebAttribute(NamedObj container, java.lang.String id, java.lang.String webName, java.lang.String content)
Factory method for creating WebAttributes that appends to the attribute if it already exists and does not have the specified content.static WebAttribute
createWebAttribute(NamedObj container, java.lang.String id, java.lang.String webName)
Factory method for creating WebAttributes.java.lang.String
getWebName()
Return the web name of this element; for example, "myElement" in <div name="myElement"> </div> in HTML.void
setWebName(java.lang.String webName)
Set the web name of this element; for example, "myElement" in <div name="myElement"> </div> in HTML.-
Methods inherited from class ptolemy.kernel.util.StringAttribute
_propagateValue, addValueListener, clone, exportMoML, getExpression, getVisibility, removeValueListener, setExpression, setVisibility, validate
-
Methods inherited from class ptolemy.kernel.util.AbstractSettableAttribute
getDefaultExpression, getValueAsString
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, 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, _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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
-
Methods inherited from interface ptolemy.kernel.util.Settable
getDisplayName
-
-
-
-
Constructor Detail
-
WebAttribute
public WebAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Create an instance of this parameter.- Parameters:
container
- The container.name
- The name.- Throws:
IllegalActionException
- If the superclass throws it.NameDuplicationException
- If the superclass throws it.
-
-
Method Detail
-
appendToWebAttribute
public static WebAttribute appendToWebAttribute(NamedObj container, java.lang.String id, java.lang.String webName, java.lang.String content) throws IllegalActionException
Factory method for creating WebAttributes that appends to the attribute if it already exists and does not have the specified content. Return the modified or new WebAttribute. Set persistent to false. This is static so that any WebExportable may call it.- Parameters:
container
- The container object for the WebAttributeid
- The Ptolemy name for the WebAttribute (needed to ensure a unique Ptolemy name)webName
- The web name of this WebAttribute.content
- The value of this WebAttribute.- Returns:
- The WebAttribute that was created (or that previously existed) with persistent set to false
- Throws:
IllegalActionException
- if the WebAttribute cannot be created (perhaps another Attribute exists with the requested name)
-
getWebName
public java.lang.String getWebName()
Return the web name of this element; for example, "myElement" in <div name="myElement"> </div> in HTML.- Returns:
- The web name of this element; for example, "myElement" in <div name="myElement"> </div> in HTML.
- See Also:
setWebName(String)
-
setWebName
public void setWebName(java.lang.String webName)
Set the web name of this element; for example, "myElement" in <div name="myElement"> </div> in HTML.- Parameters:
webName
- The web name of this element; for example, "myElement" in <div name="myElement"> </div> in HTML.- See Also:
getWebName()
-
createWebAttribute
public static WebAttribute createWebAttribute(NamedObj container, java.lang.String id, java.lang.String webName) throws IllegalActionException
Factory method for creating WebAttributes. Checks if there is an existing WebAttribute with the same name. If so, return it; if not create a new one. Sets persistent to false. Static so that any WebExportable may call it.- Parameters:
container
- The container object for the WebAttributeid
- The Ptolemy name for the WebAttribute (needed to ensure a unique Ptolemy name)webName
- The web name of this WebAttribute- Returns:
- The WebAttribute that was created (or that previously existed) with persistent set to false
- Throws:
IllegalActionException
- if the WebAttribute cannot be created (perhaps another Attribute exists with the requested name)
-
-