The comparison chart shows that it must be the
javax.swing.text.html.TableView.RowView class. To achieve this, this
patch renames the existing HTMLTableView into TableView and adds the
inner public
RowView class (derived directly for the
javax.swing.text.TableView.TableRow). The method
javax.swing.text.html.TableView.createTableRow is introduced to create
the instances of the RowView that are more or less identical
(inheritance with no changes) to the TableRow at the moment.
2006-07-06 Audrius Meskauskas <[EMAIL PROTECTED]>
* javax/swing/text/html/HTMLEditorKit.java:
(HTMLFactory.createElement): Update reference to the html table view.
* javax/swing/text/html/HTMLTableView.java: Removed (renamed).
* javax/swing/text/html/TableView.java: New file.
Index: HTMLEditorKit.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/text/html/HTMLEditorKit.java,v
retrieving revision 1.29
diff -u -r1.29 HTMLEditorKit.java
--- HTMLEditorKit.java 6 Jul 2006 09:04:38 -0000 1.29
+++ HTMLEditorKit.java 6 Jul 2006 10:43:57 -0000
@@ -557,7 +557,7 @@
else if (tag == HTML.Tag.HEAD)
view = new NullView(element);
else if (tag.equals(HTML.Tag.TABLE))
- view = new HTMLTableView(element);
+ view = new javax.swing.text.html.TableView(element);
else if (tag.equals(HTML.Tag.TD))
view = new ParagraphView(element);
else if (tag.equals(HTML.Tag.HR))
Index: HTMLTableView.java
===================================================================
RCS file: HTMLTableView.java
diff -N HTMLTableView.java
--- HTMLTableView.java 3 Mar 2006 10:47:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,82 +0,0 @@
-/* HTMLTableView.java -- A table view for HTML tables
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package javax.swing.text.html;
-
-import javax.swing.text.Element;
-import javax.swing.text.TableView;
-import javax.swing.text.View;
-import javax.swing.text.ViewFactory;
-
-/**
- * A conrete implementation of TableView that renders HTML tables.
- *
- * @author Roman Kennke ([EMAIL PROTECTED])
- */
-class HTMLTableView
- extends TableView
-{
-
- /**
- * Creates a new HTMLTableView for the specified element.
- *
- * @param el the element for the table view
- */
- public HTMLTableView(Element el)
- {
- super(el);
- }
-
- /**
- * Loads the children of the Table. This completely bypasses the ViewFactory
- * and creates instances of TableRow instead.
- *
- * @param vf ignored
- */
- protected void loadChildren(ViewFactory vf)
- {
- Element el = getElement();
- int numChildren = el.getElementCount();
- View[] rows = new View[numChildren];
- for (int i = 0; i < numChildren; ++i)
- {
- rows[i] = createTableRow(el.getElement(i));
- }
- replace(0, getViewCount(), rows);
- }
-}
Index: TableView.java
===================================================================
RCS file: TableView.java
diff -N TableView.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TableView.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,108 @@
+/* TableView.java -- A table view for HTML tables
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import javax.swing.text.Element;
+import javax.swing.text.View;
+import javax.swing.text.ViewFactory;
+
+/**
+ * A conrete implementation of TableView that renders HTML tables.
+ *
+ * @author Roman Kennke ([EMAIL PROTECTED])
+ */
+class TableView
+ extends javax.swing.text.TableView
+{
+ /**
+ * Represents a single table row.
+ */
+ public class RowView extends TableRow
+ {
+ /**
+ * Creates a new instance of the <code>RowView</code>.
+ *
+ * @param el the element for which to create a row view
+ */
+ public RowView(Element el)
+ {
+ super(el);
+ }
+ }
+
+ /**
+ * Creates a new HTML table view for the specified element.
+ *
+ * @param el the element for the table view
+ */
+ public TableView(Element el)
+ {
+ super(el);
+ }
+
+ /**
+ * Creates a view for a table row.
+ *
+ * @param el the element that represents the table row
+ * @return a view for rendering the table row
+ * (and instance of [EMAIL PROTECTED] RowView}).
+ */
+ protected TableRow createTableRow(Element el)
+ {
+ return new RowView(el);
+ }
+
+ /**
+ * Loads the children of the Table. This completely bypasses the ViewFactory
+ * and creates instances of TableRow instead.
+ *
+ * @param vf ignored
+ */
+ protected void loadChildren(ViewFactory vf)
+ {
+ Element el = getElement();
+ int numChildren = el.getElementCount();
+ View[] rows = new View[numChildren];
+ for (int i = 0; i < numChildren; ++i)
+ {
+ rows[i] = createTableRow(el.getElement(i));
+ }
+ replace(0, getViewCount(), rows);
+ }
+}