Author: adietish
Date: 2011-10-03 12:52:15 -0400 (Mon, 03 Oct 2011)
New Revision: 35288
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizard.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizardModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerWizardPage.java
Log:
[JBIDE-9793] implementing DomainWizardPage
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/META-INF/MANIFEST.MF 2011-10-03
16:24:34 UTC (rev 35287)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/META-INF/MANIFEST.MF 2011-10-03
16:52:15 UTC (rev 35288)
@@ -16,4 +16,5 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.jboss.tools.common.databinding,
org.jboss.tools.common.ui,
- org.jboss.tools.common.ui.databinding
+ org.jboss.tools.common.ui.databinding,
+ org.jboss.tools.common.ui.preferencevalue
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java 2011-10-03
16:52:15 UTC (rev 35288)
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.ui.internal.wizard;
+
+
+import java.io.File;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.ValidationStatusProvider;
+import org.eclipse.core.databinding.observable.IObservableCollection;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.ide.eclipse.as.openshift.core.NotFoundOpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
+import org.jboss.tools.common.ui.BrowserUtil;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.common.ui.databinding.DataBindingUtils;
+
+/**
+ * @author André Dietisheim
+ */
+public class NewDomainWizardPage extends AbstractOpenshiftWizardPage {
+
+ private static final String DIRECTORY_SSH_KEYS = ".ssh";
+ private static final String FILTEREXPRESSION_PUBLIC_SSH_KEY = "*.pub";
+ private static final String FILTERNAME_PUBLIC_SSH_KEY = "Public ssh key file
(*.pub)";
+ protected static final String OPENSHIFT_EXPRESS_SIGNUP_URL =
"https://openshift.redhat.com/app/user/new/express"; //$NON-NLS-1$
+
+ public NewDomainWizardPage(IWizard wizard, ServerAdapterWizardModel model) {
+ super("New Domain", "Please create a new domain",
+ "new Domain", wizard, model);
+ this.model = model;
+ }
+
+ protected void doCreateControls(Composite container, DataBindingContext dbc) {
+ GridLayoutFactory.fillDefaults().numColumns(3).margins(10, 10).applyTo(container);
+
+ Label namespaceLabel = new Label(container, SWT.NONE);
+ namespaceLabel.setText("&Domain name");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(namespaceLabel);
+ Text namespaceText = new Text(container, SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2,
1).applyTo(namespaceText);
+ DataBindingUtils.bindMandatoryTextField(namespaceText, "Domain name",
ServerAdapterWizardModel.PROPERTY_NAMESPACE, model, dbc);
+
+ Label sshKeyLabel = new Label(container, SWT.NONE);
+ sshKeyLabel.setText("SSH Key");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(sshKeyLabel);
+ Text sshKeyText = new Text(container, SWT.READ_ONLY | SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true,
false).applyTo(sshKeyText);
+ DataBindingUtils.bindMandatoryTextField(sshKeyText, "SSH Key",
ServerAdapterWizardModel.PROPERTY_SSHKEY, sshKeyText, dbc);
+ Button browseSShKeyButton = new Button(container, SWT.PUSH);
+ browseSShKeyButton.setText("Browse");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(100,
34).applyTo(browseSShKeyButton);
+ browseSShKeyButton.addSelectionListener(onBrowseSshKey());
+
+ Label spacerLabel = new Label(container, SWT.None);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(spacerLabel);
+
+ Button createButton = new Button(container, SWT.NONE);
+ createButton.setText("&Create New Domain");
+ GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).span(2, 1).indent(0,
10).hint(140, 34).applyTo(createButton);
+ createButton.addSelectionListener(onCreate(dbc));
+ DataBindingUtils.bindButtonEnablementToValidationStatus(createButton, dbc);
+ }
+
+ private SelectionListener onBrowseSshKey() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ FileDialog dialog = new FileDialog(shell);
+ dialog.setFilterPath(getSshKeysDirectory());
+ dialog.setFilterNames(new String[]{FILTERNAME_PUBLIC_SSH_KEY});
+ dialog.setFilterExtensions(new String[]{FILTEREXPRESSION_PUBLIC_SSH_KEY});
+ String sshKeyPath = dialog.open();
+ if (sshKeyPath != null){
+ model.setSshKey(dialog.getFileName());
+ };
+ }
+ };
+ }
+
+ private String getSshKeysDirectory() {
+ String userHome = System.getProperty("user.home");
+ File sshKeysDirectory = new File(userHome, DIRECTORY_SSH_KEYS);
+ return sshKeysDirectory.getAbsolutePath();
+ }
+
+ protected SelectionAdapter onCreate(final DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ WizardUtils.runInWizard(
+ new Job("Creating new domain") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ model.createDomain();
+ } catch (OpenshiftException e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, NLS.bind(
+ "Could not create a new domain with the name \"{0}\"",
model.getNamespace()), e);
+ }
+ return Status.OK_STATUS;
+ }
+ }, getWizard().getContainer(), dbc);
+ } catch (Exception ex) {
+ // ignore
+ }
+ };
+ };
+ }
+
+ protected SelectionAdapter onSignupLinkClicked() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ BrowserUtil.checkedCreateInternalBrowser(OPENSHIFT_EXPRESS_SIGNUP_URL,
OPENSHIFT_EXPRESS_SIGNUP_URL,
+ OpenshiftUIActivator.PLUGIN_ID, OpenshiftUIActivator.getDefault().getLog());
+ getWizard().getContainer().getShell().close();
+ }
+ };
+ }
+
+ protected IObservableCollection toObservableCollection(ValidationStatusProvider...
validationStatusProviders) {
+ WritableList validationProviders = new WritableList();
+ for (ValidationStatusProvider provider : validationStatusProviders) {
+ validationProviders.add(provider);
+ }
+ return validationProviders;
+ }
+
+ @Override
+ protected void onPageVisible(DataBindingContext dbc) {
+ try {
+ WizardUtils.runInWizard(
+ new Job("Loading domain name") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ model.loadDomain();
+ } catch(NotFoundOpenshiftException e) {
+ e.printStackTrace();
+ } catch (OpenshiftException e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "Could not get domain name", e);
+ }
+ return Status.OK_STATUS;
+ }
+ }, getWizard().getContainer(), dbc);
+ } catch (Exception ex) {
+ // ignore
+ }
+ }
+}
Property changes on:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/NewDomainWizardPage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizard.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizard.java 2011-10-03
16:24:34 UTC (rev 35287)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizard.java 2011-10-03
16:52:15 UTC (rev 35288)
@@ -38,6 +38,7 @@
public void addPages() {
ServerAdapterWizardModel model = new ServerAdapterWizardModel();
addPage(new ServerWizardPage(this, model));
+ addPage(new NewDomainWizardPage(this, model));
addPage(new ApplicationWizardPage(this, model));
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizardModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizardModel.java 2011-10-03
16:24:34 UTC (rev 35287)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerAdapterWizardModel.java 2011-10-03
16:52:15 UTC (rev 35288)
@@ -12,33 +12,66 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.openshift.core.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.User;
+import org.jboss.ide.eclipse.as.openshift.core.UserConfiguration;
import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.common.ui.preferencevalue.StringPreferenceValue;
/**
* @author André Dietisheim
*/
public class ServerAdapterWizardModel extends ObservableUIPojo {
+ private static final String RHLOGIN_PREFS_KEY =
"org.jboss.ide.eclipse.as.openshift.ui.internal.wizard.ServerAdapterWizardModel_RHLOGIN";
+
public static final String PROPERTY_SERVER_URL = "serverUrl";
public static final String PROPERTY_RHLOGIN = "rhLogin";
public static final String PROPERTY_PASSWORD = "password";
- public static final String PROPERTY_CREDENTIALSVALIDITY =
"credentialsValidity";
+ public static final String PROPERTY_CREDENTIALS_VALIDITY =
"credentialsValidity";
+ public static final String PROPERTY_NAMESPACE = "namespace";
+ public static final String PROPERTY_SSHKEY = "sshKey";
private String serverUrl;
private String rhLogin;
private String password;
private IStatus credentialsValidity;
private IUser user;
+ private String namespace;
+ private StringPreferenceValue rhLoginPreferenceValue;
+ private IDomain domain;
+ private String sshKey;
public ServerAdapterWizardModel() {
this.serverUrl = IOpenshiftService.BASE_URL;
+ this.rhLoginPreferenceValue = new StringPreferenceValue(RHLOGIN_PREFS_KEY,
OpenshiftUIActivator.PLUGIN_ID);
+ this.rhLogin = initRhLogin();
}
+ protected String initRhLogin() {
+ String rhLogin = null;
+ rhLogin = rhLoginPreferenceValue.get();
+ if (rhLogin == null) {
+ rhLogin = getUserConfiguration();
+ }
+ return rhLogin;
+ }
+
+ protected String getUserConfiguration() {
+ String configuredUsername = null;
+ try {
+ configuredUsername = new UserConfiguration().getRhlogin();
+ } catch (Exception e) {
+ // do nothing
+ }
+ return configuredUsername;
+ }
+
public String getServerUrl() {
return serverUrl;
}
@@ -52,6 +85,7 @@
}
public void setRhLogin(String rhLogin) {
+ rhLoginPreferenceValue.store(rhLogin);
firePropertyChange(PROPERTY_RHLOGIN, this.rhLogin, this.rhLogin = rhLogin);
}
@@ -64,7 +98,7 @@
}
private void setCredentialsStatus(IStatus status) {
- firePropertyChange(PROPERTY_CREDENTIALSVALIDITY, this.credentialsValidity,
+ firePropertyChange(PROPERTY_CREDENTIALS_VALIDITY, this.credentialsValidity,
this.credentialsValidity = status);
}
@@ -76,7 +110,7 @@
IStatus status = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, "Your
credentails are not valid.");
try {
this.user = new User(getRhLogin(), getPassword());
- if(user.isValid()) {
+ if (user.isValid()) {
status = Status.OK_STATUS;
}
} catch (OpenshiftException e) {
@@ -88,4 +122,40 @@
public IUser getUser() {
return user;
}
+
+ public String getNamespace() {
+ return this.namespace;
+ }
+
+ public void createDomain() throws OpenshiftException {
+ this.domain = getUser().createDomain(namespace, loadSshKey());
+ }
+
+ public String getSshKey() {
+ return sshKey;
+ }
+
+ public void setSshKey(String sshKey) {
+ firePropertyChange(PROPERTY_SSHKEY, this.sshKey, this.sshKey = sshKey);
+ }
+
+ private ISSHPublicKey loadSshKey() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void renameDomain() throws OpenshiftException {
+ IDomain domain = getUser().getDomain();
+ domain.setNamespace(namespace);
+ }
+
+ public void setNamespace(String namespace) throws OpenshiftException {
+ firePropertyChange(PROPERTY_NAMESPACE, this.namespace, this.namespace = namespace);
+ }
+
+ public void loadDomain() throws OpenshiftException {
+ this.domain = getUser().getDomain();
+ setNamespace(domain.getNamespace());
+ }
+
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerWizardPage.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerWizardPage.java 2011-10-03
16:24:34 UTC (rev 35287)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.ui/src/org/jboss/ide/eclipse/as/openshift/ui/internal/wizard/ServerWizardPage.java 2011-10-03
16:52:15 UTC (rev 35288)
@@ -10,14 +10,10 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.ui.internal.wizard;
-import org.eclipse.core.databinding.AggregateValidationStatus;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.beans.BeanProperties;
-import org.eclipse.core.databinding.observable.IObservableCollection;
-import org.eclipse.core.databinding.observable.list.WritableList;
import org.eclipse.core.databinding.observable.value.WritableValue;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
@@ -25,12 +21,9 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -42,8 +35,7 @@
import org.jboss.ide.eclipse.as.openshift.ui.internal.OpenshiftUIActivator;
import org.jboss.tools.common.ui.BrowserUtil;
import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.common.ui.databinding.MandatoryStringValidator;
-import org.jboss.tools.common.ui.databinding.Status2BooleanConverter;
+import org.jboss.tools.common.ui.databinding.DataBindingUtils;
/**
* @author André Dietisheim
@@ -55,7 +47,8 @@
private Button validateButton;
public ServerWizardPage(IWizard wizard, ServerAdapterWizardModel model) {
- super("Server connetion", "Please provide the credentails of your user
account on Openshift Express", "Server Connection", wizard, model);
+ super("Server connetion", "Please provide the credentails of your user
account on Openshift Express",
+ "Server Connection", wizard, model);
this.model = model;
}
@@ -91,7 +84,7 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
Text rhLoginText = new Text(container, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2,
1).applyTo(rhLoginText);
- Binding rhLoginBining = bindMandatoryTextField(
+ Binding rhLoginBining = DataBindingUtils.bindMandatoryTextField(
rhLoginText, "Username", ServerAdapterWizardModel.PROPERTY_RHLOGIN, model,
dbc);
Label passwordLabel = new Label(container, SWT.NONE);
@@ -99,7 +92,7 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(passwordLabel);
Text passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2,
1).applyTo(passwordText);
- Binding passwordBinding = bindMandatoryTextField(
+ Binding passwordBinding = DataBindingUtils.bindMandatoryTextField(
passwordText, "Password", ServerAdapterWizardModel.PROPERTY_PASSWORD,
model, dbc);
Label spacerLabel = new Label(container, SWT.None);
@@ -112,11 +105,14 @@
this.validateButton = new Button(container, SWT.NONE);
validateButton.setText("&Validate");
GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).indent(0, 10).hint(100,
34).applyTo(validateButton);
- bindValidateButtonEnablement(validateButton, dbc, toObservableCollection(rhLoginBining,
passwordBinding));
+ DataBindingUtils.bindButtonEnablementToValidationStatus(
+ validateButton,
+ dbc,
+ rhLoginBining, passwordBinding);
validateButton.addSelectionListener(onValidate(dbc));
dbc.bindValue(
new WritableValue(null, IStatus.class),
- BeanProperties.value(ServerAdapterWizardModel.PROPERTY_CREDENTIALSVALIDITY).observe(model),
+ BeanProperties.value(ServerAdapterWizardModel.PROPERTY_CREDENTIALS_VALIDITY).observe(model),
new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER),
new UpdateValueStrategy().setAfterGetValidator(
new CredentialsStatusValidator()));
@@ -156,36 +152,6 @@
};
}
- private Binding bindMandatoryTextField(Text text, String fieldName, String
modelProperty,
- ServerAdapterWizardModel model,
- DataBindingContext dbc) {
- Binding binding = dbc.bindValue(
- WidgetProperties.text(SWT.Modify).observe(text),
- BeanProperties.value(modelProperty).observe(model),
- new UpdateValueStrategy().setAfterGetValidator(
- new MandatoryStringValidator(NLS.bind("You have to provide a value for the
{0}.", fieldName))),
- null);
- ControlDecorationSupport.create(binding, SWT.LEFT | SWT.TOP);
- return binding;
- }
-
- private void bindValidateButtonEnablement(final Button testButton, DataBindingContext
dbc,
- IObservableCollection validationStatusProviders) {
- dbc.bindValue(
- WidgetProperties.enabled().observe(testButton),
- new AggregateValidationStatus(validationStatusProviders,
AggregateValidationStatus.MAX_SEVERITY),
- new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER),
- new UpdateValueStrategy().setConverter(new Status2BooleanConverter(IStatus.ERROR)));
- }
-
- protected IObservableCollection toObservableCollection(ValidationStatusProvider...
validationStatusProviders) {
- WritableList validationProviders = new WritableList();
- for (ValidationStatusProvider provider : validationStatusProviders) {
- validationProviders.add(provider);
- }
- return validationProviders;
- }
-
private static class CredentialsStatusValidator implements IValidator {
public IStatus validate(Object value) {
if (value instanceof IStatus) {