pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Whitcomb" <Roger.Whitc...@actian.com>
Subject RE: [jira] [Commented] (PIVOT-798) Component#isEnabled does not affect appearance recursively
Date Wed, 12 Oct 2011 16:52:59 GMT
By adding a ComponentStateListener to the component's "getComponentStateListeners" list and
then adding/removing the decorator inside the "enabledChanged" method of your listener.

Something like this:
	comp.getComponentStateListeners().add(new ComponentStateListener() {
		public void enabledChanged(Component component) {
			if (component.isEnabled())
				remove decorator
				attach decorator

Something like that (you'd have to put in a "focusedChanged" method also in this example),
but hopefully you get the idea.

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@actian.com| Actian Corp. | 500
Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA  | +1 650-587-5596 | fax:
+1 650-587-5550

-----Original Message-----
From: Bill van Melle [mailto:bill.van.melle@gmail.com] 
Sent: Tuesday, October 11, 2011 11:59 PM
To: dev@pivot.apache.org
Subject: Re: [jira] [Commented] (PIVOT-798) Component#isEnabled does not affect appearance

On Tue, Oct 11, 2011 at 8:43 PM, Greg Brown <gk_brown@verizon.net> wrote:

> > It took me a while to figure out I could simply
> > override the skin's enabledChanged method to add or remove the decorator,
> > but now I'm good.
> Another option is to listen for changes to the enabled property of the
> container, if that makes sense for your app.

Isn't that what I'm doing by overriding enabledChanged?  Not sure what
you're getting at.

View raw message