Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 35504 Details for
Bug 124392
Service project type defaults cannot be controlled by preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
apply to org.eclipse.jst.ws.consumption.ui
patch124392b_o.e.jst.ws.consumption.ui.txt (text/plain), 32.30 KB, created by
Rupam Kuehner
on 2006-02-28 16:30:12 EST
(
hide
)
Description:
apply to org.eclipse.jst.ws.consumption.ui
Filename:
MIME Type:
Creator:
Rupam Kuehner
Created:
2006-02-28 16:30:12 EST
Size:
32.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.ws.consumption.ui >Index: src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java,v >retrieving revision 1.36 >diff -u -r1.36 ProjectSelectionWidget.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java 24 Feb 2006 19:09:10 -0000 1.36 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java 28 Feb 2006 21:30:25 -0000 >@@ -12,6 +12,7 @@ > * 20060204 124143 rsinha@ca.ibm.com - Rupam Kuehner > * 20060221 122661 rsinha@ca.ibm.com - Rupam Kuehner > * 20060223 129020 rsinha@ca.ibm.com - Rupam Kuehner >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime; > >@@ -361,12 +362,18 @@ > } > else > { >- >- if (isClient_) >- { > // Select the preferred client project type. > ProjectTopologyContext ptc = WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); >- String[] preferredTemplateIds = ptc.getClientTypes(); >+ String[] preferredTemplateIds = null; >+ if (isClient_) >+ { >+ preferredTemplateIds = ptc.getClientTypes(); >+ } >+ else >+ { >+ preferredTemplateIds = ptc.getServiceTypes(); >+ } >+ > boolean selected = false; > outer: for (int j = 0; j < preferredTemplateIds.length; j++) > { >@@ -386,19 +393,6 @@ > { > projectType_.select(0); > } >- >- } else >- { >- // If a "..web.." template is there, pick that as the default. >- int webTemplateIndex = getWebTemplateIndex(templates); >- if (webTemplateIndex > -1) >- { >- projectType_.select(webTemplateIndex); >- } else >- { >- projectType_.select(0); >- } >- } > } > } > } >@@ -417,19 +411,6 @@ > return -1; > } > >- private int getWebTemplateIndex(String[] templateIds) >- { >- for (int i=0; i<templateIds.length; i++) >- { >- if (templateIds[i].indexOf("web") > -1) >- { >- return i; >- } >- } >- >- return -1; >- } >- > private void updateEARState() > { > if(!projectNeedsEAR(moduleProject_.getText())) >Index: src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java,v >retrieving revision 1.47 >diff -u -r1.47 ClientRuntimeSelectionWidgetDefaultingCommand.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java 24 Feb 2006 21:48:46 -0000 1.47 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java 28 Feb 2006 21:30:25 -0000 >@@ -13,6 +13,7 @@ > * 20060206 126408 rsinha@ca.ibm.com - Rupam Kuehner > * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner > * 20060222 115834 rsinha@ca.ibm.com - Rupam Kuehner >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime; > >@@ -655,7 +656,6 @@ > { > String[] templates = WebServiceRuntimeExtensionUtils2.getClientProjectTemplates(clientIds_.getTypeId(), clientIds_.getRuntimeId()); > >- //Pick the Web one if it's there, otherwise pick the first one. > //Walk the list of client project types in the project topology preference > ProjectTopologyContext ptc= WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); > String[] preferredTemplateIds = ptc.getClientTypes(); >@@ -955,23 +955,36 @@ > //Haven't returned yet so this means that the intitially selected project cannot be used > //to influence the selection of the service/client runtime. > >- //If this is client defaulting, use the preferred client project types to >- //influence the selection of a runtime. >- if (isClient) >- { >+ //Use the preferred project types to influence the selection of a runtime. > ProjectTopologyContext ptc = WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); >- String[] preferredTemplateIds = ptc.getClientTypes(); >+ String[] preferredTemplateIds = null; >+ if (isClient) >+ { >+ preferredTemplateIds = ptc.getClientTypes(); >+ } >+ else >+ { >+ preferredTemplateIds = ptc.getServiceTypes(); >+ } >+ > > for (int n=0; n<preferredTemplateIds.length; n++) > { > String preferredTemplateId = preferredTemplateIds[n]; >- //Set templateFacetVersions = FacetUtils.getInitialFacetVersionsFromTemplate(preferredTemplateId); > > for (int m=0; m<preferredRuntimeIds.length; m++) > { >- //If this clientRuntime supports this template, choose it and exit. >- //ClientRuntimeDescriptor desc = WebServiceRuntimeExtensionUtils2.getClientRuntimeDescriptorById(preferredRuntimeIds[m]); >- boolean matches = WebServiceRuntimeExtensionUtils2.doesClientRuntimeSupportTemplate(preferredRuntimeIds[m], preferredTemplateId); >+ //If this client or service runtime supports this template, choose it and exit. >+ boolean matches = false; >+ if (isClient) >+ { >+ matches = WebServiceRuntimeExtensionUtils2.doesClientRuntimeSupportTemplate(preferredRuntimeIds[m], preferredTemplateId); >+ } >+ else >+ { >+ matches = WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportTemplate(preferredRuntimeIds[m], preferredTemplateId); >+ } >+ > if (matches) > { > DefaultRuntimeTriplet drt = new DefaultRuntimeTriplet(); >@@ -982,7 +995,7 @@ > } > } > } >- } >+ > > //Still haven't returned. Return the first preferred service/client runtime id. > if (preferredRuntimeIds.length > 0) >Index: src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyContext.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyContext.java,v >retrieving revision 1.1 >diff -u -r1.1 ProjectTopologyContext.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyContext.java 29 Nov 2005 20:17:23 -0000 1.1 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyContext.java 28 Feb 2006 21:30:25 -0000 >@@ -1,12 +1,15 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * >+ * > * Contributors: >- * IBM Corporation - initial API and implementation >+ * IBM Corporation - initial API and implementation >+ * yyyymmdd bug Email and other contact information >+ * -------- -------- ----------------------------------------------------------- >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > > package org.eclipse.jst.ws.internal.consumption.ui.preferences; >@@ -17,14 +20,20 @@ > * This constant String is used to lookup the preferred order of the different client types > **/ > public static final String PREFERENCE_CLIENT_TYPES = "clientTypes"; >+ public static final String PREFERENCE_SERVICE_TYPES = "serviceTypes"; > > /** > * This constant String is used to lookup the two EAR option > **/ > public static final String PREFERENCE_USE_TWO_EARS = "useTwoEARs"; > >+ public void setServiceTypes(String[] ids); >+ public String[] getServiceTypes(); >+ public String[] getDefaultServiceTypes(); >+ > public void setClientTypes(String[] ids); > public String[] getClientTypes(); >+ public String[] getDefaultClientTypes(); > > public void setUseTwoEARs(boolean use); > public boolean isUseTwoEARs(); >Index: src/org/eclipse/jst/ws/internal/consumption/ui/preferences/TransientProjectTopologyContext.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/TransientProjectTopologyContext.java,v >retrieving revision 1.1 >diff -u -r1.1 TransientProjectTopologyContext.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/preferences/TransientProjectTopologyContext.java 29 Nov 2005 20:17:23 -0000 1.1 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/preferences/TransientProjectTopologyContext.java 28 Feb 2006 21:30:25 -0000 >@@ -1,12 +1,15 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * >+ * > * Contributors: >- * IBM Corporation - initial API and implementation >+ * IBM Corporation - initial API and implementation >+ * yyyymmdd bug Email and other contact information >+ * -------- -------- ----------------------------------------------------------- >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > > package org.eclipse.jst.ws.internal.consumption.ui.preferences; >@@ -14,11 +17,25 @@ > > public class TransientProjectTopologyContext implements ProjectTopologyContext > { >+ private String[] serviceTypes; >+ private String[] defaultServiceTypes; >+ > private String[] clientTypes; >+ private String[] defaultClientTypes; >+ > private boolean twoEARs; > > public TransientProjectTopologyContext () {} > >+ public void setServiceTypes(String[] serviceTypes) >+ { >+ this.serviceTypes = serviceTypes; >+ } >+ public String[] getServiceTypes() >+ { >+ return serviceTypes; >+ } >+ > public void setClientTypes(String[] clientTypes) > { > this.clientTypes = clientTypes; >@@ -39,8 +56,35 @@ > > public ProjectTopologyContext copy() { > TransientProjectTopologyContext context = new TransientProjectTopologyContext(); >+ context.setServiceTypes(getServiceTypes()); >+ context.setDefaultServiceTypes(getDefaultServiceTypes()); > context.setClientTypes(getClientTypes()); >+ context.setDefaultClientTypes(getDefaultClientTypes()); > context.setUseTwoEARs(isUseTwoEARs()); > return context; > } >+ >+ >+public void setDefaultServiceTypes(String[] defaultServiceTypes) >+{ >+ this.defaultServiceTypes = defaultServiceTypes; >+} >+ >+public String[] getDefaultServiceTypes() >+{ >+ return defaultServiceTypes; >+ >+} >+ >+ >+public void setDefaultClientTypes(String[] defaultClientTypes) >+{ >+ this.defaultClientTypes = defaultClientTypes; >+} >+ >+public String[] getDefaultClientTypes() >+{ >+ return defaultClientTypes; >+ >+} > } >Index: src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyPreferencePage.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyPreferencePage.java,v >retrieving revision 1.3 >diff -u -r1.3 ProjectTopologyPreferencePage.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyPreferencePage.java 2 Feb 2006 19:04:36 -0000 1.3 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyPreferencePage.java 28 Feb 2006 21:30:25 -0000 >@@ -1,17 +1,21 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2004 IBM Corporation and others. >+ * Copyright (c) 2003, 2006 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * >+ * > * Contributors: >- * IBM Corporation - initial API and implementation >+ * IBM Corporation - initial API and implementation >+ * yyyymmdd bug Email and other contact information >+ * -------- -------- ----------------------------------------------------------- >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > > package org.eclipse.jst.ws.internal.consumption.ui.preferences; > > import java.util.Vector; >+ > import org.eclipse.jface.preference.PreferencePage; > import org.eclipse.jface.viewers.ColumnWeightData; > import org.eclipse.jface.viewers.IStructuredContentProvider; >@@ -31,9 +35,9 @@ > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Group; > import org.eclipse.swt.widgets.Table; > import org.eclipse.swt.widgets.TableColumn; >-import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchPreferencePage; > import org.eclipse.ui.PlatformUI; >@@ -47,6 +51,11 @@ > /*CONTEXT_ID PTPP0001 for the Project Topology Preference Page*/ > private String INFOPOP_PTPP_PAGE = WebServiceUIPlugin.ID + ".PPTP0001"; > >+ private TableViewer serviceTypeViewer_; >+ private Button serviceMoveUp_; >+ private Button serviceMoveDown_; >+ private Vector serviceTypes_; >+ > private TableViewer clientTypeViewer_; > private Button moveUp_; > private Button moveDown_; >@@ -68,17 +77,62 @@ > parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); > PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,INFOPOP_PTPP_PAGE); > >- Text clientTypeLabel = new Text(parent, SWT.READ_ONLY | SWT.WRAP); >- clientTypeLabel.setText(WSUIPluginMessages.LABEL_CLIENT_TYPE_NAME); >- clientTypeLabel.setLayoutData( new GridData( GridData.FILL_HORIZONTAL)); >+ Group serviceTypeComposite = new Group( parent, SWT.NONE ); >+ GridLayout servicegl = new GridLayout(); >+ servicegl.numColumns = 2; >+ servicegl.marginHeight = 0; >+ servicegl.marginWidth = 0; >+ serviceTypeComposite.setLayout(servicegl); >+ serviceTypeComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL )); >+ serviceTypeComposite.setText(WSUIPluginMessages.LABEL_SERVICE_TYPE_NAME); >+ >+ Table serviceTable= new Table(serviceTypeComposite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); >+ GridData servicegd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); >+ servicegd.widthHint = 256; >+ serviceTable.setLayoutData(servicegd); >+ serviceTable.setToolTipText(WSUIPluginMessages.TOOLTIP_SERVICE_TYPE_TABLE_VIEWER); >+ >+ serviceTypes_ = new Vector(); >+ serviceTypeViewer_ = new TableViewer(serviceTable); >+ serviceTypeViewer_.setContentProvider(new ClientTypeContentProvider()); >+ serviceTypeViewer_.setLabelProvider(new ClientTypeLabelProvider()); >+ serviceTypeViewer_.setInput(serviceTypes_); >+ >+ TableLayout serviceTableLayout = new TableLayout(); >+ TableColumn serviceTableColumn = new TableColumn(serviceTable, SWT.NONE); >+ serviceTableColumn.setText(WSUIPluginMessages.LABEL_SERVICE_TYPE_NAME); >+ ColumnWeightData serviceColumnData = new ColumnWeightData(256, 256, false); >+ serviceTableLayout.addColumnData(serviceColumnData); >+ serviceTable.setLayout(serviceTableLayout); >+ >+ Composite servicec = new Composite(serviceTypeComposite, SWT.NONE); >+ servicegl = new GridLayout(); >+ servicegl.numColumns = 1; >+ servicegl.marginHeight = 10; >+ servicegl.marginWidth = 0; >+ servicec.setLayout(servicegl); >+ >+ serviceMoveUp_ = new Button(servicec, SWT.PUSH); >+ serviceMoveUp_.setText(WSUIPluginMessages.LABEL_MOVE_UP); >+ serviceMoveUp_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); >+ serviceMoveUp_.addSelectionListener(this); >+ serviceMoveUp_.setToolTipText(WSUIPluginMessages.TOOLTIP_MOVE_UP); >+ >+ serviceMoveDown_ = new Button(servicec, SWT.PUSH); >+ serviceMoveDown_.setText(WSUIPluginMessages.LABEL_MOVE_DOWN); >+ serviceMoveDown_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); >+ serviceMoveDown_.addSelectionListener(this); >+ serviceMoveDown_.setToolTipText(WSUIPluginMessages.TOOLTIP_MOVE_DOWN); >+ > >- Composite clientTypeComposite = new Composite(parent, SWT.NONE); >+ Group clientTypeComposite = new Group( parent, SWT.NONE ); > GridLayout gl = new GridLayout(); > gl.numColumns = 2; > gl.marginHeight = 0; > gl.marginWidth = 0; > clientTypeComposite.setLayout(gl); > clientTypeComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL )); >+ clientTypeComposite.setText(WSUIPluginMessages.LABEL_CLIENT_TYPE_NAME); > > Table table= new Table(clientTypeComposite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); > GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); >@@ -157,20 +211,48 @@ > */ > public void init(IWorkbench workbench) { } > >+ > /** >- * Initializes states of the controls to their burned-in defaults. >+ * Adds the String elements of array a into Vector v. If String array b contains any elements >+ * that are not already in array a, appends these elements from array b to the end of Vector v. >+ * @param a a String array >+ * @param b a String array >+ * @param v a non-null Vector > */ >- private void initializeDefaults() >+ private void setVectorContentsFromTwoArrays(String[] a, String[] b, Vector v) > { >- clientTypes_.clear(); >- String[] types = ProjectTopologyDefaults.getClientTypes(); >- >- for (int i = 0; i < types.length; i++) >+ for (int i = 0; i < a.length; i++) > { >- clientTypes_.add(types[i]); >+ v.add(a[i]); > } > >+ for (int i = 0; i < b.length; i++) >+ { >+ if (v.indexOf(b[i]) == -1) >+ { >+ v.add(b[i]); >+ } >+ } >+ } >+ >+ /** >+ * Initializes states of the controls to their burned-in defaults. >+ */ >+ private void initializeDefaults() >+ { >+ ProjectTopologyContext context = WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); >+ serviceTypes_.clear(); >+ String[] defaultServiceTypes = context.getDefaultServiceTypes(); >+ String[] allServiceTypes = ProjectTopologyDefaults.getServiceTypes(); >+ setVectorContentsFromTwoArrays(defaultServiceTypes, allServiceTypes, serviceTypes_); >+ serviceTypeViewer_.refresh(); >+ >+ clientTypes_.clear(); >+ String[] defaultClientTypes = context.getDefaultClientTypes(); >+ String[] allClientTypes = ProjectTopologyDefaults.getClientTypes(); >+ setVectorContentsFromTwoArrays(defaultClientTypes, allClientTypes, clientTypes_); > clientTypeViewer_.refresh(); >+ > twoEAR_.setSelection(true); > } > >@@ -179,29 +261,35 @@ > */ > private void initializeValues() > { >+ //Initial service project types. > ProjectTopologyContext context = WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); >- String[] types = context.getClientTypes(); >- for (int i = 0; i < types.length; i++) >- clientTypes_.add(types[i]); >- // check whether we missed any types from the default list >- boolean missed = false; >- types = ProjectTopologyDefaults.getClientTypes(); >- for (int i = 0; i < types.length; i++) >+ String[] serviceTypesFromContext = context.getServiceTypes(); >+ String[] allServiceTypes = ProjectTopologyDefaults.getServiceTypes(); >+ setVectorContentsFromTwoArrays(serviceTypesFromContext, allServiceTypes, serviceTypes_); >+ if (allServiceTypes.length > serviceTypesFromContext.length) > { >- if (clientTypes_.indexOf(types[i]) == -1) >- { >- clientTypes_.add(types[i]); >- missed = true; >- } >+ String[] serviceTypesArray = new String[serviceTypes_.size()]; >+ serviceTypes_.copyInto(serviceTypesArray); >+ context.setServiceTypes(serviceTypesArray); > } >- if (missed) >+ // refresh viewer >+ serviceTypeViewer_.refresh(); >+ >+ >+ //Initialize client project types. >+ String[] clientTypesFromContext = context.getClientTypes(); >+ String[] allClientTypes = ProjectTopologyDefaults.getClientTypes(); >+ setVectorContentsFromTwoArrays(clientTypesFromContext, allClientTypes, clientTypes_); >+ if (allClientTypes.length > clientTypesFromContext.length) > { >- types = new String[clientTypes_.size()]; >- clientTypes_.copyInto(types); >- context.setClientTypes(types); >+ String[] clientTypesArray = new String[clientTypes_.size()]; >+ clientTypes_.copyInto(clientTypesArray); >+ context.setClientTypes(clientTypesArray); > } >+ > // refresh viewer > clientTypeViewer_.refresh(); >+ > twoEAR_.setSelection(context.isUseTwoEARs()); > } > >@@ -211,6 +299,9 @@ > private void storeValues() > { > ProjectTopologyContext context = WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); >+ String[] serviceTypesArray = new String[serviceTypes_.size()]; >+ serviceTypes_.copyInto(serviceTypesArray); >+ context.setServiceTypes(serviceTypesArray); > String[] types = new String[clientTypes_.size()]; > clientTypes_.copyInto(types); > context.setClientTypes(types); >@@ -223,20 +314,41 @@ > > public void widgetSelected(SelectionEvent e) > { >- int index = clientTypeViewer_.getTable().getSelectionIndex(); >- if (index != -1) >+ if (e.widget == serviceMoveUp_ || e.widget == serviceMoveDown_) > { >- if (e.widget == moveUp_ && index > 0) >+ int index = serviceTypeViewer_.getTable().getSelectionIndex(); >+ if (index != -1) > { >- Object object = clientTypes_.remove(index); >- clientTypes_.insertElementAt(object, index-1); >- clientTypeViewer_.refresh(); >+ if (e.widget == serviceMoveUp_ && index > 0) >+ { >+ Object object = serviceTypes_.remove(index); >+ serviceTypes_.insertElementAt(object, index-1); >+ serviceTypeViewer_.refresh(); >+ } >+ else if (e.widget == serviceMoveDown_ && index < serviceTypes_.size()-1) >+ { >+ Object object = serviceTypes_.remove(index); >+ serviceTypes_.insertElementAt(object, index+1); >+ serviceTypeViewer_.refresh(); >+ } > } >- else if (e.widget == moveDown_ && index < clientTypes_.size()-1) >+ } >+ else if (e.widget == moveUp_ || e.widget == moveDown_) >+ { >+ int index = clientTypeViewer_.getTable().getSelectionIndex(); >+ if (index != -1) > { >- Object object = clientTypes_.remove(index); >- clientTypes_.insertElementAt(object, index+1); >- clientTypeViewer_.refresh(); >+ if (e.widget == moveUp_ && index > 0) >+ { >+ Object object = clientTypes_.remove(index); >+ clientTypes_.insertElementAt(object, index - 1); >+ clientTypeViewer_.refresh(); >+ } else if (e.widget == moveDown_ && index < clientTypes_.size() - 1) >+ { >+ Object object = clientTypes_.remove(index); >+ clientTypes_.insertElementAt(object, index + 1); >+ clientTypeViewer_.refresh(); >+ } > } > } > } >Index: src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyDefaults.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyDefaults.java,v >retrieving revision 1.1 >diff -u -r1.1 ProjectTopologyDefaults.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyDefaults.java 29 Nov 2005 20:17:23 -0000 1.1 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ProjectTopologyDefaults.java 28 Feb 2006 21:30:25 -0000 >@@ -1,12 +1,15 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * >+ * > * Contributors: >- * IBM Corporation - initial API and implementation >+ * IBM Corporation - initial API and implementation >+ * yyyymmdd bug Email and other contact information >+ * -------- -------- ----------------------------------------------------------- >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > > package org.eclipse.jst.ws.internal.consumption.ui.preferences; >@@ -15,6 +18,12 @@ > > public class ProjectTopologyDefaults > { >+ >+ public static final String[] getServiceTypes() >+ { >+ return WebServiceRuntimeExtensionUtils2.getAllServiceProjectTypes(); >+ } >+ > public static final String[] getClientTypes() > { > return WebServiceRuntimeExtensionUtils2.getAllClientProjectTypes(); >Index: src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentProjectTopologyContext.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentProjectTopologyContext.java,v >retrieving revision 1.3 >diff -u -r1.3 PersistentProjectTopologyContext.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentProjectTopologyContext.java 22 Feb 2006 03:46:23 -0000 1.3 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentProjectTopologyContext.java 28 Feb 2006 21:30:25 -0000 >@@ -11,6 +11,7 @@ > * -------- -------- ----------------------------------------------------------- > * 20060202 119780 pmoogk@ca.ibm.com - Peter Moogk > * 20060216 127138 pmoogk@ca.ibm.com - Peter Moogk >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > > package org.eclipse.jst.ws.internal.consumption.ui.preferences; >@@ -30,6 +31,18 @@ > > public void load() > { >+ //Load the service project types >+ String[] serviceIds = ProjectTopologyDefaults.getServiceTypes(); >+ StringBuffer serviceSb = new StringBuffer(); >+ for (int i = 0; i < serviceIds.length; i++) >+ { >+ if (i != 0) >+ serviceSb.append(" "); >+ serviceSb.append(serviceIds[i]); >+ } >+ setDefaultStringIfNoDefault(PREFERENCE_SERVICE_TYPES, serviceSb.toString()); >+ >+ //Load the client project types > String[] ids = ProjectTopologyDefaults.getClientTypes(); > StringBuffer sb = new StringBuffer(); > for (int i = 0; i < ids.length; i++) >@@ -42,6 +55,36 @@ > setDefault(PREFERENCE_USE_TWO_EARS, ProjectTopologyDefaults.isUseTwoEARs()); > } > >+ public void setServiceTypes(String[] ids) >+ { >+ StringBuffer sb = new StringBuffer(); >+ for (int i = 0; i < ids.length; i++) >+ { >+ if (i != 0) >+ sb.append(" "); >+ sb.append(ids[i]); >+ } >+ setValue(PREFERENCE_SERVICE_TYPES, sb.toString()); >+ } >+ >+ public String[] getServiceTypes() >+ { >+ StringTokenizer st = new StringTokenizer(getValueAsString(PREFERENCE_SERVICE_TYPES)); >+ String[] s = new String[st.countTokens()]; >+ for (int i = 0; i < s.length; i++) >+ s[i] = st.nextToken(); >+ return s; >+ } >+ >+ public String[] getDefaultServiceTypes() >+ { >+ StringTokenizer st = new StringTokenizer(getDefaultString(PREFERENCE_SERVICE_TYPES)); >+ String[] s = new String[st.countTokens()]; >+ for (int i = 0; i < s.length; i++) >+ s[i] = st.nextToken(); >+ return s; >+ } >+ > public void setClientTypes(String[] ids) > { > StringBuffer sb = new StringBuffer(); >@@ -62,6 +105,15 @@ > s[i] = st.nextToken(); > return s; > } >+ >+ public String[] getDefaultClientTypes() >+ { >+ StringTokenizer st = new StringTokenizer(getDefaultString(PREFERENCE_CLIENT_TYPES)); >+ String[] s = new String[st.countTokens()]; >+ for (int i = 0; i < s.length; i++) >+ s[i] = st.nextToken(); >+ return s; >+ } > > public void setUseTwoEARs(boolean use) > { >@@ -74,8 +126,12 @@ > > public ProjectTopologyContext copy() { > TransientProjectTopologyContext context = new TransientProjectTopologyContext(); >+ context.setServiceTypes(getServiceTypes()); >+ context.setDefaultServiceTypes(getDefaultServiceTypes()); > context.setClientTypes(getClientTypes()); >+ context.setDefaultClientTypes(getDefaultClientTypes()); > context.setUseTwoEARs(isUseTwoEARs()); > return context; > } >+ > } >Index: src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils2.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils2.java,v >retrieving revision 1.14 >diff -u -r1.14 WebServiceRuntimeExtensionUtils2.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils2.java 22 Feb 2006 18:28:10 -0000 1.14 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils2.java 28 Feb 2006 21:30:25 -0000 >@@ -11,6 +11,7 @@ > * -------- -------- ----------------------------------------------------------- > * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner > * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner >+ * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner > *******************************************************************************/ > > package org.eclipse.jst.ws.internal.consumption.ui.wsrt; >@@ -58,6 +59,35 @@ > return null; > } > >+ >+ public static String[] getAllServiceProjectTypes() >+ { >+ ArrayList finalTemplateIdList = new ArrayList(); >+ Iterator iter = registry.serviceRuntimes_.values().iterator(); >+ >+ //Loop through all the serviceRuntimes >+ while (iter.hasNext()) >+ { >+ ServiceRuntimeDescriptor desc = (ServiceRuntimeDescriptor)iter.next(); >+ >+ //Get the templates for this service runtime >+ Set templates = FacetMatchCache.getInstance().getTemplatesForServiceRuntime(desc.getId()); >+ >+ //Add the template ids to the list if they have not already been added >+ Iterator itr = templates.iterator(); >+ while (itr.hasNext()) >+ { >+ IFacetedProjectTemplate template = (IFacetedProjectTemplate)itr.next(); >+ if (!finalTemplateIdList.contains(template.getId())) >+ { >+ finalTemplateIdList.add(template.getId()); >+ } >+ } >+ } >+ >+ return (String[])finalTemplateIdList.toArray(new String[]{}); >+ } >+ > public static String[] getAllClientProjectTypes() > { > ArrayList finalTemplateIdList = new ArrayList();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 124392
:
35425
|
35426
|
35427
| 35504