Author: dennyxu
Date: 2008-06-12 05:17:16 -0400 (Thu, 12 Jun 2008)
New Revision: 8740
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/MergeWebXMLCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.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.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java
Log:
JBIDE-2263: have option for web.xml updating and default implementation in ui
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 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -84,7 +84,14 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
+
+ // if the user does not check the generate implementation class button, do nothing
+ if(!model.isGenImplementation()){
+ return Status.OK_STATUS;
+ }
+
IStatus status = Status.OK_STATUS;
+
try {
List<String> portTypes = model.getPortTypes();
for (String portTypeName : portTypes) {
@@ -263,7 +270,7 @@
implCU.imports().add(importDec);
//importDec = implAST.newImportDeclaration();
//importDec.setName(implAST.newName(LOGGER_CLASS_FULLNAME));
- implCU.imports().add(importDec);
+ //implCU.imports().add(importDec);
// import jaxws WebService
importDec = implAST.newImportDeclaration();
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 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -48,6 +48,10 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
+ if(!model.isUpdateWebxml()){
+ return Status.OK_STATUS;
+ }
+
IEnvironment environment = getEnvironment();
IStatus status = null;
ServletDescriptor[] servletDescriptors = new ServletDescriptor[model
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -50,12 +50,12 @@
String command = "sh " + WSCONSUEM_FILE_NAME_LINUX;
if(System.getProperty("os.name").toLowerCase().indexOf("win")
>= 0){
command = "cmd.exe /c " + WSCONSUEM_FILE_NAME_WIN;
- path.append(WSCONSUEM_FILE_NAME_WIN);
+ path = path.append(WSCONSUEM_FILE_NAME_WIN);
}else{
- path.append(WSCONSUEM_FILE_NAME_LINUX);
+ path = path.append(WSCONSUEM_FILE_NAME_LINUX);
}
- if(!path.toFile().exists()){
+ if(!path.toFile().getAbsoluteFile().exists()){
return StatusUtils.errorStatus(
NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found,
new String[] {path.toOSString()}));
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 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -17,6 +17,10 @@
private List<String> serviceClasses;
private boolean isGenWSDL;
private String target;
+
+ private boolean isGenImplementation = true;
+
+ private boolean UpdateWebxml = true;
public List<String> getServiceClasses(){
@@ -127,4 +131,20 @@
public void setTarget(String target){
this.target = target;
}
+
+ public void setGenerateImplementatoin(boolean isGenImpl){
+ this.isGenImplementation = isGenImpl;
+ }
+
+ public boolean isGenImplementation(){
+ return this.isGenImplementation;
+ }
+
+ public boolean isUpdateWebxml(){
+ return this.UpdateWebxml;
+ }
+
+ public void setUpdateWebxml(boolean updateWebxml){
+ this.UpdateWebxml = updateWebxml;
+ }
}
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 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2008-06-12
09:17:16 UTC (rev 8740)
@@ -1,8 +1,12 @@
Label_Custom_Package_Name=Custom package name
Label_Catalog_File=Catalog file
Label_Button_Text_Seletion= &Add
+Label_Generate_Impelemtation=Generate default Web Service Implementation class
+Label_Generate_WSDL=Generete WSDL file
Label_Binding_File=Binding files
Label_JaxWS_Target=JAX-WS specification
+Label_Upate_Webxml=Update default Web.xml
+Label_Update_Webxml=Update default Web.xml
Value_Target_0=2.0
Value_Target_1=2.1
Label_Button_Text_Remove=Remove
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 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -19,7 +19,15 @@
public static String Label_Catalog_File;
public static String Label_Button_Text_Seletion;
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_Upate_Webxml;
+
+ public static String Label_Update_Webxml;
public static String Value_Target_0;
public static String Value_Target_1;
public static String Label_Button_Text_Remove;
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 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -299,7 +299,7 @@
if(jbws != null){
return jbws.getHomeDir();
}else{
- throw new CoreException(StatusUtils.errorStatus("No JBoss Web Service runtime
specified."));
+ throw new CoreException(StatusUtils.errorStatus("No JBoss Web Service runtime
has been specified."));
}
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -163,11 +163,16 @@
.setBooleanProperty(
IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_IS_SERVER_SUPPLIED,
false);
- String runtimeId = cmbRuntimes.getText();
- model
- .setStringProperty(
- IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID,
- runtimeId);
+ String runtimeId = cmbRuntimes.getText();
+ JbossWSRuntime jbws =
JbossWSRuntimeManager.getInstance().findRuntimeByName(runtimeId);
+ if (jbws != null) {
+ model.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID, jbws
+ .getName());
+ model.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_HOME,
+ jbws.getHomeDir());
+ }
enableUserSupplied(true);
changePageStatus();
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -27,6 +27,8 @@
private ServiceModel model;
private Button btnRemove;
+ private Button btnUpdateWebxml;
+ private Button btnGenDefaultImpl;
public CodeGenConfigWidget(ServiceModel model){
this.model = model;
@@ -136,6 +138,36 @@
}
});
+ 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());
+ }
+ }
+ });
+
+ btnUpdateWebxml = new Button(configCom, SWT.CHECK);
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ btnUpdateWebxml.setLayoutData(gd);
+ btnUpdateWebxml.setText(JBossWSCreationCoreMessages.Label_Upate_Webxml);
+ btnUpdateWebxml.setSelection(true);
+ btnUpdateWebxml.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ model.setUpdateWebxml(btnUpdateWebxml.getSelection());
+ }
+ });
+
return this;
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java 2008-06-12
08:02:40 UTC (rev 8739)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java 2008-06-12
09:17:16 UTC (rev 8740)
@@ -12,6 +12,7 @@
package org.jboss.tools.ws.creation.ui.widgets;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
@@ -22,6 +23,7 @@
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.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
/**
* @author Grid Qian
@@ -30,6 +32,7 @@
SimpleWidgetDataContributor {
private ServiceModel model;
+ private Button btnUpdateWebxml;
public ProviderInvokeCodeGenConfigWidget(ServiceModel model) {
this.model = model;
@@ -48,19 +51,25 @@
GridData wsdlGenData = new GridData();
wsdlGenData.horizontalSpan = 2;
wsdlGen.setLayoutData(wsdlGenData);
- wsdlGen.setText("Generete WSDL file");
+ wsdlGen.setText(JBossWSCreationCoreMessages.Label_Generate_WSDL);
wsdlGen.setSelection(false);
- wsdlGen.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
-
+ wsdlGen.addSelectionListener(new SelectionAdapter() {
+
public void widgetSelected(SelectionEvent e) {
model.setGenWSDL(wsdlGen.getSelection());
}
});
+
+ btnUpdateWebxml = new Button(configCom, SWT.CHECK);
+ btnUpdateWebxml.setText(JBossWSCreationCoreMessages.Label_Update_Webxml);
+ btnUpdateWebxml.setSelection(true);
+ btnUpdateWebxml.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ model.setUpdateWebxml(btnUpdateWebxml.getSelection());
+ }
+ });
return this;
}
}
Show replies by date