This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.beans


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch to trunk. This will go into classpath 
soon.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+dehQWSOgCCdjSDsRAi91AJwMgsoswCawGINWJwH+oMUMtB9SbwCeJDkt
5PNM5BeooGRBzO+97QwLmhQ=
=Yjf0
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1780
diff -u -r1.1780 ChangeLog
--- ChangeLog	17 Mar 2003 09:13:15 -0000	1.1780
+++ ChangeLog	17 Mar 2003 15:19:38 -0000
@@ -1,3 +1,20 @@
+2003-03-17  Michael Koch  <konqueror at gmx dot de>
+
+	* java/beans/Beans.java:
+	Explicitely import classes not packages.
+	* java/beans/FeatureDescriptor.java
+	(preferred): New member variable.
+	(isPreferred): New method.
+	(setPreferred): New method.
+	* java/beans/PropertyEditorManager.java:
+	Explicitely import used classes.
+	* java/beans/beancontext/BeanContextChild.java:
+	Added line wrapping.
+	* java/beans/beancontext/BeanContextChildSupport.java:
+	Reindented.
+	* java/beans/beancontext/BeanContextEvent.java:
+	Reindented.
+
 2003-03-17  Michael Koch
 
 	* javax/print/attribute/Attribute.java,
Index: java/beans/Beans.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/Beans.java,v
retrieving revision 1.4
diff -u -r1.4 Beans.java
--- java/beans/Beans.java	27 Feb 2003 10:52:41 -0000	1.4
+++ java/beans/Beans.java	17 Mar 2003 15:19:38 -0000
@@ -38,9 +38,11 @@
 
 package java.beans;
 
-import java.io.*;
-import java.applet.*;
-import gnu.java.io.*;
+import gnu.java.io.ClassLoaderObjectInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.applet.Applet;
 
 /**
  * <code>Beans</code> provides some helper methods that allow the basic
Index: java/beans/FeatureDescriptor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/FeatureDescriptor.java,v
retrieving revision 1.3
diff -u -r1.3 FeatureDescriptor.java
--- java/beans/FeatureDescriptor.java	27 Feb 2003 10:52:41 -0000	1.3
+++ java/beans/FeatureDescriptor.java	17 Mar 2003 15:19:38 -0000
@@ -66,6 +66,7 @@
   String shortDescription;
   boolean expert;
   boolean hidden;
+  boolean preferred;
 
   Hashtable valueHash;
 
@@ -177,6 +178,15 @@
     this.hidden = hidden;
   }
 
+  public boolean isPreferred ()
+  {
+    return preferred;
+  }
+
+  public void setPreferred (boolean preferred)
+  {
+    this.preferred = preferred;
+  }
 
   /**
    * Get an arbitrary value set with setValue().
Index: java/beans/PropertyEditorManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/PropertyEditorManager.java,v
retrieving revision 1.3
diff -u -r1.3 PropertyEditorManager.java
--- java/beans/PropertyEditorManager.java	27 Feb 2003 10:52:41 -0000	1.3
+++ java/beans/PropertyEditorManager.java	17 Mar 2003 15:19:38 -0000
@@ -39,6 +39,18 @@
 package java.beans;
 
 import gnu.java.lang.ClassHelper;
+import gnu.java.beans.editors.ColorEditor;
+import gnu.java.beans.editors.FontEditor;
+import gnu.java.beans.editors.NativeBooleanEditor;
+import gnu.java.beans.editors.NativeByteEditor;
+import gnu.java.beans.editors.NativeDoubleEditor;
+import gnu.java.beans.editors.NativeFloatEditor;
+import gnu.java.beans.editors.NativeIntEditor;
+import gnu.java.beans.editors.NativeLongEditor;
+import gnu.java.beans.editors.NativeShortEditor;
+import gnu.java.beans.editors.StringEditor;
+import java.awt.Color;
+import java.awt.Font;
 
 /**
  * PropertyEditorManager is used to find property editors
@@ -70,20 +82,21 @@
 public class PropertyEditorManager
 {
   static java.util.Hashtable editors = new java.util.Hashtable();
-  static String[] editorSearchPath = {"gnu.java.beans.editors","sun.beans.editors"};
+  static String[] editorSearchPath = { "gnu.java.beans.editors",
+                                       "sun.beans.editors" };
 
   static
     {
-      registerEditor(java.lang.Boolean.TYPE, gnu.java.beans.editors.NativeBooleanEditor.class);
-      registerEditor(java.lang.Byte.TYPE,    gnu.java.beans.editors.NativeByteEditor.class);
-      registerEditor(java.lang.Short.TYPE,   gnu.java.beans.editors.NativeShortEditor.class);
-      registerEditor(java.lang.Integer.TYPE, gnu.java.beans.editors.NativeIntEditor.class);
-      registerEditor(java.lang.Long.TYPE,    gnu.java.beans.editors.NativeLongEditor.class);
-      registerEditor(java.lang.Float.TYPE,   gnu.java.beans.editors.NativeFloatEditor.class);
-      registerEditor(java.lang.Double.TYPE,  gnu.java.beans.editors.NativeDoubleEditor.class);
-      registerEditor(java.lang.String.class, gnu.java.beans.editors.StringEditor.class);
-      registerEditor(java.awt.Color.class,   gnu.java.beans.editors.ColorEditor.class);
-      registerEditor(java.awt.Font.class,    gnu.java.beans.editors.FontEditor.class);
+      registerEditor(Boolean.TYPE, NativeBooleanEditor.class);
+      registerEditor(Byte.TYPE,    NativeByteEditor.class);
+      registerEditor(Short.TYPE,   NativeShortEditor.class);
+      registerEditor(Integer.TYPE, NativeIntEditor.class);
+      registerEditor(Long.TYPE,    NativeLongEditor.class);
+      registerEditor(Float.TYPE,   NativeFloatEditor.class);
+      registerEditor(Double.TYPE,  NativeDoubleEditor.class);
+      registerEditor(String.class, StringEditor.class);
+      registerEditor(Color.class,  ColorEditor.class);
+      registerEditor(Font.class,   FontEditor.class);
     }
 
   /**
Index: java/beans/beancontext/BeanContextChild.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/beancontext/BeanContextChild.java,v
retrieving revision 1.2
diff -u -r1.2 BeanContextChild.java
--- java/beans/beancontext/BeanContextChild.java	22 Jan 2002 22:40:12 -0000	1.2
+++ java/beans/beancontext/BeanContextChild.java	17 Mar 2003 15:19:38 -0000
@@ -43,7 +43,8 @@
 import java.beans.PropertyVetoException;
 
 /**
- * Beans implement this to get information about the execution environment and its services and to be placed in the hierarchy.
+ * Beans implement this to get information about the execution environment and
+ * its services and to be placed in the hierarchy.
  * <P>
  *
  * The difference between a <code>BeanContext</code> and a
Index: java/beans/beancontext/BeanContextChildSupport.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/beancontext/BeanContextChildSupport.java,v
retrieving revision 1.3
diff -u -r1.3 BeanContextChildSupport.java
--- java/beans/beancontext/BeanContextChildSupport.java	4 Oct 2002 08:48:01 -0000	1.3
+++ java/beans/beancontext/BeanContextChildSupport.java	17 Mar 2003 15:19:38 -0000
@@ -56,7 +56,7 @@
  *           behavior.  If there are problems, let me know.
  *
  * @author John Keiser
- * @since JDK1.2
+ * @since 1.2
  * @see java.beans.beancontext.BeanContextChild
  */
 
@@ -97,14 +97,14 @@
 	 */
 	protected VetoableChangeSupport vcSupport;
 
-
 	/**
 	 * Create a new <code>BeanContextChildSupport</code> with itself as the peer.
 	 * This is meant to be used when you subclass
 	 * <code>BeanContextChildSupport</code> to create your child.
 	 */
-	public BeanContextChildSupport() {
-		this(null);
+	public BeanContextChildSupport()
+  {
+		this (null);
 	};
 
 	/**
@@ -112,14 +112,16 @@
 	 * @param peer the peer to use, or <code>null</code> to specify
 	 *        <code>this</code>.
 	 */
-	public BeanContextChildSupport(BeanContextChild peer) {
-		if(peer == null) {
-			peer = this;
-		}
+	public BeanContextChildSupport (BeanContextChild peer)
+  {
+		if (peer == null)
+      {
+        peer = this;
+      }
 
 		beanContextChildPeer = peer;
-		pcSupport = new PropertyChangeSupport(peer);
-		vcSupport = new VetoableChangeSupport(peer);
+		pcSupport = new PropertyChangeSupport (peer);
+		vcSupport = new VetoableChangeSupport (peer);
 	}
 
 	/**
@@ -178,34 +180,42 @@
 	 *            <code>BeanContextChild</code> implementor does not
 	 *            wish to have its parent changed.
 	 */
-	public void setBeanContext(BeanContext newBeanContext)
-		throws PropertyVetoException {
-		synchronized(beanContextChildPeer) {
-			if(newBeanContext == beanContext)
-				return;
-
-			if(!rejectedSetBCOnce) {
-				if(!validatePendingSetBeanContext(newBeanContext)) {
-					rejectedSetBCOnce = true;
-					throw new PropertyVetoException("validatePendingSetBeanContext() rejected change",
-						new PropertyChangeEvent(beanContextChildPeer, "beanContext", beanContext, newBeanContext));
-				}
-				try {
-					fireVetoableChange("beanContext", beanContext, newBeanContext);
-				} catch(PropertyVetoException e) {
-					rejectedSetBCOnce = true;
-					throw e;
-				}
-			}
+  public void setBeanContext(BeanContext newBeanContext)
+    throws PropertyVetoException
+  {
+    synchronized (beanContextChildPeer)
+      {
+        if (newBeanContext == beanContext)
+          return;
+
+        if (!rejectedSetBCOnce)
+          {
+            if (!validatePendingSetBeanContext (newBeanContext))
+              {
+                rejectedSetBCOnce = true;
+                throw new PropertyVetoException ("validatePendingSetBeanContext() rejected change",
+                                                 new PropertyChangeEvent(beanContextChildPeer, "beanContext", beanContext, newBeanContext));
+              }
+            
+            try
+              {
+                fireVetoableChange ("beanContext", beanContext, newBeanContext);
+              }
+            catch (PropertyVetoException e)
+              {
+                rejectedSetBCOnce = true;
+                throw e;
+              }
+          }
 
-			releaseBeanContextResources();
+			releaseBeanContextResources ();
 
 			beanContext = newBeanContext;
 			rejectedSetBCOnce = false;
 
-			firePropertyChange("beanContext", beanContext, newBeanContext);
+			firePropertyChange ("beanContext", beanContext, newBeanContext);
 
-			initializeBeanContextResources();
+			initializeBeanContextResources ();
 		}
 	}
 
@@ -213,7 +223,8 @@
 	 * Get the parent <code>BeanContext</code>.
 	 * @return the parent <code>BeanContext</code>.
 	 */
-	public BeanContext getBeanContext() {
+	public BeanContext getBeanContext()
+  {
 		return beanContext;
 	}
 
Index: java/beans/beancontext/BeanContextEvent.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/beancontext/BeanContextEvent.java,v
retrieving revision 1.2
diff -u -r1.2 BeanContextEvent.java
--- java/beans/beancontext/BeanContextEvent.java	22 Jan 2002 22:40:12 -0000	1.2
+++ java/beans/beancontext/BeanContextEvent.java	17 Mar 2003 15:19:38 -0000
@@ -47,7 +47,8 @@
  * @since JDK1.2
  */
 
-public abstract class BeanContextEvent extends EventObject {
+public abstract class BeanContextEvent extends EventObject
+{
 	/**
 	 * The <code>BeanContext</code> that most recently passed this
 	 * event on.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]