Author: adietish
Date: 2012-04-27 19:23:48 -0400 (Fri, 27 Apr 2012)
New Revision: 40599
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
Log:
[JBIDE-11265] checking if the current value in the text field is the same as the current
domainId
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-04-27
23:20:52 UTC (rev 40598)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-04-27
23:23:48 UTC (rev 40599)
@@ -86,6 +86,9 @@
@Override
protected IStatus validate() {
final String domainName = (String) domainNameObservable.getValue();
+ if (pageModel.isCurrentDomainId(domainName)) {
+ return ValidationStatus.cancel(getDescription());
+ }
if (domainName.isEmpty()) {
return ValidationStatus.cancel(
"Enter a domain name with lower-case letters and digits only. Max length is 16
characters.");
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-04-27
23:20:52 UTC (rev 40598)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-04-27
23:23:48 UTC (rev 40599)
@@ -14,8 +14,10 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
+import com.openshift.client.IDomain;
import com.openshift.client.OpenShiftException;
/**
@@ -59,4 +61,18 @@
Logger.warn("Attempting to rename missing user domain...");
}
}
+
+ public boolean isCurrentDomainId(String domainId) {
+ IDomain domain;
+ try {
+ domain = user.getDefaultDomain();
+ if (domain == null) {
+ return false;
+ }
+ return domain.getId().equals(domainId);
+ } catch (Exception e) {
+ OpenShiftUIActivator.log(e);
+ return true;
+ }
+ }
}
Show replies by date