pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Whitcomb <roger.whitco...@gmail.com>
Subject Re: [jira] [Commented] (PIVOT-798) Component#isEnabled does not affect appearance recursively
Date Wed, 12 Oct 2011 15:13:48 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

On Oct 11, 2011, at 11:59 PM, Bill van Melle wrote:

> 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