Beans.java: Explicitely import classes not packages.
authorMichael Koch <konqueror@gmx.de>
Mon, 17 Mar 2003 15:21:45 +0000 (15:21 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Mon, 17 Mar 2003 15:21:45 +0000 (15:21 +0000)
2003-03-17  Michael Koch  <konqueror@gmx.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.

From-SVN: r64486

libjava/ChangeLog
libjava/java/beans/Beans.java
libjava/java/beans/FeatureDescriptor.java
libjava/java/beans/PropertyEditorManager.java
libjava/java/beans/beancontext/BeanContextChild.java
libjava/java/beans/beancontext/BeanContextChildSupport.java
libjava/java/beans/beancontext/BeanContextEvent.java

index f08f4f8..31ad7be 100644 (file)
@@ -1,5 +1,22 @@
 2003-03-17  Michael Koch  <konqueror@gmx.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  <konqueror@gmx.de>
+
        * java/awt/Dialog.java
        (Dialog): New constructor, changed implementations, added
        documentation.
index aa52c03..7ee0522 100644 (file)
@@ -38,9 +38,11 @@ exception statement from your version. */
 
 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 90a3c15..32f54a4 100644 (file)
@@ -66,6 +66,7 @@ public class FeatureDescriptor
   String shortDescription;
   boolean expert;
   boolean hidden;
+  boolean preferred;
 
   Hashtable valueHash;
 
@@ -177,6 +178,15 @@ public class FeatureDescriptor
     this.hidden = hidden;
   }
 
+  public boolean isPreferred ()
+  {
+    return preferred;
+  }
+
+  public void setPreferred (boolean preferred)
+  {
+    this.preferred = preferred;
+  }
 
   /**
    * Get an arbitrary value set with setValue().
index 4bd4a9f..cb03563 100644 (file)
@@ -39,6 +39,18 @@ exception statement from your version. */
 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 @@ import gnu.java.lang.ClassHelper;
 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 c3f4f00..ef2b7b3 100644 (file)
@@ -43,7 +43,8 @@ import java.beans.VetoableChangeListener;
 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 270854b..ea48cf2 100644 (file)
@@ -56,7 +56,7 @@ import java.io.Serializable;
  *           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 @@ public class BeanContextChildSupport
         */
        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 @@ public class BeanContextChildSupport
         * @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 @@ public class BeanContextChildSupport
         *            <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;
-                               }
-                       }
-
-                       releaseBeanContextResources();
+  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 ();
 
                        beanContext = newBeanContext;
                        rejectedSetBCOnce = false;
 
-                       firePropertyChange("beanContext", beanContext, newBeanContext);
+                       firePropertyChange ("beanContext", beanContext, newBeanContext);
 
-                       initializeBeanContextResources();
+                       initializeBeanContextResources ();
                }
        }
 
@@ -213,7 +223,8 @@ public class BeanContextChildSupport
         * Get the parent <code>BeanContext</code>.
         * @return the parent <code>BeanContext</code>.
         */
-       public BeanContext getBeanContext() {
+       public BeanContext getBeanContext()
+  {
                return beanContext;
        }
 
index e6d8cb2..f93d3fe 100644 (file)
@@ -47,7 +47,8 @@ import java.util.EventObject;
  * @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.