Author: Grid.Qian
Date: 2011-06-07 03:08:16 -0400 (Tue, 07 Jun 2011)
New Revision: 31867
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JBossWSUIUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java
Log:
JBIDE-8490: add more options for wsdl2java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JBossWSUIUtils.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JBossWSUIUtils.java 2011-06-07
06:59:05 UTC (rev 31866)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JBossWSUIUtils.java 2011-06-07
07:08:16 UTC (rev 31867)
@@ -36,6 +36,8 @@
* @author Grid Qian
*/
public class JBossWSUIUtils {
+ private static String JAVA = ".java"; //$NON-NLS-1$
+ private static String CLASS = ".class"; //$NON-NLS-1$
public static String addAnotherNodeToPath(String currentPath, String newNode) {
return currentPath + File.separator + newNode;
@@ -48,6 +50,20 @@
}
return returnPath;
}
+
+ public static IStatus validateClassName(String name, IJavaElement context) {
+ IStatus status = null;
+ String[] sourceComplianceLevels = getSourceComplianceLevels(context);
+ status = JavaConventions.validateClassFileName(name + CLASS, sourceComplianceLevels[0],
sourceComplianceLevels[1]);
+ if (status != null && status.getSeverity() == IStatus.ERROR) {
+ return status;
+ }
+ File file = JBossWSCreationUtils.findFileByPath(name + JAVA,
context.getJavaProject().getProject().getLocation().toOSString());
+ if (file != null && file.exists()) {
+ status =
StatusUtils.warningStatus(JBossWSUIMessages.Error_JBossWS_GenerateWizard_ClassName_Same);
+ }
+ return status;
+ }
public static IStatus validatePackageName(String name, IJavaElement context) {
IStatus status = null;
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java 2011-06-07
06:59:05 UTC (rev 31866)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java 2011-06-07
07:08:16 UTC (rev 31867)
@@ -19,6 +19,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
@@ -93,6 +95,8 @@
if (canFinish()) {
ServiceModel model = new ServiceModel();
model.setWebProjectName(project.getName());
+ IJavaProject javaProject = JavaCore.create(project);
+ model.setJavaProject(javaProject);
model.addServiceClasses(new StringBuffer().append(getPackageName())
.append(".").append(getClassName()).toString()); //$NON-NLS-1$
model.setServiceName(getServiceName());
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 2011-06-07
06:59:05 UTC (rev 31866)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java 2011-06-07
07:08:16 UTC (rev 31867)
@@ -21,6 +21,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
@@ -81,6 +83,8 @@
if (canFinish()) {
ServiceModel model = new ServiceModel();
model.setWebProjectName(project.getName());
+ IJavaProject javaProject = JavaCore.create(project);
+ model.setJavaProject(javaProject);
model.addServiceClasses(new StringBuffer().append(getPackageName())
.append(".").append(getClassName()).toString()); //$NON-NLS-1$
model.setServiceName(getServiceName());
Show replies by date