You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/08/17 06:26:22 UTC
[GitHub] sdedic commented on a change in pull request #701: Fixed enable evaluation for cloned PropertyMonitors. Defined default …
sdedic commented on a change in pull request #701: Fixed enable evaluation for cloned PropertyMonitors. Defined default …
URL: https://github.com/apache/incubator-netbeans/pull/701#discussion_r210815105
##########
File path: openide.awt/src/org/openide/awt/ActionState.java
##########
@@ -59,6 +59,9 @@
* <li>if {@link #checkValue} is {@link #NON_NULL_VALUE}, the action is checked if and only if
* the value is not {@code null}.
* <li>if the value type is an enum, its {@link Enum#name} is compared to {@link #checkValue}
+ * <li>if the value is a {@link Collection} or {@link Map}, state evaluates to the {@link Collection#isEmpty} or
+ * {@link Map#isEmpty}, respectively.
+ * <li>if the value is a {@link Number}, state will be true if value evaluates to <b>a positive integer</b>.
Review comment:
Well ... there's probably no good model with integers. And the behaviour is not "complete" enough with Collections either: some models use indexes, where 0+ means a valid value, negative invalid. Some models use counters, < 1 = empty / invalid, 1+ presence / valid.
The default could be further improved by e.g. adding a boolean `negate` plus some constants like `POSITIVE`, `NON_NEGATIVE`, `EMPTY` with the option to negate the meaning. That would cover more use-cases.
Do you think it is worth adding/changing ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists