[jbosstools-commits] JBoss Tools SVN: r35817 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Wed Oct 19 11:59:15 EDT 2011
Author: adietish
Date: 2011-10-19 11:59:14 -0400 (Wed, 19 Oct 2011)
New Revision: 35817
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
Log:
[JBIDE-9947] get back to version that does not validate runtime selection
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-19 15:35:38 UTC (rev 35816)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-19 15:59:14 UTC (rev 35817)
@@ -15,7 +15,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
@@ -103,7 +102,7 @@
GridDataFactory.fillDefaults()
.align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(projectGroup);
- Group serverAdapterGroup = createAdapterGroup(parent, dbc);
+ Group serverAdapterGroup = createAdapterGroup(parent);
GridDataFactory.fillDefaults()
.align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(serverAdapterGroup);
}
@@ -267,7 +266,7 @@
};
}
- private Group createAdapterGroup(Composite parent, DataBindingContext dbc) {
+ private Group createAdapterGroup(Composite parent) {
Group serverAdapterGroup = new Group(parent, SWT.BORDER);
serverAdapterGroup.setText("JBoss Server adapter");
FillLayout fillLayout = new FillLayout();
@@ -275,23 +274,7 @@
fillLayout.marginWidth = 6;
serverAdapterGroup.setLayout(fillLayout);
fillServerAdapterGroup(serverAdapterGroup);
- IObservableValue runtimeSelection = WidgetProperties.singleSelectionIndex().observe(suitableRuntimes);
- IObservableValue dummyObservable = new WritableValue();
- Binding comboSelectionBinding = dbc.bindValue(
- dummyObservable
- , WidgetProperties.singleSelectionIndex().observe(suitableRuntimes)
- , new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER)
- , new UpdateValueStrategy().setAfterGetValidator(new SelectedRuntimeValidator(null)));
-
- dbc.bindValue(
- dummyObservable
- , WidgetProperties.selection().observe(serverAdapterCheckbox)
- , new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER)
- , new UpdateValueStrategy().setAfterGetValidator(new SelectedRuntimeValidator(comboSelectionBinding)));
-
- runtimeSelection.setValue(null);
-
return serverAdapterGroup;
}
@@ -517,34 +500,4 @@
model.getParentModel().setProperty(AdapterWizardPageModel.CREATE_SERVER, canCreateServer);
}
- private class SelectedRuntimeValidator implements IValidator {
-
- private Binding binding;
-
- public SelectedRuntimeValidator(Binding binding) {
- this.binding = binding;
- }
-
- public IStatus validate(Object value) {
- if (!serverAdapterCheckbox.getSelection()) {
- updateBinding();
- return Status.OK_STATUS;
- }
- if (new Integer(-1).equals(suitableRuntimes.getSelectionIndex())) {
- if (suitableRuntimes.getItems() == null || suitableRuntimes.getItems().length == 0) {
- return ValidationStatus.error("Please add a new valid runtime.");
- }
- return ValidationStatus.error("Please select a runtime");
- }
- updateBinding();
- return Status.OK_STATUS;
- }
-
- private void updateBinding() {
- if (binding != null) {
- this.binding.updateModelToTarget();
- }
- }
- }
-
}
More information about the jbosstools-commits
mailing list