classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Re: [cp-patches] RFC: MetalScrollBarPropertyChangeHandler.property


From: David Gilbert
Subject: [Fwd: Re: [cp-patches] RFC: MetalScrollBarPropertyChangeHandler.propertyChange() fixes]
Date: Sat, 01 Oct 2005 21:27:29 +0000
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050728)

Sorry, I forgot to hit 'reply-all' for my response here.

Regards,

Dave
--- Begin Message --- Subject: Re: [cp-patches] RFC: MetalScrollBarPropertyChangeHandler.propertyChange() fixes Date: Sat, 01 Oct 2005 21:21:33 +0000 User-agent: Mozilla Thunderbird 1.0.6 (X11/20050728)
Mark Wielaard wrote:

Hi,

This was in my tree after DevJam. Could someone review them to make sure
they make sense?

2005-10-01  Mark Wielaard  <address@hidden>

   * javax/swing/plaf/metal/MetalScrollBarUI.java
   (MetalScrollBarPropertyChangeHandler.propertyChange):
   Only set free standing when increase or decrease button isn't null.
   If not FREE_STANDING_PROP pass up event to super class.

The second part makes the code do what the comment says it does.

Cheers,

Mark
------------------------------------------------------------------------

Index: javax/swing/plaf/metal/MetalScrollBarUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java,v
retrieving revision 1.7
diff -u -r1.7 MetalScrollBarUI.java
--- javax/swing/plaf/metal/MetalScrollBarUI.java        28 Sep 2005 13:16:47 
-0000      1.7
+++ javax/swing/plaf/metal/MetalScrollBarUI.java        1 Oct 2005 19:37:37 
-0000
@@ -90,9 +90,13 @@
        {
          Boolean prop = (Boolean) e.getNewValue();
          isFreeStanding = (prop == null ? true : prop.booleanValue());
-          increaseButton.setFreeStanding(isFreeStanding);
-          decreaseButton.setFreeStanding(isFreeStanding);
+         if (increaseButton != null)
+           increaseButton.setFreeStanding(isFreeStanding);
+         if (decreaseButton != null)
+           decreaseButton.setFreeStanding(isFreeStanding);
        }
+      else
+       super.propertyChange(e);
    }
  }
------------------------------------------------------------------------

_______________________________________________
Classpath-patches mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/classpath-patches
Hi Mark,

It looks OK to me, especially the 'else' part. Is there a situation where increaseButton and/or decreaseButton could be null? It doesn't hurt to be defensive, of course, but I'm wondering if there is a gap in my understanding of how this UI delegate is initialised...

Regards,

Dave


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]