Author: scabanovich
Date: 2012-10-05 19:54:17 -0400 (Fri, 05 Oct 2012)
New Revision: 44350
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java
Log:
JBIDE-12793
https://issues.jboss.org/browse/JBIDE-12793
Code modified to simplify dialog testing.
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java 2012-10-05
22:47:08 UTC (rev 44349)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java 2012-10-05
23:54:17 UTC (rev 44350)
@@ -148,9 +148,10 @@
String typeName = this.type.getFullyQualifiedName();
if(RegisterServiceUtil.isServiceRegistered(type.getType().getJavaProject().getProject(),
typeName, serviceType)) {
getButton(IDialogConstants.OK_ID).setEnabled(false);
- setMessage(CommonUIMessages.REGISTER_AS_SERVICE_ALREADY_REGISTERED_MESSAGE,
IMessageProvider.ERROR);
+ setErrorMessage(CommonUIMessages.REGISTER_AS_SERVICE_ALREADY_REGISTERED_MESSAGE);
} else {
getButton(IDialogConstants.OK_ID).setEnabled(true);
+ setErrorMessage(null);
if(warning != null) {
setMessage(warning, IMessageProvider.WARNING);
} else {
@@ -169,7 +170,7 @@
return c;
}
- protected void okPressed() {
+ public void okPressed() {
result = serviceTypeSelector.getValueAsString();
super.okPressed();
}
@@ -177,4 +178,11 @@
public String getResult() {
return result;
}
+
+ public void setServiceType(String type) {
+ if(!types.containsKey(type)) {
+ throw new IllegalArgumentException(type);
+ }
+ serviceTypeSelector.setValue(type);
+ }
}