Author: adietish
Date: 2011-10-03 13:25:02 -0400 (Mon, 03 Oct 2011)
New Revision: 35290
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java
Log:
[JBIDE-9805] moved DatabindingUtils to org.jboss.tools.common.ui
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java 2011-10-03
16:56:39 UTC (rev 35289)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java 2011-10-03
17:25:02 UTC (rev 35290)
@@ -46,10 +46,9 @@
*/
public static void bindButtonEnablementToValidationStatus(final Button button,
DataBindingContext dbc, Binding... bindings) {
- IObservableCollection validationStatusProviders = toObservableCollection(bindings);
dbc.bindValue(
WidgetProperties.enabled().observe(button),
- createAggregateValidationStatus(validationStatusProviders, dbc),
+ createAggregateValidationStatus(dbc, bindings),
new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER),
new UpdateValueStrategy().setConverter(new Status2BooleanConverter(IStatus.ERROR)));
}
@@ -66,13 +65,13 @@
* @return
*/
protected static AggregateValidationStatus createAggregateValidationStatus(
- IObservableCollection validationStatusProviders, DataBindingContext dbc) {
+ DataBindingContext dbc, Binding... bindings) {
AggregateValidationStatus aggregatedValidationStatus;
- if (validationStatusProviders == null) {
+ if (bindings.length == 0) {
aggregatedValidationStatus = new AggregateValidationStatus(dbc,
AggregateValidationStatus.MAX_SEVERITY);
} else {
aggregatedValidationStatus = new AggregateValidationStatus(
- validationStatusProviders, AggregateValidationStatus.MAX_SEVERITY);
+ toObservableCollection(bindings), AggregateValidationStatus.MAX_SEVERITY);
}
return aggregatedValidationStatus;
}
Show replies by date