Author: Grid.Qian
Date: 2010-03-29 03:55:03 -0400 (Mon, 29 Mar 2010)
New Revision: 21098
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizardValidator.java
Log:
JBIDE-6079: to trunk
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-03-28
20:34:40 UTC (rev 21097)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-03-29
07:55:03 UTC (rev 21098)
@@ -44,8 +44,8 @@
JBossWSGenerateWebXmlWizardPage_Project_Group=Dynamic Web Project Name
JBossWSGenerateWebXmlWizardPage_Project_Group_Tooltip=If no Dynamic Web Project exists,
you must create one before creating your sample web service.
JBossWSGenerateWebXmlWizardPage_Web_Service_Group=Web Service
-JBossWSGenerateWizard_NoProjectSelected=No project selected. Please select a Dynamic Web
Project to continue.
+Error_JBossWSGenerateWizard_NoProjectSelected=No correct project selected. Please select
a Dynamic Web Project to continue.
Error_JBossWS_Label_Runtime_Load=Error occurred while loading JBossWS Command. Select the
correct JBoss Server folder.
Error_JBossWS_Basic_Editor_Composite=Parent control should be Composite
Error_JBossWS_Basic_Editor_Support=Editor supports only Grid layout
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-03-28
20:34:40 UTC (rev 21097)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-03-29
07:55:03 UTC (rev 21098)
@@ -68,8 +68,8 @@
public static String JBossWSGenerateWebXmlWizardPage_Project_Group;
public static String JBossWSGenerateWebXmlWizardPage_Project_Group_Tooltip;
public static String JBossWSGenerateWebXmlWizardPage_Web_Service_Group;
- public static String JBossWSGenerateWizard_NoProjectSelected;
+ public static String Error_JBossWSGenerateWizard_NoProjectSelected;
public static String Error_JBossWS_Label_Runtime_Load;
public static String Error_JBossWS_Basic_Editor_Composite;
public static String Error_JBossWS_Basic_Editor_Support;
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java 2010-03-28
20:34:40 UTC (rev 21097)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java 2010-03-29
07:55:03 UTC (rev 21098)
@@ -150,7 +150,7 @@
if (firstPage != null && !firstPage.getControl().isDisposed()) {
if (firstPage.hasChanged())
firstPage
- .setErrorMessage(JBossWSUIMessages.JBossWSGenerateWizard_NoProjectSelected);
+ .setErrorMessage(JBossWSUIMessages.Error_JBossWSGenerateWizard_NoProjectSelected);
}
return false;
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizardValidator.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizardValidator.java 2010-03-28
20:34:40 UTC (rev 21097)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizardValidator.java 2010-03-29
07:55:03 UTC (rev 21098)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
+import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.jst.javaee.core.UrlPatternType;
import org.eclipse.jst.javaee.web.Servlet;
import org.eclipse.jst.javaee.web.ServletMapping;
@@ -46,22 +47,24 @@
}
public static IStatus isWSNameValid() {
+ IModelProvider provider = null;
if (model.getWebProjectName() == null) {
return StatusUtils
- .errorStatus(JBossWSUIMessages.JBossWSGenerateWizard_NoProjectSelected);
+ .errorStatus(JBossWSUIMessages.Error_JBossWSGenerateWizard_NoProjectSelected);
} else {
try {
- ModelProviderManager.getModelProvider(JBossWSCreationUtils
- .getProjectByName(model.getWebProjectName()));
- } catch (IllegalArgumentException iae) {
+ IProject project = JBossWSCreationUtils.getProjectByName(model
+ .getWebProjectName());
+ if (!JavaEEProjectUtilities.isDynamicWebProject(project)) {
+ throw new Exception();
+ }
+ provider = ModelProviderManager.getModelProvider(project);
+ } catch (Exception exc) {
model.setWebProjectName(null);
return StatusUtils
- .errorStatus(JBossWSUIMessages.JBossWSGenerateWizard_NoProjectSelected);
+ .errorStatus(JBossWSUIMessages.Error_JBossWSGenerateWizard_NoProjectSelected);
}
}
- final IModelProvider provider = ModelProviderManager
- .getModelProvider(JBossWSCreationUtils.getProjectByName(model
- .getWebProjectName()));
Object object = provider.getModelObject();
if (object instanceof WebApp) {
WebApp webApp = (WebApp) object;
@@ -115,7 +118,7 @@
.errorStatus(JBossWSUIMessages.Error_JBossWS_GenerateWizard_ClassName_Same);
} else if (project == null) {
return StatusUtils
- .errorStatus(JBossWSUIMessages.JBossWSGenerateWizard_NoProjectSelected);
+ .errorStatus(JBossWSUIMessages.Error_JBossWSGenerateWizard_NoProjectSelected);
} else {
File file = JBossWSCreationUtils.findFileByPath(className + JAVA,
project.getLocation().toOSString());
Show replies by date