[
https://issues.apache.org/jira/browse/PIVOT-798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sandro Martini updated PIVOT-798:
---------------------------------
Summary: Components should paint using their "disabled" style if they or
any ancestor is disabled (was: Component#isEnabled does not affect appearance
recursively)
Some comments from Greg and Bill, just to have more info here:
New Title for the issue could be "Component should use isBlocked() instead of
isEnabled() in deciding whether to paint in their normal or disabled style",
but maybe a description that leaves the implementation details open is
preferable.
> As I mentioned, I think that using isBlocked() to paint a disabled state
> would be preferable to recursively calling setEnabled(), since it would
> preserve the enabled state of the subcomponents. The only downside is that
> we'd now need to walk up the hierarchy for each component to determine if it
> is blocked. That makes painting a bit heavier.
Right, isBlocked() is more expensive than isEnabled(). I suppose you could pay
the cost at setEnabled time instead by giving every component a field
"ancestorIsDisabled", and have setEnabled overridden on Container to
recursively set or clear that new field as appropriate.
But I'm not sure the added complexity would be worth the slight performance
gain.
> Components should paint using their "disabled" style if they or any ancestor
> is disabled
> ----------------------------------------------------------------------------------------
>
> Key: PIVOT-798
> URL: https://issues.apache.org/jira/browse/PIVOT-798
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Sandro Martini
> Fix For: 2.1
>
> Attachments: recursive_disable.bxml
>
>
> Add a utility method setEnabledRecursive(boolean) to the container classes,
> but keep the current behavior as default.
> Some info here:
> http://apache-pivot-users.399431.n3.nabble.com/Component-isEnabled-does-not-affect-appearance-recursively-td3401718.html
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira