BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

weblogic.html
Class StyleElement

java.lang.Object
  |
  +--weblogic.html.HtmlElement
        |
        +--weblogic.html.ElementWithAttributes
              |
              +--weblogic.html.SinglePartElement
                    |
                    +--weblogic.html.StyleElement

public class StyleElement
extends SinglePartElement

The StyleElement provides a means for including rendering information with style notation. A StyleElement is added after calling HtmlPage.getHead().

Note that the NOTATION attribute was deprecated in Release 3.0, as per HTML 4.0. HTML 4.0 specifies only three tags for the StyleElement: type, media, and title. This htmlKona element has been upgraded to track HTML 4.0. Not all browsers currently support HTML 4.0.

Author:
Copyright (c) 1996-98, by WebLogic, Inc. All Rights Reserved.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.

Fields inherited from class weblogic.html.HtmlElement
codeset, useObsolete
 
Constructor Summary
StyleElement()
          Constructs an empty StyleElement with the MIME type set to "text/css".
StyleElement(MimeType type, HtmlElement contents)
          Constructs a StyleElement with the specified contents and sets it to the specified style notation.
StyleElement(java.lang.String styletype, java.lang.String contents)
          Constructs a StyleElement with the specified contents and sets it to the specified style notation.
 
Method Summary
protected  java.lang.String getHtmlCode()
           
protected  boolean printBody()
           
protected  boolean printCR()
           
protected  boolean printEndingTag()
           
 StyleElement setContents(HtmlElement contents)
          Sets the contents of a StyleElement.
 StyleElement setContents(java.lang.String contents)
          Sets the contents of a StyleElement.
 StyleElement setMedia(MediaType media, boolean list)
          Sets the media of a StyleElement.
 StyleElement setNotation(java.lang.String notation)
          Deprecated. use setType()
 StyleElement setTitle(java.lang.String title)
          Sets the title for a StyleElement.
 StyleElement setType(MimeType type)
          Sets the type for a StyleElement.
 StyleElement setType(java.lang.String styletype)
          Sets the type for a StyleElement.
 
Methods inherited from class weblogic.html.SinglePartElement
getElement, printBody, printBody, printBody, setElement, setElement, widthAsLiteral
 
Methods inherited from class weblogic.html.ElementWithAttributes
addAttribute, addAttribute, escapeQuotes, getBooleanAttribute, getElementAttribute, getLocalVar, getQuotedAttribute, output, output, output, 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

StyleElement

public StyleElement()
Constructs an empty StyleElement with the MIME type set to "text/css".

StyleElement

public StyleElement(java.lang.String styletype,
                    java.lang.String contents)
Constructs a StyleElement with the specified contents and sets it to the specified style notation.

Parameters:
styletype - Style
contents - String

StyleElement

public StyleElement(MimeType type,
                    HtmlElement contents)
Constructs a StyleElement with the specified contents and sets it to the specified style notation.

Parameters:
type - Style notation
contents - HtmlElement
Method Detail

getHtmlCode

protected java.lang.String getHtmlCode()

Overrides:
getHtmlCode in class ElementWithAttributes

printEndingTag

protected boolean printEndingTag()

Overrides:
printEndingTag in class ElementWithAttributes

printBody

protected boolean printBody()

Overrides:
printBody in class ElementWithAttributes

printCR

protected boolean printCR()

Overrides:
printCR in class ElementWithAttributes

setType

public StyleElement setType(java.lang.String styletype)
Sets the type for a StyleElement.

Parameters:
styletype - String style type
Returns:
StyleElement

setContents

public StyleElement setContents(java.lang.String contents)
Sets the contents of a StyleElement.

Parameters:
contents - String contents
Returns:
StyleElement

setContents

public StyleElement setContents(HtmlElement contents)
Sets the contents of a StyleElement.

Parameters:
contents - HtmlElement contents
Returns:
StyleElement

setMedia

public StyleElement setMedia(MediaType media,
                             boolean list)
Sets the media of a StyleElement. Use one of the encapsulated media types in MediaType. Calling this method multiple times with the "list" argument set to true sets the media type to a cumulative, comma-delimited list of media. Calling this method with the boolean "list" set to false resets the media to a single type. Calling this method with the media type set to "all" automatically supplies a list of all media types, no matter the setting of the boolean "list."

Parameters:
media - MediaType
list - True if the attribute is a list of media types
Returns:
StyleElement

setTitle

public StyleElement setTitle(java.lang.String title)
Sets the title for a StyleElement. The title offers advisory information about the element for which it is set. Values of the title attribute may be rendered by a user agent in a variety of ways, including as a "tool tip" in browser, or as a spoken phrase in an audio user agent.

Parameters:
title - Style title

setType

public StyleElement setType(MimeType type)
Sets the type for a StyleElement. Use the types in MimeType.

Parameters:
type - MimeType

setNotation

public StyleElement setNotation(java.lang.String notation)
Deprecated. use setType()
Sets the style notation for a StyleElement. Deprecated in 2.6, as per HTML 4.0 specs.

Parameters:
notation - String style notation
Returns:
StyleElement

Documentation is available at
http://www.weblogic.com/docs51