mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 03:56:43 +08:00
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
This commit is contained in:
parent
2ff04cc63a
commit
6d04746832
@ -1,3 +1,20 @@
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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().
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
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 @@ public class BeanContextChildSupport
|
||||
* Get the parent <code>BeanContext</code>.
|
||||
* @return the parent <code>BeanContext</code>.
|
||||
*/
|
||||
public BeanContext getBeanContext() {
|
||||
public BeanContext getBeanContext()
|
||||
{
|
||||
return beanContext;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user