Author: Grid.Qian
Date: 2010-04-01 02:11:22 -0400 (Thu, 01 Apr 2010)
New Revision: 21181
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/JBossWSGenerateWebXmlWizardPage.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java
Log:
JBIDE-6123: 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-04-01
04:52:23 UTC (rev 21180)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-04-01
06:11:22 UTC (rev 21181)
@@ -61,4 +61,5 @@
Error_JBossWS_GenerateWizard_IsOutputFolder=Name conflict with output folder
Error_JBossWS_GenerateWizard_PackageExists=Package already exists
Error_JBossWS_GenerateWizard_PackageNotShown=Package already exists. Note: Views might
filter empty parent packages
-Error_JBossWS_GenerateWizard_PackageExistsDifferentCase=Package already exists with a
different case
\ No newline at end of file
+Error_JBossWS_GenerateWizard_PackageExistsDifferentCase=Package already exists with a
different case
+Error_JBossWS_GenerateWizard_NoSrcInProject=The project misses JAVA Source folders
\ No newline at end of file
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-04-01
04:52:23 UTC (rev 21180)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-04-01
06:11:22 UTC (rev 21181)
@@ -86,6 +86,7 @@
public static String Error_JBossWS_GenerateWizard_PackageExists;
public static String Error_JBossWS_GenerateWizard_PackageNotShown;
public static String Error_JBossWS_GenerateWizard_PackageExistsDifferentCase;
+ public static String Error_JBossWS_GenerateWizard_NoSrcInProject;
static {
NLS.initializeMessages(BUNDLE_NAME, JBossWSUIMessages.class);
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWebXmlWizardPage.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWebXmlWizardPage.java 2010-04-01
04:52:23 UTC (rev 21180)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWebXmlWizardPage.java 2010-04-01
06:11:22 UTC (rev 21181)
@@ -12,9 +12,11 @@
import java.util.ArrayList;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
@@ -32,6 +34,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
public class JBossWSGenerateWebXmlWizardPage extends WizardPage {
@@ -208,6 +211,27 @@
if (!projects.isDisposed() && projects.getText().length() > 0) {
model.setWebProjectName(projects.getText());
}
+
+ if (((JBossWSGenerateWizard) this.getWizard()).getProject() == null) {
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NoProjectSelected);
+ return false;
+ }
+
+ IFile web = ((JBossWSGenerateWizard) this.getWizard()).getWebFile();
+ if (web == null || !web.exists()) {
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
+ return false;
+ }
+
+ try {
+ if
("" .equals(JBossWSCreationUtils.getJavaProjectSrcLocation(((JBossWSGenerateWizard)
this.getWizard()).getProject()))) { //$NON-NLS-1$
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NoSrcInProject);
+ return false;
+ }
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ }
+
IStatus status = JBossWSGenerateWizardValidator.isWSNameValid();
if (status != null) {
setErrorMessage(status.getMessage());
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-04-01
04:52:23 UTC (rev 21180)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java 2010-04-01
06:11:22 UTC (rev 21181)
@@ -55,7 +55,6 @@
private static String JAVA = ".java"; //$NON-NLS-1$
private static String WEBINF = "WEB-INF"; //$NON-NLS-1$
private IFile webFile;
- private boolean hasInited = false;
public JBossWSGenerateWizard() {
super();
@@ -141,27 +140,10 @@
JBossWSCreationUtils.getWebContentRootPath(project).append(WEBINF))
.getFile(WEB);
}
- hasInited = true;
}
@Override
public boolean canFinish() {
- if (getProject() == null) {
- if (firstPage != null && !firstPage.getControl().isDisposed()) {
- if (firstPage.hasChanged())
- firstPage
- .setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NoProjectSelected);
- }
- return false;
- }
- if (hasInited && (webFile == null || !webFile.exists())) {
- if (firstPage != null && !firstPage.getControl().isDisposed()) {
- if (firstPage.hasChanged())
- firstPage
- .setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
- }
- return false;
- }
return super.canFinish();
}
@@ -248,4 +230,9 @@
}
}
}
+
+
+ public IFile getWebFile() {
+ return webFile;
+ }
}
Show replies by date