--- a/jdk/make/common/Demo.gmk Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/make/common/Demo.gmk Mon Jan 24 13:21:20 2011 -0800
@@ -73,8 +73,11 @@
# Destination "src" directory
DEMO_BUILD_SRCDIR = $(DEMO_BUILD_AREA)/src
-DEMO_BUILD_SRCZIP = $(DEMO_BUILD_AREA)/src.zip
-DEMO_SOURCE_ZIP = $(DEMO_DESTDIR)/src.zip
+
+ifndef DEMO_SKIP_SRCZIP
+ DEMO_BUILD_SRCZIP = $(DEMO_BUILD_AREA)/src.zip
+ DEMO_SOURCE_ZIP = $(DEMO_DESTDIR)/src.zip
+endif
# Place to hold the jar image we are creating
DEMO_JAR_IMAGE = $(DEMO_BUILD_AREA)/jar_image
@@ -258,14 +261,16 @@
endif
-# Create a src.zip file
-$(DEMO_BUILD_SRCZIP): $(DEMO_FULL_SOURCES)
+ifndef DEMO_SKIP_SRCZIP
+ # Create a src.zip file
+ $(DEMO_BUILD_SRCZIP): $(DEMO_FULL_SOURCES)
@$(prep-target)
$(CD) $(DEMO_BUILD_AREA)/src && $(ZIPEXE) -q -r ../$(@F) .
-# Install the destination src.zip file and create the src tree
-$(DEMO_SOURCE_ZIP): $(DEMO_BUILD_SRCZIP)
+ # Install the destination src.zip file and create the src tree
+ $(DEMO_SOURCE_ZIP): $(DEMO_BUILD_SRCZIP)
$(install-file)
+endif
# Native library building
ifdef DEMO_LIBRARY
@@ -362,7 +367,7 @@
$(RM) -r $(DEMO_BUILD_AREA)
$(RM) -r $(DEMO_DESTDIR)
-# This should not be needed, but some versions of GNU amke have a bug that
+# This should not be needed, but some versions of GNU make have a bug that
# sometimes deleted these files for some strange and unknown reason
# (GNU make version 3.78.1 has the problem, GNU make version 3.80 doesn't?)
.PRECIOUS: $(DEMO_FULL_SOURCES) $(DEMO_BUILD_SRCZIP) $(DEMO_SOURCE_ZIP)
--- a/jdk/make/mkdemo/jfc/Makefile Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/make/mkdemo/jfc/Makefile Mon Jan 24 13:21:20 2011 -0800
@@ -43,7 +43,7 @@
# Some demos aren't currently included in OpenJDK
ifndef OPENJDK
- SUBDIRS += Java2D SwingSet2 Stylepad
+ SUBDIRS += Java2D SwingSet2 SwingSet3 Stylepad
endif
include $(BUILDDIR)/common/Subdirs.gmk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/mkdemo/jfc/SwingSet3/Makefile Mon Jan 24 13:21:20 2011 -0800
@@ -0,0 +1,43 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile to build the SwingSet3 demo.
+#
+
+BUILDDIR = ../../..
+PRODUCT = demo/jfc
+DEMONAME = SwingSet3
+include $(BUILDDIR)/common/Defs.gmk
+
+DEMO_ROOT = $(CLOSED_SRC)/share/demo/jfc/$(DEMONAME)
+DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
+DEMO_TOPFILES = ./readme.html ./swingset3.png
+DEMO_SKIP_SRCZIP = true
+
+#
+# Demo jar building rules.
+#
+include $(BUILDDIR)/common/Demo.gmk
--- a/jdk/src/share/classes/javax/swing/AbstractButton.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/AbstractButton.java Mon Jan 24 13:21:20 2011 -0800
@@ -1335,7 +1335,6 @@
*
* @param a the button's action
* @since 1.3
- * @see <a href="#actions">Actions</a>
* @see Action
* @see #setAction
*/
--- a/jdk/src/share/classes/javax/swing/JEditorPane.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/JEditorPane.java Mon Jan 24 13:21:20 2011 -0800
@@ -145,8 +145,8 @@
* <li>
* One way is to specify the character set as a parameter of the MIME
* type. This will be established by a call to the
- * <a href="#setContentType">setContentType</a> method. If the content
- * is loaded by the <a href="#setPage">setPage</a> method the content
+ * {@link #setContentType setContentType} method. If the content
+ * is loaded by the {@link #setPage setPage} method the content
* type will have been set according to the specification of the URL.
* It the file is loaded directly, the content type would be expected to
* have been set prior to loading.
--- a/jdk/src/share/classes/javax/swing/JFileChooser.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/JFileChooser.java Mon Jan 24 13:21:20 2011 -0800
@@ -256,10 +256,6 @@
private FileView fileView = null;
- // uiFileView is not serialized, as it is initialized
- // by updateUI() after deserialization
- private transient FileView uiFileView = null;
-
private boolean controlsShown = true;
private boolean useFileHiding = true;
@@ -1504,6 +1500,9 @@
if(getFileView() != null) {
filename = getFileView().getName(f);
}
+
+ FileView uiFileView = getUI().getFileView(this);
+
if(filename == null && uiFileView != null) {
filename = uiFileView.getName(f);
}
@@ -1524,6 +1523,9 @@
if(getFileView() != null) {
description = getFileView().getDescription(f);
}
+
+ FileView uiFileView = getUI().getFileView(this);
+
if(description == null && uiFileView != null) {
description = uiFileView.getDescription(f);
}
@@ -1544,6 +1546,9 @@
if(getFileView() != null) {
typeDescription = getFileView().getTypeDescription(f);
}
+
+ FileView uiFileView = getUI().getFileView(this);
+
if(typeDescription == null && uiFileView != null) {
typeDescription = uiFileView.getTypeDescription(f);
}
@@ -1564,6 +1569,9 @@
if(getFileView() != null) {
icon = getFileView().getIcon(f);
}
+
+ FileView uiFileView = getUI().getFileView(this);
+
if(icon == null && uiFileView != null) {
icon = uiFileView.getIcon(f);
}
@@ -1584,6 +1592,9 @@
if (getFileView() != null) {
traversable = getFileView().isTraversable(f);
}
+
+ FileView uiFileView = getUI().getFileView(this);
+
if (traversable == null && uiFileView != null) {
traversable = uiFileView.isTraversable(f);
}
@@ -1791,7 +1802,6 @@
}
setUI(ui);
- uiFileView = getUI().getFileView(this);
if(isAcceptAllFileFilterUsed()) {
addChoosableFileFilter(getAcceptAllFileFilter());
}
--- a/jdk/src/share/classes/javax/swing/SizeSequence.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/SizeSequence.java Mon Jan 24 13:21:20 2011 -0800
@@ -132,7 +132,7 @@
* can use <code>insertEntries</code> or <code>setSizes</code>.
*
* @see #insertEntries
- * @see #setSizes
+ * @see #setSizes(int[])
*/
public SizeSequence() {
a = emptyArray;
--- a/jdk/src/share/classes/javax/swing/TransferHandler.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/TransferHandler.java Mon Jan 24 13:21:20 2011 -0800
@@ -344,7 +344,7 @@
*
* @return the drop location
* @throws IllegalStateException if this is not a drop
- * @see #isDrop
+ * @see #isDrop()
*/
public DropLocation getDropLocation() {
assureIsDrop();
@@ -380,7 +380,7 @@
*
* @param showDropLocation whether or not to indicate the drop location
* @throws IllegalStateException if this is not a drop
- * @see #isDrop
+ * @see #isDrop()
*/
public void setShowDropLocation(boolean showDropLocation) {
assureIsDrop();
@@ -406,7 +406,7 @@
* @see #getDropAction
* @see #getUserDropAction
* @see #getSourceDropActions
- * @see #isDrop
+ * @see #isDrop()
*/
public void setDropAction(int dropAction) {
assureIsDrop();
@@ -440,7 +440,7 @@
* @throws IllegalStateException if this is not a drop
* @see #setDropAction
* @see #getUserDropAction
- * @see #isDrop
+ * @see #isDrop()
*/
public int getDropAction() {
return dropAction == -1 ? getUserDropAction() : dropAction;
@@ -468,7 +468,7 @@
* @throws IllegalStateException if this is not a drop
* @see #setDropAction
* @see #getDropAction
- * @see #isDrop
+ * @see #isDrop()
*/
public int getUserDropAction() {
assureIsDrop();
@@ -501,7 +501,7 @@
*
* @return the drag source's supported drop actions
* @throws IllegalStateException if this is not a drop
- * @see #isDrop
+ * @see #isDrop()
*/
public int getSourceDropActions() {
assureIsDrop();
--- a/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java Mon Jan 24 13:21:20 2011 -0800
@@ -32,8 +32,7 @@
* equivalent to the WindowAdapter class in the AWT.
* <p>
* See <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/internalframelistener.html">How to Write an Internal Frame Listener</a>
- * in <em>The Java Tutorial</em> and
- * <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">The Java Class Libraries (update)</a>
+ * in <em>The Java Tutorial</em>
*
* @see InternalFrameEvent
* @see InternalFrameListener
--- a/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java Mon Jan 24 13:21:20 2011 -0800
@@ -33,9 +33,7 @@
* in the AWT.
* <p>
* See <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/internalframelistener.html">How to Write an Internal Frame Listener</a>
- * in <em>The Java Tutorial</em> and
- * <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">The Java Class Libraries (update)</a>
- * for further documentation.
+ * in <em>The Java Tutorial</em> for further documentation.
*
* @see java.awt.event.WindowListener
*
--- a/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html Mon Jan 24 13:21:20 2011 -0800
@@ -66,7 +66,7 @@
Before reading further, you should be familiar
with the concept of pluggable look and feels.
For basic information, see
-<a href="http://java.sun.com/docs/books/tutorial/uiswing/start/swingTour.html#plaf">Choosing the Look and Feel</a>,
+<a href="http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html">How to Set the Look and Feel</a>,
a section in
<em>The Java Tutorial</em>.
For architectural details, you can read
--- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html Mon Jan 24 13:21:20 2011 -0800
@@ -91,7 +91,7 @@
<div class="dtd-fragment">
<pre class="dtd-fragment">
<!ELEMENT <a name="e.style">style</a> (<a href="#e.property">property</a> | <a href="#e.defaultsProperty">defaultsProperty</a> | <a href="#e.state">state</a> | <a href="#e.font">font</a> | <a href="#e.graphicsUtils">graphicsUtils</a> |
- <a href="#e.insets">insets</a> | <a href="#e.painter">painter</a> | <a href="#e.imagePainter">imagePainter</a> | <a href="#e.opaque">opaque</a> | (<a href="#beansPersistance">%beansPersistance;</a>) |
+ <a href="#e.insets">insets</a> | <a href="#e.painter">painter</a> | <a href="#e.imagePainter">imagePainter</a> | <a href="#e.opaque">opaque</a> | (<a href="#ee.beansPersistance">%beansPersistance;</a>) |
<a href="#e.imageIcon">imageIcon</a>)*>
<!ATTLIST style
<a href="#style.id">id</a> ID #IMPLIED
@@ -250,8 +250,8 @@
<p>
Defines the font for the current <a href="#e.state">state</a>,
or <a href="#e.style">style</a>. You must
- specify either an <a href="#state.idref">idref</a> or a
- <a href="#state.name">name</a> and <a href="#state.size">size</a>.
+ specify either an <a href="#font.idref">idref</a> or a
+ <a href="#font.name">name</a> and <a href="#font.size">size</a>.
</p>
<p>
The following example creates a style with a Font of
@@ -797,7 +797,7 @@
<a href="#imagePainter.path">path</a> CDATA #REQUIRED
<a href="#imagePainter.sourceInsets">sourceInsets</a> CDATA #IMPLIED
<a href="#imagePainter.destinationInsets">destinationInsets</a> CDATA #IMPLIED
- <a href="#imagePainter.paintCenter">paintCenter</a> (true|false) "true"
+ <a href="#imagePainter.painterCenter">paintCenter</a> (true|false) "true"
<a href="#imagePainter.stretch">stretch</a> (true|false) "true"
<a href="#imagePainter.center">center</a> (true|false) "false"
>
--- a/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java Mon Jan 24 13:21:20 2011 -0800
@@ -384,7 +384,7 @@
/**
* Loads all of the children to initialize the view.
- * This is called by the <a href="#setParent">setParent</a>
+ * This is called by the {@link #setParent setParent}
* method. Subclasses can reimplement this to initialize
* their child views in a different manner. The default
* implementation creates a child view for each
--- a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java Mon Jan 24 13:21:20 2011 -0800
@@ -70,7 +70,7 @@
* will render a solid color as specified in the associated text component
* in the <code>SelectionColor</code> property. This can easily be changed
* by reimplementing the
- * <a href="#getSelectionHighlighter">getSelectionHighlighter</a>
+ * {@link #getSelectionPainter getSelectionPainter}
* method.
* <p>
* A customized caret appearance can be achieved by reimplementing
--- a/jdk/src/share/classes/javax/swing/text/TableView.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/TableView.java Mon Jan 24 13:21:20 2011 -0800
@@ -315,7 +315,7 @@
* updated along the minor axis.
* <p>
* This is implemented to call the
- * <a href="#layoutColumns">layoutColumns</a> method, and then
+ * {@link #layoutColumns layoutColumns} method, and then
* forward to the superclass to actually carry out the layout
* of the tables rows.
*
--- a/jdk/src/share/classes/javax/swing/text/View.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/View.java Mon Jan 24 13:21:20 2011 -0800
@@ -117,7 +117,7 @@
what it is prepared to deal with.
<li>The coordinate system is the same as the hosting <code>Component</code>
(i.e. the <code>Component</code> returned by the
- <a href="#getContainer">getContainer</a> method).
+ {@link #getContainer getContainer} method).
This means a child view lives in the same coordinate system as the parent
view unless the parent has explicitly changed the coordinate system.
To schedule itself to be repainted a view can call repaint on the hosting
@@ -180,9 +180,9 @@
starting from the root of the view hierarchy.
The methods for doing this are:
<ul>
- <li><a href="#insertUpdate">insertUpdate</a>
- <li><a href="#removeUpdate">removeUpdate</a>
- <li><a href="#changedUpdate">changedUpdate</a>
+ <li>{@link #insertUpdate insertUpdate}
+ <li>{@link #removeUpdate removeUpdate}
+ <li>{@link #changedUpdate changedUpdate}
</ul>
<p>
</dl>
@@ -497,6 +497,10 @@
public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a,
int direction, Position.Bias[] biasRet)
throws BadLocationException {
+ if (pos < -1) {
+ // -1 is a reserved value, see the code below
+ throw new BadLocationException("Invalid position", pos);
+ }
biasRet[0] = Position.Bias.Forward;
switch (direction) {
@@ -670,15 +674,15 @@
* spread out into the following calls that subclasses can
* reimplement:
* <ol>
- * <li><a href="#updateChildren">updateChildren</a> is called
+ * <li>{@link #updateChildren updateChildren} is called
* if there were any changes to the element this view is
* responsible for. If this view has child views that are
* represent the child elements, then this method should do
* whatever is necessary to make sure the child views correctly
* represent the model.
- * <li><a href="#forwardUpdate">forwardUpdate</a> is called
+ * <li>{@link #forwardUpdate forwardUpdate} is called
* to forward the DocumentEvent to the appropriate child views.
- * <li><a href="#updateLayout">updateLayout</a> is called to
+ * <li>{@link #updateLayout updateLayout} is called to
* give the view a chance to either repair its layout, to reschedule
* layout, or do nothing.
* </ol>
@@ -711,15 +715,15 @@
* spread out into the following calls that subclasses can
* reimplement:
* <ol>
- * <li><a href="#updateChildren">updateChildren</a> is called
+ * <li>{@link #updateChildren updateChildren} is called
* if there were any changes to the element this view is
* responsible for. If this view has child views that are
* represent the child elements, then this method should do
* whatever is necessary to make sure the child views correctly
* represent the model.
- * <li><a href="#forwardUpdate">forwardUpdate</a> is called
+ * <li>{@link #forwardUpdate forwardUpdate} is called
* to forward the DocumentEvent to the appropriate child views.
- * <li><a href="#updateLayout">updateLayout</a> is called to
+ * <li>{@link #updateLayout updateLayout} is called to
* give the view a chance to either repair its layout, to reschedule
* layout, or do nothing.
* </ol>
@@ -752,15 +756,15 @@
* spread out into the following calls that subclasses can
* reimplement:
* <ol>
- * <li><a href="#updateChildren">updateChildren</a> is called
+ * <li>{@link #updateChildren updateChildren} is called
* if there were any changes to the element this view is
* responsible for. If this view has child views that are
* represent the child elements, then this method should do
* whatever is necessary to make sure the child views correctly
* represent the model.
- * <li><a href="#forwardUpdate">forwardUpdate</a> is called
+ * <li>{@link #forwardUpdate forwardUpdate} is called
* to forward the DocumentEvent to the appropriate child views.
- * <li><a href="#updateLayout">updateLayout</a> is called to
+ * <li>{@link #updateLayout updateLayout} is called to
* give the view a chance to either repair its layout, to reschedule
* layout, or do nothing.
* </ol>
@@ -1186,7 +1190,7 @@
* simply messages the view with a call to <code>insertUpdate</code>,
* <code>removeUpdate</code>, or <code>changedUpdate</code> depending
* upon the type of the event. This is called by
- * <a href="#forwardUpdate">forwardUpdate</a> to forward
+ * {@link #forwardUpdate forwardUpdate} to forward
* the event to children that need it.
*
* @param v the child view to forward the event to
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Mon Jan 24 13:21:20 2011 -0800
@@ -123,7 +123,7 @@
* to load. By default, this kit produces documents that will be
* loaded asynchronously if loaded using <code>JEditorPane.setPage</code>.
* This is controlled by a property on the document. The method
- * <a href="#createDefaultDocument">createDefaultDocument</a> can
+ * {@link #createDefaultDocument createDefaultDocument} can
* be overriden to change this. The batching of work is done
* by the <code>HTMLDocument.HTMLReader</code> class. The actual
* work is done by the <code>DefaultStyledDocument</code> and
@@ -558,7 +558,7 @@
* automatically or only <code>FormSubmitEvent</code> is fired.
* By default it is set to true.
*
- * @see #isAutoFormSubmission
+ * @see #isAutoFormSubmission()
* @see FormSubmitEvent
* @since 1.5
*/
--- a/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java Mon Jan 24 13:21:20 2011 -0800
@@ -61,7 +61,7 @@
* <p>
* This is implemented
* to forward to the superclass as well as call the
- * <a href="#setPropertiesFromAttributes">setPropertiesFromAttributes</a>
+ * {@link #setPropertiesFromAttributes setPropertiesFromAttributes}
* method to set the paragraph properties from the css
* attributes. The call is made at this time to ensure
* the ability to resolve upward through the parents
--- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java Mon Jan 24 13:21:20 2011 -0800
@@ -51,7 +51,7 @@
* <p>
* The primary entry point for HTML View implementations
* to get their attributes is the
- * <a href="#getViewAttributes">getViewAttributes</a>
+ * {@link #getViewAttributes getViewAttributes}
* method. This should be implemented to establish the
* desired policy used to associate attributes with the view.
* Each HTMLEditorKit (i.e. and therefore each associated
--- a/jdk/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java Mon Jan 24 13:20:07 2011 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java Mon Jan 24 13:21:20 2011 -0800
@@ -48,7 +48,11 @@
private static final Object DTD_KEY = new Object();
- protected static synchronized void setDefaultDTD() {
+ protected static void setDefaultDTD() {
+ getDefaultDTD();
+ }
+
+ private static synchronized DTD getDefaultDTD() {
AppContext appContext = AppContext.getAppContext();
DTD dtd = (DTD) appContext.get(DTD_KEY);
@@ -67,6 +71,8 @@
appContext.put(DTD_KEY, dtd);
}
+
+ return dtd;
}
protected static DTD createDTD(DTD dtd, String name) {
@@ -92,7 +98,7 @@
}
public void parse(Reader r, HTMLEditorKit.ParserCallback cb, boolean ignoreCharSet) throws IOException {
- new DocumentParser((DTD) AppContext.getAppContext().get(DTD_KEY)).parse(r, cb, ignoreCharSet);
+ new DocumentParser(getDefaultDTD()).parse(r, cb, ignoreCharSet);
}
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/6342301/bug6342301.java Mon Jan 24 13:21:20 2011 -0800
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ @bug 6342301
+ @summary Bad interaction between setting the ui and file filters in JFileChooser
+ @author Pavel Porvatov
+*/
+
+import javax.swing.*;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.metal.MetalFileChooserUI;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import java.io.File;
+
+public class bug6342301 {
+ private static String tempDir;
+
+ public static void main(String[] args) throws Exception {
+ tempDir = System.getProperty("java.io.tmpdir");
+
+ if (tempDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
+ tempDir = System.getProperty("user.home");
+ }
+
+ System.out.println("Temp directory: " + tempDir);
+
+ UIManager.setLookAndFeel(new MetalLookAndFeel());
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ HackedFileChooser openChooser = new HackedFileChooser();
+
+ openChooser.setUI(new MetalFileChooserUI(openChooser));
+ openChooser.setCurrentDirectory(new File(tempDir));
+ }
+ });
+ }
+
+ private static class HackedFileChooser extends JFileChooser {
+ public void setUI(ComponentUI newUI) {
+ super.setUI(newUI);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JLabel/7004134/bug7004134.java Mon Jan 24 13:21:20 2011 -0800
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ @bug 7004134
+ @summary JLabel containing a ToolTipText does no longer show ToolTip after browser refresh
+ @author Pavel Porvatov
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.MouseEvent;
+import java.lang.reflect.Field;
+
+public class bug7004134 {
+ private static volatile JFrame frame;
+
+ private static volatile JLabel label;
+
+ private static volatile int toolTipWidth;
+
+ public static void main(String[] args) throws Exception {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ label = new JLabel("A JLabel used as object for an HTML-formatted tooltip");
+ label.setToolTipText("<html><body bgcolor=FFFFE1>An HTML-formatted ToolTip</body></html>");
+
+ frame = new JFrame();
+
+ frame.add(label);
+ frame.pack();
+ frame.setVisible(true);
+
+ ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
+
+ toolTipManager.setInitialDelay(0);
+ toolTipManager.mouseMoved(new MouseEvent(label, 0, 0, 0, 0, 0, 0, false));
+ }
+ });
+
+ Thread.sleep(500);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ toolTipWidth = getTipWindow().getWidth();
+
+ frame.dispose();
+ }
+ });
+
+ Thread thread = new Thread(new ThreadGroup("Some ThreadGroup"), new Runnable() {
+ public void run() {
+ SunToolkit.createNewAppContext();
+
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame = new JFrame();
+
+ frame.add(label);
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.pack();
+ frame.setVisible(true);
+
+ ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
+
+ toolTipManager.setInitialDelay(0);
+ toolTipManager.mouseMoved(new MouseEvent(label, 0, 0, 0, 0, 0, 0, false));
+ }
+ });
+
+ Thread.sleep(500);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ int newToolTipWidth = getTipWindow().getWidth();
+
+ frame.dispose();
+
+ if (toolTipWidth != newToolTipWidth) {
+ throw new RuntimeException("Tooltip width is different. Initial: " + toolTipWidth +
+ ", new: " + newToolTipWidth);
+ }
+ }
+ });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+ });
+
+ thread.start();
+ thread.join();
+ }
+
+ private static Component getTipWindow() {
+ try {
+ Field tipWindowField = ToolTipManager.class.getDeclaredField("tipWindow");
+
+ tipWindowField.setAccessible(true);
+
+ Popup value = (Popup) tipWindowField.get(ToolTipManager.sharedInstance());
+
+ Field componentField = Popup.class.getDeclaredField("component");
+
+ componentField.setAccessible(true);
+
+ return (Component) componentField.get(value);
+ } catch (Exception e) {
+ throw new RuntimeException("getToolTipComponent failed", e);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/NavigationFilter/6735293/bug6735293.java Mon Jan 24 13:21:20 2011 -0800
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6735293
+ * @summary javax.swing.text.NavigationFilter.getNextVisualPositionFrom() not always throws BadLocationException
+ * @author Pavel Porvatov
+ */
+
+import javax.swing.*;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.NavigationFilter;
+import javax.swing.text.Position;
+
+public class bug6735293 {
+ private static volatile JFormattedTextField jtf;
+
+ private static volatile NavigationFilter nf;
+
+ private static volatile JFrame jFrame;
+
+ public static void main(String[] args) throws Exception {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ jtf = new JFormattedTextField();
+ nf = new NavigationFilter();
+ jtf.setText("A text message");
+
+ jFrame = new JFrame();
+ jFrame.getContentPane().add(jtf);
+ jFrame.pack();
+ jFrame.setVisible(true);
+ }
+ });
+
+ Thread.sleep(1000);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ Position.Bias[] biasRet = {Position.Bias.Forward};
+
+ for (int direction : new int[]{
+ SwingConstants.EAST,
+ SwingConstants.WEST,
+ // the following constants still will lead to "BadLocationException: Length must be positive"
+ SwingConstants.SOUTH,
+ SwingConstants.NORTH,
+ }) {
+ for (int position : new int[]{-100, Integer.MIN_VALUE}) {
+ for (Position.Bias bias : new Position.Bias[]{Position.Bias.Backward, Position.Bias.Forward}) {
+ try {
+ nf.getNextVisualPositionFrom(jtf, position, bias, direction, biasRet);
+
+ throw new RuntimeException("BadLocationException was not thrown: position = " +
+ position + ", bias = " + bias + ", direction = " + direction);
+ } catch (BadLocationException e) {
+ // Ok
+ }
+ }
+ }
+ }
+
+ jFrame.dispose();
+ }
+ });
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/html/parser/Parser/6990651/bug6990651.java Mon Jan 24 13:21:20 2011 -0800
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ @bug 6990651
+ @summary Regression: NPE when refreshing applet since 6u22-b01
+ @author Pavel Porvatov
+*/
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+
+public class bug6990651 {
+ private static volatile JEditorPane editor;
+
+ public static void main(String[] args) throws Exception {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ editor = new JEditorPane("text/html", "Hello world!");
+ }
+ });
+
+ Thread thread = new Thread(new ThreadGroup("Some ThreadGroup"), new Runnable() {
+ public void run() {
+ SunToolkit.createNewAppContext();
+
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ editor.setText("Hello world!");
+ }
+ });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+ });
+
+ thread.start();
+ thread.join();
+ }
+}