Author: Grid.Qian
Date: 2008-06-22 08:50:34 -0400 (Sun, 22 Jun 2008)
New Revision: 8893
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/data/ServiceModel.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/wsrt/JBossWSConfigWidgetFactory.java
Log:
JBIDE-2404:change jboss ws client to fit for eclipse 3.4
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 2008-06-22
12:41:42 UTC (rev 8892)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java 2008-06-22
12:50:34 UTC (rev 8893)
@@ -45,6 +45,8 @@
this.model = model;
this.wsClient = wsClient;
this.scenario = scenario;
+ model.setWsScenario(scenario);
+
}
@Override
@@ -52,16 +54,20 @@
throws ExecutionException {
try {
- String location =
JBossWSCreationUtils.getJbossWSRuntimeLocation(JBossWSCreationUtils.getProjectByName(model.getWebProjectName()));
+ String location = JBossWSCreationUtils
+ .getJbossWSRuntimeLocation(JBossWSCreationUtils
+ .getProjectByName(model.getWebProjectName()));
if (location.equals("")) {
return StatusUtils
.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
- } else if(!new
Path(location).append(JbossWSUIMessages.Bin).append(JbossWSUIMessages.Command).toFile().exists()){
+ } else if (!new Path(location).append(JbossWSUIMessages.Bin)
+ .append(JbossWSUIMessages.Command).toFile().exists()) {
return StatusUtils
- .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
}
} catch (CoreException e1) {
- return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ return StatusUtils
+ .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
}
model.setTarget(JBossWSCreationCoreMessages.Value_Target_0);
if (scenario == WebServiceScenario.CLIENT) {
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-22
12:41:42 UTC (rev 8892)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2008-06-22
12:50:34 UTC (rev 8893)
@@ -17,7 +17,16 @@
private List<String> serviceClasses;
private boolean isGenWSDL;
private String target;
+ private int wsScenario;
+ public int getWsScenario() {
+ return wsScenario;
+ }
+
+ public void setWsScenario(int wsScenario) {
+ this.wsScenario = wsScenario;
+ }
+
private boolean isGenImplementation = true;
private boolean UpdateWebxml = true;
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-22
12:41:42 UTC (rev 8892)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java 2008-06-22
12:50:34 UTC (rev 8893)
@@ -1,7 +1,5 @@
package org.jboss.tools.ws.creation.ui.widgets;
-
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -20,159 +18,184 @@
import org.eclipse.swt.widgets.Text;
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.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
public class CodeGenConfigWidget extends SimpleWidgetDataContributor {
-
+
private ServiceModel model;
+
+ public ServiceModel getModel() {
+ return model;
+ }
+
+ public void setModel(ServiceModel model) {
+ this.model = model;
+ }
+
private Button btnRemove;
private Button btnUpdateWebxml;
private Button btnGenDefaultImpl;
- public CodeGenConfigWidget(ServiceModel model){
+ public CodeGenConfigWidget(ServiceModel model) {
this.model = model;
}
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener){
-
+
+ public WidgetDataEvents addControls(Composite parent,
+ Listener statusListener) {
+
Composite configCom = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
+ GridLayout layout = new GridLayout(3, false);
configCom.setLayout(layout);
configCom.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- //custom package name
+
+ // custom package name
Label lblCustomPakage = new Label(configCom, SWT.NONE);
- lblCustomPakage.setText(JBossWSCreationCoreMessages.Label_Custom_Package_Name);
//$NON-NLS-1$
+ lblCustomPakage
+ .setText(JBossWSCreationCoreMessages.Label_Custom_Package_Name); //$NON-NLS-1$
final Text txtCustomPkgName = new Text(configCom, SWT.BORDER);
txtCustomPkgName.setText(model.getCustomPackage());
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
txtCustomPkgName.setLayoutData(gd);
- txtCustomPkgName.addModifyListener(new ModifyListener(){
+ txtCustomPkgName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
model.setCustomPackage(txtCustomPkgName.getText());
- }});
-
- //target
- new Label(configCom, SWT.NONE).setText(JBossWSCreationCoreMessages.Label_JaxWS_Target);
//$NON-NLS-1$
+ }
+ });
+
+ // target
+ new Label(configCom, SWT.NONE)
+ .setText(JBossWSCreationCoreMessages.Label_JaxWS_Target); //$NON-NLS-1$
final Combo cbSpec = new Combo(configCom, SWT.BORDER | SWT.READ_ONLY);
cbSpec.add(JBossWSCreationCoreMessages.Value_Target_0, 0); //$NON-NLS-1$
- cbSpec.add(JBossWSCreationCoreMessages.Value_Target_1, 1); //$NON-NLS-1$
- if(JBossWSCreationCoreMessages.Value_Target_0.equals(model.getTarget())){
+ cbSpec.add(JBossWSCreationCoreMessages.Value_Target_1, 1); //$NON-NLS-1$
+ if (JBossWSCreationCoreMessages.Value_Target_0
+ .equals(model.getTarget())) {
cbSpec.select(0);
- }
- else{
+ } else {
cbSpec.select(1);
}
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
cbSpec.setLayoutData(gd);
- cbSpec.addModifyListener(new ModifyListener(){
+ cbSpec.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
model.setTarget(cbSpec.getText());
- }});
-
- //catalog file
- new Label(configCom, SWT.NONE).setText(JBossWSCreationCoreMessages.Label_Catalog_File);
//$NON-NLS-1$
+ }
+ });
+
+ // catalog file
+ new Label(configCom, SWT.NONE)
+ .setText(JBossWSCreationCoreMessages.Label_Catalog_File); //$NON-NLS-1$
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);
//$NON-NLS-1$
- btnCatlog.addSelectionListener(new SelectionAdapter(){
+ btnCatlog
+ .setText(JBossWSCreationCoreMessages.Label_Button_Text_Seletion); //$NON-NLS-1$
+ btnCatlog.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- String fileLocation = new FileDialog(Display.getCurrent().getActiveShell(),
SWT.NONE).open();
+ String fileLocation = new FileDialog(Display.getCurrent()
+ .getActiveShell(), SWT.NONE).open();
txtCatlog.setText(fileLocation);
model.setCatalog(fileLocation);
}
});
-
- //binding files
- new Label(configCom, SWT.NONE).setText(JBossWSCreationCoreMessages.Label_Binding_File);
//$NON-NLS-1$
-
- final List bindingList = new List(configCom, SWT.BORDER | SWT.SCROLL_LINE |
SWT.V_SCROLL | SWT.H_SCROLL);
+
+ // binding files
+ new Label(configCom, SWT.NONE)
+ .setText(JBossWSCreationCoreMessages.Label_Binding_File); //$NON-NLS-1$
+
+ final List bindingList = new List(configCom, SWT.BORDER
+ | SWT.SCROLL_LINE | SWT.V_SCROLL | SWT.H_SCROLL);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.heightHint = Display.getCurrent().getActiveShell().getBounds().height / 4;
gd.verticalSpan = 3;
bindingList.setLayoutData(gd);
loadBindingFiles(bindingList);
- bindingList.addSelectionListener(new SelectionAdapter(){
+ bindingList.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- if(bindingList.getSelectionIndex() >= 0){
+ if (bindingList.getSelectionIndex() >= 0) {
btnRemove.setEnabled(true);
- }else{
+ } else {
btnRemove.setEnabled(false);
}
}
});
-
Button btnSelect = new Button(configCom, SWT.NONE);
- btnSelect.setText(JBossWSCreationCoreMessages.Label_Button_Text_Seletion);
//$NON-NLS-1$
- btnSelect.addSelectionListener(new SelectionAdapter(){
+ btnSelect
+ .setText(JBossWSCreationCoreMessages.Label_Button_Text_Seletion); //$NON-NLS-1$
+ btnSelect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
-
- String fileLocation = new FileDialog(Display.getCurrent().getActiveShell(),
SWT.NONE).open();
- if(fileLocation != null &&
- !model.getBindingFiles().contains(fileLocation)){
+
+ String fileLocation = new FileDialog(Display.getCurrent()
+ .getActiveShell(), SWT.NONE).open();
+ if (fileLocation != null
+ && !model.getBindingFiles().contains(fileLocation)) {
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(){
+ btnRemove.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
model.getBindingFiles().remove(bindingList.getSelectionIndex());
- bindingList.remove(bindingList.getSelectionIndex());
- if(bindingList.getSelectionIndex() == -1){
+ bindingList.remove(bindingList.getSelectionIndex());
+ if (bindingList.getSelectionIndex() == -1) {
btnRemove.setEnabled(false);
}
}
});
-
- 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{
+ 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());
+ }
+ }
+ });
+
+ 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());
}
- }
- });
-
- 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());
- }
- });
-
+ });
+ }
return this;
}
-
- private void loadBindingFiles(List bindingList){
- for(String fileLocation: model.getBindingFiles()){
+
+ private void loadBindingFiles(List bindingList) {
+ for (String fileLocation : model.getBindingFiles()) {
bindingList.add(fileLocation);
}
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/wsrt/JBossWSConfigWidgetFactory.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/wsrt/JBossWSConfigWidgetFactory.java 2008-06-22
12:41:42 UTC (rev 8892)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/wsrt/JBossWSConfigWidgetFactory.java 2008-06-22
12:50:34 UTC (rev 8893)
@@ -12,63 +12,70 @@
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.ui.widgets.CodeGenConfigWidget;
-public class JBossWSConfigWidgetFactory implements INamedWidgetContributorFactory {
+public class JBossWSConfigWidgetFactory implements
+ INamedWidgetContributorFactory {
- private SimpleWidgetContributor servicesXMLSelectWidgetContrib;
+ private SimpleWidgetContributor servicesXMLSelectWidgetContrib;
private ServiceModel model;
+ private CodeGenConfigWidget servicesXMLSelectWidget;
- public JBossWSConfigWidgetFactory(){
+ public JBossWSConfigWidgetFactory() {
}
- public INamedWidgetContributor getFirstNamedWidget(){
- if( servicesXMLSelectWidgetContrib == null ) init();
+ public INamedWidgetContributor getFirstNamedWidget() {
+ if (servicesXMLSelectWidgetContrib == null)
+ init();
return servicesXMLSelectWidgetContrib;
}
- public INamedWidgetContributor getNextNamedWidget( INamedWidgetContributor
widgetContributor){
- if( servicesXMLSelectWidgetContrib == null ) init();
+ public INamedWidgetContributor getNextNamedWidget(
+ INamedWidgetContributor widgetContributor) {
+ if (servicesXMLSelectWidgetContrib == null)
+ init();
INamedWidgetContributor nextWidgetContrib = null;
return nextWidgetContrib;
}
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- // Map the data model from the defaulting command to this widget factory.
+ public void registerDataMappings(DataMappingRegistry dataRegistry) {
+ // Map the data model from the defaulting command to this widget
+ // factory.
// The framework will actually to the call to getWebServiceDataModel in
- // the ExampleDefaultingCommand class and then call the setWebServiceDataModel
+ // the ExampleDefaultingCommand class and then call the
+ // setWebServiceDataModel
// method in this class.
- dataRegistry.addMapping( InitialCommand.class,
- "WebServiceDataModel", //$NON-NLS-1$
- JBossWSConfigWidgetFactory.class );
- dataRegistry.addMapping(InitialClientCommand.class, "WebServiceDataModel",
JBossWSConfigWidgetFactory.class);
+ dataRegistry.addMapping(InitialCommand.class, "WebServiceDataModel",
//$NON-NLS-1$
+ JBossWSConfigWidgetFactory.class);
+ dataRegistry.addMapping(InitialClientCommand.class,
+ "WebServiceDataModel", JBossWSConfigWidgetFactory.class);
}
- public void setWebServiceDataModel( ServiceModel model ){
+ public void setWebServiceDataModel(ServiceModel model) {
this.model = model;
+ if (servicesXMLSelectWidget != null) {
+ servicesXMLSelectWidget.setModel(model);
+ }
}
- private void init(){
- //Pages of Axis2 Web Services Java Bean Scenario
- CodeGenConfigWidget servicesXMLSelectWidget =
- new CodeGenConfigWidget(model);
- servicesXMLSelectWidgetContrib = createWidgetContributor(
+ private void init() {
+
+ servicesXMLSelectWidget = new CodeGenConfigWidget(model);
+ servicesXMLSelectWidgetContrib = createWidgetContributor(
"JBoss Web Service Code Generation Configuration",
"Please input the appropriate option for the code generation",
- servicesXMLSelectWidget );
+ servicesXMLSelectWidget);
}
- private SimpleWidgetContributor createWidgetContributor(String title,
- String description,
- final WidgetDataContributor contributor){
- SimpleWidgetContributor widgetContrib = new SimpleWidgetContributor();
+ private SimpleWidgetContributor createWidgetContributor(String title,
+ String description, final WidgetDataContributor contributor) {
+ SimpleWidgetContributor widgetContrib = new SimpleWidgetContributor();
widgetContrib.setTitle(title);
widgetContrib.setDescription(description);
- widgetContrib.setFactory( new WidgetContributorFactory(){
- public WidgetContributor create(){
+ widgetContrib.setFactory(new WidgetContributorFactory() {
+ public WidgetContributor create() {
return contributor;
}
});
return widgetContrib;
- }
+ }
}