diff --git a/jdk/src/share/classes/javax/swing/text/html/CSS.java b/jdk/src/share/classes/javax/swing/text/html/CSS.java index 12e83e06b9b..16f67026796 100644 --- a/jdk/src/share/classes/javax/swing/text/html/CSS.java +++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java @@ -153,6 +153,8 @@ public class CSS implements Serializable { * Fetch the default value for the attribute. * If there is no default value (such as for * composite attributes), null will be returned. + * + * @return default value for the attribute */ public String getDefaultValue() { return defaultValue; @@ -161,6 +163,8 @@ public class CSS implements Serializable { /** * Indicates if the attribute should be inherited * from the parent or not. + * + * @return true if the attribute should be inherited from the parent */ public boolean isInherited() { return inherited; @@ -1036,6 +1040,8 @@ public class CSS implements Serializable { /** * Return the set of all possible CSS attribute keys. + * + * @return the set of all possible CSS attribute keys */ public static Attribute[] getAllAttributeKeys() { Attribute[] keys = new Attribute[Attribute.allAttributes.length]; diff --git a/jdk/src/share/classes/javax/swing/text/html/FormView.java b/jdk/src/share/classes/javax/swing/text/html/FormView.java index 09d59082b19..965ef9d6618 100644 --- a/jdk/src/share/classes/javax/swing/text/html/FormView.java +++ b/jdk/src/share/classes/javax/swing/text/html/FormView.java @@ -448,6 +448,8 @@ public class FormView extends ComponentView implements ActionListener { /** * This method is responsible for submitting the form data. * A thread is forked to undertake the submission. + * + * @param data data to submit */ protected void submitData(String data) { Element form = getFormElement(); diff --git a/jdk/src/share/classes/javax/swing/text/html/HTML.java b/jdk/src/share/classes/javax/swing/text/html/HTML.java index dc49ff3b228..648312dea05 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTML.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTML.java @@ -571,6 +571,9 @@ public class HTML { * are recognized by the default HTML reader. * This set does not include tags that are * manufactured by the reader. + * + * @return the set of actual HTML tags that + * are recognized by the default HTML reader */ public static Tag[] getAllTags() { Tag[] tags = new Tag[Tag.allTags.length]; @@ -626,6 +629,7 @@ public class HTML { * @param key the key to use to fetch the value * @param def the default value to use if the attribute isn't * defined or there is an error converting to an integer + * @return an attribute value */ public static int getIntegerAttributeValue(AttributeSet attr, Attribute key, int def) { diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java index 5aa989411cd..5ced35d36dc 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java @@ -339,6 +339,7 @@ public class HTMLDocument extends DefaultStyledDocument { *
This is a convenience method for
* getReader(int, int, int, HTML.Tag, TRUE).
*
+ * @param pos the starting position
* @param popDepth the number of ElementSpec.EndTagTypes
* to generate before inserting
* @param pushDepth the number of ElementSpec.StartTagTypes
@@ -1022,6 +1023,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* @throws IllegalArgumentException if elem is a leaf
* @throws IllegalStateException if an HTMLEditorKit.Parser
* has not been defined
+ * @throws BadLocationException if replacement is impossible because of
+ * a structural issue
+ * @throws IOException if an I/O exception occurs
* @since 1.3
*/
public void setInnerHTML(Element elem, String htmlText) throws
@@ -1099,6 +1103,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* @param htmlText the string to be parsed and inserted in place of elem
* @throws IllegalStateException if an HTMLEditorKit.Parser has not
* been set
+ * @throws BadLocationException if replacement is impossible because of
+ * a structural issue
+ * @throws IOException if an I/O exception occurs
* @since 1.3
*/
public void setOuterHTML(Element elem, String htmlText) throws
@@ -1177,6 +1184,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* @throws IllegalArgumentException if elem is a leaf
* @throws IllegalStateException if an HTMLEditorKit.Parser has not
* been set on the document
+ * @throws BadLocationException if insertion is impossible because of
+ * a structural issue
+ * @throws IOException if an I/O exception occurs
* @since 1.3
*/
public void insertAfterStart(Element elem, String htmlText) throws
@@ -1247,6 +1257,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* @throws IllegalArgumentException if elem is a leaf
* @throws IllegalStateException if an HTMLEditorKit.Parser has not
* been set on the document
+ * @throws BadLocationException if insertion is impossible because of
+ * a structural issue
+ * @throws IOException if an I/O exception occurs
* @since 1.3
*/
public void insertBeforeEnd(Element elem, String htmlText) throws
@@ -1310,6 +1323,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* @param htmlText the string to be parsed and inserted before elem
* @throws IllegalStateException if an HTMLEditorKit.Parser has not
* been set on the document
+ * @throws BadLocationException if insertion is impossible because of
+ * a structural issue
+ * @throws IOException if an I/O exception occurs
* @since 1.3
*/
public void insertBeforeStart(Element elem, String htmlText) throws
@@ -1368,6 +1384,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* @param htmlText the string to be parsed and inserted after elem
* @throws IllegalStateException if an HTMLEditorKit.Parser has not
* been set on the document
+ * @throws BadLocationException if insertion is impossible because of
+ * a structural issue
+ * @throws IOException if an I/O exception occurs
* @since 1.3
*/
public void insertAfterEnd(Element elem, String htmlText) throws
@@ -1890,6 +1909,7 @@ public class HTMLDocument extends DefaultStyledDocument {
/**
* Type of tag this iterator represents.
+ * @return the tag
*/
public abstract HTML.Tag getTag();
}
@@ -2171,10 +2191,24 @@ public class HTMLDocument extends DefaultStyledDocument {
*/
public class HTMLReader extends HTMLEditorKit.ParserCallback {
+ /**
+ * Constructs an HTMLReader using default pop and push depth and no tag to insert.
+ *
+ * @param offset the starting offset
+ */
public HTMLReader(int offset) {
this(offset, 0, 0, null);
}
+ /**
+ * Constructs an HTMLReader.
+ *
+ * @param offset the starting offset
+ * @param popDepth how many parents to ascend before insert new element
+ * @param pushDepth how many parents to descend (relative to popDepth) before
+ * inserting
+ * @param insertTag a tag to insert (may be null)
+ */
public HTMLReader(int offset, int popDepth, int pushDepth,
HTML.Tag insertTag) {
this(offset, popDepth, pushDepth, insertTag, true, false, true);
@@ -2742,6 +2776,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* all of the well-known tags will have been registered.
* This can be used to change the handling of a particular
* tag or to add support for custom tags.
+ *
+ * @param t an HTML tag
+ * @param a tag action handler
*/
protected void registerTag(HTML.Tag t, TagAction a) {
tagMap.put(t, a);
@@ -2762,6 +2799,9 @@ public class HTMLDocument extends DefaultStyledDocument {
* tag for those actions that are shared across
* many tags. By default this does nothing and
* completely ignores the tag.
+ *
+ * @param t the HTML tag
+ * @param a the attributes
*/
public void start(HTML.Tag t, MutableAttributeSet a) {
}
@@ -2773,12 +2813,17 @@ public class HTMLDocument extends DefaultStyledDocument {
* tag for those actions that are shared across
* many tags. By default this does nothing and
* completely ignores the tag.
+ *
+ * @param t the HTML tag
*/
public void end(HTML.Tag t) {
}
}
+ /**
+ * Action assigned by default to handle the Block task of the reader.
+ */
public class BlockAction extends TagAction {
public void start(HTML.Tag t, MutableAttributeSet attr) {
@@ -2816,6 +2861,9 @@ public class HTMLDocument extends DefaultStyledDocument {
}
+ /**
+ * Action assigned by default to handle the Paragraph task of the reader.
+ */
public class ParagraphAction extends BlockAction {
public void start(HTML.Tag t, MutableAttributeSet a) {
@@ -2829,6 +2877,9 @@ public class HTMLDocument extends DefaultStyledDocument {
}
}
+ /**
+ * Action assigned by default to handle the Special task of the reader.
+ */
public class SpecialAction extends TagAction {
public void start(HTML.Tag t, MutableAttributeSet a) {
@@ -2848,6 +2899,9 @@ public class HTMLDocument extends DefaultStyledDocument {
}
+ /**
+ * Action assigned by default to handle the Hidden task of the reader.
+ */
public class HiddenAction extends TagAction {
public void start(HTML.Tag t, MutableAttributeSet a) {
@@ -3093,6 +3147,9 @@ public class HTMLDocument extends DefaultStyledDocument {
}
}
+ /**
+ * Action assigned by default to handle the Character task of the reader.
+ */
public class CharacterAction extends TagAction {
public void start(HTML.Tag t, MutableAttributeSet attr) {
@@ -3515,6 +3572,8 @@ public class HTMLDocument extends DefaultStyledDocument {
* context. Therefore all text that is seen belongs
* to the text area and is hence added to the
* TextAreaDocument associated with the text area.
+ *
+ * @param data the given content
*/
protected void textAreaContent(char[] data) {
try {
@@ -3529,6 +3588,8 @@ public class HTMLDocument extends DefaultStyledDocument {
* PRE element. This synthesizes lines to hold the
* runs of text, and makes calls to addContent to
* actually add the text.
+ *
+ * @param data the given content
*/
protected void preContent(char[] data) {
int last = 0;
@@ -3550,6 +3611,9 @@ public class HTMLDocument extends DefaultStyledDocument {
/**
* Adds an instruction to the parse buffer to create a
* block element with the given attributes.
+ *
+ * @param t an HTML tag
+ * @param attr the attribute set
*/
protected void blockOpen(HTML.Tag t, MutableAttributeSet attr) {
if (impliedP) {
@@ -3574,6 +3638,8 @@ public class HTMLDocument extends DefaultStyledDocument {
/**
* Adds an instruction to the parse buffer to close out
* a block element of the given type.
+ *
+ * @param t the HTML tag
*/
protected void blockClose(HTML.Tag t) {
inBlock--;
@@ -3672,6 +3738,9 @@ public class HTMLDocument extends DefaultStyledDocument {
/**
* Adds content that is basically specified entirely
* in the attribute set.
+ *
+ * @param t an HTML tag
+ * @param a the attribute set
*/
protected void addSpecialElement(HTML.Tag t, MutableAttributeSet a) {
if ((t != HTML.Tag.FRAME) && (! inParagraph) && (! inPre)) {
@@ -4049,7 +4118,13 @@ public class HTMLDocument extends DefaultStyledDocument {
*/
Option option;
+ /**
+ * Buffer to keep building elements.
+ */
protected Vectore.
*/
protected HTMLDocument getHTMLDocument(JEditorPane e) {
@@ -1501,6 +1506,7 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible {
}
/**
+ * @param e the JEditorPane
* @return HTMLEditorKit for e.
*/
protected HTMLEditorKit getHTMLEditorKit(JEditorPane e) {
@@ -1514,6 +1520,10 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible {
/**
* Returns an array of the Elements that contain offset.
* The first elements corresponds to the root.
+ *
+ * @param doc an instance of HTMLDocument
+ * @param offset value of offset
+ * @return an array of the Elements that contain offset
*/
protected Element[] getElementsAt(HTMLDocument doc, int offset) {
return getElementsAt(doc.getDefaultRootElement(), offset, 0);
@@ -1541,6 +1551,11 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible {
* return -1 if no elements is found representing tag,
* or 0 if the parent of the leaf at offset represents
* tag.
+ *
+ * @param doc an instance of HTMLDocument
+ * @param offset an offset to start from
+ * @param tag tag to represent
+ * @return number of elements
*/
protected int elementCountToTag(HTMLDocument doc, int offset,
HTML.Tag tag) {
diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLFrameHyperlinkEvent.java b/jdk/src/share/classes/javax/swing/text/html/HTMLFrameHyperlinkEvent.java
index 82516f670d9..a52a6920621 100644
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLFrameHyperlinkEvent.java
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLFrameHyperlinkEvent.java
@@ -125,6 +125,8 @@ public class HTMLFrameHyperlinkEvent extends HyperlinkEvent {
/**
* returns the target for the link.
+ *
+ * @return the target for the link
*/
public String getTarget() {
return targetFrame;