oracle.html
クラス StyleElement

java.lang.Object
  |
  +--oracle.html.IHtmlItemImpl
        |
        +--oracle.html.StyleElement
 

public class StyleElement
extends IHtmlItemImpl

説明:

StyleElementクラスとStyleクラスはいっしょに機能して、CSS1(Cascading Style Sheet Level 1)の埋込みサポートおよびインライン・サポートを提供します。

使用方法:

このクラスのインスタンスを使用して、特定のスタイルを定義するスタイル・プロパティ(フォント、カラー、サイズなど)をグループ化します。 次に、このクラスのインスタンスをStyleクラスのインスタンスに関連付けることにより、特定のHTML要素/タグを定義済みのスタイルに関連付けます。

例:

   // Creats a new HtmlHead object
   Htmlhead hd = new HtmlHead("Style Example");
   // Creats a new Style object
   Style s = new Style();
   // Creates a new StyleElement object
   StyleElement se = new StyleElement();
   // adds a font property to this object
   se.addProperty("font", "10pt Arial");
   // adds the new object to the Style object
   s.addElement("BODY", se);
   // adds the style object to the head object
   hd.addStyle(s);
  

関連項目:
Style, HtmlHead

コンストラクタの概要
StyleElement()
          空のStyleElementオブジェクトを作成します。
 
メソッドの概要
 StyleElement addProperty(java.lang.String name, java.lang.String value)
          StyleElementオブジェクトにスタイル・プロパティ(名前/値ペア)を追加します。
 java.util.Enumeration properties()
           
 java.lang.String propertyAt(int index)
          指定された位置にあるプロパティを取り出します。
 StyleElement setPropertyAt(java.lang.String name, java.lang.String value, int index)
          インデックスにより指定された位置にプロパティを設定します。
 int size()
          オブジェクト内のプロパティ数を返します。
 java.lang.String toHTML()
          オブジェクトの内容をHTML文字列として返します。
 java.lang.String toString()
           
 
クラス oracle.html.IHtmlItemImplから継承したメソッド
print, print
 
クラス java.lang.Objectから継承したメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

StyleElement

public StyleElement() 
空のStyleElementオブジェクトを作成します。
メソッドの詳細

addProperty

public StyleElement addProperty(java.lang.String name,
                                java.lang.String value) 
StyleElementオブジェクトにスタイル・プロパティ(名前/値ペア)を追加します。
パラメータ:
name - スタイルの名前(たとえば「font」)
value - 指定されたスタイルの値(たとえば「10pt」)
戻り値:
this

propertyAt

public java.lang.String propertyAt(int index) 
指定された位置にあるプロパティを取り出します。
パラメータ:
index - 指定された位置
戻り値:
指定された位置にあるプロパティ

setPropertyAt

public StyleElement setPropertyAt(java.lang.String name,
                                  java.lang.String value,
                                  int index) 
インデックスにより指定された位置にプロパティを設定します。
その位置にあった元のプロパティは破棄されます。
パラメータ:
name - プロパティの名前(たとえば「font」)
value - プロパティの値(たとえば「10pt Arial」)
index - 指定された位置
戻り値:
this

size

public int size() 
オブジェクト内のプロパティ数を返します。
戻り値:
オブジェクト内のプロパティ数

toHTML

public java.lang.String toHTML() 
クラスIHtmlItemImplの記述:
オブジェクトの内容をHTML文字列として返します。
オーバーライド:
クラス IHtmlItemImpl内のtoHTML
タグのコピー元クラス: IHtmlItemImpl
戻り値:
オブジェクトの内容を表すHTML文字列

toString

public java.lang.String toString() 
オーバーライド:
クラス java.lang.ObjectのtoString

properties

public java.util.Enumeration properties()