JBoss Tools SVN: r31872 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-07 04:11:13 -0400 (Tue, 07 Jun 2011)
New Revision: 31872
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java
Log:
JBIDE-8961 - improving tmp deploy error handling
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java 2011-06-07 07:44:08 UTC (rev 31871)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java 2011-06-07 08:11:13 UTC (rev 31872)
@@ -22,10 +22,12 @@
package org.jboss.ide.eclipse.as.ui.wizards;
import java.io.File;
+import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -63,10 +65,10 @@
private IWizardHandle handle;
- private Label deployLabel, nameLabel;
- private Text deployText, nameText;
- private Button browse;
- private String name, deployLoc;
+ private Label deployLabel, tmpDeployLabel, nameLabel;
+ private Text deployText, tmpDeployText, nameText;
+ private Button browse, tmpBrowse;
+ private String name, deployLoc, tmpDeployLoc;
public StrippedServerWizardFragment() {
}
@@ -86,6 +88,12 @@
deployLabel.setText(Messages.swf_DeployDirectory);
browse.setText(Messages.browse);
+ tmpDeployLabel = new Label(main, SWT.NONE);
+ tmpDeployText = new Text(main, SWT.BORDER);
+ tmpBrowse = new Button(main, SWT.PUSH);
+ tmpDeployLabel.setText(Messages.swf_TempDeployDirectory);
+ tmpBrowse.setText(Messages.browse);
+
FormData namelData = new FormData();
namelData.top = new FormAttachment(0, 5);
namelData.left = new FormAttachment(0, 5);
@@ -113,25 +121,33 @@
bData.top = new FormAttachment(nameText, 5);
browse.setLayoutData(bData);
+ lData = new FormData();
+ lData.top = new FormAttachment(deployText, 5);
+ lData.left = new FormAttachment(0, 5);
+ tmpDeployLabel.setLayoutData(lData);
+
+ tData = new FormData();
+ tData.top = new FormAttachment(deployText, 5);
+ tData.left = new FormAttachment(tmpDeployLabel, 5);
+ tData.right = new FormAttachment(tmpBrowse, -5);
+ tmpDeployText.setLayoutData(tData);
+
+ bData = new FormData();
+ bData.right = new FormAttachment(100, -5);
+ bData.top = new FormAttachment(deployText, 5);
+ tmpBrowse.setLayoutData(bData);
+
+
ModifyListener ml = new ModifyListener() {
public void modifyText(ModifyEvent e) {
textChanged();
}
};
- browse.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
+ browse.addSelectionListener(new MySelectionListener(deployText));
+ tmpBrowse.addSelectionListener(new MySelectionListener(tmpDeployText));
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog d = new DirectoryDialog(new Shell());
- d.setFilterPath(deployText.getText());
- String x = d.open();
- if (x != null)
- deployText.setText(x);
- }
- });
-
+ tmpDeployText.addModifyListener(ml);
deployText.addModifyListener(ml);
nameText.addModifyListener(ml);
nameText.setText(getDefaultNameText());
@@ -139,11 +155,29 @@
.getImageDescriptor(JBossServerUISharedImages.WIZBAN_JBOSS_LOGO));
return main;
}
+
+ private class MySelectionListener implements SelectionListener {
+ private Text text;
+ public MySelectionListener(Text text) {
+ this.text = text;
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog d = new DirectoryDialog(new Shell());
+ d.setFilterPath(text.getText());
+ String x = d.open();
+ if (x != null)
+ text.setText(x);
+ }
+ }
+
protected void textChanged() {
IStatus status = checkErrors();
if (status.isOK()) {
deployLoc = deployText.getText();
+ tmpDeployLoc = tmpDeployText.getText();
name = nameText.getText();
handle.setMessage("", IStatus.OK); //$NON-NLS-1$
handle.update();
@@ -162,6 +196,32 @@
return new Status(IStatus.WARNING, JBossServerUIPlugin.PLUGIN_ID, IStatus.OK,
Messages.StrippedServerWizardFragment_DeployFolderDoesNotExistStatusMessage, null);
}
+ f = new File(tmpDeployText.getText());
+ if (!f.exists() || !f.isDirectory()) {
+ return new Status(IStatus.WARNING, JBossServerUIPlugin.PLUGIN_ID, IStatus.OK,
+ Messages.StrippedServerWizardFragment_TemporaryDeployFolderDoesNotExistStatusMessage, null);
+ }
+
+ // Check if a renameTo on these folders will fail
+ File tmp1, dep1;
+ tmp1 = dep1 = null;
+ boolean success = false;
+ try {
+ tmp1 = File.createTempFile(JBossServerUIPlugin.PLUGIN_ID, ".txt", new File(tmpDeployText.getText())); //$NON-NLS-1$
+ dep1 = new Path(deployText.getText()).append(JBossServerUIPlugin.PLUGIN_ID + ".txt").toFile(); //$NON-NLS-1$
+ success = tmp1.renameTo(dep1);
+ } catch(IOException ioe) {
+ } finally {
+ if( tmp1 != null && tmp1.exists())
+ tmp1.delete();
+ if( dep1 != null && dep1.exists())
+ dep1.delete();
+ if( !success )
+ return new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID, 0,
+ "Unable to rename files from your temporary folder to your deploy folder. Please verify both are on the same filesystem.", null); //$NON-NLS-1$
+ }
+
+
return new Status(IStatus.OK, JBossServerUIPlugin.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
}
@@ -201,6 +261,7 @@
serverWC.setServerConfiguration(null);
serverWC.setName(name);
serverWC.setAttribute(DeployableServer.DEPLOY_DIRECTORY, deployLoc);
+ serverWC.setAttribute(DeployableServer.TEMP_DEPLOY_DIRECTORY, tmpDeployLoc);
getTaskModel().putObject(TaskModel.TASK_SERVER, serverWC);
} catch (Exception ce) {
}
14 years, 10 months
JBoss Tools SVN: r31871 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-07 03:44:08 -0400 (Tue, 07 Jun 2011)
New Revision: 31871
Modified:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java
Log:
as.ui compilation failure in branch, not seeing an error in branch, but jenkins sees error
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java 2011-06-07 07:09:48 UTC (rev 31870)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java 2011-06-07 07:44:08 UTC (rev 31871)
@@ -35,10 +35,8 @@
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.internal.UpdateServerJob;
import org.eclipse.wst.server.core.util.PublishAdapter;
-import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
import org.eclipse.wst.server.ui.internal.viewers.BaseContentProvider;
-import org.jboss.ide.eclipse.as.ui.Messages;
/**
* @deprecated
@@ -349,7 +347,7 @@
}
}
} catch (Exception e) {
- Trace.trace(Trace.FINEST, Messages.ServerContentProvider_ErrorInServersViewAnimation, e);
+ //Trace.trace(Trace.FINEST, Messages.ServerContentProvider_ErrorInServersViewAnimation, e);
}
display.timerExec(SLEEP, animator[0]);
}
14 years, 10 months
JBoss Tools SVN: r31870 - in trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core: data and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2011-06-07 03:09:48 -0400 (Tue, 07 Jun 2011)
New Revision: 31870
Added:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaHelpOptionCommand.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ClientSampleCreationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/Java2WSCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/RemoveClientJarsCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceCreationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceSampleCreationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java
Log:
JBIDE-8490: add more options for wsdl2java
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -10,7 +10,6 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
@@ -21,7 +20,6 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.osgi.util.NLS;
@@ -56,14 +54,14 @@
monitor.subTask(JBossWSCreationCoreMessages.Progress_Message_Generating);
IStatus status = Status.OK_STATUS;
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(model.getWebProjectName());
+ IProject project = model.getJavaProject().getProject();
JBossWSCreationCorePlugin.getDefault().setGenerateTime(System.currentTimeMillis());
try {
String runtimeLocation = JBossWSCreationUtils.getJBossWSRuntimeLocation(project);
String commandLocation = runtimeLocation + Path.SEPARATOR+ "bin"; //$NON-NLS-1$
IPath path = new Path(commandLocation);
List<String> command = new ArrayList<String>();
- String[] env = getEnvironmentVariables(project);
+ String[] env = getEnvironmentVariables(model.getJavaProject());
if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) { //$NON-NLS-1$ //$NON-NLS-2$
command.add("cmd.exe"); //$NON-NLS-1$
command.add("/c"); //$NON-NLS-1$
@@ -78,7 +76,7 @@
return StatusUtils.errorStatus(NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found, new String[] { path.toOSString() }));
}
addCommandlineArgs(command);
- addCommonArgs(command, project);
+ addCommonArgs(command, model.getJavaProject());
Process proc = DebugPlugin.exec(command.toArray(new String[command.size()]), new File(commandLocation), env);
StringBuffer errorResult = new StringBuffer();
@@ -125,7 +123,7 @@
}
return status;
} finally {
- refreshProject(model.getWebProjectName(), monitor);
+ refreshProject(model.getJavaProject(), monitor);
monitor.done();
}
@@ -134,11 +132,10 @@
// SET JAVA_HOME environment variable to the location of java runtime of the
// project if the user
// doesn't set the env variable
- private String[] getEnvironmentVariables(IProject project) {
+ protected String[] getEnvironmentVariables(IJavaProject javaProject) {
String[] env = null;
String javaHome = System.getenv(JAVA_HOME);
if (javaHome == null || !(new File(javaHome).exists())) {
- IJavaProject javaProject = JavaCore.create(project);
if (javaProject == null || !javaProject.exists())
return null;
try {
@@ -155,9 +152,8 @@
return env;
}
- private void addCommonArgs(List<String> command, IProject project) throws Exception {
- String projectRoot = JBossWSCreationUtils.getProjectRoot(model.getWebProjectName()).toOSString();
- IJavaProject javaProject = JavaCore.create(project);
+ protected void addCommonArgs(List<String> command, IJavaProject javaProject) throws Exception {
+ String projectRoot = model.getJavaProject().getProject().getLocation().toOSString();
command.add("-k"); //$NON-NLS-1$
command.add("-s"); //$NON-NLS-1$
command.add(JBossWSCreationUtils.getCustomSrcLocation(model.getJavaSourceFolder()));
@@ -165,12 +161,19 @@
StringBuffer opDir = new StringBuffer();
opDir.append(projectRoot).append(Path.SEPARATOR).append(javaProject.getOutputLocation().removeFirstSegments(1).toOSString());
command.add(opDir.toString());
+ if (model.getAddOptions() != null && !"".equals(model.getAddOptions())) { //$NON-NLS-1$
+ String str = model.getAddOptions().trim();
+ String[] strArray = str.split(" +"); //$NON-NLS-1$
+ for (int i=0 ; i<strArray.length; i++) {
+ command.add(strArray[i]);
+ }
+ }
if (model.getWsdlURI() != null) {
command.add(model.getWsdlURI());
}
}
- private void convertInputStreamToString(final StringBuffer result,
+ protected void convertInputStreamToString(final StringBuffer result,
final InputStream input) {
Thread thread = new Thread() {
public void run() {
@@ -192,9 +195,9 @@
thread.start();
}
- private void refreshProject(String project, IProgressMonitor monitor) {
+ protected void refreshProject(IJavaProject project, IProgressMonitor monitor) {
try {
- JBossWSCreationUtils.getProjectByName(project).refreshLocal(2,monitor);
+ project.getProject().refreshLocal(2,monitor);
} catch (CoreException e) {
e.printStackTrace();
JBossWSCreationCorePlugin.getDefault().logError(e);
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ClientSampleCreationCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ClientSampleCreationCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ClientSampleCreationCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -16,10 +16,8 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
@@ -68,15 +66,7 @@
throws ExecutionException {
argsNum = 0;
IStatus status = Status.OK_STATUS;
- IJavaProject project = null;
- try {
- project = JBossWSCreationUtils.getJavaProjectByName(model
- .getWebProjectName());
- } catch (JavaModelException e) {
- JBossWSCreationCorePlugin.getDefault().logError(e);
- return StatusUtils
- .errorStatus(JBossWSCreationCoreMessages.Error_Create_Client_Sample);
- }
+ IJavaProject project = model.getJavaProject();
// find web service client classes
List<ICompilationUnit> clientUnits = JBossWSCreationUtils
@@ -177,13 +167,7 @@
String className, boolean isInterface, String interfaceName,
IJavaProject javaProject) {
try {
- IPath srcPath = new Path(
- JBossWSCreationUtils.getCustomSrcLocation(model.getJavaSourceFolder()));
- srcPath = javaProject.getPath().append(
- srcPath.makeRelativeTo(javaProject.getProject()
- .getLocation()));
- IPackageFragmentRoot root = javaProject
- .findPackageFragmentRoot(srcPath);
+ IPackageFragmentRoot root = JBossWSCreationUtils.getPackageFragmentRoot(javaProject, model.getJavaSourceFolder());
if (packageName == null) {
packageName = ""; //$NON-NLS-1$
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -1,30 +1,23 @@
package org.jboss.tools.ws.creation.core.commands;
-import java.io.File;
import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
-import javax.wsdl.Definition;
-import javax.xml.namespace.QName;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
@@ -42,7 +35,6 @@
import org.eclipse.jdt.core.dom.PackageDeclaration;
import org.eclipse.jdt.core.dom.ParameterizedType;
import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.QualifiedName;
import org.eclipse.jdt.core.dom.ReturnStatement;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.SimpleType;
@@ -74,67 +66,76 @@
private static final String ANNOTATION_PROPERTY_SERVICE_NAME = "serviceName"; //$NON-NLS-1$
private static final String ANNOTATION_PROPERTY_ENDPOINT_INTERFACE = "endpointInterface"; //$NON-NLS-1$
private static final String ANNOTATION_PROPERTY_TNS = "targetNamespace"; //$NON-NLS-1$
+ private static final String IMPL_PACKAGE = ".impl"; //$NON-NLS-1$
+ public static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
private ServiceModel model;
- private IWorkspaceRoot fWorkspaceRoot;
- private IProject project;
+ private IJavaProject project;
private String packageName;
+ private String serviceName;
+ private String targetNamespace;
public ImplementationClassCreationCommand(ServiceModel model) {
this.model = model;
- fWorkspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
-
}
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
-
+
+ IStatus status = Status.OK_STATUS;
// if the user does not check the generate implementation class button,
// do nothing
if (!model.isGenImplementation()) {
- return Status.OK_STATUS;
+ return status;
}
-
- IStatus status = Status.OK_STATUS;
- project = JBossWSCreationUtils.getProjectByName(model
- .getWebProjectName());
+
+ project = model.getJavaProject();
+ packageName = model.getCustomPackage();
+ List<ICompilationUnit> portTypeUnits = JBossWSCreationUtils
+ .findJavaUnitsByAnnotation(project, JBossWSCreationCoreMessages.Webservice_Annotation, packageName);
+ if (portTypeUnits.size() == 0 ) {
+ return status;
+ }
+
+ packageName = portTypeUnits.get(0).getParent().getElementName() + IMPL_PACKAGE;
+ IPackageFragment pack = null;
try {
-
- IJavaProject javaPrj = JavaCore.create(project);
- List<ICompilationUnit> serviceUnits = JBossWSCreationUtils
- .findJavaUnitsByAnnotation(javaPrj,
- JBossWSCreationCoreMessages.Webservice_Annotation,
- model.getCustomPackage());
-
- packageName = model.getCustomPackage();
- boolean noPackageName = false;
- if ("".equals(packageName)) { //$NON-NLS-1$
- noPackageName = true;
- }
- boolean isCheck = true;
- for (ICompilationUnit service : serviceUnits) {
- if (!service.findPrimaryType().isInterface()) {
+ pack = createImplPackage(packageName);
+ } catch (JavaModelException e1) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_Failed_to_Generate_Implementation,e1);
+ return status;
+ }
+ Service service = model.getService();
+ serviceName = service.getQName().getLocalPart();
+ targetNamespace = model.getWsdlDefinition().getTargetNamespace();
+ Iterator<?> iter = service.getPorts().values().iterator();
+ List<String> ptList = new LinkedList<String>();
+ while (iter.hasNext()) {
+ Port port = (Port) iter.next();
+ ptList.add(port.getBinding().getPortType().getQName().getLocalPart().toLowerCase());
+ }
+
+ boolean isOverWrite = false;
+ try {
+ for (ICompilationUnit portType : portTypeUnits) {
+ if (!portType.findPrimaryType().isInterface()) {
continue;
}
- if (noPackageName) {
- packageName = service.getParent().getElementName();
+ String clsName = getClassName(portType.getElementName());
+ String implClsName = getImplClassName(clsName);
+ if (!ptList.contains(clsName.toLowerCase())) {
+ continue;
+ }
+ if (!isOverWrite && findImplClass(implClsName)) {
+ if (!isOverwriteClass()) {
+ break;
+ }
+ isOverWrite = true;
}
- String implClsName = getImplClassName(getClassName(service
- .getElementName()));
- if (isCheck) {
- if (findImplClass(implClsName)) {
- isCheck = false;
- if (!isOverwriteClass()) {
- break;
- }
- }
- }
- generateImplClass(service);
- model.addServiceClasses(getImplPackageName()
- + "." + implClsName); //$NON-NLS-1$
+ generateImplClass(portType, pack, clsName, implClsName);
+ model.addServiceClasses(new StringBuffer(packageName).append(".").append(implClsName).toString()); //$NON-NLS-1$
}
-
} catch (CoreException e) {
status = StatusUtils
.errorStatus(
@@ -151,79 +152,28 @@
return status;
}
- private boolean isOverwriteClass() throws JavaModelException {
- boolean b = MessageDialog
- .openConfirm(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell(),
- JBossWSCreationCoreMessages.Confirm_Override_ImplClass,
- JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSImpl_Overwrite);
- return b;
- }
-
- private boolean findImplClass(String claName) throws JavaModelException {
- boolean b = false;
- IPackageFragmentRoot root = getPackageFragmentRoot();
- String implPackageName = getImplPackageName();
- IPackageFragment pack = root.getPackageFragment(implPackageName);
- if (pack.getCompilationUnit(claName + ".java").exists()) { //$NON-NLS-1$
- b = true;
- }
- return b;
- }
-
- protected String[] getServiceNameFromWSDL() {
- String[] names = new String[2];
- Definition def = model.getWsdlDefinition();
- Map<?, ?> services = def.getServices();
- if (services != null) {
- QName[] a = new QName[services.keySet().size()];
- if (a != null && a.length > 0) {
- services.keySet().toArray(a);
- names[0] = a[0].getLocalPart();
- }
- }
- names[1] = def.getTargetNamespace();
- return names;
- }
-
@SuppressWarnings("unchecked")
- protected void generateImplClass(ICompilationUnit service)
+ protected void generateImplClass(ICompilationUnit portType, IPackageFragment pack, String ptCls, String clsName)
throws CoreException, BadLocationException {
ASTParser astp = ASTParser.newParser(AST.JLS3);
astp.setKind(ASTParser.K_COMPILATION_UNIT);
- astp.setSource(service);
+ astp.setSource(portType);
CompilationUnit cu = (CompilationUnit) astp.createAST(null);
- IPackageFragment pack = getImplPakcage();
-
- String className = getClassName(service.getElementName());
-
- String implFileName = getJavaFileName(className);
-
- String[] names = getServiceNameFromWSDL();
-
- String serviceName = names[0];
-
- String targetNamespace = names[1];
-
- ICompilationUnit icu = pack.createCompilationUnit(implFileName,
- "", true, null); //$NON-NLS-1$
+ String implFileName = getJavaFileName(clsName);
+ ICompilationUnit icu = pack.createCompilationUnit(implFileName,"", true, null); //$NON-NLS-1$
+
// create a working copy with a new owner
-
icu.becomeWorkingCopy(null);
-
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(icu);
parser.setResolveBindings(false);
parser.setFocalPosition(0);
-
CompilationUnit implCu = (CompilationUnit) parser.createAST(null);
AST ast = implCu.getAST();
// creation of a Document and ASTRewrite
String source = icu.getBuffer().getContents();
Document document = new Document(source);
-
implCu.recordModifications();
// start to add content into implementation class
@@ -234,25 +184,23 @@
implCu.setPackage(implPackage);
// add imports for implementation class
- addImportsToImplementationClass(implCu, cu, className);
+ addImportsToImplementationClass(implCu, cu, ptCls);
// add class declaration
TypeDeclaration type = ast.newTypeDeclaration();
type.setInterface(false);
// add WebService annotation
- String endpoint = getServiceInterfaceFullName(className);
+ String endpoint = getPortTypeFullName(portType.getParent().getElementName(), ptCls);
NormalAnnotation ann = null;
if (serviceName != null) {
ann = createAnnotation(ast, serviceName, endpoint, targetNamespace);
} else {
- ann = createAnnotation(ast, className, endpoint, targetNamespace);
+ ann = createAnnotation(ast, clsName, endpoint, targetNamespace);
}
type.modifiers().add(ann);
- type.modifiers().add(
- ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
- type.setName(ast.newSimpleName(getImplClassName(className)));
- type.superInterfaceTypes().add(
- ast.newSimpleType(ast.newName(className)));
+ type.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
+ type.setName(ast.newSimpleName(clsName));
+ type.superInterfaceTypes().add(ast.newSimpleType(ast.newName(ptCls)));
// add Logger variable declaration
// createLoggerField(ast, type, portTypeName);
@@ -268,7 +216,6 @@
methods[i]);
type.bodyDeclarations().add(newMethod);
}
-
implCu.types().add(type);
// try to save the Java file
@@ -288,20 +235,8 @@
return packageName;
}
- private IPackageFragmentRoot getPackageFragmentRoot()
- throws JavaModelException {
- String str = model.getWebProjectName() + File.separator
- + getSourceFolderPath(project);
- IPath path = new Path(str);
- IResource res = fWorkspaceRoot.findMember(path);
- IJavaProject javaPrj = JavaCore.create(project);
- return javaPrj.getPackageFragmentRoot(res);
-
- }
-
private String getJavaFileName(String className) {
-
- return getImplClassName(className) + DEFAULT_CU_SUFFIX;
+ return className + DEFAULT_CU_SUFFIX;
}
private String getImplClassName(String className) {
@@ -313,20 +248,7 @@
return clsName;
}
- private IPackageFragment getImplPakcage() throws JavaModelException {
- IPackageFragmentRoot root = getPackageFragmentRoot();
- String implPackageName = getImplPackageName();
- IPackageFragment pack = root.getPackageFragment(implPackageName);
-
- if (!pack.exists()) {
- String packName = pack.getElementName();
- pack = root.createPackageFragment(packName, true, null);
- }
-
- return pack;
- }
-
- private String getServiceInterfaceFullName(String className) {
+ private String getPortTypeFullName(String packageName, String className) {
return packageName + "." + className; //$NON-NLS-1$
}
@@ -345,11 +267,8 @@
// import port type interface
ImportDeclaration importDec = implAST.newImportDeclaration();
- QualifiedName portTypeImport = implAST.newQualifiedName(
- implAST.newName(serviceCU.getPackage().getName()
- .getFullyQualifiedName()),
- implAST.newSimpleName(serviceName));
- importDec.setName(portTypeImport);
+ importDec.setName(implAST.newName(serviceCU.getPackage().getName().toString()));
+ importDec.setOnDemand(true);
implCU.imports().add(importDec);
// importDec = implAST.newImportDeclaration();
// importDec.setName(implAST.newName(LOGGER_CLASS_FULLNAME));
@@ -515,7 +434,32 @@
return null;
}
+
+ private IPackageFragment createImplPackage(String implPackage) throws JavaModelException {
+ IPackageFragmentRoot root = JBossWSCreationUtils.getPackageFragmentRoot(project, model.getJavaSourceFolder());
+ return root.createPackageFragment(implPackage,false, null);
+ }
+
+ private boolean isOverwriteClass() throws JavaModelException {
+ boolean b = MessageDialog
+ .openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ JBossWSCreationCoreMessages.Confirm_Override_ImplClass,
+ JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSImpl_Overwrite);
+ return b;
+ }
+
+ private boolean findImplClass(String claName) throws JavaModelException {
+ boolean b = false;
+ IPackageFragmentRoot root = JBossWSCreationUtils.getPackageFragmentRoot(project, model.getJavaSourceFolder());
+ String implPackageName = getImplPackageName();
+ IPackageFragment pack = root.getPackageFragment(implPackageName);
+ if (pack.getCompilationUnit(claName + ".java").exists()) { //$NON-NLS-1$
+ b = true;
+ }
+ return b;
+ }
+
protected List<ImportDeclaration> getImportsWithoutJaxwsAnnotation(
CompilationUnit cu) {
List<ImportDeclaration> importList = new ArrayList<ImportDeclaration>();
@@ -532,11 +476,4 @@
return importList;
}
- private IPath getSourceFolderPath(IProject project)
- throws JavaModelException {
- IPath path = new Path(
- JBossWSCreationUtils.getCustomSrcLocation(model.getJavaSourceFolder()));
- return path.makeRelativeTo(project.getProject().getLocation());
- }
-
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -11,6 +11,8 @@
package org.jboss.tools.ws.creation.core.commands;
+import java.util.List;
+
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
@@ -21,6 +23,9 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.ws.internal.wsrt.IWebServiceClient;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
@@ -50,11 +55,11 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
-
+ IJavaProject project = null;
try {
- String location = JBossWSCreationUtils
- .getJBossWSRuntimeLocation(JBossWSCreationUtils
- .getProjectByName(model.getWebProjectName()));
+ project = JavaCore.create(JBossWSCreationUtils.getProjectByName(model.getWebProjectName()));
+ model.setJavaProject(project);
+ String location = JBossWSCreationUtils.getJBossWSRuntimeLocation(project.getProject());
if (location.equals("")) { //$NON-NLS-1$
return StatusUtils
.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
@@ -70,6 +75,18 @@
.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
}
model.setTarget(JBossWSCreationCoreMessages.Value_Target_0);
+ try {
+ List<String> list = JBossWSCreationUtils.getJavaProjectSrcFolder(project.getProject());
+ if (list != null && list.size() > 0) {
+ model.setSrcList(list);
+ model.setJavaSourceFolder(list.get(0));
+ } else {
+ return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_No_SourceFolder);
+ }
+ } catch (JavaModelException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
if (scenario == WebServiceScenario.CLIENT) {
model.setWsdlURI(wsClient.getWebServiceClientInfo().getWsdlURL());
Definition definition = null;
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -1,5 +1,7 @@
package org.jboss.tools.ws.creation.core.commands;
+import java.util.List;
+
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
@@ -10,6 +12,9 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.ws.internal.wsrt.IWebService;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
@@ -34,8 +39,10 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
-
+ IJavaProject project = null;
try {
+ project = JavaCore.create(JBossWSCreationUtils.getProjectByName(model.getWebProjectName()));
+ model.setJavaProject(project);
String location = JBossWSCreationUtils.getJBossWSRuntimeLocation(JBossWSCreationUtils.getProjectByName(model.getWebProjectName()));
if (location.equals("")) { //$NON-NLS-1$
return StatusUtils
@@ -52,6 +59,18 @@
.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
}
model.setTarget(JBossWSCreationCoreMessages.Value_Target_0);
+ try {
+ List<String> list = JBossWSCreationUtils.getJavaProjectSrcFolder(project.getProject());
+ if (list != null && list.size() > 0) {
+ model.setSrcList(list);
+ model.setJavaSourceFolder(list.get(0));
+ } else {
+ return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_No_SourceFolder);
+ }
+ } catch (JavaModelException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
if (scenario == WebServiceScenario.TOPDOWN) {
model.setWsdlURI(ws.getWebServiceInfo().getWsdlURL());
Definition definition = null;
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/Java2WSCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/Java2WSCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/Java2WSCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -18,12 +18,10 @@
import java.util.jar.Manifest;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.utils.ClasspathParser;
-import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
/**
* @author Grid Qian
@@ -49,13 +47,8 @@
@Override
protected void addCommandlineArgs(List<String> command) throws IOException {
-
- String projectName = model.getWebProjectName();
- String projectRoot = JBossWSCreationUtils.getProjectRoot(projectName)
- .toOSString();
-
- IProject iProject = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(projectName);
+ String projectRoot = model.getJavaProject().getProject().getLocation().toOSString();
+ IProject iProject = model.getJavaProject().getProject();
if (model.isGenWSDL()) {
command.add("-w"); //$NON-NLS-1$
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -21,6 +21,7 @@
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.jface.dialogs.MessageDialog;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
@@ -53,6 +54,7 @@
private ServiceModel model;
IStatus status;
+ private IJavaProject project;
private static String WEB_XML = "web.xml"; //$NON-NLS-1$
public MergeWebXMLCommand(ServiceModel model) {
@@ -73,17 +75,16 @@
for (int i = 0; i < serviceClasses.size(); i++) {
servletDescriptors[i] = getServletDescriptor(serviceClasses.get(i));
}
- IProject pro = JBossWSCreationUtils.getProjectByName(model
- .getWebProjectName());
- if (!hasWebXML(pro)) {
- IVirtualComponent vc = ComponentCore.createComponent(pro);
+ project = model.getJavaProject();
+ if (!hasWebXML(project.getProject())) {
+ IVirtualComponent vc = ComponentCore.createComponent(project.getProject());
IDataModel model = DataModelFactory
.createDataModel(new WebCreateDeploymentFilesDataModelProvider());
model.setProperty(
ICreateDeploymentFilesDataModelProperties.GENERATE_DD, vc);
model.setProperty(
ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT,
- pro);
+ project.getProject());
IDataModelOperation op = model.getDefaultOperation();
try {
op.execute(new NullProgressMonitor(), null);
@@ -96,37 +97,28 @@
}
private void mergeWebXML(final ServletDescriptor[] servletDescriptors) {
- final IModelProvider provider = ModelProviderManager
- .getModelProvider(JBossWSCreationUtils.getProjectByName(model
- .getWebProjectName()));
+ final IModelProvider provider = ModelProviderManager.getModelProvider(project.getProject());
provider.modify(new Runnable() {
public void run() {
Object object = provider.getModelObject();
if (object instanceof WebApp) {
WebApp webApp = (WebApp) object;
for (int i = 0; i < servletDescriptors.length; i++) {
- addjeeServlet(JBossWSCreationUtils
- .getProjectByName(model.getWebProjectName()),
- servletDescriptors[i], webApp);
+ addjeeServlet(servletDescriptors[i], webApp);
}
}
if (object instanceof org.eclipse.jst.j2ee.webapplication.WebApp) {
org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) object;
for (int i = 0; i < servletDescriptors.length; i++) {
- addServlet(JBossWSCreationUtils.getProjectByName(model
- .getWebProjectName()), servletDescriptors[i],
- webApp);
+ addServlet(servletDescriptors[i],webApp);
}
}
}
-
}, null);
}
@SuppressWarnings("unchecked")
- protected void addServlet(IProject projectByName,
- ServletDescriptor servletDescriptor,
- org.eclipse.jst.j2ee.webapplication.WebApp webapp) {
+ protected void addServlet(ServletDescriptor servletDescriptor, org.eclipse.jst.j2ee.webapplication.WebApp webapp) {
@SuppressWarnings("rawtypes")
List theServlets = webapp.getServlets();
boolean b = false;
@@ -193,8 +185,7 @@
}
}
- public void addjeeServlet(IProject webProject,
- ServletDescriptor servletDescriptor, WebApp webapp) {
+ public void addjeeServlet(ServletDescriptor servletDescriptor, WebApp webapp) {
@SuppressWarnings("rawtypes")
List theServlets = webapp.getServlets();
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/RemoveClientJarsCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/RemoveClientJarsCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/RemoveClientJarsCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -23,11 +23,8 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.jboss.tools.ws.core.classpath.JBossWSRuntimeClassPathInitializer.JBossWSRuntimeClasspathContainer;
-import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.JBossWSCreationCorePlugin;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
-import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
/**
* @author Grid Qian
@@ -51,14 +48,7 @@
public IStatus executeOverride(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
- IJavaProject project = null;
- try {
- project = JBossWSCreationUtils.getJavaProjectByName(model
- .getWebProjectName());
- } catch (JavaModelException e) {
- JBossWSCreationCorePlugin.getDefault().logError(e);
- return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Create_Client_Sample);
- }
+ IJavaProject project = model.getJavaProject();
status = removeClassPath(project);
return status;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceCreationCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceCreationCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceCreationCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -14,10 +14,8 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.JBossWSCreationCorePlugin;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
public class ServiceCreationCommand extends AbstractDataModelOperation {
@@ -39,15 +37,7 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- IJavaProject project = null;
- try {
- project = JBossWSCreationUtils.getJavaProjectByName(model
- .getWebProjectName());
- } catch (JavaModelException e) {
- JBossWSCreationCorePlugin.getDefault().logError(e);
- return StatusUtils
- .errorStatus(JBossWSCreationCoreMessages.Error_Create_Client_Sample);
- }
+ IJavaProject project = model.getJavaProject();
// find the class, make sure it's in the project and open if we find it
if (model.getServiceClasses() != null && model.getServiceClasses().size() == 1) {
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceSampleCreationCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceSampleCreationCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ServiceSampleCreationCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -12,12 +12,9 @@
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.JBossWSCreationCorePlugin;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
public class ServiceSampleCreationCommand extends AbstractDataModelOperation {
@@ -39,15 +36,7 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- IJavaProject project = null;
- try {
- project = JBossWSCreationUtils.getJavaProjectByName(model
- .getWebProjectName());
- } catch (JavaModelException e) {
- JBossWSCreationCorePlugin.getDefault().logError(e);
- return StatusUtils
- .errorStatus(JBossWSCreationCoreMessages.Error_Create_Client_Sample);
- }
+ IJavaProject project = model.getJavaProject();
ICompilationUnit createdClass =
createJavaClass(model.getCustomPackage(), JBossWSCreationUtils
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -24,7 +24,6 @@
import org.jboss.tools.ws.creation.core.JBossWSCreationCorePlugin;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
-import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
/**
* @author Grid Qian
@@ -42,10 +41,8 @@
throws ExecutionException {
String implClass = model.getServiceClasses().get(0);
- String project = model.getWebProjectName();
try {
- IType type = JBossWSCreationUtils.getJavaProjectByName(project)
- .findType(implClass);
+ IType type = model.getJavaProject().findType(implClass);
if (type != null) {
if(!type.getPackageFragment().exists()|| type.getPackageFragment().isDefaultPackage()){
return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_No_Package);
@@ -63,13 +60,13 @@
} else {
return StatusUtils.errorStatus(NLS.bind(
JBossWSCreationCoreMessages.Error_No_Class,
- new String[] { implClass, project }));
+ new String[] { implClass, model.getJavaProject().getProject().getName() }));
}
} catch (JavaModelException e) {
JBossWSCreationCorePlugin.getDefault().logError(e);
return StatusUtils.errorStatus(NLS.bind(
JBossWSCreationCoreMessages.Error_No_Class, new String[] {
- implClass, project }));
+ implClass, model.getJavaProject().getProject().getName() }));
}
return Status.OK_STATUS;
}
Added: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaHelpOptionCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaHelpOptionCommand.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaHelpOptionCommand.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -0,0 +1,115 @@
+package org.jboss.tools.ws.creation.core.commands;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.ws.core.utils.StatusUtils;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
+import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
+
+public class WSDL2JavaHelpOptionCommand extends WSDL2JavaCommand {
+
+ private String helpOptions;
+ private Thread thread;
+
+ public WSDL2JavaHelpOptionCommand(ServiceModel model){
+ super(model);
+ }
+ protected void addCommandlineArgs(List<String> command) {
+ command.add("-h"); //$NON-NLS-1$
+ }
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ IStatus status = Status.OK_STATUS;
+ IProject project = model.getJavaProject().getProject();
+ String runtimeLocation;
+ try {
+ runtimeLocation = JBossWSCreationUtils.getJBossWSRuntimeLocation(project);
+ } catch (CoreException e1) {
+ return StatusUtils.errorStatus(e1);
+ }
+ String commandLocation = runtimeLocation + Path.SEPARATOR+ "bin"; //$NON-NLS-1$
+ IPath path = new Path(commandLocation);
+ List<String> command = new ArrayList<String>();
+ String[] env = getEnvironmentVariables(model.getJavaProject());
+ if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) { //$NON-NLS-1$ //$NON-NLS-2$
+ command.add("cmd.exe"); //$NON-NLS-1$
+ command.add("/c"); //$NON-NLS-1$
+ command.add(getCommandLineFileName_win());
+ path = path.append(getCommandLineFileName_win());
+ } else {
+ command.add("sh"); //$NON-NLS-1$
+ command.add(getCommandLineFileName_linux());
+ path = path.append(getCommandLineFileName_linux());
+ }
+ if (!path.toFile().getAbsoluteFile().exists()) {
+ return StatusUtils.errorStatus(NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found, new String[] { path.toOSString() }));
+ }
+ addCommandlineArgs(command);
+ Process proc = null;
+ try {
+ proc = DebugPlugin.exec(command.toArray(new String[command.size()]), new File(commandLocation), env);
+ } catch (CoreException e) {
+ return StatusUtils.errorStatus(e);
+ }
+ convertInputStreamToString(proc.getInputStream());
+ return status;
+ }
+
+ public void convertInputStreamToString(final InputStream input) {
+ final StringBuffer result = new StringBuffer();
+ thread = new Thread() {
+ public void run() {
+ try {
+ InputStreamReader ir = new InputStreamReader(input);
+ LineNumberReader reader = new LineNumberReader(ir);
+ String str;
+ str = reader.readLine();
+ boolean boo = false;
+ while (str != null) {
+ if (!boo && !"options:".equals(str.toLowerCase().trim())) { //$NON-NLS-1$
+ str = reader.readLine();
+ continue;
+ }
+ if (!boo) {
+ boo = true;
+ }
+ if (JBossWSCreationUtils.isOptions(str)) {
+ str = str.replaceAll(" +", " "); //$NON-NLS-1$ //$NON-NLS-2$
+ result.append(str).append("\n"); //$NON-NLS-1$
+ }
+ str = reader.readLine();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ helpOptions = result.toString();
+ }
+ };
+ thread.start();
+ }
+ public Thread getThread() {
+ return thread;
+ }
+
+ public String getHelpOptions() {
+ return helpOptions;
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaHelpOptionCommand.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -4,7 +4,10 @@
import java.util.List;
import javax.wsdl.Definition;
+import javax.wsdl.Service;
+import org.eclipse.jdt.core.IJavaProject;
+
public class ServiceModel {
private String webProjectName;
@@ -25,6 +28,10 @@
private String applicationName;
private String javaSourceFolder;
private Definition wsdlDefinition;
+ private IJavaProject project;
+ private Service service;
+ private String addOptions;
+ private List<String> srcList;
public int getWsScenario() {
return wsScenario;
@@ -188,4 +195,37 @@
public void setWsdlDefinition(Definition wsdlDefinition) {
this.wsdlDefinition = wsdlDefinition;
}
+
+ public IJavaProject getJavaProject() {
+ return project;
+ }
+
+ public void setJavaProject(IJavaProject project) {
+ this.project = project;
+ }
+
+ public Service getService() {
+ return service;
+ }
+
+ public void setService(Service service) {
+ this.service = service;
+ }
+
+ public String getAddOptions() {
+ return addOptions;
+ }
+
+ public void setAddOptions(String addOptions) {
+ this.addOptions = addOptions;
+ }
+
+ public List<String> getSrcList() {
+ return srcList;
+ }
+
+ public void setSrcList(List<String> srcList) {
+ this.srcList = srcList;
+ }
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2011-06-07 07:09:48 UTC (rev 31870)
@@ -2,6 +2,7 @@
AddRestEasyJarsCommand_RestEasy_JARS_Not_Found=Cannot find RestEasy JARs.
Value_Target_0=2.0
Value_Target_1=2.1
+Value_Target_2=2.2
Separator_Java=/
WebserviceClient_Annotation=WebServiceClient
Webservice_Annotation=WebService
@@ -15,24 +16,42 @@
Label_Custom_Package_Name=Package name
Label_Catalog_File=Catalog file
-Label_Button_Text_Seletion= &Add
+Label_Add_Button= &Add
Label_Generate_Impelemtation=Generate default Web Service Implementation classes
Label_Generate_WSDL=Generate WSDL file
Label_Binding_File=Binding files
Label_JaxWS_Target=JAX-WS specification
Label_Update_Webxml=Update the default Web.xml
Label_EnableSOAP12_Binding_Extension=Enable binding extension support (Only available for JBossWS 3.0 or later)
-Label_Button_Text_Remove=Remove
+Label_Remove_Button=&Remove
Progress_Message_Generating=Generating Web Service resources...
Client_Sample_Run_Over= Call Over!
-Label_SourceFolder_Name=Source Folder:
+Label_Servlet_Name=Web Service
+Label_SourceFolder_Name=Source Folder
+Label_Service_Name=WSDL Service
+Label_Implcls_Name=Impl Class
+Label_AdditionalOption_Name=Additional Options
+Label_Help_Button=Help...
+Label__Browse_Button=Browse...
+Tooltip_AdditionalOption=The senior options for the generating process.(Only for senior user, make sure your input is right)
+Tooltip_Servlet=The Web Service name used in web.xml
+Tooltip_Implcls=The Web Service implementation class Name
+Tooltip_Service=Specify one Service to generate codes. The service display format(ServiceName#Service.Port, Service.Port...)
Tooltip_SourceFolder=Specify the source folder into which the generated code files are written
+Tooltip_JaxWS_Target=Specify the JAX-WS Target Version
+Tooltip_Custom_Package=The package name that contains the generated codes
+Tooltip_Catalog_File=The catalog file used by the generating process
+Tooltip_BindingFile=The binding files used by the generating process
Error_Message_Invalid_Binding_File={0} is not a valid JAX-WS or JAXB binding file
Error_Message_Failed_To_Generate_Code=Failed to Generate Web Service code, please check the log for more details
Error_Message_Failed_to_Generate_Implementation=Failed to generate implementation class
Error_Message_Command_File_Not_Found=The command file: "{0}" does not exist, please check the JBoss Web Service runtime setting to make sure the location of JBoss Web Service runtime is valid.
Error_Message_No_Runtime_Specified=No JBoss Web Service runtime has been specified.
+Error_Message_No_SourceFolder=No Source Folder is found in the Project
+Error_Message_No_Service=No correct Service in the WSDL file
+Error_Message_No_ServicePort=No ports in the Service
+Error_Message_No_ServletName=The Web Service Name isn't valid
Error_No_Annotation=This class has no required JAXWS Annotation!
Error_No_Class= The class {0} cannot be loaded via project {1}.Check that the project contains the class, or that the class is loadable according to the Java Build Path of the project.
Error_WS_Location=The JBoss WS Runtime Location is NULL. Please set the location on JBoss WS preferences page.
@@ -46,4 +65,6 @@
RSMergeWebXMLCommand_REST_Servlet_Exists=RestEasy servlet already exists.
RSMergeWebXMLCommand_REST_Servlet_Mapping_Exists=RestEasy servlet mapping already exists.
Confirm_Override_Servlet=Confirm Web Service Name Overwrite
-Confirm_Override_ImplClass=Confirm Web Service Implementation classes Overwrite
\ No newline at end of file
+Confirm_Override_ImplClass=Confirm Web Service Implementation classes Overwrite
+AdditionalOption_Dialog_Title=Web Service Generation Options
+No_Message_AdditionalOptions_Dialog=No senior options can be used.
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -9,6 +9,7 @@
public static String Value_Target_0;
public static String Value_Target_1;
+ public static String Value_Target_2;
public static String Separator_Java;
public static String WebserviceClient_Annotation;
public static String Webservice_Annotation;
@@ -21,23 +22,41 @@
public static String Label_Custom_Package_Name;
public static String Label_Catalog_File;
- public static String Label_Button_Text_Seletion;
+ public static String Label_Add_Button;
public static String Label_Binding_File;
public static String Label_Generate_Impelemtation;
public static String Label_Generate_WSDL;
public static String Label_JaxWS_Target;
public static String Label_Update_Webxml;
public static String Label_EnableSOAP12_Binding_Extension;
- public static String Label_Button_Text_Remove;
+ public static String Label_Remove_Button;
+ public static String Label__Browse_Button;
public static String Progress_Message_Generating;
public static String Client_Sample_Run_Over;
public static String Label_SourceFolder_Name;
+ public static String Label_Service_Name;
+ public static String Label_Implcls_Name;
+ public static String Label_Servlet_Name;
+ public static String Label_AdditionalOption_Name;
+ public static String Label_Help_Button;
+ public static String Tooltip_AdditionalOption;
+ public static String Tooltip_Implcls;
+ public static String Tooltip_Servlet;
+ public static String Tooltip_Service;
public static String Tooltip_SourceFolder;
+ public static String Tooltip_JaxWS_Target;
+ public static String Tooltip_Custom_Package;
+ public static String Tooltip_Catalog_File;
+ public static String Tooltip_BindingFile;
public static String Error_Message_Invalid_Binding_File;
public static String Error_Message_Failed_To_Generate_Code;
public static String Error_Message_Failed_to_Generate_Implementation;
public static String Error_Message_Command_File_Not_Found;
+ public static String Error_Message_No_SourceFolder;
+ public static String Error_Message_No_Service;
+ public static String Error_Message_No_ServletName;
+ public static String Error_Message_No_ServicePort;
public static String Error_No_Annotation;
public static String Error_No_Class;
public static String Error_No_Package;
@@ -55,6 +74,8 @@
public static String RSMergeWebXMLCommand_REST_Servlet_Exists;
public static String RSMergeWebXMLCommand_REST_Servlet_Mapping_Exists;
+ public static String AdditionalOption_Dialog_Title;
+ public static String No_Message_AdditionalOptions_Dialog;
public static String Confirm_Override_Servlet;
public static String Confirm_Override_ImplClass;
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -430,6 +430,22 @@
}
return src;
}
+
+ public static List<String> getJavaProjectSrcFolder(IProject project) throws JavaModelException{
+ IPackageFragmentRoot[] packageFragmentRoots = JavaCore.create(
+ project).getAllPackageFragmentRoots();
+ if (packageFragmentRoots != null && packageFragmentRoots.length > 0) {
+ List<String> list = new ArrayList<String>();
+ for (int i = 0; i < packageFragmentRoots.length; i++) {
+ IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[i];
+ if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_SOURCE) {
+ list.add(packageFragmentRoot.getResource().getFullPath().toOSString());
+ }
+ }
+ return list;
+ }
+ return null;
+ }
public static IResource[] getJavaSourceRoots(IJavaProject javaProject)
throws JavaModelException {
@@ -609,5 +625,26 @@
Definition def = wsdlReader.readWSDL(wsdlURL);
return def;
}
+
+ public static boolean isOptions(String str) {
+ String[] isUsed = {
+ "-k", "-s", "-o", "-p", "-b", "-c", "-t", "-e", "-v", "-h", "-w" }; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$
+ boolean boo = true;
+ for (int i = 0; i < isUsed.length; i++) {
+ if (str.trim().startsWith(isUsed[i])) {
+ boo = false;
+ break;
+ }
+ }
+ return boo;
+ }
+
+ public static IPackageFragmentRoot getPackageFragmentRoot(IJavaProject project, String src) throws JavaModelException {
+ IPath path = new Path(JBossWSCreationUtils.getCustomSrcLocation(src));
+ String str = project.getProject().getName() + File.separator + path.makeRelativeTo(project.getProject().getLocation());
+ IPath path1 = new Path(str);
+ IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path1);
+ return project.getPackageFragmentRoot(res);
+ }
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java 2011-06-07 07:08:56 UTC (rev 31869)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java 2011-06-07 07:09:48 UTC (rev 31870)
@@ -29,7 +29,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.jboss.tools.ws.core.utils.StatusUtils;
-import org.jboss.tools.ws.creation.core.JBossWSCreationCorePlugin;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
/**
14 years, 10 months
JBoss Tools SVN: r31869 - in trunk/ws/plugins/org.jboss.tools.ws.creation.ui: src/org/jboss/tools/ws/creation/ui/utils and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2011-06-07 03:08:56 -0400 (Tue, 07 Jun 2011)
New Revision: 31869
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/utils/JBossCreationUIUtils.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/Java2WSDLCodeGenConfigWidget.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/WSDL2JavaCodeGenConfigWidget.java
Log:
JBIDE-8490: add more options for wsdl2java
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/META-INF/MANIFEST.MF 2011-06-07 07:08:33 UTC (rev 31868)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/META-INF/MANIFEST.MF 2011-06-07 07:08:56 UTC (rev 31869)
@@ -24,7 +24,8 @@
org.jboss.tools.ws.core,
org.eclipse.jst.ws.creation.ui,
org.eclipse.wst.common.modulecore,
- org.jboss.tools.ws.ui
+ org.jboss.tools.ws.ui,
+ org.eclipse.jdt.ui
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.ws.creation.ui.wsrt
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/utils/JBossCreationUIUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/utils/JBossCreationUIUtils.java 2011-06-07 07:08:33 UTC (rev 31868)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/utils/JBossCreationUIUtils.java 2011-06-07 07:08:56 UTC (rev 31869)
@@ -1,68 +1,136 @@
package org.jboss.tools.ws.creation.ui.utils;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
public class JBossCreationUIUtils {
- public static Combo createSourceCombo(Composite parent, final ServiceModel model) {
- final Combo outputDirCombo = new Combo(parent, SWT.READ_ONLY);
- outputDirCombo.setToolTipText(JBossWSCreationCoreMessages.Tooltip_SourceFolder);
- outputDirCombo.addListener(SWT.Modify, new Listener(){
- public void handleEvent(Event arg0) {
- String javaSourceFolder = outputDirCombo.getText();
- model.setJavaSourceFolder(javaSourceFolder);
- }
-
- });
+ public static Combo createComboItem(Composite configCom, ServiceModel model, String label, String tooltip) {
+ JBossCreationUIUtils.createLabel(configCom,label,tooltip);
+ return JBossCreationUIUtils.createCombo(configCom, model,tooltip);
+ }
+
+ public static void createLabel(Composite configCom, String label, String tooltip) {
+ final Label srcDirLabel = new Label(configCom, SWT.NONE);
+ srcDirLabel.setText(label);
+ srcDirLabel.setToolTipText(tooltip);
+ }
- populateSourceFolderCombo(outputDirCombo, model.getWebProjectName());
- return outputDirCombo;
+ public static Combo createCombo(Composite parent, final ServiceModel model, String tooltip) {
+ Combo combo = new Combo(parent, SWT.READ_ONLY);
+ combo.setToolTipText(tooltip);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ combo.setLayoutData(gd);
+ return combo;
}
- public static void populateSourceFolderCombo(Combo outputDirCombo, String projectName) {
- outputDirCombo.removeAll();
- try {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- IPackageFragmentRoot[] packageFragmentRoots = JavaCore.create(project).getAllPackageFragmentRoots();
- for (int i = 0; i < packageFragmentRoots.length; i++) {
- IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[i];
- if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_SOURCE) {
- outputDirCombo.add(packageFragmentRoot.getResource().getFullPath().toOSString());
- }
- }
- outputDirCombo.select(0);
- } catch (JavaModelException jme) {
- // catch it
- }
+ public static boolean populateServiceCombo(Combo serviceCombo, Definition definition) {
+ serviceCombo.removeAll();
+ if (definition != null && definition.getServices() != null && !definition.getServices().isEmpty()) {
+ Iterator<?> iter = definition.getServices().values().iterator();
+ boolean hasServicePort = false;
+ while (iter.hasNext()) {
+ Service service = (Service) iter.next();
+ StringBuffer serviceName = new StringBuffer(service.getQName().getLocalPart()).append("#"); //$NON-NLS-1$
+ if (service.getPorts() != null && !service.getPorts().isEmpty()){
+ Iterator<?> innerIter = service.getPorts().values().iterator();
+ while (innerIter.hasNext()) {
+ serviceName.append(((Port)innerIter.next()).getName());
+ if (innerIter.hasNext()) {
+ serviceName.append(","); //$NON-NLS-1$
+ }
+ }
+ hasServicePort = true;
+ }
+ serviceCombo.add(serviceName.toString());
+ serviceCombo.setData(serviceName.toString(), service);
+ }
+ if (hasServicePort) {
+ serviceCombo.select(0);
+ return true;
+ }
+ }
+ return false;
}
+
+ public static boolean populateSourceFolderCombo(Combo outputDirCombo, List<String> list) {
+ outputDirCombo.removeAll();
+ if (list != null && list.size() > 0) {
+ for (int i=0; i < list.size(); i++) {
+ outputDirCombo.add(list.get(i));
+ }
+ outputDirCombo.select(0);
+ return true;
+ } else {
+ return false;
+ }
+ }
- public static void createSourceComboLabel(Composite configCom) {
- final Label srcDirLabel = new Label(configCom, SWT.NONE);
- srcDirLabel.setText(JBossWSCreationCoreMessages.Label_SourceFolder_Name);
- srcDirLabel.setToolTipText(JBossWSCreationCoreMessages.Tooltip_SourceFolder);
+ public static Text createTextItem(Composite configCom, ServiceModel model,
+ String label, String tooltip) {
+ JBossCreationUIUtils.createLabel(configCom,label,tooltip);
+ return JBossCreationUIUtils.createText(configCom, model,tooltip);
}
- public static void createSourceComboItem(Composite configCom,
- Combo sourceCombo, ServiceModel model) {
- JBossCreationUIUtils.createSourceComboLabel(configCom);
- sourceCombo = JBossCreationUIUtils.createSourceCombo(configCom, model);
+ public static Text createText(Composite parent, ServiceModel model,
+ String tooltip) {
+ Text text = new Text(parent, SWT.NONE);
+ text.setToolTipText(tooltip);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
- sourceCombo.setLayoutData(gd);
+ text.setLayoutData(gd);
+ return text;
}
+
+ public static void populateTargetCombo(Combo targetCombo, ServiceModel model) {
+ targetCombo.add(JBossWSCreationCoreMessages.Value_Target_0, 0);
+ targetCombo.add(JBossWSCreationCoreMessages.Value_Target_1, 1);
+ targetCombo.add(JBossWSCreationCoreMessages.Value_Target_2, 2);
+ if (JBossWSCreationCoreMessages.Value_Target_0.equals(model.getTarget())) {
+ targetCombo.select(0);
+ } else if (JBossWSCreationCoreMessages.Value_Target_1.equals(model.getTarget())) {
+ targetCombo.select(1);
+ } else {
+ targetCombo.select(2);
+ }
+ }
+
+ public static Text createTextItemWithButton(Composite configCom, ServiceModel model, String label, String tooltip) {
+ JBossCreationUIUtils.createLabel(configCom,label,tooltip);
+ Text text = JBossCreationUIUtils.createTextWithButton(configCom, tooltip);
+ return text;
+ }
+
+ public static Text createTextWithButton(Composite configCom, String tooltip) {
+ Text text = new Text(configCom, SWT.BORDER);
+ text.setToolTipText(tooltip);
+ text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return text;
+ }
+
+ public static Button createCheckButton(Composite configCom,
+ String label) {
+ Button button = new Button(configCom, SWT.CHECK);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 3;
+ button.setLayoutData(gd);
+ button.setText(label);
+ return button;
+ }
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/Java2WSDLCodeGenConfigWidget.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/Java2WSDLCodeGenConfigWidget.java 2011-06-07 07:08:33 UTC (rev 31868)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/Java2WSDLCodeGenConfigWidget.java 2011-06-07 07:08:56 UTC (rev 31869)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.creation.ui.widgets;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -19,9 +20,11 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor;
import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents;
+import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.ui.utils.JBossCreationUIUtils;
@@ -36,6 +39,8 @@
private ServiceModel model;
private Button btnUpdateWebxml;
private Combo sourceCombo;
+ private boolean isOK;
+ private IStatus status = null;
public Java2WSDLCodeGenConfigWidget(ServiceModel model) {
this.model = model;
@@ -51,7 +56,18 @@
configCom.setLayoutData(new GridData(GridData.FILL_BOTH));
//choose source folder
- JBossCreationUIUtils.createSourceComboItem(configCom, sourceCombo, model);
+ sourceCombo = JBossCreationUIUtils.createComboItem(configCom, model,JBossWSCreationCoreMessages.Label_SourceFolder_Name ,JBossWSCreationCoreMessages.Tooltip_SourceFolder);
+ sourceCombo.addListener(SWT.Modify, new Listener(){
+ @Override
+ public void handleEvent(Event arg0) {
+ String javaSourceFolder = sourceCombo.getText();
+ model.setJavaSourceFolder(javaSourceFolder);
+ }
+ });
+ isOK = JBossCreationUIUtils.populateSourceFolderCombo(sourceCombo, model.getSrcList());
+ if(!isOK) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_No_SourceFolder);
+ }
final Button wsdlGen = new Button(configCom, SWT.CHECK | SWT.NONE);
GridData wsdlGenData = new GridData();
@@ -78,4 +94,8 @@
});
return this;
}
+
+ public IStatus getStatus() {
+ return status;
+ }
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/WSDL2JavaCodeGenConfigWidget.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/WSDL2JavaCodeGenConfigWidget.java 2011-06-07 07:08:33 UTC (rev 31868)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/WSDL2JavaCodeGenConfigWidget.java 2011-06-07 07:08:56 UTC (rev 31869)
@@ -1,26 +1,41 @@
package org.jboss.tools.ws.creation.ui.widgets;
+import javax.wsdl.Service;
+
+import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.PackageFragment;
+import org.eclipse.jdt.ui.IJavaElementSearchConstants;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor;
import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
+import org.jboss.tools.ws.core.utils.StatusUtils;
+import org.jboss.tools.ws.creation.core.commands.WSDL2JavaHelpOptionCommand;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
@@ -32,21 +47,22 @@
private ServiceModel model;
private IStatus status = null;
+ private Button removeButton;
+ private Button updateWebxmlButton;
+ private Button genDefaultButton;
+ private Button extensionButton;
+ private Button customPacButton;
+ private Button catalogButton;
+ private Button additionalButton;
+ private Combo serviceCombo = null;
+ private Combo sourceCombo = null;
+ private Combo targetCombo = null;
+ private Text customPacText;
+ private Text catalogText;
+ private Text additionalText;
+ private List bindingList;
+ private boolean isOK;
- public ServiceModel getModel() {
- return model;
- }
-
- public void setModel(ServiceModel model) {
- this.model = model;
- }
-
- private Button btnRemove;
- private Button btnUpdateWebxml;
- private Button btnGenDefaultImpl;
- private Button btnExtension;
- private Combo sourceCombo;
-
public WSDL2JavaCodeGenConfigWidget(ServiceModel model) {
this.model = model;
}
@@ -59,74 +75,177 @@
configCom.setLayout(layout);
configCom.setLayoutData(new GridData(GridData.FILL_BOTH));
- //choose source folder
- JBossCreationUIUtils.createSourceComboItem(configCom, sourceCombo, model);
-
+ // services list
+ serviceCombo = JBossCreationUIUtils.createComboItem(configCom, model,
+ JBossWSCreationCoreMessages.Label_Service_Name,
+ JBossWSCreationCoreMessages.Tooltip_Service);
+ serviceCombo.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(Event arg0) {
+ Service service = (Service) serviceCombo.getData(serviceCombo.getText());
+ if (service == null) {
+ return;
+ } else if (service.getPorts() == null
+ || service.getPorts().isEmpty()) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_No_ServicePort);
+ statusListener.handleEvent(null);
+ } else {
+ model.setService(service);
+ }
+ }
+ });
+
+ // choose source folder
+ sourceCombo = JBossCreationUIUtils.createComboItem(configCom, model,
+ JBossWSCreationCoreMessages.Label_SourceFolder_Name,
+ JBossWSCreationCoreMessages.Tooltip_SourceFolder);
+ sourceCombo.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(Event arg0) {
+ String javaSourceFolder = sourceCombo.getText();
+ model.setJavaSourceFolder(javaSourceFolder);
+ }
+ });
+
// custom package name
- final Label lblCustomPakage = new Label(configCom, SWT.NONE);
- lblCustomPakage
- .setText(JBossWSCreationCoreMessages.Label_Custom_Package_Name);
- final Text txtCustomPkgName = new Text(configCom, SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- txtCustomPkgName.setLayoutData(gd);
- txtCustomPkgName.addModifyListener(new ModifyListener() {
+ customPacText = JBossCreationUIUtils.createTextItemWithButton(configCom, model,
+ JBossWSCreationCoreMessages.Label_Custom_Package_Name,
+ JBossWSCreationCoreMessages.Tooltip_Custom_Package);
+ customPacButton = new Button(configCom, SWT.NONE);
+ customPacButton.setText(JBossWSCreationCoreMessages.Label__Browse_Button);
+ customPacText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- if ("".equals(txtCustomPkgName.getText()) //$NON-NLS-1$
- || validatePackage(txtCustomPkgName.getText())) {
- model.setCustomPackage(txtCustomPkgName.getText());
+ if ("".equals(customPacText.getText()) //$NON-NLS-1$
+ || validatePackage(customPacText.getText())) {
+ model.setCustomPackage(customPacText.getText());
}
statusListener.handleEvent(null);
}
});
- txtCustomPkgName.setText(model.getCustomPackage());
-
+ customPacButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ IJavaProject project = model.getJavaProject();
+ if (project == null) {
+ return;
+ }
+ try {
+ SelectionDialog dialog = JavaUI.createPackageDialog(
+ null, project, IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS);
+ if (dialog.open() == Window.OK) {
+ if (dialog.getResult() != null
+ && dialog.getResult().length == 1) {
+ String fqPackageName = ((PackageFragment) dialog
+ .getResult()[0]).getElementName();
+ customPacText.setText(fqPackageName);
+ }
+ }
+ } catch (JavaModelException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
// target
- new Label(configCom, SWT.NONE)
- .setText(JBossWSCreationCoreMessages.Label_JaxWS_Target);
- final Combo cbSpec = new Combo(configCom, SWT.BORDER | SWT.READ_ONLY);
- cbSpec.add(JBossWSCreationCoreMessages.Value_Target_0, 0);
- cbSpec.add(JBossWSCreationCoreMessages.Value_Target_1, 1);
- if (JBossWSCreationCoreMessages.Value_Target_0
- .equals(model.getTarget())) {
- cbSpec.select(0);
- } else {
- cbSpec.select(1);
- }
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- cbSpec.setLayoutData(gd);
- cbSpec.addModifyListener(new ModifyListener() {
-
+ targetCombo = JBossCreationUIUtils.createComboItem(configCom, model,
+ JBossWSCreationCoreMessages.Label_JaxWS_Target,
+ JBossWSCreationCoreMessages.Tooltip_JaxWS_Target);
+ targetCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- model.setTarget(cbSpec.getText());
+ model.setTarget(targetCombo.getText());
}
});
// catalog file
- new Label(configCom, SWT.NONE)
- .setText(JBossWSCreationCoreMessages.Label_Catalog_File);
- final Text txtCatlog = new Text(configCom, SWT.BORDER);
- txtCatlog.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Button btnCatlog = new Button(configCom, SWT.NONE);
- btnCatlog
- .setText(JBossWSCreationCoreMessages.Label_Button_Text_Seletion);
- btnCatlog.addSelectionListener(new SelectionAdapter() {
+ catalogText = JBossCreationUIUtils.createTextItemWithButton(configCom,
+ model, JBossWSCreationCoreMessages.Label_Catalog_File,
+ JBossWSCreationCoreMessages.Tooltip_Catalog_File);
+ catalogButton = new Button(configCom, SWT.NONE);
+ catalogButton.setText(JBossWSCreationCoreMessages.Label_Add_Button);
+ catalogButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- String fileLocation = new FileDialog(Display.getCurrent()
- .getActiveShell(), SWT.NONE).open();
- txtCatlog.setText(fileLocation);
+ String fileLocation = new FileDialog(Display.getCurrent().getActiveShell(), SWT.NONE).open();
+ catalogText.setText(fileLocation);
model.setCatalog(fileLocation);
}
});
// binding files
- new Label(configCom, SWT.NONE)
- .setText(JBossWSCreationCoreMessages.Label_Binding_File);
+ createBindingFileItem(configCom);
- final List bindingList = new List(configCom, SWT.BORDER
- | SWT.SCROLL_LINE | SWT.V_SCROLL | SWT.H_SCROLL);
- gd = new GridData(GridData.FILL_HORIZONTAL);
+ // extension check button
+ extensionButton = JBossCreationUIUtils.createCheckButton(
+ configCom, JBossWSCreationCoreMessages.Label_EnableSOAP12_Binding_Extension);
+ extensionButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ model.setEnableSOAP12(extensionButton.getSelection());
+ }
+ });
+
+ if (model.getWsScenario() != WebServiceScenario.CLIENT) {
+ // generate default impl class
+ genDefaultButton = JBossCreationUIUtils.createCheckButton(configCom,
+ JBossWSCreationCoreMessages.Label_Generate_Impelemtation);
+ genDefaultButton.setSelection(true);
+ genDefaultButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ model.setGenerateImplementatoin(genDefaultButton.getSelection());
+ updateWebxmlButton.setEnabled(genDefaultButton.getSelection());
+ if (!genDefaultButton.getSelection()) {
+ model.setUpdateWebxml(false);
+ } else {
+ model.setUpdateWebxml(updateWebxmlButton.getSelection());
+ }
+ }
+ });
+
+ // update the web.xml
+ updateWebxmlButton = JBossCreationUIUtils.createCheckButton(
+ configCom, JBossWSCreationCoreMessages.Label_Update_Webxml);
+ updateWebxmlButton.setSelection(true);
+ updateWebxmlButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ model.setUpdateWebxml(updateWebxmlButton.getSelection());
+ }
+ });
+ }
+
+ // additional choice
+ additionalText = JBossCreationUIUtils.createTextItemWithButton(configCom, model,
+ JBossWSCreationCoreMessages.Label_AdditionalOption_Name,
+ JBossWSCreationCoreMessages.Tooltip_AdditionalOption);
+ additionalButton = new Button(configCom, SWT.NONE);
+ additionalButton.setText(JBossWSCreationCoreMessages.Label_Help_Button);
+ additionalButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String message = getAdditionalOptions(model);
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ JBossWSCreationCoreMessages.AdditionalOption_Dialog_Title, message);
+ }
+ });
+ additionalText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if (!"".equals(additionalText.getText())) { //$NON-NLS-1$
+ model.setAddOptions(additionalText.getText());
+ } else {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_No_ServletName);
+ statusListener.handleEvent(null);
+ }
+ }
+ });
+
+ updateComposite();
+ return this;
+ }
+
+ private void createBindingFileItem(Composite configCom) {
+ Label label = new Label(configCom, SWT.NONE);
+ label.setText(JBossWSCreationCoreMessages.Label_Binding_File);
+ label.setToolTipText(JBossWSCreationCoreMessages.Tooltip_BindingFile);
+ bindingList = new List(configCom, SWT.BORDER | SWT.SCROLL_LINE
+ | SWT.V_SCROLL | SWT.H_SCROLL);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ bindingList.setToolTipText(JBossWSCreationCoreMessages.Tooltip_BindingFile);
gd.heightHint = Display.getCurrent().getActiveShell().getBounds().height / 4;
gd.verticalSpan = 3;
bindingList.setLayoutData(gd);
@@ -134,19 +253,17 @@
bindingList.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (bindingList.getSelectionIndex() >= 0) {
- btnRemove.setEnabled(true);
+ removeButton.setEnabled(true);
} else {
- btnRemove.setEnabled(false);
+ removeButton.setEnabled(false);
}
}
});
Button btnSelect = new Button(configCom, SWT.NONE);
- btnSelect
- .setText(JBossWSCreationCoreMessages.Label_Button_Text_Seletion);
+ btnSelect.setText(JBossWSCreationCoreMessages.Label_Add_Button);
btnSelect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
-
String fileLocation = new FileDialog(Display.getCurrent()
.getActiveShell(), SWT.NONE).open();
if (fileLocation != null
@@ -154,99 +271,79 @@
bindingList.add(fileLocation);
model.addBindingFile(fileLocation);
}
-
}
});
-
new Label(configCom, SWT.NONE);
- btnRemove = new Button(configCom, SWT.NONE);
- btnRemove.setEnabled(false);
- btnRemove.setText(JBossWSCreationCoreMessages.Label_Button_Text_Remove);
- btnRemove.addSelectionListener(new SelectionAdapter() {
+ removeButton = new Button(configCom, SWT.NONE);
+ removeButton.setEnabled(false);
+ removeButton.setText(JBossWSCreationCoreMessages.Label_Remove_Button);
+ removeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
model.getBindingFiles().remove(bindingList.getSelectionIndex());
bindingList.remove(bindingList.getSelectionIndex());
if (bindingList.getSelectionIndex() == -1) {
- btnRemove.setEnabled(false);
+ removeButton.setEnabled(false);
}
}
});
+ }
- btnExtension = new Button(configCom, SWT.CHECK);
- gd = new GridData();
- gd.horizontalSpan = 3;
- btnExtension.setLayoutData(gd);
- btnExtension
- .setText(JBossWSCreationCoreMessages.Label_EnableSOAP12_Binding_Extension);
- btnExtension.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- model.setEnableSOAP12(btnExtension.getSelection());
- }
- });
+ private void updateComposite() {
+ boolean a = JBossWSCreationUtils.supportSOAP12(model.getWebProjectName());
+ extensionButton.setEnabled(a);
+ extensionButton.setSelection(a);
- if (model.getWsScenario() != WebServiceScenario.CLIENT) {
- btnGenDefaultImpl = new Button(configCom, SWT.CHECK);
- gd = new GridData();
- gd.horizontalSpan = 3;
- btnGenDefaultImpl.setLayoutData(gd);
- btnGenDefaultImpl
- .setText(JBossWSCreationCoreMessages.Label_Generate_Impelemtation);
- btnGenDefaultImpl.setSelection(true);
- btnGenDefaultImpl.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- model.setGenerateImplementatoin(btnGenDefaultImpl
- .getSelection());
- btnUpdateWebxml.setEnabled(btnGenDefaultImpl.getSelection());
- if (!btnGenDefaultImpl.getSelection()) {
- model.setUpdateWebxml(false);
- } else {
- model.setUpdateWebxml(btnUpdateWebxml.getSelection());
- }
- }
- });
+ isOK = JBossCreationUIUtils.populateServiceCombo(serviceCombo,
+ model.getWsdlDefinition());
+ if (!isOK) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_No_Service);
+ }
- btnUpdateWebxml = new Button(configCom, SWT.CHECK);
- gd = new GridData();
- gd.horizontalSpan = 3;
- btnUpdateWebxml.setLayoutData(gd);
- btnUpdateWebxml
- .setText(JBossWSCreationCoreMessages.Label_Update_Webxml);
- btnUpdateWebxml.setSelection(true);
- btnUpdateWebxml.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- model.setUpdateWebxml(btnUpdateWebxml.getSelection());
- }
- });
+ isOK = JBossCreationUIUtils.populateSourceFolderCombo(sourceCombo, model.getSrcList());
+ if (!isOK) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_No_SourceFolder);
}
-
- // select soap12 checkbox if the target jbossws runtime is more
- // than 3.0
- updateExtensionButtonStatus();
-
- return this;
+ JBossCreationUIUtils.populateTargetCombo(targetCombo, model);
+ customPacText.setText(model.getCustomPackage());
}
- private void updateExtensionButtonStatus() {
- boolean a = JBossWSCreationUtils.supportSOAP12(model
- .getWebProjectName());
- btnExtension.setEnabled(a);
- btnExtension.setSelection(a);
- }
-
private void loadBindingFiles(List bindingList) {
for (String fileLocation : model.getBindingFiles()) {
bindingList.add(fileLocation);
}
}
- private boolean validatePackage(String name) {
+ public static String getAdditionalOptions(ServiceModel model) {
+ IStatus status = null;
+ String message = JBossWSCreationCoreMessages.No_Message_AdditionalOptions_Dialog;
+ WSDL2JavaHelpOptionCommand command = new WSDL2JavaHelpOptionCommand(
+ model);
try {
- status = JBossWSUIUtils.validatePackageName(name,
- JBossWSCreationUtils.getJavaProjectByName(model
- .getWebProjectName()));
- } catch (JavaModelException e1) {
- e1.printStackTrace();
+ status = command.execute(null, null);
+ } catch (ExecutionException e) {
+ status = StatusUtils.errorStatus(e);
}
+ if (status.isOK()) {
+ Thread thread = command.getThread();
+ int i = 0;
+ while (thread.isAlive() && i < 20) {
+ i++;
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ if (command.getHelpOptions() != null) {
+ message = command.getHelpOptions();
+ }
+ }
+ return message;
+ }
+
+ private boolean validatePackage(String name) {
+ status = JBossWSUIUtils.validatePackageName(name,model.getJavaProject());
if (status != null && status.getSeverity() == IStatus.ERROR) {
return false;
}
@@ -256,4 +353,12 @@
public IStatus getStatus() {
return status;
}
+
+ public ServiceModel getModel() {
+ return model;
+ }
+
+ public void setModel(ServiceModel model) {
+ this.model = model;
+ }
}
14 years, 10 months
JBoss Tools SVN: r31868 - trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2011-06-07 03:08:33 -0400 (Tue, 07 Jun 2011)
New Revision: 31868
Modified:
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java
Log:
JBIDE-8490: add more options for wsdl2java
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java 2011-06-07 07:08:16 UTC (rev 31867)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java 2011-06-07 07:08:33 UTC (rev 31868)
@@ -67,7 +67,7 @@
public void testClientCodeGenerationCommand() throws ExecutionException {
IProject project = fproject.getProject();
-
+ model.setJavaProject(JavaCore.create(project));
// test wsdl2Javacommand
model.setJavaSourceFolder("//JBossWSTestProject//src");
WSDL2JavaCommand cmdW2j = new WSDL2JavaCommand(model);
@@ -84,6 +84,7 @@
public void testRemoveClientJarsCommand() throws ExecutionException {
RemoveClientJarsCommand command = new RemoveClientJarsCommand(model);
+ model.setJavaProject(JavaCore.create(fproject.getProject()));
IStatus status = command.execute(null, null);
assertTrue(status.getMessage(), status.isOK());
try {
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java 2011-06-07 07:08:16 UTC (rev 31867)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java 2011-06-07 07:08:33 UTC (rev 31868)
@@ -6,6 +6,7 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.JavaCore;
import org.jboss.tools.test.util.TestProjectProvider;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
@@ -32,6 +33,8 @@
ServiceModel model = new ServiceModel();
model.setUpdateWebxml(true);
model.setWebProjectName("WebTest");
+ model.setJavaProject(JavaCore.create(prj));
+
MergeWebXMLCommand command = new MergeWebXMLCommand(model);
command.execute(null, null);
file = JBossWSCreationUtils.findFileByPath("web.xml", prj.getLocation().toOSString());
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java 2011-06-07 07:08:16 UTC (rev 31867)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java 2011-06-07 07:08:33 UTC (rev 31868)
@@ -14,7 +14,11 @@
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
+import java.util.Iterator;
+import javax.wsdl.Definition;
+import javax.wsdl.Service;
+
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -34,8 +38,6 @@
import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.ws.core.classpath.JBossWSRuntime;
-import org.jboss.tools.ws.core.classpath.JBossWSRuntimeManager;
import org.jboss.tools.ws.creation.core.commands.ImplementationClassCreationCommand;
import org.jboss.tools.ws.creation.core.commands.InitialCommand;
import org.jboss.tools.ws.creation.core.commands.MergeWebXMLCommand;
@@ -89,6 +91,10 @@
//test initial command
InitialCommand cmdInitial = new InitialCommand(model, ws, WebServiceScenario.TOPDOWN);
IStatus status = cmdInitial.execute(null, null);
+ assertNotNull(model.getWsdlDefinition());
+ Definition def = model.getWsdlDefinition();
+ Iterator<?> iter = def.getServices().values().iterator();
+ model.setService((Service) iter.next());
assertTrue(status.getMessage(), status.isOK());
assertEquals(wsdlFile.getLocationURI().toString(), model.getWsdlURI());
assertEquals("", model.getCustomPackage());
@@ -111,18 +117,18 @@
ImplementationClassCreationCommand cmdImpl = new ImplementationClassCreationCommand(model);
status = cmdImpl.execute(null, null);
assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
- assertFalse(project.getFile("src/org/apache/hello_world_soap_http/GreeterImpl.java").exists());
+ assertFalse(project.getFile("src/org/apache/hello_world_soap_http.impl/GreeterImpl.java").exists());
model.setGenerateImplementatoin(true);
cmdImpl = new ImplementationClassCreationCommand(model);
status = cmdImpl.execute(null, null);
assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
- assertTrue("failed to generate implemenatation class", project.getFile("src/org/apache/hello_world_soap_http/GreeterImpl.java").exists());
+ assertTrue("failed to generate implemenatation class", project.getFile("src/org/apache/hello_world_soap_http/impl/GreeterImpl.java").exists());
}
public void doMergeWebXMLCommand() throws ExecutionException{
model.setGenerateImplementatoin(true);
- model.addServiceClasses("org.apache.hello_world_soap_http.GreeterImpl");
+ model.addServiceClasses("org.apache.hello_world_soap_http.impl.GreeterImpl");
MergeWebXMLCommand cmdweb = new MergeWebXMLCommand(model);
IStatus status = cmdweb.execute(null, null);
@@ -138,7 +144,7 @@
assertTrue("failed to update web.xml ", webApp.getServlets().size() > 0);
Servlet servlet = (Servlet)webApp.getServlets().get(0);
assertEquals("the servlet with the name 'Greeter' was not created", servlet.getServletName(), "Greeter");
- assertEquals("org.apache.hello_world_soap_http.GreeterImpl", servlet.getServletClass());
+ assertEquals("org.apache.hello_world_soap_http.impl.GreeterImpl", servlet.getServletClass());
ServletMapping mapping = (ServletMapping)webApp.getServletMappings().get(0);
assertEquals("Greeter", mapping.getServletName());
@@ -150,7 +156,7 @@
assertEquals("servlet display name:","Greeter", servlet.getDisplayName());
if(servlet.getWebType() instanceof ServletType){
ServletType webtype = (ServletType)servlet.getWebType();
- assertEquals("org.apache.hello_world_soap_http.GreeterImpl", webtype.getClassName());
+ assertEquals("org.apache.hello_world_soap_http.impl.GreeterImpl", webtype.getClassName());
}
org.eclipse.jst.j2ee.webapplication.ServletMapping mapping = (org.eclipse.jst.j2ee.webapplication.ServletMapping)webApp.getServletMappings().get(0);
assertEquals("url pattern: ","/Greeter", mapping.getUrlPattern());
14 years, 10 months
JBoss Tools SVN: r31867 - in trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
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());
14 years, 10 months
JBoss Tools SVN: r31866 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-07 02:59:05 -0400 (Tue, 07 Jun 2011)
New Revision: 31866
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java
Log:
Launch configuration should not be setting mode to 'started'. Only the poll thread should do that.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java 2011-06-07 06:22:51 UTC (rev 31865)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java 2011-06-07 06:59:05 UTC (rev 31866)
@@ -63,7 +63,6 @@
behavior.setProcess(processes[0]);
}
behavior.setRunMode(mode);
- behavior.setServerStarted();
} catch (CoreException ce) {
// report it
}
14 years, 10 months
JBoss Tools SVN: r31865 - branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-07 02:22:51 -0400 (Tue, 07 Jun 2011)
New Revision: 31865
Modified:
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
Log:
JBIDE-8303 commit 2 to branch
Modified: branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
--- branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2011-06-07 06:22:03 UTC (rev 31864)
+++ branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2011-06-07 06:22:51 UTC (rev 31865)
@@ -78,9 +78,11 @@
}
public boolean performFinish() {
- IWizardPage currentPage = getContainer().getCurrentPage();
- if (currentPage instanceof WizardPageWithNotification) {
- ((WizardPageWithNotification)currentPage).pageExited(WizardWithNotification.FINISH);
+ IWizardPage[] allPages = getPages();
+ for( int i = 0; i < allPages.length; i++ ) {
+ if (allPages[i] instanceof WizardPageWithNotification) {
+ ((WizardPageWithNotification)allPages[i]).pageExited(WizardWithNotification.FINISH);
+ }
}
final boolean create = (this.existingPackage == null);
14 years, 10 months
JBoss Tools SVN: r31864 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-07 02:22:03 -0400 (Tue, 07 Jun 2011)
New Revision: 31864
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
Log:
JBIDE-8303 second commit to trunk
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2011-06-07 04:15:27 UTC (rev 31863)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2011-06-07 06:22:03 UTC (rev 31864)
@@ -78,9 +78,11 @@
}
public boolean performFinish() {
- IWizardPage currentPage = getContainer().getCurrentPage();
- if (currentPage instanceof WizardPageWithNotification) {
- ((WizardPageWithNotification)currentPage).pageExited(WizardWithNotification.FINISH);
+ IWizardPage[] allPages = getPages();
+ for( int i = 0; i < allPages.length; i++ ) {
+ if (allPages[i] instanceof WizardPageWithNotification) {
+ ((WizardPageWithNotification)allPages[i]).pageExited(WizardWithNotification.FINISH);
+ }
}
final boolean create = (this.existingPackage == null);
14 years, 10 months
JBoss Tools SVN: r31863 - trunk/bpel/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-06-07 00:15:27 -0400 (Tue, 07 Jun 2011)
New Revision: 31863
Modified:
trunk/bpel/docs/reference/en-US/troubleshooting.xml
Log:
updated
Modified: trunk/bpel/docs/reference/en-US/troubleshooting.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/troubleshooting.xml 2011-06-07 04:01:16 UTC (rev 31862)
+++ trunk/bpel/docs/reference/en-US/troubleshooting.xml 2011-06-07 04:15:27 UTC (rev 31863)
@@ -7,9 +7,11 @@
<para>
Refer to the OASIS documentation linked in the SA column for a detailed explanation of the BPEL requirement, and for possible resolutions for the error.
</para>
- <para>
- The substitution parameters (for example: {0} and {1}) are placeholders for the BPEL element, attribute or value identified by the Validator.
- </para>
+ <note>
+ <para>
+ The substitution parameters (for example: {0} and {1}) are placeholders for the BPEL element, attribute or value identified by the Validator.
+ </para>
+ </note>
<section>
<title>Error messages</title>
<table>
14 years, 10 months