On Tue, 2006-08-08 at 17:52 +0200, Jeroen Frijters wrote:
> Jeroen Frijters wrote:
> > Lillian Angel wrote:
> > > On Sat, 2006-08-05 at 11:28 +0200, Jeroen Frijters wrote:
> > > > Hi,
> > > >
> > > > I commented out the GTK specific code in java/awt/Component.java.
> > > > Component cannot have dependencies on any specific type of peer.
> > > >
> > > > Lillian could you please find a generic way to do what is
> > required?
> > > >
> > >
> > > Right now, its not possible to do it another way. I have
> > removed this
> > > code and added a comment else where. Thanks for pointing this out.
> >
> > Thanks, but shouldn't setDropTarget check if peer == null and
> > in that case store the drop target and call its addNotify in
> > Component.addNotify?
>
> Oh I see it already does that, in that case I would think that all that
> is needed is an extra "if (peer != null)" around the
> dropTarget.addNotify() in setDropTarget.
Ah, not really required but it is good to have. I have added the check
in.
Thanks
2006-08-08 Lillian Angel <[EMAIL PROTECTED]>
* java/awt/Component.java
(setDropTarget): Added check.
>
> Regards,
> Jeroen
Index: java/awt/Component.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
retrieving revision 1.144
diff -u -r1.144 Component.java
--- java/awt/Component.java 8 Aug 2006 15:40:49 -0000 1.144
+++ java/awt/Component.java 8 Aug 2006 16:01:51 -0000
@@ -700,7 +700,9 @@
public void setDropTarget(DropTarget dt)
{
this.dropTarget = dt;
- dropTarget.addNotify(peer);
+
+ if (peer != null)
+ dropTarget.addNotify(peer);
}
/**