BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

Class SpanElement


public class SpanElement
extends MultiPartElement

A SpanElement, like a DivElement, offers a generic mechanism for adding structure to documents. The SPAN and DIV HTML elements are the only two HTML elements that do not add presentation to their enclosed content. By creating instances and classes of elements and applying style sheets, you can customize the presentation of a document. For more information on using a SpanElement, read the documentation on Grouping elements at W3C.

A SpanElement is an inline element, meaning that it does not introduce a visual break in the text. It cannot be used to group block-level elements like paragraphs; it can be used within a DivElement.

A DivElement is a block element, which customarily begins a new paragraph. It can be used to group other block-level elements, but can't be added to a ParagraphElement. Most browsers represent a DivElement with a line break before and after its contents.

Copyright (c) 1995-97, WebLogic, Inc.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:

Fields inherited from class weblogic.html.HtmlElement
codeset, useObsolete
Constructor Summary
SpanElement(java.lang.String styleclass)
          Constructs a SpanElement with the specified class.
SpanElement(java.lang.String styleclass, java.lang.String idstr)
          Constructs a SpanElement with the specified class and ID.
Method Summary
 SpanElement addElement(HtmlElement val)
          Adds an HtmlElement to a SpanElement.
 SpanElement addElement(java.lang.String elem)
          Adds a StringElement to a SpanElement.
protected  java.lang.String getHtmlCode()
protected  boolean printCR()
Methods inherited from class weblogic.html.MultiPartElement
addHeadMultiElement, addMultiElement, getMultiElementAt, getNumElements, printBody, printBody, printBody, removeElement, removeElementAt, replaceElementAt, replaceMultiElementAt, widthAsLiteral
Methods inherited from class weblogic.html.ElementWithAttributes
addAttribute, addAttribute, escapeQuotes, getBooleanAttribute, getElementAttribute, getLocalVar, getQuotedAttribute, output, output, output, printBody, printEndingTag, setBooleanAttribute, setBooleanAttribute, setClass, setDirection, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setId, setLang, setLocalVar, setQuotedAttribute, setStyle
Methods inherited from class weblogic.html.HtmlElement
asAnchorElement, asBigElement, asBlockquoteElement, asBoldElement, asCenteredElement, asCiteElement, asCodeElement, asCommentElement, asDefineTermElement, asEmphasisElement, asFontElement, asFontElement, asFontElement, asHtmlContainer, asItalicElement, asKeyboardElement, asLiteralElement, asParagraphElement, asSampleElement, asSmallElement, asStrikeElement, asStrongElement, asSubscriptElement, asSuperscriptElement, asTeletypeElement, asUnderlineElement, asVariableElement, getVersion, setAnchorMode, setCodeset, toString, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public SpanElement(java.lang.String styleclass,
                   java.lang.String idstr)
Constructs a SpanElement with the specified class and ID. The class is a string that matches a designated style in the head of the document, and the ID can be used to identify each SpanElement.

styleclass - Matches a style class
idstr - Identifies a grouping of types of SpanElements


public SpanElement(java.lang.String styleclass)
Constructs a SpanElement with the specified class. The class is a string that matches a designated style in the head of the document.

styleclass - Matches a style class
Method Detail


protected java.lang.String getHtmlCode()

getHtmlCode in class ElementWithAttributes


protected boolean printCR()

printCR in class ElementWithAttributes


public SpanElement addElement(HtmlElement val)
Adds an HtmlElement to a SpanElement. Note that you cannot add block-level elements to a SpanElement.

val - HtmlElement
SpanElement object


public SpanElement addElement(java.lang.String elem)
Adds a StringElement to a SpanElement.

val - StringElement
SpanElement object

Documentation is available at