3909N/A * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A * or visit www.oracle.com if you need additional information or have any 4378N/A * Constants used in the <code>HTMLDocument</code>. These 4378N/A * are basically tag and attribute definitions. 0N/A * Typesafe enumeration for an HTML tag. Although the 0N/A * set of HTML tags is a closed set, we have left the 0N/A * set open so that people can add their own tag types 0N/A * to their custom parser and still communicate to the 0N/A * Creates a new <code>Tag</code> with the specified <code>id</code>, 0N/A * and with <code>causesBreak</code> and <code>isBlock</code> 0N/A * set to <code>false</code>. 0N/A * @param id the id of the new tag 0N/A * Creates a new <code>Tag</code> with the specified <code>id</code>; 0N/A * <code>causesBreak</code> and <code>isBlock</code> are defined 0N/A * @param id the id of the new tag 0N/A * @param causesBreak <code>true</code> if this tag 0N/A * causes a break to the flow of data 0N/A * @param isBlock <code>true</code> if the tag is used 0N/A * to add structure to a document 0N/A * Returns <code>true</code> if this tag is a block 0N/A * tag, which is a tag used to add structure to a 0N/A * @return <code>true</code> if this tag is a block 0N/A * tag, otherwise returns <code>false</code> 0N/A * Returns <code>true</code> if this tag causes a 0N/A * line break to the flow of data, otherwise returns 0N/A * <code>false</code>. 0N/A * @return <code>true</code> if this tag causes a 0N/A * line break to the flow of data, otherwise returns 0N/A * <code>false</code> 0N/A * Returns <code>true</code> if this tag is pre-formatted, 0N/A * which is true if the tag is either <code>PRE</code> or 0N/A * <code>TEXTAREA</code>. 0N/A * @return <code>true</code> if this tag is pre-formatted, 0N/A * otherwise returns <code>false</code> 0N/A * Returns the string representation of the 0N/A * @return the <code>String</code> representation of the tag 0N/A * Returns <code>true</code> if this tag is considered to be a paragraph 0N/A * in the internal HTML model. <code>false</code> - otherwise. 0N/A * @return <code>true</code> if this tag is considered to be a paragraph 0N/A * in the internal HTML model. <code>false</code> - otherwise. 0N/A // --- Tag Names ----------------------------------- 0N/A public static final Tag BR =
new Tag(
"br",
true,
false);
0N/A public static final Tag DD =
new Tag(
"dd",
true,
true);
0N/A public static final Tag DL =
new Tag(
"dl",
true,
true);
0N/A public static final Tag DT =
new Tag(
"dt",
true,
true);
0N/A public static final Tag H1 =
new Tag(
"h1",
true,
true);
0N/A public static final Tag H2 =
new Tag(
"h2",
true,
true);
0N/A public static final Tag H3 =
new Tag(
"h3",
true,
true);
0N/A public static final Tag H4 =
new Tag(
"h4",
true,
true);
0N/A public static final Tag H5 =
new Tag(
"h5",
true,
true);
0N/A public static final Tag H6 =
new Tag(
"h6",
true,
true);
0N/A public static final Tag HR =
new Tag(
"hr",
true,
false);
0N/A public static final Tag LI =
new Tag(
"li",
true,
true);
0N/A public static final Tag OL =
new Tag(
"ol",
true,
true);
0N/A public static final Tag P =
new Tag(
"p",
true,
true);
0N/A public static final Tag TD =
new Tag(
"td",
true,
true);
0N/A public static final Tag TH =
new Tag(
"th",
true,
true);
0N/A public static final Tag TR =
new Tag(
"tr",
false,
true);
0N/A public static final Tag UL =
new Tag(
"ul",
true,
true);
0N/A * All text content must be in a paragraph element. 0N/A * If a paragraph didn't exist when content was 0N/A * encountered, a paragraph is manufactured. 0N/A * This is a tag synthesized by the HTML reader. 0N/A * Since elements are identified by their tag type, 0N/A * we create a some fake tag types to mark the elements 0N/A * that were manufactured. 0N/A * All text content is labeled with this tag. 0N/A * This is a tag synthesized by the HTML reader. 0N/A * Since elements are identified by their tag type, 0N/A * we create a some fake tag types to mark the elements 0N/A * that were manufactured. 0N/A * All comments are labeled with this tag. 0N/A * This is a tag synthesized by the HTML reader. 0N/A * Since elements are identified by their tag type, 0N/A * we create a some fake tag types to mark the elements 0N/A * that were manufactured. 0N/A DD,
DFN,
DIR,
DIV,
DL,
DT,
EM,
FONT,
FORM,
FRAME,
0N/A FRAMESET,
H1,
H2,
H3,
H4,
H5,
H6,
HEAD,
HR,
HTML,
0N/A // Force HTMLs static initialize to be loaded. 0N/A // There is no unique instance of UnknownTag, so we allow it to be 0N/A * Creates a new <code>UnknownTag</code> with the specified 0N/A * @param id the id of the new tag 0N/A * Returns the hash code which corresponds to the string 0N/A * Compares this object to the specifed object. 0N/A * The result is <code>true</code> if and only if the argument is not 0N/A * <code>null</code> and is an <code>UnknownTag</code> object 0N/A * with the same name. 0N/A * @param obj the object to compare this tag with 0N/A * @return <code>true</code> if the objects are equal; 0N/A * <code>false</code> otherwise 0N/A * Typesafe enumeration representing an HTML 0N/A * Creates a new <code>Attribute</code> with the specified 0N/A * @param id the id of the new <code>Attribute</code> 0N/A * Returns the string representation of this attribute. 0N/A * @return the string representation of this attribute 0N/A // The secret to 73, is that, given that the Hashtable contents 0N/A // never change once the static initialization happens, the initial size 0N/A // that the hashtable grew to was determined, and then that very size 0N/A /** Maps from StyleConstant key to HTML.Tag. */ 0N/A * Returns the set of actual HTML tags that 0N/A * are recognized by the default HTML reader. 0N/A * This set does not include tags that are 0N/A * manufactured by the reader. 0N/A * Fetches a tag constant for a well-known tag name (i.e. one of 0N/A * the tags in the set {A, ADDRESS, APPLET, AREA, B, 0N/A * BASE, BASEFONT, BIG, 0N/A * BLOCKQUOTE, BODY, BR, CAPTION, CENTER, CITE, CODE, 0N/A * DD, DFN, DIR, DIV, DL, DT, EM, FONT, FORM, FRAME, 0N/A * FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, 0N/A * I, IMG, INPUT, ISINDEX, KBD, LI, LINK, MAP, MENU, 0N/A * META, NOBR, NOFRAMES, OBJECT, OL, OPTION, P, PARAM, 0N/A * PRE, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, S, 0N/A * STRONG, STYLE, SUB, SUP, TABLE, TD, TEXTAREA, 0N/A * TH, TITLE, TR, TT, U, UL, VAR}. If the given 0N/A * name does not represent one of the well-known tags, then 0N/A * <code>null</code> will be returned. 0N/A * @param tagName the <code>String</code> name requested 0N/A * @return a tag constant corresponding to the <code>tagName</code>, 0N/A * or <code>null</code> if not found 0N/A * Returns the HTML <code>Tag</code> associated with the 0N/A * <code>StyleConstants</code> key <code>sc</code>. 0N/A * If no matching <code>Tag</code> is found, returns 0N/A * <code>null</code>. 0N/A * @param sc the <code>StyleConstants</code> key 0N/A * @return tag which corresponds to <code>sc</code>, or 0N/A * <code>null</code> if not found 0N/A * Fetches an integer attribute value. Attribute values 0N/A * are stored as a string, and this is a convenience method 0N/A * to convert to an actual integer. 0N/A * @param attr the set of attributes to use to try to fetch a value 0N/A * @param key the key to use to fetch the value 0N/A * @param def the default value to use if the attribute isn't 0N/A * defined or there is an error converting to an integer 0N/A // This is used in cases where the value for the attribute has not 0N/A // size determined similar to size of tagHashtable 0N/A * Returns the set of HTML attributes recognized. 0N/A * @return the set of HTML attributes recognized 0N/A * Fetches an attribute constant for a well-known attribute name 0N/A * (i.e. one of the attributes in the set {FACE, COMMENT, SIZE, 0N/A * COLOR, CLEAR, BACKGROUND, BGCOLOR, TEXT, LINK, VLINK, ALINK, 0N/A * WIDTH, HEIGHT, ALIGN, NAME, HREF, REL, REV, TITLE, TARGET, 0N/A * SHAPE, COORDS, ISMAP, NOHREF, ALT, ID, SRC, HSPACE, VSPACE, 0N/A * USEMAP, LOWSRC, CODEBASE, CODE, ARCHIVE, VALUE, VALUETYPE, 0N/A * TYPE, CLASS, STYLE, LANG, DIR, DECLARE, CLASSID, DATA, CODETYPE, 0N/A * STANDBY, BORDER, SHAPES, NOSHADE, COMPACT, START, ACTION, METHOD, 0N/A * ENCTYPE, CHECKED, MAXLENGTH, MULTIPLE, SELECTED, ROWS, COLS, 0N/A * DUMMY, CELLSPACING, CELLPADDING, VALIGN, HALIGN, NOWRAP, ROWSPAN, 0N/A * COLSPAN, PROMPT, HTTPEQUIV, CONTENT, LANGUAGE, VERSION, N, 0N/A * FRAMEBORDER, MARGINWIDTH, MARGINHEIGHT, SCROLLING, NORESIZE, 0N/A * If the given name does not represent one of the well-known attributes, 0N/A * then <code>null</code> will be returned. 0N/A * @param attName the <code>String</code> requested 0N/A * @return the <code>Attribute</code> corresponding to <code>attName</code>