diff options
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit')
11 files changed, 0 insertions, 1021 deletions
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11BindingReferenceEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11BindingReferenceEditManager.java deleted file mode 100644 index 16e72ee33..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11BindingReferenceEditManager.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CommandStack; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description; -import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11EndPoint; -import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin; -import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding; -import org.eclipse.wst.wsdl.ui.internal.dialogs.W11BrowseComponentDialog; -import org.eclipse.wst.wsdl.ui.internal.dialogs.W11NewComponentDialog; -import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants; -import org.eclipse.wst.wsdl.ui.internal.util.WSDLSetComponentHelper; -import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; - -public class W11BindingReferenceEditManager implements ComponentReferenceEditManager { - protected W11Description description; - protected IFile iFile; - - public W11BindingReferenceEditManager(W11Description description, IFile iFile) { - this.description = description; - this.iFile = iFile; - } - - public IComponentDialog getBrowseDialog() { - return new W11BrowseComponentDialog(IWSDLSearchConstants.BINDING_META_NAME, iFile, description); - } - - public IComponentDialog getNewDialog() { - return new W11NewComponentDialog(IWSDLSearchConstants.BINDING_META_NAME, iFile, description); - } - - private Definition getDefinition() { - return (Definition) description.getTarget(); - } - - public void modifyComponentReference(Object referencingObject, ComponentSpecification referencedComponent) { - W11EndPoint w11EndPoint = (W11EndPoint) referencingObject; - Object bindingObject = referencedComponent.getObject(); - if (bindingObject == null) { - // Need to figure out the IBinding based on the information contained in the ComponentSpecification - - } - - if (bindingObject instanceof ComponentSpecification) { - Port port = (Port) w11EndPoint.getTarget(); - WSDLSetComponentHelper helper = new WSDLSetComponentHelper(iFile, getDefinition()); - helper.setWSDLComponent(port, "binding", (ComponentSpecification) bindingObject); //$NON-NLS-1$ - } - else if (bindingObject instanceof IBinding){ - IBinding binding = (IBinding) bindingObject; - Command command = w11EndPoint.getSetBindingCommand(binding); - CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class); - stack.execute(command); - } - } - - public IComponentDescriptionProvider getComponentDescriptionProvider() { - return null; - } - - public ComponentSpecification[] getQuickPicks() { - List specList = new ArrayList(); - - Iterator bindings = description.getBindings().iterator(); - while (bindings.hasNext()) { - IBinding binding = (IBinding) bindings.next(); - String qualifier = ""; //$NON-NLS-1$ - String name = binding.getName(); - IFile file = null; - - ComponentSpecification spec = new ComponentSpecification(qualifier, name, file); - spec.setObject(binding); - specList.add(spec); - } - - ComponentSpecification[] specArray = new ComponentSpecification[specList.size()]; - specList.toArray(specArray); - - return specArray; - } - - public ComponentSpecification[] getHistory() { - ComponentSpecification[] history = new ComponentSpecification[0]; - return history; - } - - public void addToHistory(ComponentSpecification component) { - - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11InterfaceReferenceEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11InterfaceReferenceEditManager.java deleted file mode 100644 index d4efef365..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11InterfaceReferenceEditManager.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CommandStack; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Binding; -import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description; -import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface; -import org.eclipse.wst.wsdl.ui.internal.dialogs.W11BrowseComponentDialog; -import org.eclipse.wst.wsdl.ui.internal.dialogs.W11NewComponentDialog; -import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants; -import org.eclipse.wst.wsdl.ui.internal.util.WSDLSetComponentHelper; -import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; - -public class W11InterfaceReferenceEditManager implements ComponentReferenceEditManager { - protected W11Description description; - protected IFile iFile; - - public W11InterfaceReferenceEditManager(W11Description description, IFile iFile) { - this.description = description; - this.iFile = iFile; - } - - public IComponentDialog getBrowseDialog() { - return new W11BrowseComponentDialog(IWSDLSearchConstants.PORT_TYPE_META_NAME, iFile, description); - } - - public IComponentDialog getNewDialog() { - return new W11NewComponentDialog(IWSDLSearchConstants.PORT_TYPE_META_NAME, iFile, description); - } - - private Definition getDefinition() { - return (Definition) description.getTarget(); - } - - public void modifyComponentReference(Object referencingObject, ComponentSpecification referencedComponent) { - W11Binding w11Binding = (W11Binding) referencingObject; - Object interfaceObject = referencedComponent.getObject(); - if (interfaceObject == null) { - // Need to figure out the IInterface based on the information contained in the ComponentSpecification - - } - - if (interfaceObject instanceof ComponentSpecification) { - Binding binding = (Binding) w11Binding.getTarget(); - WSDLSetComponentHelper helper = new WSDLSetComponentHelper(iFile, getDefinition()); - helper.setWSDLComponent(binding, "type", (ComponentSpecification) interfaceObject); //$NON-NLS-1$ - } - else if (interfaceObject instanceof IInterface){ - IInterface interfaze = (IInterface) interfaceObject; - Command command = w11Binding.getSetInterfaceCommand(interfaze); - CommandStack stack = (CommandStack) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(CommandStack.class); - stack.execute(command); - } - } - - public IComponentDescriptionProvider getComponentDescriptionProvider() { - - return null; - } - - public ComponentSpecification[] getQuickPicks() { - List specList = new ArrayList(); - - Iterator interfaces = description.getInterfaces().iterator(); - while (interfaces.hasNext()) { - IInterface interfaze = (IInterface) interfaces.next(); - String qualifier = ""; //$NON-NLS-1$ - String name = interfaze.getName(); - IFile file = null; - - ComponentSpecification spec = new ComponentSpecification(qualifier, name, file); - spec.setObject(interfaze); - specList.add(spec); - } - - ComponentSpecification[] specArray = new ComponentSpecification[specList.size()]; - specList.toArray(specArray); - - return specArray; - } - - public ComponentSpecification[] getHistory() { - ComponentSpecification[] history = new ComponentSpecification[0]; - return history; - } - - public void addToHistory(ComponentSpecification component) { - - - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11MessageReferenceEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11MessageReferenceEditManager.java deleted file mode 100644 index f1c4877e8..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11MessageReferenceEditManager.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Path; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.MessageReference; -import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description; -import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Message; -import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11MessageReference; -import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessage; -import org.eclipse.wst.wsdl.ui.internal.dialogs.W11BrowseComponentDialog; -import org.eclipse.wst.wsdl.ui.internal.dialogs.W11NewComponentDialog; -import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants; -import org.eclipse.wst.wsdl.ui.internal.util.WSDLSetComponentHelper; -import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; - -public class W11MessageReferenceEditManager implements ComponentReferenceEditManager { - protected W11Description description; - protected IFile iFile; - - public W11MessageReferenceEditManager(W11Description description, IFile iFile) { - this.description = description; - this.iFile = iFile; - } - - public IComponentDialog getBrowseDialog() { - return new W11BrowseComponentDialog(IWSDLSearchConstants.MESSAGE_META_NAME, iFile, description); - } - - public IComponentDialog getNewDialog() { - return new W11NewComponentDialog(IWSDLSearchConstants.MESSAGE_META_NAME, iFile, description); - } - - private Definition getDefinition() { - return (Definition) description.getTarget(); - } - - public void modifyComponentReference(Object referencingObject, ComponentSpecification referencedComponent) { - W11MessageReference w11MessageRef = (W11MessageReference) referencingObject; - Object messageObject = referencedComponent.getObject(); - if (messageObject == null) { - // Need to figure out the IMessage based on the information contained in the ComponentSpecification - - } - - if (messageObject instanceof ComponentSpecification) { - MessageReference messageRef= (MessageReference) w11MessageRef.getTarget(); - WSDLSetComponentHelper helper = new WSDLSetComponentHelper(iFile, getDefinition()); - helper.setWSDLComponent(messageRef, "message", (ComponentSpecification) messageObject); //$NON-NLS-1$ - } - else if (messageObject instanceof W11Message){ - // Below is a little complex.... The alternative was to have IMessage contain a - // getSetMessageCommand() which would handle all of this but does a getSetMessageCommand() - // make sense at the generic level..... - W11Message iMessage = (W11Message) messageObject; - ComponentSpecification specObject = new ComponentSpecification(); - specObject.setName(iMessage.getName()); - specObject.setMetaName(IWSDLSearchConstants.MESSAGE_META_NAME); - specObject.setQualifier(description.getTargetNamespace()); - - String location = ((Definition) description.getTarget()).getLocation(); - String platformResource = "platform:/resource"; //$NON-NLS-1$ - if (location != null && location.startsWith(platformResource)) - { - Path path = new Path(location.substring(platformResource.length())); - specObject.setFile(ResourcesPlugin.getWorkspace().getRoot().getFile(path)); - } - - MessageReference messageRef= (MessageReference) w11MessageRef.getTarget(); - WSDLSetComponentHelper helper = new WSDLSetComponentHelper(iFile, getDefinition()); - helper.setWSDLComponent(messageRef, "message", (ComponentSpecification) specObject); //$NON-NLS-1$ - } - } - - public IComponentDescriptionProvider getComponentDescriptionProvider() { - - return null; - } - - public ComponentSpecification[] getQuickPicks() { - List specList = new ArrayList(); - - Iterator messages = description.getMessages().iterator(); - while (messages.hasNext()) { - IMessage message = (IMessage) messages.next(); - String qualifier = ""; //$NON-NLS-1$ - String name = message.getName(); - IFile file = null; - - ComponentSpecification spec = new ComponentSpecification(qualifier, name, file); - spec.setObject(message); - specList.add(spec); - } - - ComponentSpecification[] specArray = new ComponentSpecification[specList.size()]; - specList.toArray(specArray); - - return specArray; - } - - public ComponentSpecification[] getHistory() { - - return null; - } - - public void addToHistory(ComponentSpecification component) { - - - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBaseSearchListProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBaseSearchListProvider.java deleted file mode 100644 index ca043c694..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBaseSearchListProvider.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Path; -import org.eclipse.wst.common.core.search.pattern.QualifiedName; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider; -import org.eclipse.wst.wsdl.WSDLElement; -import org.eclipse.wst.wsdl.internal.impl.ImportImpl; - -public abstract class WSDLBaseSearchListProvider implements IComponentSearchListProvider { - protected void createWSDLComponentObjects(IComponentList list, List inputComponents, QualifiedName metaName) { - Iterator it = inputComponents.iterator(); - while (it.hasNext()) { - WSDLElement wsdlElement = (WSDLElement) it.next(); - String name = wsdlElement.getElement().getAttribute("name"); //$NON-NLS-1$ - String qualifier = wsdlElement.getEnclosingDefinition().getTargetNamespace(); - - ComponentSpecification componentSpec = new ComponentSpecification(); - componentSpec.setMetaName(metaName); - componentSpec.setName(name); - componentSpec.setQualifier(qualifier); - - String location = wsdlElement.getEnclosingDefinition().getLocation(); - String platformResource = "platform:/resource"; //$NON-NLS-1$ - if (location != null && location.startsWith(platformResource)) { - Path path = new Path(location.substring(platformResource.length())); - IFile result = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - if (result != null) { - componentSpec.setFile(result); - } - } - - list.add(componentSpec); - } - } - - protected List getWSDLFileImports(List wsdlImports) { - List list = new ArrayList(); - Iterator it = wsdlImports.iterator(); - while (it.hasNext()) { - ImportImpl importItem = (ImportImpl) it.next(); - importItem.importDefinitionOrSchema(); // Load if necessary - if (importItem.getESchema() == null) { - list.add(importItem); - } - } - - return list; - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBindingSearchListProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBindingSearchListProvider.java deleted file mode 100644 index 70499f994..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBindingSearchListProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.wst.common.core.search.scope.SearchScope; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants; - -public class WSDLBindingSearchListProvider extends WSDLBaseSearchListProvider { - private Definition definition; - - public WSDLBindingSearchListProvider(Definition definition) { - this.definition = definition; - } - - public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) { - // Grab explictly defined components - createWSDLComponentObjects(list, definition.getEBindings(), IWSDLSearchConstants.BINDING_META_NAME); - - // Grab directly imported components - Iterator importsIt = getWSDLFileImports(definition.getEImports()).iterator(); - while (importsIt.hasNext()) { - Import importItem = (Import) importsIt.next(); - Definition importDefinition = importItem.getEDefinition(); - List importedComponents = importDefinition.getEBindings(); - - createWSDLComponentObjects(list, importedComponents, IWSDLSearchConstants.BINDING_META_NAME); - } - - if (scope != null) { - WSDLComponentFinder finder = new WSDLComponentFinder(IWSDLSearchConstants.BINDING_META_NAME); - Iterator it = finder.getWorkbenchResourceComponents(scope).iterator(); - while (it.hasNext()) { - list.add(it.next()); - } - } - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentDescriptionProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentDescriptionProvider.java deleted file mode 100644 index eb6424aa4..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentDescriptionProvider.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.wst.common.core.search.SearchMatch; -import org.eclipse.wst.common.core.search.pattern.QualifiedName; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider; -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.ui.internal.WSDLEditorPlugin; -import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants; - -public class WSDLComponentDescriptionProvider extends LabelProvider implements IComponentDescriptionProvider { - private static final Image BINDING_IMAGE = WSDLEditorPlugin.getInstance().getImage("icons/binding_obj.gif"); //$NON-NLS-1$ - private static final Image PORTTYPE_IMAGE = WSDLEditorPlugin.getInstance().getImage("icons/porttype_obj.gif"); //$NON-NLS-1$ - private static final Image MESSAGE_IMAGE = WSDLEditorPlugin.getInstance().getImage("icons/message_obj.gif"); //$NON-NLS-1$ - - public boolean isApplicable(Object component) { - return true; - } - - public String getQualifier(Object component) { - String result = null; - if (component instanceof ComponentSpecification) - { - result = ((ComponentSpecification)component).getQualifier(); - } - else if (component instanceof WSDLElement) - { - result = ((WSDLElement) component).getEnclosingDefinition().getTargetNamespace(); - } - else if (component instanceof SearchMatch) - { - QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component); - if (qualifiedName != null) - { - result = qualifiedName.getNamespace(); - } - } - return result; - } - - public String getName(Object component) { - String result = null; - if (component instanceof ComponentSpecification) - { - result = ((ComponentSpecification)component).getName(); - } - else if (component instanceof WSDLElement) - { - result = ((WSDLElement)component).getElement().getAttribute("name"); //$NON-NLS-1$ - } - else if (component instanceof SearchMatch) - { - QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component); - if (qualifiedName != null) - { - result = qualifiedName.getLocalName(); - } - } - return result; - } - - public Image getFileIcon(Object component) { - return WSDLEditorPlugin.getInstance().getImage("icons/wsdl_file_obj.gif"); //$NON-NLS-1$ - } - - public IFile getFile(Object component) { - IFile result = null; - if (component instanceof ComponentSpecification) - { - result = ((ComponentSpecification)component).getFile(); - } - else if (component instanceof SearchMatch) - { - result = ((SearchMatch)component).getFile(); - } - else if (component instanceof WSDLElement) - { - WSDLElement concreteComponent = (WSDLElement) component; - Definition definition = concreteComponent.getEnclosingDefinition(); - if (definition != null) - { - // TODO (cs) revisit and test more - // - String location = definition.getLocation(); - String platformResource = "platform:/resource"; //$NON-NLS-1$ - if (location != null && location.startsWith(platformResource)) - { - Path path = new Path(location.substring(platformResource.length())); - result = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - } - } - } - return result; - } - - public ILabelProvider getLabelProvider() { - return this; - } - - public String getText(Object element) { - String result = ""; //$NON-NLS-1$ - String name = getName(element); - if (name != null) { - result += name; - } - return result; - } - - public Image getImage(Object component) - { - Image result = null; - if (component instanceof ComponentSpecification) - { - QualifiedName qualifiedName = ((ComponentSpecification) component).getMetaName(); - if ( qualifiedName != null ){ - if ( qualifiedName.equals(IWSDLSearchConstants.BINDING_META_NAME)) - result = BINDING_IMAGE; - else if ( qualifiedName.equals(IWSDLSearchConstants.PORT_TYPE_META_NAME)) - result = PORTTYPE_IMAGE; - else if ( qualifiedName.equals(IWSDLSearchConstants.MESSAGE_META_NAME)) - result = MESSAGE_IMAGE; - - } - } - else if (component instanceof SearchMatch) - { - SearchMatch searchMatch = (SearchMatch)component; - QualifiedName qualifiedName = (QualifiedName)searchMatch.map.get("metaName"); //$NON-NLS-1$ - if ( qualifiedName != null ){ - if ( qualifiedName.equals(IWSDLSearchConstants.BINDING_META_NAME)) - result = BINDING_IMAGE; - else if ( qualifiedName.equals(IWSDLSearchConstants.PORT_TYPE_META_NAME)) - result = PORTTYPE_IMAGE; - else if ( qualifiedName.equals(IWSDLSearchConstants.MESSAGE_META_NAME)) - result = MESSAGE_IMAGE; - - } - } - else if (component instanceof Binding) - result = BINDING_IMAGE; - else if (component instanceof PortType) - result = PORTTYPE_IMAGE; - else if (component instanceof Message) - result = MESSAGE_IMAGE; - - return result; - } - - private QualifiedName getQualifiedNameForSearchMatch(SearchMatch match) { - QualifiedName qualifiedName = null; - Object o = match.map.get("name"); //$NON-NLS-1$ - if (o != null && o instanceof QualifiedName) - { - qualifiedName = (QualifiedName)o; - } - return qualifiedName; - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentFinder.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentFinder.java deleted file mode 100644 index 9acb310fc..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentFinder.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.wst.common.core.search.SearchEngine; -import org.eclipse.wst.common.core.search.SearchMatch; -import org.eclipse.wst.common.core.search.pattern.QualifiedName; -import org.eclipse.wst.common.core.search.pattern.SearchPattern; -import org.eclipse.wst.common.core.search.scope.SearchScope; -import org.eclipse.wst.common.core.search.util.CollectingSearchRequestor; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern; - -public class WSDLComponentFinder { - QualifiedName metaName; - public WSDLComponentFinder(QualifiedName metaName) { - this.metaName = metaName; - } - - - protected void findComponents(SearchEngine searchEngine, List list, SearchScope searchScope) - { - try { - CollectingSearchRequestor requestor = new CollectingSearchRequestor(); - - XMLComponentDeclarationPattern pattern = new XMLComponentDeclarationPattern(new QualifiedName("*", "*"), metaName, SearchPattern.R_PATTERN_MATCH); //$NON-NLS-1$ //$NON-NLS-2$ - - // TODO (cs) rethink the commented out code below. Is there some reason for narrowing to list of search particpants? - // It seems the only benefit may be to filter our xsd component declarations that aren't defined - // in stand alone wsdl documents. Perhaps it's best to do this with an additional property arg on the - // declaration pattern or perhaps simply doing some 'post' filtering. - // - //String participantId = metaName.getNamespace().equals(WSDLConstants.WSDL_NAMESPACE_URI) ? - // "org.eclipse.wst.wsdl.search.WSDLSearchParticipant" : - // "org.eclipse.wst.xsd.search.XSDSearchParticipant"; - //SearchParticipant particpant = SearchPlugin.getDefault().getSearchParticipant(participantId); - //SearchParticipant[] participants = { particpant }; - - // TODO (cs) I'm betting we'll need to provide some hook here to allow extenders to configure - // the search options. Currently we just pass in null. - searchEngine.search(pattern, requestor, searchScope, null, new NullProgressMonitor()); - - for (Iterator i = requestor.getResults().iterator(); i.hasNext(); ) - { - SearchMatch match = (SearchMatch)i.next(); - ComponentSpecification spec = new ComponentSpecification(); - spec.setMetaName(metaName); - spec.setFile(match.getFile()); - - Object o = match.map.get("name"); //$NON-NLS-1$ - if (o != null && o instanceof QualifiedName) - { - QualifiedName qualifiedName = (QualifiedName)o; - if (qualifiedName.getLocalName() != null) - { - spec.setName(qualifiedName.getLocalName()); - spec.setQualifier(qualifiedName.getNamespace()); - list.add(spec); - } - } - } - } catch (CoreException e) { - e.printStackTrace(); - //status.add(e.getStatus()); - } - } - - public List getWorkbenchResourceComponents(SearchScope scope) { - - List list = new ArrayList(); - SearchEngine searchEngine = new SearchEngine(); - findComponents(searchEngine, list, scope); - return list; - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLInterfaceSearchListProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLInterfaceSearchListProvider.java deleted file mode 100644 index 1412c0a6c..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLInterfaceSearchListProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.wst.common.core.search.scope.SearchScope; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants; - -public class WSDLInterfaceSearchListProvider extends WSDLBaseSearchListProvider { - private Definition definition; - - public WSDLInterfaceSearchListProvider(Definition definition) { - this.definition = definition; - } - - public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) { - // Grab explictly defined components - createWSDLComponentObjects(list, definition.getEPortTypes(), IWSDLSearchConstants.PORT_TYPE_META_NAME); - - // Grab directly imported components - Iterator importsIt = getWSDLFileImports(definition.getEImports()).iterator(); - while (importsIt.hasNext()) { - Import importItem = (Import) importsIt.next(); - Definition importDefinition = importItem.getEDefinition(); - List importedComponents = importDefinition.getEPortTypes(); - - createWSDLComponentObjects(list, importedComponents, IWSDLSearchConstants.PORT_TYPE_META_NAME); - } - - if (scope != null) { - WSDLComponentFinder finder = new WSDLComponentFinder(IWSDLSearchConstants.PORT_TYPE_META_NAME); - Iterator it = finder.getWorkbenchResourceComponents(scope).iterator(); - while (it.hasNext()) { - list.add(it.next()); - } - } - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLMessageSearchListProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLMessageSearchListProvider.java deleted file mode 100644 index 0fa28554e..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLMessageSearchListProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.wst.common.core.search.scope.SearchScope; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants; - -public class WSDLMessageSearchListProvider extends WSDLBaseSearchListProvider { - private Definition definition; - - public WSDLMessageSearchListProvider(Definition definition) { - this.definition = definition; - } - public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) { - // Grab explictly defined components - createWSDLComponentObjects(list, definition.getEMessages(), IWSDLSearchConstants.MESSAGE_META_NAME); - - // Grab directly imported components - Iterator importsIt = getWSDLFileImports(definition.getEImports()).iterator(); - while (importsIt.hasNext()) { - Import importItem = (Import) importsIt.next(); - Definition importDefinition = importItem.getEDefinition(); - List importedComponents = importDefinition.getEMessages(); - - createWSDLComponentObjects(list, importedComponents, IWSDLSearchConstants.MESSAGE_META_NAME); - } - - if (scope != null) { - WSDLComponentFinder finder = new WSDLComponentFinder(IWSDLSearchConstants.MESSAGE_META_NAME); - Iterator it = finder.getWorkbenchResourceComponents(scope).iterator(); - while (it.hasNext()) { - list.add(it.next()); - } - } - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDElementReferenceEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDElementReferenceEditManager.java deleted file mode 100644 index e211ca816..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDElementReferenceEditManager.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin; -import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDElementDeclarationCommand; -import org.eclipse.wst.wsdl.ui.internal.util.WSDLSetComponentHelper; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; -import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog; -import org.eclipse.wst.xsd.ui.internal.editor.XSDElementReferenceEditManager; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDSchema; - -public class WSDLXSDElementReferenceEditManager extends XSDElementReferenceEditManager { - public WSDLXSDElementReferenceEditManager(IFile currentFile, XSDSchema[] schemas) { - super(currentFile, schemas); - } - - public IComponentDialog getNewDialog() - { - return new NewTypeDialog(); - } - - public void modifyComponentReference(Object referencingObject, ComponentSpecification component) { - if (referencingObject instanceof Adapter) { - Adapter adapter = (Adapter) referencingObject; - referencingObject = adapter.getTarget(); - } - - if (referencingObject instanceof Part) { - Part part = (Part) referencingObject; - IFile file = null; - if (ASDEditorPlugin.getActiveEditor().getEditorInput() instanceof IFileEditorInput) { - file = ((IFileEditorInput) ASDEditorPlugin.getActiveEditor().getEditorInput()).getFile(); - } - - if (component.isNew()) { - if (component.getMetaName() == IXSDSearchConstants.ELEMENT_META_NAME) { - AddXSDElementDeclarationCommand command = new AddXSDElementDeclarationCommand(part.getEnclosingDefinition(), component.getName()); - command.run(); - String tns = command.getXSDElement().getTargetNamespace(); - component.setQualifier(tns); - } - } - - WSDLSetComponentHelper helper = new WSDLSetComponentHelper(file, part.getEnclosingDefinition()); - helper.setXSDElementComponent(part, component); - } - } - - public ComponentSpecification[] getQuickPicks() { -// ElementComponentList list = new ElementComponentList(); -// -// if (ASDEditorPlugin.getActiveEditor().getEditorInput() instanceof IFileEditorInput) { -// IFile file = ((IFileEditorInput) ASDEditorPlugin.getActiveEditor().getEditorInput()).getFile(); -// XSDElementsSearchListProvider provider = new XSDElementsSearchListProvider(file, schemas); -// provider.populateComponentList(list, null, null); -// } -// -// ComponentSpecification specs[] = new ComponentSpecification[list.size()]; -// for (int index = 0; index < list.size(); index++) { -// specs[index] = (ComponentSpecification) list.get(index); -// } - - return new ComponentSpecification[0]; - } - - public void setSchemas(XSDSchema[] schemas) { - this.schemas = schemas; - } - - private class ElementComponentList implements IComponentList { - private List list = new ArrayList(); - - public void add(Object object) { - list.add(object); - } - - public Iterator iterator() { - return list.iterator(); - } - - public int size() { - return list.size(); - } - - public Object get(int index) { - return list.get(index); - } - } -} diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDTypeReferenceEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDTypeReferenceEditManager.java deleted file mode 100644 index b14db4567..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDTypeReferenceEditManager.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.edit; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin; -import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDTypeDefinitionCommand; -import org.eclipse.wst.wsdl.ui.internal.util.WSDLSetComponentHelper; -import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDAttributeUse; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDSchema; - -public class WSDLXSDTypeReferenceEditManager extends XSDTypeReferenceEditManager { - - public WSDLXSDTypeReferenceEditManager(IFile currentFile, XSDSchema[] schemas) { - super(currentFile, schemas); - } - - public void modifyComponentReference(Object referencingObject, ComponentSpecification component) { - if (referencingObject instanceof Adapter) { - Adapter adapter = (Adapter) referencingObject; - referencingObject = adapter.getTarget(); - } - - if (referencingObject instanceof Part) { - Part part = (Part) referencingObject; - IFile file = null; - if (ASDEditorPlugin.getActiveEditor().getEditorInput() instanceof IFileEditorInput) { - file = ((IFileEditorInput) ASDEditorPlugin.getActiveEditor().getEditorInput()).getFile(); - } - - if (component.isNew()) { - AddXSDTypeDefinitionCommand command = new AddXSDTypeDefinitionCommand(part.getEnclosingDefinition(), component.getName()); - if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME) { - command.isComplexType(true); - } - else { - command.isComplexType(false); - } - command.run(); - String tns = command.getXSDElement().getTargetNamespace(); - component.setQualifier(tns); - } - - WSDLSetComponentHelper helper = new WSDLSetComponentHelper(file, part.getEnclosingDefinition()); - helper.setXSDTypeComponent(part, component); - } - else if (referencingObject instanceof XSDElementDeclaration) { - super.modifyComponentReference(referencingObject, component); - } - else if (referencingObject instanceof XSDAttributeUse) { - - } - } - - public void setSchemas(XSDSchema[] schemas) { - this.schemas = schemas; - } -} |