Commit 6d047468 by Michael Koch Committed by Michael Koch

Beans.java: Explicitely import classes not packages.

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
parent 2ff04cc6
2003-03-17 Michael Koch <konqueror@gmx.de> 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 * java/awt/Dialog.java
(Dialog): New constructor, changed implementations, added (Dialog): New constructor, changed implementations, added
documentation. documentation.
......
...@@ -38,9 +38,11 @@ exception statement from your version. */ ...@@ -38,9 +38,11 @@ exception statement from your version. */
package java.beans; package java.beans;
import java.io.*; import gnu.java.io.ClassLoaderObjectInputStream;
import java.applet.*; import java.io.InputStream;
import gnu.java.io.*; import java.io.IOException;
import java.io.ObjectInputStream;
import java.applet.Applet;
/** /**
* <code>Beans</code> provides some helper methods that allow the basic * <code>Beans</code> provides some helper methods that allow the basic
......
...@@ -66,6 +66,7 @@ public class FeatureDescriptor ...@@ -66,6 +66,7 @@ public class FeatureDescriptor
String shortDescription; String shortDescription;
boolean expert; boolean expert;
boolean hidden; boolean hidden;
boolean preferred;
Hashtable valueHash; Hashtable valueHash;
...@@ -177,6 +178,15 @@ public class FeatureDescriptor ...@@ -177,6 +178,15 @@ public class FeatureDescriptor
this.hidden = hidden; this.hidden = hidden;
} }
public boolean isPreferred ()
{
return preferred;
}
public void setPreferred (boolean preferred)
{
this.preferred = preferred;
}
/** /**
* Get an arbitrary value set with setValue(). * Get an arbitrary value set with setValue().
......
...@@ -39,6 +39,18 @@ exception statement from your version. */ ...@@ -39,6 +39,18 @@ exception statement from your version. */
package java.beans; package java.beans;
import gnu.java.lang.ClassHelper; 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 * PropertyEditorManager is used to find property editors
...@@ -70,20 +82,21 @@ import gnu.java.lang.ClassHelper; ...@@ -70,20 +82,21 @@ import gnu.java.lang.ClassHelper;
public class PropertyEditorManager public class PropertyEditorManager
{ {
static java.util.Hashtable editors = new java.util.Hashtable(); 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 static
{ {
registerEditor(java.lang.Boolean.TYPE, gnu.java.beans.editors.NativeBooleanEditor.class); registerEditor(Boolean.TYPE, NativeBooleanEditor.class);
registerEditor(java.lang.Byte.TYPE, gnu.java.beans.editors.NativeByteEditor.class); registerEditor(Byte.TYPE, NativeByteEditor.class);
registerEditor(java.lang.Short.TYPE, gnu.java.beans.editors.NativeShortEditor.class); registerEditor(Short.TYPE, NativeShortEditor.class);
registerEditor(java.lang.Integer.TYPE, gnu.java.beans.editors.NativeIntEditor.class); registerEditor(Integer.TYPE, NativeIntEditor.class);
registerEditor(java.lang.Long.TYPE, gnu.java.beans.editors.NativeLongEditor.class); registerEditor(Long.TYPE, NativeLongEditor.class);
registerEditor(java.lang.Float.TYPE, gnu.java.beans.editors.NativeFloatEditor.class); registerEditor(Float.TYPE, NativeFloatEditor.class);
registerEditor(java.lang.Double.TYPE, gnu.java.beans.editors.NativeDoubleEditor.class); registerEditor(Double.TYPE, NativeDoubleEditor.class);
registerEditor(java.lang.String.class, gnu.java.beans.editors.StringEditor.class); registerEditor(String.class, StringEditor.class);
registerEditor(java.awt.Color.class, gnu.java.beans.editors.ColorEditor.class); registerEditor(Color.class, ColorEditor.class);
registerEditor(java.awt.Font.class, gnu.java.beans.editors.FontEditor.class); registerEditor(Font.class, FontEditor.class);
} }
/** /**
......
...@@ -43,7 +43,8 @@ import java.beans.VetoableChangeListener; ...@@ -43,7 +43,8 @@ import java.beans.VetoableChangeListener;
import java.beans.PropertyVetoException; 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> * <P>
* *
* The difference between a <code>BeanContext</code> and a * The difference between a <code>BeanContext</code> and a
......
...@@ -56,7 +56,7 @@ import java.io.Serializable; ...@@ -56,7 +56,7 @@ import java.io.Serializable;
* behavior. If there are problems, let me know. * behavior. If there are problems, let me know.
* *
* @author John Keiser * @author John Keiser
* @since JDK1.2 * @since 1.2
* @see java.beans.beancontext.BeanContextChild * @see java.beans.beancontext.BeanContextChild
*/ */
...@@ -97,14 +97,14 @@ public class BeanContextChildSupport ...@@ -97,14 +97,14 @@ public class BeanContextChildSupport
*/ */
protected VetoableChangeSupport vcSupport; protected VetoableChangeSupport vcSupport;
/** /**
* Create a new <code>BeanContextChildSupport</code> with itself as the peer. * Create a new <code>BeanContextChildSupport</code> with itself as the peer.
* This is meant to be used when you subclass * This is meant to be used when you subclass
* <code>BeanContextChildSupport</code> to create your child. * <code>BeanContextChildSupport</code> to create your child.
*/ */
public BeanContextChildSupport() { public BeanContextChildSupport()
this(null); {
this (null);
}; };
/** /**
...@@ -112,14 +112,16 @@ public class BeanContextChildSupport ...@@ -112,14 +112,16 @@ public class BeanContextChildSupport
* @param peer the peer to use, or <code>null</code> to specify * @param peer the peer to use, or <code>null</code> to specify
* <code>this</code>. * <code>this</code>.
*/ */
public BeanContextChildSupport(BeanContextChild peer) { public BeanContextChildSupport (BeanContextChild peer)
if(peer == null) { {
if (peer == null)
{
peer = this; peer = this;
} }
beanContextChildPeer = peer; beanContextChildPeer = peer;
pcSupport = new PropertyChangeSupport(peer); pcSupport = new PropertyChangeSupport (peer);
vcSupport = new VetoableChangeSupport(peer); vcSupport = new VetoableChangeSupport (peer);
} }
/** /**
...@@ -179,33 +181,41 @@ public class BeanContextChildSupport ...@@ -179,33 +181,41 @@ public class BeanContextChildSupport
* wish to have its parent changed. * wish to have its parent changed.
*/ */
public void setBeanContext(BeanContext newBeanContext) public void setBeanContext(BeanContext newBeanContext)
throws PropertyVetoException { throws PropertyVetoException
synchronized(beanContextChildPeer) { {
if(newBeanContext == beanContext) synchronized (beanContextChildPeer)
{
if (newBeanContext == beanContext)
return; return;
if(!rejectedSetBCOnce) { if (!rejectedSetBCOnce)
if(!validatePendingSetBeanContext(newBeanContext)) { {
if (!validatePendingSetBeanContext (newBeanContext))
{
rejectedSetBCOnce = true; rejectedSetBCOnce = true;
throw new PropertyVetoException("validatePendingSetBeanContext() rejected change", throw new PropertyVetoException ("validatePendingSetBeanContext() rejected change",
new PropertyChangeEvent(beanContextChildPeer, "beanContext", beanContext, newBeanContext)); new PropertyChangeEvent(beanContextChildPeer, "beanContext", beanContext, newBeanContext));
} }
try {
fireVetoableChange("beanContext", beanContext, newBeanContext); try
} catch(PropertyVetoException e) { {
fireVetoableChange ("beanContext", beanContext, newBeanContext);
}
catch (PropertyVetoException e)
{
rejectedSetBCOnce = true; rejectedSetBCOnce = true;
throw e; throw e;
} }
} }
releaseBeanContextResources(); releaseBeanContextResources ();
beanContext = newBeanContext; beanContext = newBeanContext;
rejectedSetBCOnce = false; rejectedSetBCOnce = false;
firePropertyChange("beanContext", beanContext, newBeanContext); firePropertyChange ("beanContext", beanContext, newBeanContext);
initializeBeanContextResources(); initializeBeanContextResources ();
} }
} }
...@@ -213,7 +223,8 @@ public class BeanContextChildSupport ...@@ -213,7 +223,8 @@ public class BeanContextChildSupport
* Get the parent <code>BeanContext</code>. * Get the parent <code>BeanContext</code>.
* @return the parent <code>BeanContext</code>. * @return the parent <code>BeanContext</code>.
*/ */
public BeanContext getBeanContext() { public BeanContext getBeanContext()
{
return beanContext; return beanContext;
} }
......
...@@ -47,7 +47,8 @@ import java.util.EventObject; ...@@ -47,7 +47,8 @@ import java.util.EventObject;
* @since JDK1.2 * @since JDK1.2
*/ */
public abstract class BeanContextEvent extends EventObject { public abstract class BeanContextEvent extends EventObject
{
/** /**
* The <code>BeanContext</code> that most recently passed this * The <code>BeanContext</code> that most recently passed this
* event on. * event on.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment