|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--javax.swing.text.AbstractWriter | +--javax.swing.text.html.MinimalHTMLWriter
MinimalHTMLWriter は、エディタキットで作成されないドキュメントの HTML を書き出すために HTMLEditorKit が使用する代替ライターです。 ドキュメントの形式は次のとおりです。
<html> <head> <style> <!-- 名前付きスタイルのリスト p.normal { font-family: SansSerif; margin-height: 0; font-size: 14 } --> </style> </head> <body> <p style=normal> <b> 行の並びのボールド、イタリック、および下線の属性は HTML タグとして発行される。それ以外の属性は <font> タグ の部分的なスタイル属性として発行される。構文はインラインスタ イルに類似する</b> </p> </body> </html>
クラス javax.swing.text.AbstractWriter から継承したフィールド |
NEWLINE |
コンストラクタの概要 | |
MinimalHTMLWriter(Writer w,
StyledDocument doc)
新しい MinimalHTMLWriter を作成します。 |
|
MinimalHTMLWriter(Writer w,
StyledDocument doc,
int pos,
int len)
新しい MinimalHTMLWriter を作成します。 |
メソッドの概要 | |
protected void |
endFontTag()
<font> タグ用の終了タグを書き出します。 |
protected boolean |
inFontTag()
<font> タグ内なら true を返します。 |
protected boolean |
isText(Element elem)
要素がテキストなら true を返します。 |
protected void |
startFontTag(String style)
<font> タグ用の開始タグを書き出します。 |
protected void |
text(Element elem)
テキストの書き出しを制御します。 |
void |
write()
StyledDocument からの HTML 出力の生成を制御します。 |
protected void |
writeAttributes(AttributeSet attr)
次の型用のすべての属性を書き出します。 |
protected void |
writeBody()
キュメント内の要素で反復され、枝の要素か葉の要素かを判断して要素を処理します。 |
protected void |
writeComponent(Element elem)
コンポーネント要素の書き出しを制御します。 |
protected void |
writeContent(Element elem,
boolean needsIndenting)
テキストの書き出しを処理します。 |
protected void |
writeEndParagraph()
<p> タグに対する終了タグの発行を処理します。 |
protected void |
writeEndTag(String endTag)
適切にインデント処理された終了タグを書き出します。 |
protected void |
writeHeader()
<head> および <style> のタグを書き出します。 |
protected void |
writeHTMLTags(AttributeSet attr)
属性設定に基づいてテキストのボールド <b>、イタリック <i>、および <u> のタグ生成を制御します。 |
protected void |
writeImage(Element elem)
アイコン要素の書き出しを制御します。 |
protected void |
writeLeaf(Element elem)
テキスト以外の葉の要素の書き出しを制御します。 |
protected void |
writeNonHTMLAttributes(AttributeSet attr)
HTML 準拠の方法でキャラクタレベル属性 (ボールド、イタリック、アンダーライン以外の属性) の書き出しを制御します。 |
protected void |
writeStartParagraph(Element elem)
段落の開始タグを発行します。 |
protected void |
writeStartTag(String tag)
適切にインデント処理された開始タグを書き出します。 |
protected void |
writeStyles()
<style> タグのコンテンツとしてすべての名前付きスタイルを書き出します。 |
クラス javax.swing.text.AbstractWriter から継承したメソッド |
decrIndent,
getDocument,
getElementIterator,
getText,
incrIndent,
indent,
inRange,
setIndentSpace,
setLineLength,
write,
write |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
コンストラクタの詳細 |
public MinimalHTMLWriter(Writer w, StyledDocument doc)
w
- ライターdoc
- StyledDocumentpublic MinimalHTMLWriter(Writer w, StyledDocument doc, int pos, int len)
w
- Writerdoc
- StyledDocumentpos
- ドキュメント内でコンテンツを取得する位置len
- 書き出す量メソッドの詳細 |
public void write() throws IOException, BadLocationException
protected void writeAttributes(AttributeSet attr) throws IOException
StyleConstants.ParagraphConstants StyleConstants.CharacterConstants StyleConstants.FontConstants StyleConstants.ColorConstants.属性名と値はコロンで、各組はセミコロンでそれぞれ区切られます。
protected void text(Element elem) throws IOException, BadLocationException
protected void writeStartTag(String tag) throws IOException
protected void writeEndTag(String endTag) throws IOException
protected void writeHeader() throws IOException
protected void writeStyles() throws IOException
protected void writeBody() throws IOException, BadLocationException
protected void writeEndParagraph() throws IOException
protected void writeStartParagraph(Element elem) throws IOException
protected void writeLeaf(Element elem) throws IOException
protected void writeImage(Element elem) throws IOException
elem
- StyleConstants.IconElementName 型の要素protected void writeComponent(Element elem) throws IOException
protected boolean isText(Element elem)
protected void writeContent(Element elem, boolean needsIndenting) throws IOException, BadLocationException
protected void writeHTMLTags(AttributeSet attr) throws IOException
protected void writeNonHTMLAttributes(AttributeSet attr) throws IOException
protected boolean inFontTag()
protected void endFontTag() throws IOException
protected void startFontTag(String style) throws IOException
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |