This commit was manufactured by cvs2svn to create tag 'R1_0_0'.
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/WSDLComponentRenameParticipant.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/WSDLComponentRenameParticipant.java
new file mode 100644
index 0000000..c9f9d01
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/WSDLComponentRenameParticipant.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+
+package org.eclipse.wst.wsdl.ui.internal.refactor;
+
+import java.util.List;
+
+import org.eclipse.wst.wsdl.WSDLElement;
+import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.ComponentRenameArguments;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.XMLComponentRenameParticipant;
+import org.eclipse.xsd.XSDNamedComponent;
+
+/**
+ * This participant takes case of renaming matches that are XSD components
+ */
+public class WSDLComponentRenameParticipant extends XMLComponentRenameParticipant {
+
+ protected boolean initialize(Object element) {
+
+ if(element instanceof WSDLElement || element instanceof XSDNamedComponent){
+ if(getArguments() instanceof ComponentRenameArguments){
+ matches = (List)((ComponentRenameArguments)getArguments()).getMatches().get(IWSDLSearchConstants.WSDL_NAMESPACE);
+ }
+ if(matches != null){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String getName() {
+
+ return "WSDL component rename participant";
+ }
+}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/RenameComponentAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/RenameComponentAction.java
new file mode 100644
index 0000000..543c8c6
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/RenameComponentAction.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.wst.wsdl.ui.internal.refactor.actions;
+
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.ui.actions.GlobalBuildAction;
+import org.eclipse.wst.wsdl.Binding;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.PortType;
+import org.eclipse.wst.wsdl.WSDLElement;
+import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
+import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
+import org.eclipse.wst.wsdl.ui.internal.util.NodeAssociationManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.w3c.dom.Element;
+
+public class RenameComponentAction extends WSDLSelectionDispatchAction {
+
+ private RefactoringComponent selectedComponent;
+
+ public RenameComponentAction(ISelection selection,
+ Definition model) {
+ super(selection);
+ setModel(model);
+ }
+
+ protected boolean doCanEnableXSDSelection(XSDNamedComponent selectedObject) {
+
+ selectedComponent = null;
+ if (selectedObject != null) {
+ selectedComponent = new XMLRefactoringComponent(
+ selectedObject,
+ (IDOMElement)selectedObject.getElement(),
+ selectedObject.getName(),
+ selectedObject.getTargetNamespace());
+
+ // if it's element reference, then this action is not appropriate
+ if (selectedObject instanceof XSDElementDeclaration) {
+ XSDElementDeclaration element = (XSDElementDeclaration) selectedObject;
+ if (element.isElementDeclarationReference()) {
+ selectedComponent = null;
+ }
+ }
+ if(selectedObject instanceof XSDTypeDefinition){
+ XSDTypeDefinition type = (XSDTypeDefinition) selectedObject;
+ XSDConcreteComponent parent = type.getContainer();
+ if (parent instanceof XSDElementDeclaration) {
+ XSDElementDeclaration element = (XSDElementDeclaration) parent;
+ if(element.getAnonymousTypeDefinition().equals(type)){
+ selectedComponent = null;
+ }
+ }
+ else if(parent instanceof XSDAttributeDeclaration) {
+ XSDAttributeDeclaration element = (XSDAttributeDeclaration) parent;
+ if(element.getAnonymousTypeDefinition().equals(type)){
+ selectedComponent = null;
+ }
+ }
+ }
+ }
+
+ return canRun();
+ }
+
+ protected boolean doCanEnableWSDLSelection(WSDLElement selectedObject) {
+
+ selectedComponent = null;
+ String localName = null;
+ String namespace = null;
+ if (selectedObject instanceof Binding){
+ localName = ((Binding)selectedObject).getQName().getLocalPart();
+ namespace = ((Binding)selectedObject).getQName().getNamespaceURI();
+ }
+ else if (selectedObject instanceof PortType){
+ localName = ((PortType)selectedObject).getQName().getLocalPart();
+ namespace = ((PortType)selectedObject).getQName().getNamespaceURI();
+ }
+ else if (selectedObject instanceof Message){
+ localName = ((Message)selectedObject).getQName().getLocalPart();
+ namespace = ((Message)selectedObject).getQName().getNamespaceURI();
+ }
+ if(localName != null){
+ selectedComponent = new XMLRefactoringComponent(
+ selectedObject,
+ (IDOMElement)selectedObject.getElement(),
+ localName,
+ namespace);
+ }
+
+
+ return canRun();
+ }
+
+ protected boolean canEnable(Object selectedObject) {
+
+ if (selectedObject instanceof XSDNamedComponent) {
+ return doCanEnableXSDSelection((XSDNamedComponent) selectedObject);
+ } else if(selectedObject instanceof WSDLElementImpl){
+ return doCanEnableWSDLSelection((WSDLElementImpl) selectedObject);
+ }
+ if (selectedObject instanceof Element) {
+ Element node = (Element) selectedObject;
+ if (getDefinition() != null) {
+ // issue (eb) dependency on utility class to get component from the model based on element
+ Object concreteComponent = (new NodeAssociationManager()).getModelObjectForNode(getDefinition(), node);
+ return canEnable(concreteComponent);
+ }
+ }
+ return false;
+
+ }
+
+ public boolean canRun() {
+
+ return selectedComponent != null;
+ }
+
+ public void run(ISelection selection) {
+
+ RenameComponentProcessor processor = new RenameComponentProcessor(selectedComponent, selectedComponent.getName());
+ RenameRefactoring refactoring = new RenameRefactoring(processor);
+ try {
+ RefactoringWizard wizard = new RenameRefactoringWizard(
+ refactoring,
+ RefactoringMessages
+ .getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
+ RefactoringMessages
+ .getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
+ null);
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
+ wizard);
+ op.run(WSDLEditorPlugin.getShell(), wizard
+ .getDefaultPageTitle());
+ triggerBuild();
+ } catch (InterruptedException e) {
+ // do nothing. User action got cancelled
+ }
+
+ }
+
+ public static void triggerBuild() {
+ if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
+ new GlobalBuildAction(WSDLEditorPlugin.getInstance().getWorkbench()
+ .getActiveWorkbenchWindow(),
+ IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
+ }
+ }
+
+
+}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorActionGroup.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorActionGroup.java
new file mode 100644
index 0000000..b9bed6c
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorActionGroup.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+
+package org.eclipse.wst.wsdl.ui.internal.refactor.actions;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.xsd.ui.internal.refactor.actions.RenameAction;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
+
+public class WSDLRefactorActionGroup extends RefactorActionGroup {
+
+
+ private static final String RENAME_ELEMENT = "org.eclipse.wst.wsdl.ui.refactor.rename.element"; //$NON-NLS-1$
+
+
+ public WSDLRefactorActionGroup(ISelection selection,
+ Definition definition) {
+
+ super(selection);
+ if( definition != null){
+ fEditorActions = new ArrayList();
+ RenameComponentAction action = new RenameComponentAction(selection, definition);
+ fRenameAction = new RenameAction(selection);
+ fRenameAction.setRenameComponentAction(action);
+ fRenameAction.setActionDefinitionId(RENAME_ELEMENT);
+ fEditorActions.add(fRenameAction);
+ initAction(fRenameAction, selection);
+ }
+ }
+
+ public void dispose() {
+ //disposeAction(fRenameAction, fSelectionProvider);
+ super.dispose();
+ }
+
+}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorGroupActionDelegate.java
new file mode 100644
index 0000000..02fcfdf
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorGroupActionDelegate.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+
+package org.eclipse.wst.wsdl.ui.internal.refactor.actions;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.WSDLFactory;
+import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupActionDelegate;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupSubMenu;
+
+public class WSDLRefactorGroupActionDelegate extends RefactorGroupActionDelegate {
+
+
+
+ public WSDLRefactorGroupActionDelegate() {
+ super();
+ }
+
+ /**
+ * Fills the menu with applicable refactor sub-menues
+ * @param menu The menu to fill
+ */
+ protected void fillMenu(Menu menu) {
+ if (fSelection == null) {
+ return;
+ }
+ if (workbenchPart != null) {
+ IWorkbenchPartSite site = workbenchPart.getSite();
+ if (site == null)
+ return;
+
+ IEditorPart editor = site.getPage().getActiveEditor();
+ if (editor != null) {
+ IEditorInput editorInput = editor.getEditorInput();
+ if(editorInput instanceof IFileEditorInput){
+ IFileEditorInput fileInput = (IFileEditorInput)editorInput;
+ Definition definition = createDefinition(fileInput.getFile(), resourceSet);
+ RefactorActionGroup refactorMenuGroup = new WSDLRefactorActionGroup(fSelection, definition);
+ RefactorGroupSubMenu subMenu = new RefactorGroupSubMenu(refactorMenuGroup);
+ subMenu.fill(menu, -1);
+ }
+
+ }
+
+ }
+
+ }
+
+
+public static Definition createDefinition(IFile file, ResourceSet resourceSet) {
+
+ URI uri = URI.createFileURI(file.getLocation().toString());
+ Definition definition = WSDLFactory.eINSTANCE.createDefinition();
+ // we need this model to be able to get locations
+ try {
+ definition.setDocumentBaseURI(uri.toString());
+ IStructuredModel structuredModel = StructuredModelManager
+ .getModelManager().getModelForRead(file);
+ IDOMModel domModel = (IDOMModel) structuredModel;
+ WSDLResourceFactoryImpl resourceFactory = new WSDLResourceFactoryImpl();
+ Resource wsdlResource = resourceFactory.createResource(uri);
+ wsdlResource.setURI(uri);
+ if(resourceSet != null){
+ resourceSet.getResources().add(wsdlResource);
+ }
+ definition.setElement(domModel.getDocument()
+ .getDocumentElement());
+ } catch (IOException e) {
+ // do nothing
+ } catch (CoreException e) {
+ // do nothing
+ }
+ return definition;
+ }
+
+
+
+}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLSelectionDispatchAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLSelectionDispatchAction.java
new file mode 100644
index 0000000..cc81b42
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLSelectionDispatchAction.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+
+package org.eclipse.wst.wsdl.ui.internal.refactor.actions;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.xsd.ui.internal.refactor.actions.SelectionDispatchAction;
+
+
+public class WSDLSelectionDispatchAction extends SelectionDispatchAction
+{
+ public static final String RENAME_ELEMENT = "org.eclipse.wst.wsdl.ui.refactor.rename.element"; //$NON-NLS-1$
+
+ public WSDLSelectionDispatchAction(ISelection selection)
+ {
+ super(selection);
+ }
+
+ protected Definition getDefinition(){
+ Object model = getModel();
+ if(model instanceof Definition)
+ {
+ return (Definition) model;
+ }
+
+ return null;
+ }
+
+
+
+}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/IWSDLSearchConstants.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/IWSDLSearchConstants.java
new file mode 100644
index 0000000..9aaa516
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/IWSDLSearchConstants.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+
+package org.eclipse.wst.wsdl.ui.internal.search;
+
+import org.eclipse.wst.common.core.search.pattern.QualifiedName;
+
+
+public interface IWSDLSearchConstants {
+
+ public static final String WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/";
+ public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
+
+ public static String WSDL_CONTENT_TYPE_ID = "org.eclipse.wst.wsdl.wsdlsource";
+
+ public static final QualifiedName MESSAGE_META_NAME = new QualifiedName(
+ WSDL_NAMESPACE, "message");
+
+ public static final QualifiedName PORT_TYPE_META_NAME = new QualifiedName(
+ WSDL_NAMESPACE, "portType");
+
+ public static final QualifiedName BINDING_META_NAME = new QualifiedName(
+ WSDL_NAMESPACE, "binding");
+
+
+
+}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchContributor.java
new file mode 100644
index 0000000..1b4445b
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchContributor.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+
+package org.eclipse.wst.wsdl.ui.internal.search;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.wst.common.core.search.pattern.SearchPattern;
+import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
+import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
+import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
+
+public class WSDLSearchContributor extends ComponentSearchContributor {
+
+
+ protected void initializeDeclarations() {
+
+ declarations = new HashMap();
+ String ns = IWSDLSearchConstants.WSDL_NAMESPACE;
+
+ SearchPattern pattern = new XMLSearchPattern(ns, "message", "name");
+ declarations.put(IWSDLSearchConstants.MESSAGE_META_NAME, pattern);
+
+ pattern = new XMLSearchPattern( ns, "portType", "name");
+ declarations.put(IWSDLSearchConstants.PORT_TYPE_META_NAME, pattern);
+
+ pattern = new XMLSearchPattern(ns, "binding", "name");
+ declarations.put(IWSDLSearchConstants.BINDING_META_NAME, pattern);
+
+ }
+
+ protected void initializeReferences() {
+
+ references = new HashMap();
+ String ns = IWSDLSearchConstants.WSDL_NAMESPACE;
+
+ List patterns = new ArrayList();
+ patterns.add(new XMLSearchPattern( ns, "part", "element"));
+ references.put(IXSDSearchConstants.ELEMENT_META_NAME, patterns);
+
+ patterns = new ArrayList();
+ patterns.add(new XMLSearchPattern(ns, "part", "type"));
+ references.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, patterns);
+
+ patterns = new ArrayList();
+ patterns.add(new XMLSearchPattern(ns, "part", "type"));
+ references.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, patterns);
+
+ patterns = new ArrayList();
+ patterns.add(new XMLSearchPattern(ns, "input", "message"));
+ patterns.add(new XMLSearchPattern(ns, "output", "message"));
+ patterns.add(new XMLSearchPattern(ns, "fault", "message"));
+ references.put(IWSDLSearchConstants.MESSAGE_META_NAME, patterns);
+
+ patterns = new ArrayList();
+ patterns.add(new XMLSearchPattern(ns, "binding", "type"));
+ references.put(IWSDLSearchConstants.PORT_TYPE_META_NAME, patterns);
+
+ patterns = new ArrayList();
+ patterns.add(new XMLSearchPattern( ns, "port", "binding"));
+ references.put(IWSDLSearchConstants.BINDING_META_NAME, patterns);
+ }
+
+ protected void initializeSupportedNamespaces() {
+ namespaces = new String[]{ IXSDSearchConstants.XMLSCHEMA_NAMESPACE, IWSDLSearchConstants.WSDL_NAMESPACE};
+ }
+
+}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchParticipant.java b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchParticipant.java
new file mode 100644
index 0000000..d8508b6
--- /dev/null
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchParticipant.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+
+package org.eclipse.wst.wsdl.ui.internal.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.common.core.search.SearchParticipant;
+import org.eclipse.wst.common.core.search.SearchPlugin;
+import org.eclipse.wst.common.core.search.pattern.SearchPattern;
+import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
+import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
+import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
+import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
+import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
+import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
+import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
+
+public class WSDLSearchParticipant extends XMLSearchParticipant {
+
+ private static String ID = "org.eclipse.wst.wsdl.search.WSDLSearchParticipant";
+ private static String XSD_PARTICIPANNT_ID = "org.eclipse.wst.xsd.search.XSDSearchParticipant";
+
+
+
+ public boolean initialize(SearchPattern pattern, String[] contentTypes){
+
+ super.initialize(pattern, contentTypes);
+ id = ID;
+ if(pattern instanceof XMLComponentSearchPattern ){
+ XMLComponentSearchPattern componentPattern = (XMLComponentSearchPattern)pattern;
+ String namespace = componentPattern.getMetaName().getNamespace();
+ if(IWSDLSearchConstants.WSDL_NAMESPACE.equals(namespace) ||
+ IXSDSearchConstants.XMLSCHEMA_NAMESPACE.equals(namespace)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ public ComponentSearchContributor getSearchContributor() {
+
+ return new WSDLSearchContributor();
+ }
+
+ public void beginSearching(SearchPattern pattern) {
+
+ super.beginSearching(pattern);
+ List patterns = new ArrayList();
+ if(pattern instanceof XMLComponentDeclarationPattern){
+
+ XMLComponentDeclarationPattern componentPattern = (XMLComponentDeclarationPattern)pattern;
+ if(IWSDLSearchConstants.WSDL_NAMESPACE.equals(componentPattern.getMetaName().getNamespace())){
+ XMLSearchPattern childPattern = getSearchContributor().getDeclarationPattern(componentPattern.getMetaName());
+ if(childPattern != null){
+ childPattern.setSearchName(componentPattern.getName().getLocalName());
+ childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
+ patterns.add(childPattern);
+ }
+ }
+ else if(IXSDSearchConstants.XMLSCHEMA_NAMESPACE.equals(componentPattern.getMetaName().getNamespace())){
+ SearchParticipant xsdParticipant = SearchPlugin.getDefault().getSearchParticipant(XSD_PARTICIPANNT_ID);
+ if(xsdParticipant instanceof XMLSearchParticipant){
+ ComponentSearchContributor xsdContributor = ((XMLSearchParticipant)xsdParticipant).getSearchContributor();
+ if(xsdContributor != null){
+ XMLSearchPattern childPattern = xsdContributor.getDeclarationPattern(componentPattern.getMetaName());
+ if(childPattern != null){
+ childPattern.setSearchName(componentPattern.getName().getLocalName());
+ childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
+ patterns.add(childPattern);
+ }
+ }
+ }
+ }
+ componentPattern.setChildren((XMLSearchPattern[]) patterns.toArray(new XMLSearchPattern[patterns.size()]));
+
+ }
+ else if(pattern instanceof XMLComponentReferencePattern){
+ XMLComponentReferencePattern componentPattern = (XMLComponentReferencePattern)pattern;
+ XMLSearchPattern[] childPatterns = getSearchContributor().getReferencesPatterns(componentPattern.getMetaName());
+ for (int i = 0; i < childPatterns.length; i++) {
+ XMLSearchPattern childPattern = childPatterns[i];
+ childPattern.setSearchName(componentPattern.getName().getLocalName());
+ childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
+ patterns.add(childPattern);
+ }
+ SearchParticipant xsdParticipant = SearchPlugin.getDefault().getSearchParticipant(XSD_PARTICIPANNT_ID);
+ if(xsdParticipant instanceof XMLSearchParticipant){
+ ComponentSearchContributor xsdContributor = ((XMLSearchParticipant)xsdParticipant).getSearchContributor();
+ if(xsdContributor != null){
+ childPatterns = xsdContributor.getReferencesPatterns(componentPattern.getMetaName());
+ for (int i = 0; i < childPatterns.length; i++) {
+ XMLSearchPattern childPattern = childPatterns[i];
+ childPattern.setSearchName(componentPattern.getName().getLocalName());
+ childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
+ patterns.add(childPattern);
+ }
+ }
+ }
+ componentPattern.setChildren((XMLSearchPattern[]) patterns.toArray(new XMLSearchPattern[patterns.size()]));
+
+ }
+
+ }
+
+
+
+
+
+
+
+}
diff --git a/docs/org.eclipse.wst.wsi.ui.doc.user/.project b/docs/org.eclipse.wst.wsi.ui.doc.user/.project
index 0d7c46e..c16d955 100644
--- a/docs/org.eclipse.wst.wsi.ui.doc.user/.project
+++ b/docs/org.eclipse.wst.wsi.ui.doc.user/.project
@@ -5,18 +5,7 @@
<projects>
</projects>
<buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/test.xml b/tests/org.eclipse.wst.wsdl.tests.performance/test.xml
index f9e55de..e153083 100644
--- a/tests/org.eclipse.wst.wsdl.tests.performance/test.xml
+++ b/tests/org.eclipse.wst.wsdl.tests.performance/test.xml
@@ -9,7 +9,7 @@
<property name="plugin-name" value="org.eclipse.wst.wsdl.tests.performance"/>
<property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
<property name="perf-tests-file" value="${testDir}/performance-tests.xml"/>
- <property name="extraVMargs" value="-Doagis80Dir=${testDir} -DprojectDir=${testDir}/OAGIS8.0 -Xmx512M"/>
+ <property name="extraVMargs" value="-Doagis80Dir=${testDir} -DprojectDir=${testDir}/OAGIS8.0 -Xmx256M"/>
<property name="workspace" value="${eclipse-home}/workspace_wsdl_performance"/>