Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.ui')
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/.classpath19
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.core.prefs59
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/META-INF/MANIFEST.MF91
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/build.properties23
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/dlcl16/showproperties_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/dtool16/capturescreen.gifbin384 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/elcl16/showproperties_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/etool16/capturescreen.gifbin613 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomminus.gifbin559 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomplus.gifbin559 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/reloadgrammar.gifbin367 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/validate.gifbin558 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/icons/wsdl_file_obj.gifbin572 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/plugin.properties37
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/plugin.xml538
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/schema/adapterFactory.exsd121
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/schema/contentGeneratorUI.exsd151
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityElementFilter.exsd115
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityItemTreeProviders.exsd115
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/schema/internalEditorExtensions.exsd107
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/schema/propertyDescriptorProvider.exsd115
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/DefaultEditorMode.java47
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/IDesignViewerActionBarContributor.java18
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ISelectionMapper.java17
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/InternalWSDLMultiPageEditor.java577
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/Messages.java164
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ReloadDependenciesActionDelegate.java41
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourceEditorActionBarContributor.java207
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourcePageActionContributor.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/StructuredTextViewerConfigurationWSDL.java24
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLActionBarContributor.java246
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorPlugin.java588
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorResourceChangeHandler.java317
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLPreferencePage.java94
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLSelectionMapper.java39
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementAction.java330
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementDeclarationAction.java54
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddImportAction.java78
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddWSISchemaImportAction.java202
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/BaseNodeAction.java39
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/EditNamespacesAction.java125
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/IWSDLToolbarAction.java18
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenInNewEditor.java64
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenWSDLEditorUtil.java108
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/RenameAction.java142
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/SmartRenameAction.java655
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLAdapterFactory.java190
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLBaseAdapter.java217
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11AddPartAction.java109
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11OpenImportAction.java60
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingElementAction.java56
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingMessageAction.java56
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingTypeAction.java56
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewElementAction.java56
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewMessageAction.java59
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewTypeAction.java82
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Binding.java297
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingMessageReference.java135
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingOperation.java106
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11CategoryAdapter.java144
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Description.java354
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11EndPoint.java228
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Import.java76
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Interface.java85
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Message.java105
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11MessageReference.java482
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Operation.java202
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForAttribute.java128
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForElement.java145
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForPart.java252
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Service.java105
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Type.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11TypesCategoryAdapter.java29
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddBindingCommand.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddEndPointCommand.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddFaultParameterCommand.java67
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddImportCommand.java45
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddInputParameterCommand.java70
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddInterfaceCommand.java66
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddMessageCommand.java57
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOperationCommand.java117
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOutputParameterCommand.java80
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddPartCommand.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddSchemaCommand.java69
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddServiceCommand.java129
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteCommand.java124
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteParameterCommand.java113
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11EditNamespacesCommand.java178
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11GenerateBindingCommand.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11RenameCommand.java256
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderMessageReferencesCommand.java122
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderParametersCommand.java171
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetAddressCommand.java205
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetBindingCommand.java88
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetElementCommand.java116
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetInterfaceCommand.java36
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetTypeCommand.java128
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11TopLevelElementCommand.java186
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11AddressExtensibilityElementAdapter.java47
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11ExtensibilityElementAdapter.java18
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java48
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitor.java212
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitorForFields.java109
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBaseParameterCommand.java558
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingCommand.java47
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingFaultCommand.java43
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingInputCommand.java42
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOperationCommand.java104
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOutputCommand.java43
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddExtensionElementCommand.java79
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultCommand.java79
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultParameterCommand.java167
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddImportCommand.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputCommand.java83
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputParameterCommand.java280
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageCommand.java109
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageReferenceCommand.java71
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOperationCommand.java145
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputCommand.java82
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputParameterCommand.java90
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPartCommand.java209
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortCommand.java49
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortTypeCommand.java75
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddServiceCommand.java72
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddTypesCommand.java43
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddUnknownExtensibilityElementCommand.java80
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDElementDeclarationCommand.java147
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDSchemaCommand.java84
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDTypeDefinitionCommand.java162
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/WSDLElementCommand.java19
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/AddressPortOptionsPage.java87
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/BaseContentGeneratorOptionsPage.java82
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpBindingOptionsPage.java103
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/ISoapStyleInfo.java15
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapBindingOptionsPage.java215
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/EditNamespacesDialog.java126
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/GenerateBindingOnSaveDialog.java99
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/NewComponentDialog.java189
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/ProtocolComponentControl.java334
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11BrowseComponentDialog.java137
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11NewComponentDialog.java135
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11BindingReferenceEditManager.java115
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11InterfaceReferenceEditManager.java112
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11MessageReferenceEditManager.java128
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBaseSearchListProvider.java110
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBindingSearchListProvider.java44
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentDescriptionProvider.java178
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLComponentFinder.java89
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLInterfaceSearchListProvider.java44
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLMessageSearchListProvider.java44
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDElementReferenceEditManager.java99
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDTypeReferenceEditManager.java111
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibilityItemTreeProviderRegistry.java33
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibleTypeSystemProvider.java85
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeAssociationProvider.java20
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeReconciler.java21
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITreeChildProvider.java23
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITypeSystemProvider.java30
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/NSKeyedExtensionRegistry.java142
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorConfiguration.java193
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtension.java36
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtensionProperties.java69
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLNodeAssociationProvider.java80
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/ExtensiblityElementFilter.java18
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/HttpExtensiblityElementFilter.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/MimeExtensiblityElementFilter.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/SoapExtensiblityElementFilter.java61
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/XSDExtensiblityElementFilter.java31
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/back.gifbin873 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_not_obj.gifbin222 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_obj.gifbin128 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/binding_obj.gifbin610 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bindingheader_obj.gifbin576 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/browsebutton.gifbin53 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/complextype_obj.gifbin155 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/delete_obj.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/element_obj.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/error_co.gifbin82 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fault_obj.gifbin360 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/file_obj.gifbin349 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fldr_el.gifbin366 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/forward.gifbin874 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/hidebinding.gifbin315 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpaddress_obj.gifbin556 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpbinding_obj.gifbin376 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpoperation_obj.gifbin598 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlencoded_obj.gifbin596 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlreplacement_obj.gifbin232 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/import_obj.gifbin114 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/importheader_obj.gifbin336 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/input_obj.gifbin338 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/message_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/messageheader_obj.gifbin581 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespace_obj.gifbin207 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespacedecl_obj.gifbin211 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/new_wsdl_wiz.pngbin5955 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operation_obj.gifbin150 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operationbinding_obj.gifbin615 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_no.gifbin148 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_obj.gifbin347 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_yes.gifbin343 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/page_banner.gifbin5600 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/part_obj.gifbin200 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/port_obj.gifbin220 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttype_obj.gifbin576 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttypeheader_obj.gifbin603 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtcmplxpltyp_obj.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtelemt_obj.gifbin599 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtsmpltyp_obj.gifbin350 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/quickassist.gifbin225 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/service_obj.gifbin542 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/serviceheader_obj.gifbin580 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/simpletype_obj.gifbin150 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soap_obj.gifbin589 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapaddress_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapatt_obj.gifbin583 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbinding_obj.gifbin637 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbody_obj.gifbin585 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapfault_obj.gifbin605 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheader_obj.gifbin587 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheaderfault_obj.gifbin598 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapoperation_obj.gifbin598 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/types_obj.gifbin592 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/validate.gifbin558 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/wsdl_file_obj.gifbin572 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_file_obj.gifbin574 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_obj.gifbin574 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/HTTPLabelProvider.java52
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/SOAPLabelProvider.java56
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/messages.properties123
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/EditorModeSectionFilter.java16
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ExtensionsSection.java265
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSection.java234
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSectionFilter.java28
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSection.java219
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSectionFilter.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java56
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlink.java117
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlinkDetector.java105
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelAdapter.java191
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelLocatorAdapterFactory.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelQueryExtension.java237
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelReconcileAdapter.java154
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ComponentReferenceUtil.java959
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/CreateWSDLElementHelper.java469
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NameUtil.java581
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NodeAssociationManager.java146
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/OpenOnSelectionHelper.java404
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ReferenceEditManagerHelper.java123
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ServicePolicyHelper.java178
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ValidateHelper.java405
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/W11OpenExternalEditorHelper.java219
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLAdapterFactoryHelper.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLEditorUtil.java273
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLResourceUtil.java145
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLSetComponentHelper.java244
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDComponentHelper.java282
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDTypeSystemProvider.java212
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BaseRenamer.java44
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BindingRenamer.java42
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/MessageRenamer.java63
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/PortTypeRenamer.java42
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitor.java197
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitorForParameters.java97
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/BindingWizard.java299
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/ContentGeneratorOptionsPage.java26
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/HttpBindingOptionsPage.java143
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NamespaceTable.java702
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java421
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/PortWizard.java157
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/SoapBindingOptionsPage.java189
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFileOptionsPage.java776
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFilePage.java133
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeAssociationProvider.java77
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorCSHelpIds.java191
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorPlugin.java68
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDLabelProvider.java115
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDMultiPageEditor.java331
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDSelectionManager.java100
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/Messages.java80
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddBindingAction.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddEndPointAction.java55
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddFaultAction.java63
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddImportAction.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInputAction.java59
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInterfaceAction.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddMessageAction.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOperationAction.java63
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOutputAction.java59
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddParameterAction.java57
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddSchemaAction.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddServiceAction.java59
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDCaptureScreenAction.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDeleteAction.java57
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDirectEditAction.java84
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragAction.java50
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragReorderAction.java284
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDEditNamespacesAction.java74
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDGenerateBindingAction.java43
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDOpenSchemaAction.java44
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingBindingAction.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingInterfaceAction.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewBindingAction.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewInterfaceAction.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/BaseSelectionAction.java157
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/IASDAddCommand.java15
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ShowPropertiesViewAction.java56
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtension.java49
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtensionRegistry.java48
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtension.java84
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtensionRegistry.java81
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewContextMenuProvider.java170
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicalViewer.java176
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicsConstants.java54
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/KeyboardDragImpl.java78
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/CenteredConnectionAnchor.java88
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/TopLeftConnectionAnchor.java35
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDCCombo.java1511
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDComboBoxCellEditor.java302
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ComboBoxCellEditorManager.java204
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java60
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelCellEditorLocator.java70
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelEditManager.java139
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/TypeReferenceDirectEditManager.java178
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDEditPartFactory.java97
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDRootEditPart.java32
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java125
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java216
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingColumnEditPart.java64
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingContentEditPart.java104
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingEditPart.java308
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ColumnEditPart.java67
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/DefinitionsEditPart.java160
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EditPartNavigationHandlerUtil.java199
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java393
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/IFeedbackHandler.java16
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/INamedEditPart.java19
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/InterfaceEditPart.java169
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/MessageReferenceEditPart.java277
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java165
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java235
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterTypeEditPart.java410
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ServiceEditPart.java165
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/AbstractModelCollection.java86
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingColumn.java76
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingContentPlaceHolder.java23
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/IActionProvider.java16
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/InterfaceColumn.java64
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/ServiceColumn.java81
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropCommand.java135
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropEditPolicy.java38
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDGraphNodeDragTracker.java30
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDLabelDirectEditPolicy.java44
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDSelectionEditPolicy.java89
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BaseLinkIconFigure.java216
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BoxComponentFigure.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ComponentReferenceConnection.java59
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/HeadingFigure.java81
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/LinkIconFigure.java90
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ListFigure.java79
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ModelDiagnosticInfo.java71
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingColumnLayout.java145
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingContentLayout.java105
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingLayout.java60
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/ColumnData.java83
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/RowLayout.java182
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObject.java26
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObjectListener.java15
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBinding.java28
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingMessageReference.java19
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingOperation.java20
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IDescription.java38
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IEndPoint.java24
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IImport.java19
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IInterface.java25
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessage.java23
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessageReference.java30
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/INamedObject.java20
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IOperation.java29
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IParameter.java35
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IService.java21
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IType.java18
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/messages.properties50
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlinePage.java98
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlineProvider.java156
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ICategoryAdapter.java17
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ITreeElement.java23
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDAbstractSection.java438
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDTabbedPropertySheetPage.java48
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/BindingSection.java225
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/DocumentationSection.java154
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/EndPointSection.java286
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ImportSection.java323
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NameSection.java243
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NamespaceSection.java259
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ParameterSection.java261
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ReferenceSection.java138
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/ASDEditPartFactoryHelper.java51
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/EndPointComparator.java54
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/IOpenExternalEditorHelper.java19
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/WSDLComponentRenameParticipant.java43
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/RenameComponentAction.java204
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorActionGroup.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorGroupActionDelegate.java66
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLSelectionDispatchAction.java39
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/IWSDLSearchConstants.java34
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchContributor.java77
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchParticipant.java130
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesAction.java162
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInProjectAction.java45
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInWorkingSetAction.java78
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLReferencesSearchGroup.java44
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLSearchReferencesGroupActionDelegate.java46
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/Messages.java29
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPNodeEditorProvider.java96
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPSelectPartsDialog.java142
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/messages.properties12
421 files changed, 0 insertions, 45034 deletions
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.classpath b/bundles/org.eclipse.wst.wsdl.ui/.classpath
deleted file mode 100644
index 9917879ce..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.classpath
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src-asd"/>
- <classpathentry kind="src" path="src-asd-wsdl11"/>
- <classpathentry kind="src" path="src-refactor"/>
- <classpathentry kind="src" path="src-soap"/>
- <classpathentry kind="src" path="src-search"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
- <accessrules>
- <accessrule kind="accessible" pattern="javax/xml/namespace/QName"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.cvsignore b/bundles/org.eclipse.wst.wsdl.ui/.cvsignore
deleted file mode 100644
index a65f62be2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-build.xml
-wsdleditor.jar
-temp.folder
-org.eclipse.wst.wsdl.ui_1.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.project b/bundles/org.eclipse.wst.wsdl.ui/.project
deleted file mode 100644
index c5a4ddcd0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.wsdl.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <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.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 9715c2c56..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,59 +0,0 @@
-#Sun Jun 03 00:49:06 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index bbf7ac879..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Jan 30 23:38:15 EST 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/bundles/org.eclipse.wst.wsdl.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.wsdl.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index ea37d07cc..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,91 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %_UI_PLUGIN_NAME
-Bundle-SymbolicName: org.eclipse.wst.wsdl.ui; singleton:=true
-Bundle-Version: 1.2.100.qualifier
-Bundle-Activator: org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.wsdl.ui.internal;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.actions;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.adapters,
- org.eclipse.wst.wsdl.ui.internal.adapters.actions,
- org.eclipse.wst.wsdl.ui.internal.adapters.basic,
- org.eclipse.wst.wsdl.ui.internal.adapters.commands,
- org.eclipse.wst.wsdl.ui.internal.adapters.specialized,
- org.eclipse.wst.wsdl.ui.internal.adapters.visitor,
- org.eclipse.wst.wsdl.ui.internal.asd,
- org.eclipse.wst.wsdl.ui.internal.asd.actions,
- org.eclipse.wst.wsdl.ui.internal.asd.design,
- org.eclipse.wst.wsdl.ui.internal.asd.design.connections,
- org.eclipse.wst.wsdl.ui.internal.asd.design.directedit,
- org.eclipse.wst.wsdl.ui.internal.asd.design.editparts,
- org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model,
- org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies,
- org.eclipse.wst.wsdl.ui.internal.asd.design.figures,
- org.eclipse.wst.wsdl.ui.internal.asd.design.layouts,
- org.eclipse.wst.wsdl.ui.internal.asd.facade,
- org.eclipse.wst.wsdl.ui.internal.asd.outline,
- org.eclipse.wst.wsdl.ui.internal.asd.properties.sections,
- org.eclipse.wst.wsdl.ui.internal.asd.util,
- org.eclipse.wst.wsdl.ui.internal.commands;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui,
- org.eclipse.wst.wsdl.ui.internal.dialogs;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.edit,
- org.eclipse.wst.wsdl.ui.internal.extensions,
- org.eclipse.wst.wsdl.ui.internal.filter;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.icons;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.label.providers,
- org.eclipse.wst.wsdl.ui.internal.properties.sections,
- org.eclipse.wst.wsdl.ui.internal.reconciler;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.refactor;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.search;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.search.actions;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.soap.customizations;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.text;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.util;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.visitor;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.wizards;x-internal:=true,
- org.eclipse.wst.wsdl.ui.internal.xsd;x-internal:=true
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.common;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.gef;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.editors;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.0.101,1.2.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.xsd;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.wst.wsdl;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.xsd.ui;bundle-version="[1.2.0,1.3.0)",
- org.eclipse.emf.edit;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.emf.edit.ui;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,2.0.0)",
- javax.wsdl;bundle-version="[1.4.0,1.5.0)",
- org.eclipse.wst.wsdl.validation;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ltk.ui.refactoring;bundle-version="[3.2.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.4.4,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.apache.xerces;bundle-version="[2.8.0,3.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.command.env;bundle-version="[1.0.102,1.1.0)",
- org.eclipse.wst.ws;bundle-version="[1.0.101,2.0.0)",
- org.eclipse.wst.command.env.core;bundle-version="[1.0.101,1.1.0)",
- org.eclipse.wst.ws.ui;bundle-version="[1.0.101,1.2.0)",
- org.eclipse.search;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.ws.service.policy.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.ws.service.policy;bundle-version="[1.0.0,2.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.wsdl.ui/about.html b/bundles/org.eclipse.wst.wsdl.ui/about.html
deleted file mode 100644
index 2199df3f0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/build.properties b/bundles/org.eclipse.wst.wsdl.ui/build.properties
deleted file mode 100644
index 26692d3a5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/build.properties
+++ /dev/null
@@ -1,23 +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
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- .,\
- META-INF/,\
- about.html
-jars.compile.order = .
-source.. = src-asd/,\
- src-asd-wsdl11,\
- src-refactor/,\
- src-soap/,\
- src-search/
-output.. = bin/
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/dlcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/dlcl16/showproperties_obj.gif
deleted file mode 100644
index d94ff1055..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/dlcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/dtool16/capturescreen.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/dtool16/capturescreen.gif
deleted file mode 100644
index 3570c90f4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/dtool16/capturescreen.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/elcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/elcl16/showproperties_obj.gif
deleted file mode 100644
index 1dc19a31a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/elcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/capturescreen.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/capturescreen.gif
deleted file mode 100644
index 176830af2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/capturescreen.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomminus.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomminus.gif
deleted file mode 100644
index dd2c92f9e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomminus.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomplus.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomplus.gif
deleted file mode 100644
index 466d756b3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/etool16/zoomplus.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/reloadgrammar.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/reloadgrammar.gif
deleted file mode 100644
index 9d4c9ca3f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/reloadgrammar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/validate.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/validate.gif
deleted file mode 100644
index 2b347ac45..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/wsdl_file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/wsdl_file_obj.gif
deleted file mode 100644
index 75b1f92b4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/wsdl_file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/plugin.properties b/bundles/org.eclipse.wst.wsdl.ui/plugin.properties
deleted file mode 100644
index 81fc79947..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/plugin.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 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
-###############################################################################
-_UI_LABEL_NEW_CATEGORY_NAME_WS=Web Services
-_UI_LABEL_CREATE_NEW_WSDL_FILE=Create a new WSDL File
-_UI_WSDL_LABEL=WSDL Files
-_UI_LABEL_GENERAL=General
-_UI_LABEL_DOCUMENTATION=Documentation
-_UI_LABEL_EXTENSIONS=Extensions
-_UI_LABEL_REFACTOR=Refactor
-_UI_EDITOR_NAME=WSDL Editor
-_UI_RELOAD_DEPENDENCIES=Reload Dependencies
-refactoring.menu.label=Refactor
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-WSDLEditorModes=WSDL Editor Modes
-
-command.wsdl.refactor.rename.element.name=Rename WSDL component
-
-_UI_PLUGIN_NAME=WSDL UI
-providerName=Eclipse.org
-##
-WSDL_Source_target_name=WSDL Source
-WSDL_hyperlink=WSDL Content
-SOAP=SOAP
-HTTP=HTTP
-References=References \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/plugin.xml b/bundles/org.eclipse.wst.wsdl.ui/plugin.xml
deleted file mode 100644
index 4f2961cb4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/plugin.xml
+++ /dev/null
@@ -1,538 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%_UI_EDITOR_NAME"
- icon="icons/wsdl_file_obj.gif"
- class="org.eclipse.wst.wsdl.ui.internal.InternalWSDLMultiPageEditor"
- contributorClass="org.eclipse.wst.wsdl.ui.internal.WSDLActionBarContributor"
- id="org.eclipse.wst.wsdl.ui.internal.WSDLEditor">
- <contentTypeBinding
- contentTypeId="org.eclipse.wst.wsdl.wsdlsource" />
- </editor>
- </extension>
-
- <extension point="org.eclipse.ui.newWizards">
- <category
- id="org.eclipse.jst.ws.ui.new"
- name="%_UI_LABEL_NEW_CATEGORY_NAME_WS" />
- <wizard
- id="org.eclipse.wst.wsdl.ui"
- name="WSDL"
- class="org.eclipse.wst.wsdl.ui.internal.wizards.NewWSDLWizard"
- category="org.eclipse.jst.ws.ui.new"
- icon="icons/wsdl_file_obj.gif">
- <description>%_UI_LABEL_CREATE_NEW_WSDL_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages">
- <!-- place everything in "Web Services" -->
- <page
- name="%_UI_WSDL_LABEL"
- category="org.eclipse.wst.ws.internal.ui.preferences.name"
- class="org.eclipse.wst.wsdl.ui.internal.WSDLPreferencePage"
- id="org.eclipse.wst.wsdl.ui.internal.WSDLPreferencePage" />
- </extension>
-
- <!-- This extension point is used to suplement WSDL 1.1 schemas in order to -->
- <!-- constrain the extensiblity elements that are allowed at the 'wsdl' level -->
- <extension-point
- id="extensibilityElementFilter"
- name="Extensiblity Element Filter"
- schema="schema/extensibilityElementFilter.exsd" />
-
- <extension-point id="internalEditorConfiguration" name="WSDLEditorExtensionConfiguration"/>
- <extension-point id="editorModes" name="%WSDLEditorModes"/>
- <extension-point id="extensionCategories" name="Extension Categories"/>
- <extension-point id="contentGeneratorUI" name="UI Port and Binding Content Generators" schema="schema/contentGeneratorUI.exsd"/>
- <extension-point id="adapterFactory" name="Adapter Factory Extension" schema="schema/adapterFactory.exsd"/>
-
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
- <propertyContributor
- contributorId="org.eclipse.wst.wsdl.ui.internal.WSDLEditor"
-
- labelProvider="org.eclipse.wst.wsdl.ui.internal.asd.ASDLabelProvider">
- <propertyCategory category="general"></propertyCategory>
- <propertyCategory category="documentation"></propertyCategory>
- <propertyCategory category="extensibility"></propertyCategory>
- </propertyContributor>
- </extension>
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
- <propertyTabs
- contributorId="org.eclipse.wst.wsdl.ui.internal.WSDLEditor">
- <propertyTab
- label="%_UI_LABEL_GENERAL"
- category="general"
- id="org.eclipse.wst.xmlwebservices.general">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_EXTENSIONS"
- category="extensibility"
- id="org.eclipse.wst.xmlwebservices.extensibility">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_DOCUMENTATION"
- category="documentation"
- id="org.eclipse.wst.xmlwebservices.documentation">
- </propertyTab>
- </propertyTabs>
- </extension>
-
- <extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
- <propertySections contributorId="org.eclipse.wst.wsdl.ui.internal.WSDLEditor">
- <propertySection tab="org.eclipse.wst.xmlwebservices.documentation"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.DocumentationSection"
- id="prop.section.DocumentationSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NameSection"
- id="prop.section.NameSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessage">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.properties.sections.W11ParameterSection"
- filter="org.eclipse.wst.wsdl.ui.internal.properties.sections.W11ParameterSectionFilter"
- id="prop.section.W11ParameterSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NameSection"
- id="prop.section.NameSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NameSection"
- id="prop.section.NameSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NameSection"
- id="prop.section.NameSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IService">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.EndPointSection"
- id="prop.section.EndPointSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.BindingSection"
- id="prop.section.BindingSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.ImportSection"
- id="prop.section.ImportSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IImport">
- </input>
- </propertySection>
- <!--
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.asd.editor.properties.sections.SchemaSection"
- id="prop.section.SchemaSection">
- <input type="org.eclipse.wst.wsdl.asd.facade.IType">
- </input>
- </propertySection>
- -->
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NamespaceSection"
- id="prop.section.NamespaceSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NamespaceSection"
- id="prop.section.NamespaceSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NamespaceSection"
- id="prop.section.NamespaceSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11CategoryAdapter">
- </input>
- </propertySection>
-
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.properties.sections.W11MessageReferenceSection"
- filter="org.eclipse.wst.wsdl.ui.internal.properties.sections.W11MessageReferenceSectionFilter"
- id="prop.section.MessageReferenceSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference">
- </input>
- </propertySection>
-
- <!-- move to wsdl specific plugin -->
- <propertySection tab="org.eclipse.wst.xmlwebservices.extensibility"
- class="org.eclipse.wst.wsdl.ui.internal.properties.sections.W11ExtensionsSection"
- id="prop.section.W11ApplicationInfoSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.extensibility"
- class="org.eclipse.wst.wsdl.ui.internal.properties.sections.W11ExtensionsSection"
- id="prop.section.W11ApplicationInfoSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NameSection"
- id="prop.section.NameSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingOperation">
- </input>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.xmlwebservices.general"
- class="org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NameSection"
- id="prop.section.NameSection">
- <input type="org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingMessageReference">
- </input>
- </propertySection>
- </propertySections>
-</extension>
-
- <extension point="org.eclipse.wst.wsdl.ui.extensionCategories">
- <category
- displayName="HTTP"
- namespaceURI="http://schemas.xmlsoap.org/wsdl/http/">
- </category>
-
- <category
- displayName="SOAP"
- namespaceURI="http://schemas.xmlsoap.org/wsdl/soap/">
- </category>
-
- <category
- displayName="MIME"
- namespaceURI="http://schemas.xmlsoap.org/wsdl/mime/">
- </category>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.wst.wsdl.ui.refactoring.menu.objectContrib"
- objectClass="org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter">
- <action
- id="org.eclipse.wst.wsdleditor.refactoring.menu.refactorGroup.object"
- enablesFor="1"
- style="pulldown"
- menubarPath="refactoring-slot-temp"
- label="%_UI_LABEL_REFACTOR"
- class="org.eclipse.wst.wsdl.ui.internal.refactor.actions.WSDLRefactorGroupActionDelegate">
- </action>
- </objectContribution>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.wst.wsdl.ui.searchReferences.menu.objectContrib"
- objectClass="org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter">
- <action
- id="org.eclipse.wst.wsdleditor.searchReferences.menu.searchReferences.object"
- enablesFor="1"
- style="pulldown"
- menubarPath="searchReferences-slot-temp"
- label="%References"
- class="org.eclipse.wst.wsdl.ui.internal.search.actions.WSDLSearchReferencesGroupActionDelegate">
- </action>
- </objectContribution>
- </extension>
-
- <!-- intialize wsdl source validator -->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.wsdl.ui.internal.reconciler.DelegatingSourceValidatorForWSDL"
- id="org.eclipse.wst.wsdl.ui.internal.reconciler.DelegatingSourceValidatorForWSDL">
- <contentTypeIdentifier
- id="org.eclipse.wst.wsdl.wsdlsource">
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
- </partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <!-- add preference pages to the context menu action (ID must correspond to the declared "path" above) -->
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.wsdl.ui.internal.WSDLPreferencePage"
- target="org.eclipse.wst.wsdl.wsdlsource" />
- <sourceViewerConfiguration
- class="org.eclipse.wst.wsdl.ui.internal.StructuredTextViewerConfigurationWSDL"
- target="org.eclipse.wst.wsdl.wsdlsource" />
-<!--
- <contentOutlineConfiguration
- class="org.eclipse.wst.wsdl.ui.internal.outline.WSDLContentOutlineConfiguration"
- target="org.eclipse.wst.wsdl.wsdlsource" />
--->
- </extension>
-
- <!-- this extension point is used to augment the ModelQuery to provide WSDL specific guided editing -->
- <extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
- <modelQueryExtension
- class="org.eclipse.wst.wsdl.ui.internal.text.WSDLModelQueryExtension"
- contentType="org.eclipse.wst.wsdl.wsdlsource">
- </modelQueryExtension>
- </extension>
-
- <!-- Search participant extension that supports XMLComponentSearchPatten on WSDL resources -->
- <extension
- point="org.eclipse.wst.common.core.searchParticipants">
- <searchParticipant
- id="org.eclipse.wst.wsdl.search.WSDLSearchParticipant"
- class="org.eclipse.wst.wsdl.ui.internal.search.WSDLSearchParticipant">
- <enablement>
- <or>
- <with variable="pattern">
- <instanceof value="org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern"/>
- </with>
- </or>
- </enablement>
- </searchParticipant>
- </extension>
-
-
-
- <!-- Refactoring CORE -->
- <extension
- point="org.eclipse.ltk.core.refactoring.renameParticipants">
- <renameParticipant
- name="WSDL Rename Particpant"
- class="org.eclipse.wst.wsdl.ui.internal.refactor.WSDLComponentRenameParticipant"
- id="org.eclipse.wst.wsdl.ui.refactoring.WSDLComponentRenameParticipant">
- <enablement>
- <or>
- <with variable="element">
- <instanceof value="org.eclipse.wst.wsdl.WSDLElement"/>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.xsd.XSDNamedComponent"/>
- </with>
- </or>
- </enablement>
- </renameParticipant>
- </extension>
-
- <!-- Refactoring UI extensions -->
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.wst.wsdl.ui.refactoring.menu.objectContrib"
- objectClass="org.eclipse.wst.wsdl.WSDLElement">
- <action
- id="org.eclipse.wst.wsdl.ui.refactoring.menu.refactorGroup.object"
- enablesFor="1"
- style="pulldown"
- menubarPath="additions"
- label="%refactoring.menu.label"
- class="org.eclipse.wst.wsdl.ui.internal.refactor.actions.WSDLRefactorGroupActionDelegate">
- </action>
- </objectContribution>
-
- <viewerContribution
- id="org.eclipse.wst.xsd.ui.refactoring.menu.source"
- targetID="org.eclipse.wst.wsdl.wsdlsource.source.EditorContext">
- <action id="org.eclipse.wst.wsdl.ui.refactoring.menu.refactorGroup.source"
- style="pulldown"
- menubarPath="additions"
- label="%refactoring.menu.label"
- class="org.eclipse.wst.wsdl.ui.internal.refactor.actions.WSDLRefactorGroupActionDelegate">
- </action>
- </viewerContribution>
- </extension>
-
- <extension point="org.eclipse.ui.commands">
- <command
- name="%command.wsdl.refactor.rename.element.name"
- description="%command.wsdl.refactor.rename.element.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.wsdl.ui.refactor.rename.element">
- </command>
- </extension>
-
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.ui.articles.action.contribution.editor"
- targetID="org.eclipse.wst.wsdl.ui.internal.WSDLEditor">
-
- <menu
- id="WSDLEditor"
- label="%_UI_EDITOR_NAME"
- path="additions">
- <separator name="group1" />
- </menu>
-
- <action
- id="org.eclipse.wst.wsdl.ui.actions.ReloadDependenciesActionDelegate"
- label="%_UI_RELOAD_DEPENDENCIES"
- icon="icons/reloadgrammar.gif"
- tooltip="Reload Dependencies"
- menubarPath="WSDLEditor/group1"
- class="org.eclipse.wst.wsdl.ui.internal.ReloadDependenciesActionDelegate">
- </action>
-
- <!--
- <action
- id="org.eclipse.wst.wsdl.ui.internal.actions.ValidateActionDelegate"
- label="%_UI_ACTION_VALIDATE_WSDL_DOCUMENT"
- icon="icons/validate.gif"
- tooltip="%_UI_ACTION_VALIDATE_WSDL_DOCUMENT"
- menubarPath="WSDLEditor/group1"
- toolbarPath="%Normal/WSDLEditor"
- class="org.eclipse.wst.wsdl.ui.internal.actions.ValidateActionDelegate">
- </action>
- -->
-
- </editorContribution>
- <editorContribution
- targetID="org.eclipse.wst.wsdl.wsdlsource.source"
- id="org.eclipse.wst.wsdl.wsdlsource.ruler.actions">
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- actionID="RulerDoubleClick"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction"/>
- <action
- label="%SelectRuler.label"
- class="org.eclipse.ui.texteditor.SelectRulerAction"
- actionID="RulerClick"
- id="org.eclipse.ui.texteditor.SelectRulerAction"/>
- </editorContribution>
- </extension>
-
- <!-- ===================================================================== -->
-
- <extension
- point="org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://schemas.xmlsoap.org/wsdl/soap/"
- class="org.eclipse.wst.wsdl.ui.internal.filter.SoapExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
- <extension
- point="org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://schemas.xmlsoap.org/wsdl/http/"
- class="org.eclipse.wst.wsdl.ui.internal.filter.HttpExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
- <extension
- point="org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://schemas.xmlsoap.org/wsdl/mime/"
- class="org.eclipse.wst.wsdl.ui.internal.filter.MimeExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
-
- <extension
- point="org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://www.w3.org/2001/XMLSchema"
- class="org.eclipse.wst.wsdl.ui.internal.filter.XSDExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
- <extension
- point="org.eclipse.wst.xsd.ui.extensibilityNodeCustomizations">
- <nodeCustomization
- namespace="http://schemas.xmlsoap.org/wsdl/soap/"
- nodeEditorProviderClass="org.eclipse.wst.wsdl.ui.internal.soap.customizations.SOAPNodeEditorProvider"
- labelProviderClass="org.eclipse.wst.wsdl.ui.internal.label.providers.SOAPLabelProvider">
- </nodeCustomization>
- <nodeCustomization
- namespace="http://schemas.xmlsoap.org/wsdl/http/"
- nodeEditorProviderClass="org.eclipse.wst.wsdl.ui.internal.soap.customizations.SOAPNodeEditorProvider"
- labelProviderClass="org.eclipse.wst.wsdl.ui.internal.label.providers.HTTPLabelProvider">
- </nodeCustomization>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.wst.wsdl.wsdlsource.source.RulerContext"
- id="org.eclipse.wst.wsld.ui.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- </viewerContribution>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
- <target
- id="org.eclipse.wst.wsdl.wsdlsource"
- name="%WSDL_Source_target_name">
- </target>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.wst.wsdl.ui.internal.text.WSDLHyperlinkDetector"
- id="org.eclipse.wst.wsdl.ui.internal.text.WSDLHyperlinkDetector"
- name="%WSDL_hyperlink"
- targetId="org.eclipse.wst.wsdl.wsdlsource">
- </hyperlinkDetector>
- </extension>
-
- <extension point = "org.eclipse.wst.wsdl.ui.contentGeneratorUI">
- <contentGeneratorUI
- name="SOAP"
- namespace="http://schemas.xmlsoap.org/wsdl/soap/"
- label="%SOAP"
- portOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.AddressPortOptionsPage"
- bindingOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.SoapBindingOptionsPage">
- </contentGeneratorUI>
- </extension>
- <extension point = "org.eclipse.wst.wsdl.ui.contentGeneratorUI">
- <contentGeneratorUI
- name="HTTP"
- namespace="http://schemas.xmlsoap.org/wsdl/http/"
- label="%HTTP"
- portOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.AddressPortOptionsPage"
- bindingOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.HttpBindingOptionsPage">
- </contentGeneratorUI>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/schema/adapterFactory.exsd b/bundles/org.eclipse.wst.wsdl.ui/schema/adapterFactory.exsd
deleted file mode 100644
index 2a8653691..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/schema/adapterFactory.exsd
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.wsdl.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.wsdl.ui" id="adapterFactory" name="Adapter Factory Extension"/>
- </appInfo>
- <documentation>
- The Adapter Factory Extension extension point allows clients to register adapter factories that extend the description of WSDL elements for UI purposes.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <documentation>
- The Adapter Factory Extension extension point allows clients to register adapter factories that extend the description of WSDL elements for UI purposes.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="adapterFactory"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="adapterFactory">
- <complexType>
- <attribute name="namespace" type="string" use="required">
- <annotation>
- <documentation>
- The namespace this extension point instance applies to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="adapterFactoryClass" type="string" use="required">
- <annotation>
- <documentation>
- Adapter factory for a specific namespace. The class must implement &lt;code&gt;org.eclipse.emf.common.notify.AdapterFactory&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.emf.common.notify.AdapterFactory"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a content generator ui contribution:
-&lt;pre&gt;
- &lt;extension point = &quot;org.eclipse.wst.wsdl.ui.adapterFactory&quot;&gt;
- &lt;adapterFactory
- namespace=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
- adapterFactoryClass=&quot;org.eclipse.wst.wsdl.ui.internal.soap.SOAPAdapterFactory&quot;&gt;
- &lt;/adapterFactory&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The supplied classes must implement &lt;code&gt;org.eclipse.emf.common.notify.AdapterFactory&lt;/code&gt;.
- </documentation>
- </annotation>
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2008 IBM Corporation and others.&lt;br&gt;
-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 &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/schema/contentGeneratorUI.exsd b/bundles/org.eclipse.wst.wsdl.ui/schema/contentGeneratorUI.exsd
deleted file mode 100644
index 89758b7b6..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/schema/contentGeneratorUI.exsd
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.wsdl.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.wsdl.ui" id="contentGeneratorUI" name="UI Port and Binding Content Generators"/>
- </appinfo>
- <documentation>
- The UI Port and Binding Content Generators extension point allows clients to register UI (in the New WSDL File wizard) for their custom generators for Ports and Bindings.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <documentation>
- The UI Port and Binding Content Generators extension point allows clients to register ui (for the New WSDL File wizard) for their custom content generators for WSDL Ports and Bindings.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="contentGeneratorUI"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentGeneratorUI">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- Name used for this particular extension point instance.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="namespace" type="string" use="required">
- <annotation>
- <documentation>
- The namespace this extension point instance applies to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="portOptionsPageClass" type="string" use="required">
- <annotation>
- <documentation>
- UI that offers port options. The class must implement &lt;code&gt;org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage&lt;/code&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="bindingOptionsPageClass" type="string" use="required">
- <annotation>
- <documentation>
- UI that offers binding options. The class must implement &lt;code&gt;org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage&lt;/code&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="label" type="string">
- <annotation>
- <documentation>
- The label used to describe this extension point instance.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- The following is an example of a content generator ui contribution:
-&lt;pre&gt;
- &lt;extension point = &quot;org.eclipse.wst.wsdl.ui.contentGeneratorUI&quot;&gt;
- &lt;contentGeneratorUI
- name=&quot;SOAP&quot;
- namespace=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
- portOptionsPageClass=&quot;org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.AddressPortOptionsPage&quot;
- bindingOptionsPageClass=&quot;org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.SoapBindingOptionsPage&quot;&gt;
- &lt;/contentGeneratorUI&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiInfo"/>
- </appinfo>
- <documentation>
- The supplied classes must implement &lt;code&gt;org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage&lt;/code&gt;.
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2008 IBM Corporation and others.&lt;br&gt;
-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 &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityElementFilter.exsd b/bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityElementFilter.exsd
deleted file mode 100644
index b9470d861..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityElementFilter.exsd
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.wsdl.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.wsdl.ui" id="extensibilityelementFilter" name="Extensibility Element Filter"/>
- </appInfo>
- <documentation>
- The Extensibility Element Filter extension point allows clients to register filters for Extensibility Elements in the WSDL Editor based on the Extensibility Element&apos;s namespace. These filters determine what is to be displayed in the WSDL Editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="extensibilityElementFilter"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="extensibilityElementFilter">
- <complexType>
- <attribute name="namespace" type="string" use="required">
- <annotation>
- <documentation>
- The namespace this extension point instance applies to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;code&gt;org.eclipse.wst.wsdl.ui.internal.filter.ExtensiblityElementFilter&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an Extensibility Element Filter contribution:
-&lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.wsdl.ui.extensibilityElementFilter&quot;&gt;
- &lt;extensibilityElementFilter
- namespace=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
- class=&quot;org.eclipse.wst.wsdl.ui.internal.filter.SoapExtensiblityElementFilter&quot;/&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The supplied class must implement &lt;code&gt;org.eclipse.wst.wsdl.ui.internal.filter.ExtensiblityElementFilter&lt;/code&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-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 &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityItemTreeProviders.exsd b/bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityItemTreeProviders.exsd
deleted file mode 100644
index e7f897c24..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/schema/extensibilityItemTreeProviders.exsd
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.wsdl.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.wsdl.ui" id="extensibilityItemTreeProviders" name="Extensibility Item Tree Providers"/>
- </appInfo>
- <documentation>
- The Extensibility Item Tree Provider extension point allows clients to register custom ILabelProviders (to provide custom labels and icons) for Extensibility Elements in the WSDL Editor based on the Extensibility Element&apos;s namespace.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="extensibilityItemTreeProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="extensibilityItemTreeProvider">
- <complexType>
- <attribute name="namespace" type="string" use="required">
- <annotation>
- <documentation>
- The namespace this extension point instance applies to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="labelProviderClass" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;code&gt;org.eclipse.jface.viewers.ILabelProvider&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an Extensibility Item Tree Provider contribution:
-&lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.wsdl.ui.extensibilityItemTreeProviders&quot;&gt;
- &lt;extensibilityItemTreeProvider
- namespace=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
- labelProviderClass=&quot;org.eclipse.wst.wsdl.ui.internal.outline.SOAPLabelProvider&quot;/&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The supplied class must implement &lt;code&gt;org.eclipse.jface.viewers.ILabelProvider&lt;/code&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-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 &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/schema/internalEditorExtensions.exsd b/bundles/org.eclipse.wst.wsdl.ui/schema/internalEditorExtensions.exsd
deleted file mode 100644
index f5710d795..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/schema/internalEditorExtensions.exsd
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.wsdl.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.wsdl.ui" id="internalEditorExtensions" name="Internal Editor Extensions"/>
- </appInfo>
- <documentation>
- The Internal Editor Extension point is used to provide GUI objects, actions, context menu items, etc... for non WSDL Model Objects in the WSDL Editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="internalEditorExtension"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="internalEditorExtension">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;code&gt;org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an Internal Editor Extension contribution:
-&lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.wsdl.ui.internalEditorExtensions&quot;&gt;
- &lt;internalEditorExtension
- class=&quot;org.eclipse.wst.wsdl.ui.internal.xsd.XSDExtension&quot; /&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The supplied class must implement &lt;code&gt;org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension&lt;/code&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-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 &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/schema/propertyDescriptorProvider.exsd b/bundles/org.eclipse.wst.wsdl.ui/schema/propertyDescriptorProvider.exsd
deleted file mode 100644
index 613846034..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/schema/propertyDescriptorProvider.exsd
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.wsdl.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.wsdl.ui" id="propertyDescriptorProvider" name="Property Descriptor Provider"/>
- </appInfo>
- <documentation>
- The Property Descriptor Provider extension point allows clients to register their own custom IPropertyDescriptor in the WSDL Editor based on namespace.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="propertyDescriptorProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="propertyDescriptorProvider">
- <complexType>
- <attribute name="namespace" type="string">
- <annotation>
- <documentation>
- The namespace this extension point instance applies to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- The class that implements &lt;code&gt;org.eclipse.ui.views.properties.IPropertyDescriptor&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an contribution:
-&lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.wsdl.ui.propertyDescriptorProvider&quot;&gt;
- &lt;propertyDescriptorProvider
- namespace=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
- class=&quot;org.eclipse.wst.wsdl.ui.internal.example.ExamplePropertyDescriptor&quot;/&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The supplied class must implement &lt;code&gt;org.eclipse.ui.views.properties.IPropertyDescriptor&lt;/code&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-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 &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/DefaultEditorMode.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/DefaultEditorMode.java
deleted file mode 100644
index b6abb6659..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/DefaultEditorMode.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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;
-
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ASDEditPartFactory;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ASDContentOutlineProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode;
-
-public class DefaultEditorMode extends EditorMode
-{
- public final static String ID = DefaultEditorMode.class.getName();
-
- public String getDisplayName()
- {
- return Messages._UI_LABEL_DEFAULT;
- }
-
- public EditPartFactory getEditPartFactory()
- {
- return new ASDEditPartFactory();
- }
-
- public String getId()
- {
- return ID;
- }
-
- public IContentProvider getOutlineProvider()
- {
- return new ASDContentOutlineProvider();
- }
-
- public Object getAdapter(Class adapter)
- {
- return super.getAdapter(adapter);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/IDesignViewerActionBarContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/IDesignViewerActionBarContributor.java
deleted file mode 100644
index fc201a3c2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/IDesignViewerActionBarContributor.java
+++ /dev/null
@@ -1,18 +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;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-public interface IDesignViewerActionBarContributor extends ISourceViewerActionBarContributor {
- public void initViewerSpecificContributions(IActionBars bars);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ISelectionMapper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ISelectionMapper.java
deleted file mode 100644
index 2b6dafd95..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ISelectionMapper.java
+++ /dev/null
@@ -1,17 +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;
-
-import org.eclipse.jface.viewers.ISelection;
-
-public interface ISelectionMapper {
- ISelection mapSelection(ISelection selectedObject);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/InternalWSDLMultiPageEditor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/InternalWSDLMultiPageEditor.java
deleted file mode 100644
index 961cf6e91..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/InternalWSDLMultiPageEditor.java
+++ /dev/null
@@ -1,577 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.KeyStroke;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.GEFActionConstants;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11AddPartAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11OpenImportAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingElementAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingMessageAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewElementAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewMessageAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddMessageAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDirectEditAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.KeyboardDragImpl;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.DefinitionsEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ASDContentOutlinePage;
-import org.eclipse.wst.wsdl.ui.internal.asd.util.IOpenExternalEditorHelper;
-import org.eclipse.wst.wsdl.ui.internal.edit.W11BindingReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.W11InterfaceReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.W11MessageReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLXSDElementReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLXSDTypeReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.text.WSDLModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.W11OpenExternalEditorHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLResourceUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IKeyboardDrag;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDElementReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class InternalWSDLMultiPageEditor extends ASDMultiPageEditor
-{
- ResourceSet resourceSet;
- Resource wsdlResource;
-
- protected WSDLEditorResourceChangeHandler resourceChangeHandler;
-
- protected WSDLModelAdapter modelAdapter;
- protected SourceEditorSelectionListener fSourceEditorSelectionListener;
- protected WSDLSelectionManagerSelectionListener fWSDLSelectionListener;
-
- private IStructuredModel structuredModel;
- private final static String WSDL_EDITOR_MODE_EXTENSION_ID = "org.eclipse.wst.wsdl.ui.editorModes"; //$NON-NLS-1$
-
- public IDescription buildModel(IEditorInput editorInput) {
- try {
- // ISSUE: This code which deals with the structured model is similar to the one in the XSD editor.
- // It could be refactored into the base class.
-
- Document document = null;
- IDocument doc = structuredTextEditor.getDocumentProvider().getDocument(editorInput);
- if (doc instanceof IStructuredDocument) {
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
- if (model == null) {
- model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
- }
- structuredModel = model;
- document = ((IDOMModel) model).getDocument();
- }
- Assert.isNotNull(document);
-
- Object obj = null;
-
- if (document instanceof INodeNotifier) {
- INodeNotifier notifier = (INodeNotifier) document;
- modelAdapter = (WSDLModelAdapter) notifier.getAdapterFor(WSDLModelAdapter.class);
- if (modelAdapter == null) {
- modelAdapter = new WSDLModelAdapter();
- notifier.addAdapter(modelAdapter);
- obj = modelAdapter.createDefinition(document);
- }
- if (obj == null) {
- obj = modelAdapter.createDefinition(document);
- }
- }
-
- if (obj instanceof Definition) {
- Definition definition = (Definition) obj;
- model = (IDescription) WSDLAdapterFactoryHelper.getInstance().adapt(definition);
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- return model;
- }
-
- private XSDSchema[] getInlineSchemas() {
- List types = getModel().getTypes();
- XSDSchema[] schemas = new XSDSchema[types.size()];
- for (int index = 0; index < types.size(); index++) {
- W11Type type = (W11Type) types.get(index);
- schemas[index] = (XSDSchema) type.getTarget();
- }
-
- return schemas;
- }
-
- public Object getAdapter(Class type) {
- if (type == Definition.class)
- {
- return ((W11Description) getModel()).getTarget();
- }
- else if (type == ISelectionMapper.class)
- {
- return new WSDLSelectionMapper();
- }
- else if (type == Definition.class && model instanceof Adapter)
- {
- return ((Adapter)model).getTarget();
- }
- else if (type == IOpenExternalEditorHelper.class) {
- return new W11OpenExternalEditorHelper(getEditorInput());
- }
-
- else if (type == XSDTypeReferenceEditManager.class)
- {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- WSDLXSDTypeReferenceEditManager refManager = new WSDLXSDTypeReferenceEditManager(fileEditorInput.getFile(), null);
- refManager.setSchemas(getInlineSchemas());
- return refManager;
- }
- }
- else if (type == XSDElementReferenceEditManager.class)
- {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- WSDLXSDElementReferenceEditManager refManager = new WSDLXSDElementReferenceEditManager(fileEditorInput.getFile(), null);
- refManager.setSchemas(getInlineSchemas());
- return refManager;
- }
- }
- else if (type == W11BindingReferenceEditManager.class) {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- return new W11BindingReferenceEditManager((W11Description) getModel(), fileEditorInput.getFile());
- }
- }
- else if (type == W11InterfaceReferenceEditManager.class) {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- return new W11InterfaceReferenceEditManager((W11Description) getModel(), fileEditorInput.getFile());
- }
- }
- else if (type == W11MessageReferenceEditManager.class) {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- return new W11MessageReferenceEditManager((W11Description) getModel(), fileEditorInput.getFile());
- }
- }
- else if (type == ProductCustomizationProvider.class)
- {
- return WSDLEditorPlugin.getInstance().getProductCustomizationProvider();
- }
- else if (type == IKeyboardDrag.class) {
- return new KeyboardDragImpl();
- }
- else if (type == IOpenExternalEditorHelper.class) {
- return new W11OpenExternalEditorHelper(getEditorInput());
- }
- return super.getAdapter(type);
- }
-
- /**
- * Listener on SSE's source editor's selections that converts DOM
- * selections into xsd selections and notifies WSDL selection manager
- */
- private class SourceEditorSelectionListener implements ISelectionChangedListener {
- /**
- * Determines WSDL facade object based on DOM node
- *
- * @param object
- * @return
- */
- private Object getWSDLFacadeObject(Object object) {
- // get the element node
- Element element = null;
- if (object instanceof Node) {
- Node node = (Node) object;
- if (node != null) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- element = (Element) node;
- }
- else if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- element = ((Attr) node).getOwnerElement();
- }
- }
- }
- Object o = element;
- if (element != null) {
- Definition def = (Definition) ((W11Description) model).getTarget();
- Object modelObject = WSDLEditorUtil.getInstance().findModelObjectForElement(def, element);
-
- // rmah: We handle this special scenario where the modelObject is an XSDSchemaExtensibilityElement.
- // We actually want the XSDSchema object. However, our node reconciler will always return
- // XSDSchemaExtensibilityElement because both XSDSchemaExtensibilityElement and XSDSchema
- // both have the SAME Element object, and the reconciler encounters the XSDSchemaExtensibilityElement
- // first.... See WSDLNodeNodeAssociationProvider for more details.....
- if (modelObject instanceof XSDSchemaExtensibilityElement) {
- modelObject = ((XSDSchemaExtensibilityElement) modelObject).getSchema();
- }
- if (modelObject != null) {
- o = WSDLAdapterFactoryHelper.getInstance().adapt((Notifier) modelObject);
- }
- }
- return o;
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- if (getSelectionManager().getEnableNotify() && getActivePage() == 1)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- List selections = new ArrayList();
- for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();)
- {
- Object domNode = i.next();
- Object facade = getWSDLFacadeObject(domNode);
- if (facade != null)
- {
- selections.add(facade);
- }
- }
-
- if (!selections.isEmpty())
- {
- StructuredSelection wsdlSelection = new StructuredSelection(selections);
- getSelectionManager().setSelection(wsdlSelection, getTextEditor().getSelectionProvider());
- }
- }
- }
- }
- }
-
- /**
- * Listener on WSDL's selection manager's selections that converts WSDL
- * selections into DOM selections and notifies SSE's selection provider
- */
- private class WSDLSelectionManagerSelectionListener implements ISelectionChangedListener {
- /**
- * Determines DOM node based on object (wsdl node)
- *
- * @param object
- * @return
- */
- private Object getObjectForOtherModel(Object object) {
- Node node = null;
-
- if (object instanceof Node) {
- node = (Node) object;
- }
- else if (object instanceof String) {
- // The string is expected to be a URI fragment used to identify a WSDL element.
- // The URI fragment should be relative to the definition being edited in this editor.
- String uriFragment = (String)object;
- EObject definition = ((Definition)((W11Description)getModel()).getTarget());
- EObject modelObject = definition.eResource().getEObject(uriFragment);
-
- if (modelObject != null) {
- node = WSDLEditorUtil.getInstance().getNodeForObject(modelObject);
- }
- }
- else {
- node = WSDLEditorUtil.getInstance().getNodeForObject(object);
- }
-
- // the text editor can only accept sed nodes!
- //
- if (!(node instanceof IDOMNode)) {
- node = null;
- }
- return node;
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- // do not fire selection in source editor if the current active page is the InternalWSDLMultiPageEditor (source)
- // We only want to make source selections if the active page is either the outline or properties (a modify
- // has been done via the outline or properties and not the source view). We don't want to be selecting
- // and unselecting things in the source when editing in the source!!
- boolean makeSelection = true;
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null && !(event.getSource() instanceof IPostSelectionProvider)) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActivePart() instanceof InternalWSDLMultiPageEditor) {
- if (getActiveEditor() instanceof StructuredTextEditor) {
- makeSelection = false;
- }
- }
- }
-
- // do not fire selection in source editor if selection event came
- // from source editor
- if (event.getSource() != getTextEditor().getSelectionProvider() && makeSelection) {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- List otherModelObjectList = new ArrayList();
- for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) {
- Object wsdlObject = i.next();
-
- if (wsdlObject instanceof WSDLBaseAdapter) {
- wsdlObject = ((WSDLBaseAdapter) wsdlObject).getTarget();
- }
-
- Object otherModelObject = getObjectForOtherModel(wsdlObject);
- if (otherModelObject != null) {
- otherModelObjectList.add(otherModelObject);
- }
- }
- if (!otherModelObjectList.isEmpty()) {
- StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
- getTextEditor().getSelectionProvider().setSelection(nodeSelection);
- }
- }
- }
- }
- }
-
- protected void configureGraphicalViewer() {
- super.configureGraphicalViewer();
- graphicalViewer.getKeyHandler().put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));
- setEditPartFactory(getEditorModeManager().getCurrentMode().getEditPartFactory());
- }
-
- protected void createPages() {
- super.createPages();
-
- if (resourceChangeHandler == null) {
- resourceChangeHandler = new WSDLEditorResourceChangeHandler(this);
- resourceChangeHandler.attach();
- }
-
- fSourceEditorSelectionListener = new SourceEditorSelectionListener();
- ISelectionProvider provider = getTextEditor().getSelectionProvider();
- if (provider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) provider).addPostSelectionChangedListener(fSourceEditorSelectionListener);
- }
- else {
- provider.addSelectionChangedListener(fSourceEditorSelectionListener);
- }
-
- fWSDLSelectionListener = new WSDLSelectionManagerSelectionListener();
- getSelectionManager().addSelectionChangedListener(fWSDLSelectionListener);
- }
-
- public void dispose() {
- if (structuredModel != null) {
- structuredModel.releaseFromEdit();
- }
- if (resourceChangeHandler != null) {
- resourceChangeHandler.dispose();
- }
- getSelectionManager().removeSelectionChangedListener(fWSDLSelectionListener);
- super.dispose();
- }
-
- public void reloadDependencies() {
- try {
- Definition definition = (Definition) ((W11Description) getModel()).getTarget();
- if (definition != null) {
- WSDLResourceUtil.reloadDirectives(definition);
- ComponentReferenceUtil.updateBindingReferences(definition);
- ComponentReferenceUtil.updatePortTypeReferences(definition);
- ComponentReferenceUtil.updateMessageReferences(definition);
- ComponentReferenceUtil.updateSchemaReferences(definition);
- // the line below simply causes a notification in order to
- // update our
- // views
- //
- definition.setDocumentationElement(definition.getDocumentationElement());
- }
- }
- finally {
- }
- }
-
- protected void createActions() {
- super.createActions();
-
- ActionRegistry registry = getActionRegistry();
- BaseSelectionAction action;
- if (!isFileReadOnly()) {
- action = new ASDAddMessageAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new W11AddPartAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new W11SetNewMessageAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new W11SetExistingMessageAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new W11SetNewTypeAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new W11SetExistingTypeAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new W11SetNewElementAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new W11SetExistingElementAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- ASDDirectEditAction directEditAction = new ASDDirectEditAction(this);
- directEditAction.setSelectionProvider(getSelectionManager());
- registry.registerAction(directEditAction);
- }
- action = new W11OpenImportAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new OpenInNewEditor(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
- }
-
- private static final String DEFAULT_EDITOR_MODE_ID = "org.eclipse.wst.wsdl.ui.defaultEditorModeId"; //$NON-NLS-1$
-
- protected EditorModeManager createEditorModeManager()
- {
- final ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)getAdapter(ProductCustomizationProvider.class);
- EditorModeManager manager = new EditorModeManager(WSDL_EDITOR_MODE_EXTENSION_ID)
- {
- public void init()
- {
- if (productCustomizationProvider == null ||
- productCustomizationProvider.isEditorModeApplicable(DefaultEditorMode.ID))
- {
- addMode(new DefaultEditorMode());
- }
- super.init();
- }
-
- protected EditorMode getDefaultMode()
- {
- String defaultModeId = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(DEFAULT_EDITOR_MODE_ID);
- if (defaultModeId != null)
- {
- EditorMode editorMode = getEditorMode(defaultModeId);
- if (editorMode != null)
- {
- return editorMode;
- }
- }
- return super.getDefaultMode();
- }
- };
- manager.setProductCustomizationProvider(productCustomizationProvider);
- return manager;
- }
-
- public void editorModeChanged(EditorMode newEditorMode)
- {
- EditPartFactory editPartFactory = newEditorMode.getEditPartFactory();
- if (editPartFactory != null)
- {
- graphicalViewer.setEditPartFactory(editPartFactory);
- if (graphicalViewer instanceof DesignViewGraphicalViewer)
- {
- DesignViewGraphicalViewer viewer = (DesignViewGraphicalViewer)graphicalViewer;
- DefinitionsEditPart editPart = (DefinitionsEditPart)viewer.getRootEditPart().getContents();
- editPart.setModelChildren(Collections.EMPTY_LIST);
- editPart.refresh();
- editPart.setModelChildren(null);
- editPart.refresh();
- }
- }
- IContentProvider provider = newEditorMode.getOutlineProvider();
- if (provider != null)
- {
- ASDContentOutlinePage outline = (ASDContentOutlinePage)getContentOutlinePage();
- if (outline != null)
- {
- TreeViewer treeViewer = outline.getTreeViewer();
- if (treeViewer != null)
- {
- outline.getTreeViewer().setContentProvider(provider);
- outline.getTreeViewer().refresh();
- }
- }
-
- }
- }
-
- protected void storeCurrentModePreference(String id)
- {
- WSDLEditorPlugin.getInstance().getPreferenceStore().setValue(DEFAULT_EDITOR_MODE_ID, id);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/Messages.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/Messages.java
deleted file mode 100644
index 98744b8c6..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/Messages.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.wsdl.ui.internal.messages"; //$NON-NLS-1$
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class); //$NON-NLS-1$
- }
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- /**
- * @deprecated: Use Messages._STRING_KEY to access strings.
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
- /**
- * @deprecated: Use Messages._STRING_KEY to access strings.
- */
- public static String getString(String key, String arg0) {
- return MessageFormat.format(getString(key), new Object [] { arg0 });
- }
-
- /**
- * @deprecated: Use Messages._STRING_KEY to access strings.
- */
- public static String getString(String key, Object[] args) {
- return MessageFormat.format(getString(key), args);
- }
-
- public static String _UI_EDITOR_NAME;
- public static String _UI_DEPENDENCIES_CHANGED;
- public static String _UI_DEPENDENCIES_CHANGED_REFRESH;
- public static String _UI_EDIT_NAMESPACES_DIALOG_TITLE;
- public static String _UI_PREF_PAGE_CREATING_FILES;
- public static String _UI_REMEMBER_MY_DECISION_LABEL;
- public static String _UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE;
- public static String _UI_REGEN_BINDINGS_ON_SAVE_QUESTIONMARK;
- public static String _UI_LABEL_WARNING_DUPLICATE_NAME_EXISTS;
- public static String _UI_LABEL_NAMESPACE_URIS_TO_BE_INCLUDED;
- public static String _UI_PREF_PAGE_AUTO_REGENERATE_BINDING;
- public static String _UI_PREF_PAGE_PROMPT_REGEN_BINDING_ON_SAVE;
- public static String _UI_EDIT_NAMESPACES;
- public static String _UI_ACTION_ADD_IMPORT;
- public static String _UI_ACTION_ADD_BINDING;
- public static String _UI_ACTION_ADD_PART;
- public static String _UI_ACTION_ADD_XML_SCHEMA_ELEMENT;
- public static String _UI_ACTION_REORDER_PART;
- public static String _UI_ACTION_REORDER_MESSAGE_REFERENCE;
- public static String _UI_ACTION_OPEN_IN_NEW_EDITOR;
- public static String _UI_ACTION_EXISTING_MESSAGE;
- public static String _UI_ACTION_EXISTING_ELEMENT;
- public static String _UI_ERROR_NAMESPACE_INVALID;
- public static String _UI_ERROR_FILE_ALREADY_EXISTS;
- public static String _UI_DESCRIPTION_NEW_WSDL_FILE;
- public static String _UI_REGEN_BINDINDS_ON_SAVE;
- public static String _UI_RADIO_DOCUMENT_LITERAL;
- public static String _UI_TITLE_SPECIFY_PORTTYPE;
- public static String _UI_LABEL_BINDING_PROTOCOL;
- public static String _UI_LABEL_INLINE_SCHEMA_OF;
- public static String _UI_LABEL_TARGET_NAMESPACE;
- public static String _UI_LABEL_PREFIX_WITH_COLON;
- public static String _UI_LABEL_CREATE_WSDL_SKELETON;
- public static String _UI_LABEL_CREATE_NEW_WSDL_FILE;
- public static String _UI_LABEL_SOAP_BINDING_OPTIONS;
- public static String _UI_LABEL_HTTP_BINDING_OPTIONS;
- public static String _UI_LABEL_ADD_EXTENSION_ELEMENT;
- public static String _UI_SPECIFY_BINDING_DETAILS_LABEL;
- public static String _UI_SPECIFY_PORT_DETAILS_TO_BE_CREATED;
- public static String _UI_LABEL_NEW_BINDING;
- public static String _UI_LABEL_NEW_PORTTYPE;
- public static String _UI_LABEL_REFERENCE_KIND;
- public static String _UI_LABEL_NEW_MESSAGE;
- public static String _UI_RADIO_RPC_ENCODED;
- public static String _UI_RADIO_RPC_LITERAL;
- public static String _UI_ACTION_EXISTING_TYPE;
- public static String _UI_SPECIFY_PORT_DETAILS;
- public static String _UI_TITLE_SPECIFY_BINDING;
- public static String _UI_TITLE_SPECIFY_BINDING_DETAILS;
- public static String _UI_ERROR_FILE_MUST_END_WITH_WSDL;
- public static String _UI_TITLE_SPECIFY_MESSAGE;
- public static String _UI_TITLE_NEW_WSDL_FILE;
- public static String _UI_NAME_INVALID_CHAR_END;
- public static String _UI_ACTION_RENAME;
- public static String _UI_FOLDER_TYPES;
- public static String _UI_CANCEL_LABEL;
- public static String _UI_ACTION_NEW_TYPE;
- public static String _UI_ACTION_SET_TYPE;
- public static String _UI_FOLDER_IMPORTS;
- public static String _UI_FOLDER_SERVICES;
- public static String _UI_FOLDER_BINDINGS;
- public static String _UI_FOLDER_INTERFACES;
- public static String _UI_FOLDER_PORTTYPES;
- public static String _UI_FOLDER_MESSAGES;
- public static String _UI_ACTION_NEW_MESSAGE;
- public static String _UI_ACTION_NEW_ELEMENT;
- public static String _UI_ACTION_SET_ELEMENT;
- public static String _UI_ACTION_SET_MESSAGE;
- public static String _UI_ACTION_SET_BINDING;
- public static String _UI_CHECKBOX_OVERWRITE;
- public static String _UI_ACTION_SET_PORTTYPE;
- public static String _UI_ACTION_EDIT_PORT_ADDRESS;
- public static String _UI_ACTION_ADD;
- public static String _UI_ACTION_OPEN_IMPORT;
- public static String _UI_UNSPECIFIED;
- public static String _UI_LABEL_NAME;
- public static String _UI_LABEL_TYPE;
- public static String _UI_BUTTON_NEW;
- public static String _UI_LABEL_ELEMENT;
- public static String _UI_BUTTON_BROWSE;
- public static String _UI_BINDING_WIZARD;
- public static String _UI_BINDING;
- public static String _UI_LABEL_MESSAGE;
- public static String _UI_LABEL_REMOVE;
- public static String _UI_TITLE_SELECT;
- public static String _UI_TITLE_SELECT_FILE;
- public static String _UI_DESCRIPTION_SELECT_WSDL_OR_XSD;
- public static String _UI_TITLE_OPTIONS;
- public static String _UI_YES_LABEL;
- public static String _UI_PORT_TYPE;
- public static String _UI_PORT_WIZARD;
- public static String _UI_NO_LABEL;
- public static String _UI_ADD;
- public static String _UI_HELP;
- public static String _UI_LABEL_NAME_FILTER;
- public static String _WARN_NAME_MUST_CONTAIN_AT_LEAST_ONE_CHAR;
- public static String _WARN_NAME_HAS_SPACE;
- public static String _WARN_NAME_INVALID_FIRST;
- public static String _WARN_NAME_INVALID_CHAR;
- public static String _UI_LABEL_DEFAULT;
- public static String _WSI_COMPLIANCE_LINK_TEXT;
- public static String _WARN_WSI_COMPLIANCE_PROTOCOL;
- public static String _ERROR_WSI_COMPLIANCE_PROTOCOL;
- public static String _WARN_WSI_COMPLIANCE_RPC_ENCODING;
- public static String _ERROR_WSI_COMPLIANCE_RPC_ENCODING;
- public static String _UI_LABEL_UNDEFINED_ARG1;
- public static String _UI_LABEL_OR_UNDEFINED_ARG2;
- public static String _UI_LABEL_NO_OBJECT_SPECIFIED_ARG1;
- public static String _UI_LABEL_NO_PARAMETERS_SPECIFIED;
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ReloadDependenciesActionDelegate.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ReloadDependenciesActionDelegate.java
deleted file mode 100644
index 2e2c438a1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/ReloadDependenciesActionDelegate.java
+++ /dev/null
@@ -1,41 +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;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-public class ReloadDependenciesActionDelegate extends ActionDelegate implements IEditorActionDelegate
-{
- private InternalWSDLMultiPageEditor wsdlEditor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor)
- {
- wsdlEditor = (targetEditor instanceof InternalWSDLMultiPageEditor) ? (InternalWSDLMultiPageEditor)targetEditor : null;
- }
-
- public void run(IAction action)
- {
- if (wsdlEditor != null)
- {
- try
- {
- wsdlEditor.reloadDependencies();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourceEditorActionBarContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourceEditorActionBarContributor.java
deleted file mode 100644
index c5fe27300..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourceEditorActionBarContributor.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-public class SourceEditorActionBarContributor extends MultiPageEditorActionBarContributor implements IExtendedContributor {
-
- protected IEditorActionBarContributor designViewerActionBarContributor = null;
- protected IEditorActionBarContributor sourceViewerActionContributor = null;
- protected InternalWSDLMultiPageEditor multiPageEditor = null;
-
- // EditorExtension
- private static final String EDITOR_ID = "org.eclipse.wst.wsdl.ui.internal.actions.XMLMultiPageEditorPart"; //$NON-NLS-1$
- private IExtendedContributor extendedContributor;
-
- public SourceEditorActionBarContributor() {
- super();
-
- sourceViewerActionContributor = new SourcePageActionContributor();
-
- // Read action extensions.
- ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
- extendedContributor = builder.readActionExtensions(EDITOR_ID);
- }
-
- public void init(IActionBars actionBars) {
- super.init(actionBars);
-
- if (actionBars != null) {
- initDesignViewerActionBarContributor(actionBars);
- initSourceViewerActionContributor(actionBars);
- }
- }
-
- protected void initDesignViewerActionBarContributor(IActionBars actionBars) {
- if (designViewerActionBarContributor != null)
- designViewerActionBarContributor.init(actionBars, getPage());
- }
-
- protected void initSourceViewerActionContributor(IActionBars actionBars) {
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.init(actionBars, getPage());
- }
-
- public void dispose() {
- super.dispose();
-
- if (designViewerActionBarContributor != null)
- designViewerActionBarContributor.dispose();
-
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.dispose();
-
- if (extendedContributor != null)
- extendedContributor.dispose();
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor.EditorActionBarContributor#contributeToMenu(IMenuManager)
- */
- public final void contributeToMenu(IMenuManager menu) {
- super.contributeToMenu(menu);
-
- addToMenu(menu);
-
- if (extendedContributor != null)
- extendedContributor.contributeToMenu(menu);
- }
-
- protected void addToMenu(IMenuManager menu) {
- }
-
- /**
- * @see IExtendedContributor#contributeToPopupMenu(IMenuManager)
- */
- public final void contributeToPopupMenu(IMenuManager menu) {
-
- addToPopupMenu(menu);
-
- if (extendedContributor != null)
- extendedContributor.contributeToPopupMenu(menu);
- }
-
- protected void addToPopupMenu(IMenuManager menu) {
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor.EditorActionBarContributor#contributeToToolBar(IToolBarManager)
- */
- public final void contributeToToolBar(IToolBarManager toolBarManager) {
- super.contributeToToolBar(toolBarManager);
-
- addToToolBar(toolBarManager);
-
- if (extendedContributor != null)
- extendedContributor.contributeToToolBar(toolBarManager);
- }
-
- protected void addToToolBar(IToolBarManager toolBarManager) {
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor.EditorActionBarContributor#contributeToStatusLine(IStatusLineManager)
- */
- public final void contributeToStatusLine(IStatusLineManager manager) {
- super.contributeToStatusLine(manager);
-
- addToStatusLine(manager);
-
- if (extendedContributor != null)
- extendedContributor.contributeToStatusLine(manager);
- }
-
- protected void addToStatusLine(IStatusLineManager manager) {
- }
-
- /**
- * @see IExtendedContributor#updateToolbarActions()
- */
- public void updateToolbarActions() {
- if (extendedContributor != null)
- extendedContributor.updateToolbarActions();
- }
-
- public void setActiveEditor(IEditorPart targetEditor) {
- // save multiPageEditor before calling super.setActiveEditor(targetEditor)
- // super.setActiveEditor will call setActivePage(IEditorPart activeEditor)
- // multiPageEditor is needed in setActivePage(IEditorPart activeEditor)
- if (targetEditor instanceof InternalWSDLMultiPageEditor)
- multiPageEditor = (InternalWSDLMultiPageEditor) targetEditor;
-
- super.setActiveEditor(targetEditor);
-
- updateToolbarActions();
-
- if (extendedContributor != null)
- extendedContributor.setActiveEditor(targetEditor);
- }
-
- public void setActivePage(IEditorPart activeEditor) {
- // This contributor is designed for StructuredTextMultiPageEditorPart.
- // To safe-guard this from problems caused by unexpected usage by other editors, the following
- // check is added.
- if (multiPageEditor != null) {
- if (activeEditor != null && activeEditor instanceof StructuredTextEditor)
- activateSourcePage(activeEditor);
- else
- activateDesignPage(activeEditor);
- }
-
- updateToolbarActions();
-
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
- // update menu bar and tool bar
- actionBars.updateActionBars();
- }
- }
-
- protected void activateDesignPage(IEditorPart activeEditor) {
- if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- }
-
- if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
- // if design page is not really an IEditorPart, activeEditor == null, so pass in multiPageEditor instead (d282414)
- if (activeEditor == null) {
- sourceViewerActionContributor.setActiveEditor(multiPageEditor);
- }
- else {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- }
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(false);
- }
- }
-
- protected void activateSourcePage(IEditorPart activeEditor) {
- if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- }
-
- if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(true);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourcePageActionContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourcePageActionContributor.java
deleted file mode 100644
index 60fc70dfe..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/SourcePageActionContributor.java
+++ /dev/null
@@ -1,58 +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;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-
-/**
- * SourcePageActionContributor
- *
- * This class is for multi page editor's source page contributor.
- *
- * Use WSDLEditorActionContributor for single page editor
- * */
-public class SourcePageActionContributor extends ActionContributorXML {
-
- private IActionBars fBars;
-
- /**
- * This method calls:
- * <ul>
- * <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li>
- * <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar
- * manager</li>
- * <li><code>contributeToStatusLine</code> with <code>bars</code>' status line
- * manager</li>
- * </ul>
- * The given action bars are also remembered and made accessible via
- * <code>getActionBars</code>.
- *
- * @param bars the action bars
- *
- */
- public void init(IActionBars bars) {
- fBars = bars;
- contributeToMenu(bars.getMenuManager());
- contributeToToolBar(bars.getToolBarManager());
- contributeToStatusLine(bars.getStatusLineManager());
- }
-
- /**
- * Returns this contributor's action bars.
- *
- * @return the action bars
- */
- public IActionBars getActionBars() {
- return fBars;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/StructuredTextViewerConfigurationWSDL.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/StructuredTextViewerConfigurationWSDL.java
deleted file mode 100644
index 9afb129f4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/StructuredTextViewerConfigurationWSDL.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-public class StructuredTextViewerConfigurationWSDL extends StructuredTextViewerConfigurationXML {
- protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
- Map targets = super.getHyperlinkDetectorTargets(sourceViewer);
- targets.put("org.eclipse.wst.wsdl.wsdlsource", null); //$NON-NLS-1$
- return targets;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLActionBarContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLActionBarContributor.java
deleted file mode 100644
index 5859ce2e7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLActionBarContributor.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
-import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
-import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-import org.eclipse.wst.wsdl.ui.internal.actions.IWSDLToolbarAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.CaptureScreenAction;
-
-public class WSDLActionBarContributor extends MultiPageEditorActionBarContributor
-{
- private IEditorPart activeEditorPart;
- private InternalWSDLMultiPageEditor wsdlEditor;
- protected ITextEditor textEditor;
- protected IEditorActionBarContributor sourceViewerActionContributor = null;
- protected List fPartListeners= new ArrayList();
- ZoomInRetargetAction zoomInRetargetAction;
- ZoomOutRetargetAction zoomOutRetargetAction;
- ZoomComboContributionItem zoomComboContributionItem;
- Action captureScreenAction;
-
- /**
- * Constructor for WSDLActionBarContributor.
- */
- public WSDLActionBarContributor()
- {
- super();
- sourceViewerActionContributor = new SourcePageActionContributor();
- zoomInRetargetAction = new ZoomInRetargetAction();
- zoomInRetargetAction.setImageDescriptor(WSDLEditorPlugin.getImageDescriptorFromPlugin("icons/etool16/zoomplus.gif"));
- zoomOutRetargetAction = new ZoomOutRetargetAction();
- zoomOutRetargetAction.setImageDescriptor(WSDLEditorPlugin.getImageDescriptorFromPlugin("icons/etool16/zoomminus.gif"));
- captureScreenAction = new CaptureScreenAction();
- fPartListeners.add(zoomInRetargetAction);
- fPartListeners.add(zoomOutRetargetAction);
- }
-
- public void setActivePage(IEditorPart part)
- {
- if (activeEditorPart == part)
- return;
-
- activeEditorPart = part;
-
- IActionBars actionBars = getActionBars();
- boolean isSource = false;
-
- if (activeEditorPart != null && activeEditorPart instanceof ITextEditor)
- {
- isSource = true;
- zoomInRetargetAction.setEnabled(false);
- zoomOutRetargetAction.setEnabled(false);
- activateSourcePage(activeEditorPart, true);
- captureScreenAction.setEnabled(false);
- }
- else
- {
- activateSourcePage(wsdlEditor, false);
- if (part instanceof InternalWSDLMultiPageEditor)
- {
- wsdlEditor = (InternalWSDLMultiPageEditor) part;
- }
- if (wsdlEditor != null)
- {
- // cs: here's we ensure the UNDO and REDO actions are available when
- // the design view is active
- IWorkbenchPartSite site = wsdlEditor.getSite();
- if (site instanceof IEditorSite)
- {
- ITextEditor textEditor = wsdlEditor.getTextEditor();
- IActionBars siteActionBars = ((IEditorSite) site).getActionBars();
- siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, getAction(textEditor, ITextEditorActionConstants.UNDO));
- siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, getAction(textEditor, ITextEditorActionConstants.REDO));
- siteActionBars.updateActionBars();
- }
-
- Object adapter = wsdlEditor.getAdapter(ActionRegistry.class);
- if (adapter instanceof ActionRegistry)
- {
- ActionRegistry registry = (ActionRegistry) adapter;
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), registry.getAction(ASDDeleteAction.ID));
- zoomInRetargetAction.setEnabled(true);
- zoomOutRetargetAction.setEnabled(true);
- captureScreenAction.setEnabled(true);
- }
- }
- }
-
- if (actionBars != null) {
- // update menu bar and tool bar
- actionBars.updateActionBars();
- }
-
- if (zoomComboContributionItem != null)
- {
- zoomComboContributionItem.setVisible(!isSource);
- zoomComboContributionItem.update();
- }
- }
-
- /**
- * Returns the action registed with the given text editor.
- * @return IAction or null if editor is null.
- */
- protected IAction getAction(ITextEditor editor, String actionID)
- {
- try
- {
- return (editor == null ? null : editor.getAction(actionID));
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- public void contributeToToolBar(IToolBarManager manager)
- {
- manager.add(new GroupMarker("WSDLEditor")); //$NON-NLS-1$
- List list = WSDLEditorPlugin.getInstance().getWSDLEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- manager.add((IWSDLToolbarAction)i.next());
- }
-
-// manager.add(new Separator());
- String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH };
- zoomComboContributionItem = new ZoomComboContributionItem(getPage(), zoomStrings);
- manager.add(zoomComboContributionItem);
- manager.add(captureScreenAction);
- }
-
- public void setActiveEditor(IEditorPart part)
- {
- IEditorPart activeNestedEditor = null;
- if (part instanceof MultiPageEditorPart)
- {
- activeNestedEditor = part;
- }
- setActivePage(activeNestedEditor);
-
- if (part instanceof InternalWSDLMultiPageEditor)
- {
- wsdlEditor = (InternalWSDLMultiPageEditor) part;
-
- textEditor = wsdlEditor.getTextEditor();
- if (textEditor != null)
- {
- getActionBars().updateActionBars();
- }
- }
-
- List list = WSDLEditorPlugin.getInstance().getWSDLEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- ((IWSDLToolbarAction)i.next()).setEditorPart(part);
- }
- super.setActiveEditor(part);
- }
-
- protected void activateSourcePage(IEditorPart activeEditor, boolean state)
- {
- if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)
- {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(state);
- }
- }
-
- public void init(IActionBars bars, IWorkbenchPage page)
- {
- Iterator e = fPartListeners.iterator();
- while (e.hasNext())
- {
- page.addPartListener((RetargetAction) e.next());
- }
-
- initSourceViewerActionContributor(bars);
- super.init(bars, page);
- }
-
-
- protected void initSourceViewerActionContributor(IActionBars actionBars) {
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.init(actionBars, getPage());
- }
-
- public void dispose()
- {
- fPartListeners = null;
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.dispose();
- super.dispose();
- }
-
-public void contributeToMenu(IMenuManager manager) {
- super.contributeToMenu(manager);
-
- IMenuManager menu = new MenuManager(Messages._UI_EDITOR_NAME, "WSDLEditor");
-
- menu.add(zoomInRetargetAction);
- menu.add(zoomOutRetargetAction);
- manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
- menu.add(captureScreenAction);
-
- menu.updateAll(true);
-
-}
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorPlugin.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorPlugin.java
deleted file mode 100644
index 667fd899e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorPlugin.java
+++ /dev/null
@@ -1,588 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Hashtable;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.adapterfactory.extension.AdapterFactoryExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.adapterfactory.extension.AdapterFactoryExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.extensions.NSKeyedExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.extensions.WSDLEditorConfiguration;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionsSchemasRegistry;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-public class WSDLEditorPlugin extends AbstractUIPlugin //, IPluginHelper
-{
- public static final String DEFAULT_PAGE = "org.eclipse.wst.wsdl.ui.internal.defaultpage"; //$NON-NLS-1$
- public static final String DESIGN_PAGE = "org.eclipse.wst.wsdl.ui.internal.designpage"; //$NON-NLS-1$
- public static final String SOURCE_PAGE = "org.eclipse.wst.wsdl.ui.internal.sourcepage"; //$NON-NLS-1$
-
- public final static String PLUGIN_ID = "org.eclipse.wst.wsdl.ui"; //$NON-NLS-1$
- public final static String WSDL_EDITOR_ID = "org.eclipse.wst.wsdl.ui.internal.WSDLEditor"; //$NON-NLS-1$
- public final static String XSD_EDITOR_ID = "org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor"; //$NON-NLS-1$
- public final static String WSDL_CONTENT_TYPE_ID = "org.eclipse.wst.wsdl.wsdlsource"; //$NON-NLS-1$
-
- public final static String DEFAULT_TARGET_NAMESPACE = "http://www.example.org"; //$NON-NLS-1$
-
- public static int DEPENDECIES_CHANGED_POLICY_PROMPT = 0;
- public static int DEPENDECIES_CHANGED_POLICY_IGNORE = 1;
- public static int DEPENDECIES_CHANGED_POLICY_RELOAD = 2;
-
- protected static WSDLEditorPlugin instance;
- private ExtensionsSchemasRegistry registry;
- private WSDLEditorConfiguration wsdlEditorConfiguration = null;
-
- private NSKeyedExtensionRegistry extensiblityElementFilterRegistry;
- private ContentGeneratorUIExtensionRegistry contentGeneratorUIExtensionRegistry;
- private AdapterFactoryExtensionRegistry adapterFactoryExtensionRegistry;
-
- private int dependenciesChangedPolicy = DEPENDECIES_CHANGED_POLICY_RELOAD;
-
- public WSDLEditorConfiguration getWSDLEditorConfiguration()
- {
- if (wsdlEditorConfiguration == null)
- {
- wsdlEditorConfiguration = new WSDLEditorConfiguration();
- }
- return wsdlEditorConfiguration;
- }
-
- public ExtensionsSchemasRegistry getExtensionsSchemasRegistry() {
- if (registry == null) {
- registry = new ExtensionsSchemasRegistry("org.eclipse.wst.wsdl.ui.extensionCategories"); //$NON-NLS-1$
- registry.__internalSetDeprecatedExtensionId("org.eclipse.wst.wsdl.ui.ExtensionsSchemasDescription"); //$NON-NLS-1$
- registry.setPrefStore(WSDLEditorPlugin.getInstance().getPreferenceStore() );
- }
-
- return registry;
- }
-
- public static void logMessage(String message)
- {
- }
-
- /**
- * Resources helper.
- */
-
- public WSDLEditorPlugin()
- {
- super();
- instance = this;
-
- // TODO... remove this code when we add 'dependenciesChangedPolicy'
- // to an editor preferences page
- try
- {
- // _DEBUG_UPDATE_POLICY = 0Dummy.label=
- String string = "0Dummy.label"; //$NON-NLS-1$
- int policy = Integer.parseInt(string);
- if (policy >= 0 && policy <= DEPENDECIES_CHANGED_POLICY_RELOAD)
- {
- dependenciesChangedPolicy = policy;
- }
- }
- catch (Exception e)
- {
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception
- {
- super.stop(context);
- }
-
- public NSKeyedExtensionRegistry getExtensiblityElementFilterRegistry()
- {
- if (extensiblityElementFilterRegistry == null)
- {
- extensiblityElementFilterRegistry = new NSKeyedExtensionRegistry();
- new ElementContentFilterExtensionRegistryReader(extensiblityElementFilterRegistry).readRegistry();
- }
- return extensiblityElementFilterRegistry;
- }
-
- public ContentGeneratorUIExtensionRegistry getContentGeneratorUIExtensionRegistry() {
- if (contentGeneratorUIExtensionRegistry == null) {
- contentGeneratorUIExtensionRegistry = new ContentGeneratorUIExtensionRegistry();
- new ContentGeneratorUIExtensionRegistryReader(contentGeneratorUIExtensionRegistry).readRegistry();
- }
-
- return contentGeneratorUIExtensionRegistry;
- }
-
- public AdapterFactoryExtensionRegistry getAdapterFactoryExtensionRegistry() {
- if (adapterFactoryExtensionRegistry == null) {
- adapterFactoryExtensionRegistry = new AdapterFactoryExtensionRegistry();
- new AdapterFactoryExtensionRegistryReader(adapterFactoryExtensionRegistry).readRegistry();
- }
-
- return adapterFactoryExtensionRegistry;
- }
-
- /**
- * Get the Install URL
- */
- public static URL getInstallURL()
- {
- try
- {
- return FileLocator.resolve(instance.getBundle().getEntry("/")); //$NON-NLS-1$
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- /**
- * Return the plugin physical directory location
- */
- public static IPath getPluginLocation()
- {
- try
- {
- IPath installPath = new Path(getInstallURL().toExternalForm()).removeTrailingSeparator();
- String installStr = FileLocator.toFileURL(new URL(installPath.toString())).getFile();
- return new Path(installStr);
- }
- catch (IOException e)
- {
- //System.out.println("WSDLEditorPlugin.getPluginLocation() exception.." + e);
- }
- return null;
- }
-
- protected Hashtable imageDescriptorCache = new Hashtable();
-
- protected ImageDescriptor internalGetImageDescriptor(String key)
- {
- ImageDescriptor imageDescriptor = (ImageDescriptor) imageDescriptorCache.get(key);
- if (imageDescriptor == null)
- {
- imageDescriptor = ImageDescriptor.createFromFile(WSDLEditorPlugin.class, key);
- if (imageDescriptor != null)
- {
- imageDescriptorCache.put(key, imageDescriptor);
- }
- }
- return imageDescriptor;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptorFromPlugin(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); //$NON-NLS-1$
- }
-
- public static ImageDescriptor getImageDescriptor(String key)
- {
- return getInstance().internalGetImageDescriptor(key);
- }
-
- public Image getImage(String iconName)
- {
- ImageRegistry imageRegistry = getImageRegistry();
-
- if (imageRegistry.get(iconName) != null)
- {
- return imageRegistry.get(iconName);
- }
- else
- {
- imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
- return imageRegistry.get(iconName);
- }
- }
-
- /*
- public Image getImage(String key, boolean isGrayed)
- {
- Image image = null;
- if (!isGrayed)
- {
- image = super.getImage(key);
- }
- else
- {
- image = (Image)grayedImageMap.get(key);
- if (image == null)
- {
- Image colorImage = super.getImage(key);
- if (colorImage != null)
- {
- image = new Image(Display.getCurrent(), colorImage, SWT.IMAGE_GRAY);//SWT.IMAGE_DISABLE);
- grayedImageMap.put(key, image);
- }
- }
- }
- return image;
- }
- */
-
- /**
- * Get the metadata directory for this plugin
- */
- public static String getMetaDataDirectory()
- {
- return getInstance().getStateLocation().toOSString();
- }
-
- /**
- * Get the singleton instance.
- */
- public static WSDLEditorPlugin getInstance()
- {
- if (instance == null)
- {
- new WSDLEditorPlugin();
- }
-
- return instance;
- }
-
- public IWorkspace getWorkspace()
- {
- return ResourcesPlugin.getWorkspace();
- }
-
- public static Shell getShell()
- {
- return getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)
- */
- protected void initializeDefaultPreferences(IPreferenceStore store)
- {
- store.setDefault(DEFAULT_PAGE, DESIGN_PAGE);
-
- // WSDLPreferencePage prefs
- store.setDefault(Messages._UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE, DEFAULT_TARGET_NAMESPACE); //$NON-NLS-1$
- store.setDefault(Messages._UI_PREF_PAGE_AUTO_REGENERATE_BINDING, false); //$NON-NLS-1$
- store.setDefault(Messages._UI_PREF_PAGE_PROMPT_REGEN_BINDING_ON_SAVE, false); //$NON-NLS-1$
- // Do we need this preference below? Look at WSDLPreferencePage.java
-// store.setDefault("Defualt Location:", "http://www.example.com");
- }
-
- /**
- * setDefaultPage
- * Set the default page to open when the editor starts. Maintains the state
- * when WSAD is shutdown and restarted.
- * @param page
- */
- public void setDefaultPage(String page)
- {
- getPreferenceStore().setValue(DEFAULT_PAGE, page);
- }
-
- public String getDefaultPage()
- {
- return getPreferenceStore().getString(DEFAULT_PAGE);
- }
-
- public int getDependenciesChangedPolicy()
- {
- //return getPreferenceStore().getInt(DEPENDECIES_CHANGED_POLICY);
- return dependenciesChangedPolicy;
- }
-
-
- private static final String PRODUCT_CUSTOMIZATION_PROVIDER_PLUGIN_ID = "org.eclipse.wst.wsdl.ui.productCustomizationProviderPluginId"; //$NON-NLS-1$
- private static final String PRODUCT_CUSTOMIZATION_PROVIDER_CLASS_NAME = "org.eclipse.wst.wsdl.ui.productCustomizationProviderClassName"; //$NON-NLS-1$
-
- private static ProductCustomizationProvider productCustomizationProvider;
- private static boolean productCustomizationProviderInitialized = false;
-
- public ProductCustomizationProvider getProductCustomizationProvider()
- {
- if (!productCustomizationProviderInitialized)
- {
- productCustomizationProviderInitialized = true;
- String pluginName = getPreferenceStore().getString(PRODUCT_CUSTOMIZATION_PROVIDER_PLUGIN_ID);
- String className = getPreferenceStore().getString(PRODUCT_CUSTOMIZATION_PROVIDER_CLASS_NAME);
- if (pluginName != null && pluginName.length() > 0 &&
- className != null && className.length() > 0)
- {
- try
- {
- Bundle bundle = Platform.getBundle(pluginName);
- Class clazz = bundle.loadClass(className);
- productCustomizationProvider = (ProductCustomizationProvider)clazz.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- }
- return productCustomizationProvider;
- }
-}
-
-class BaseRegistryReader
-{
- protected static final String PLUGIN_ID = "org.eclipse.wst.wsdl.ui"; //$NON-NLS-1$
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry(String extensionPointId)
- {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(PLUGIN_ID, extensionPointId);
-
- if (point != null)
- {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- readElement(elements[i]);
- }
- }
- }
-
- protected void readElement(IConfigurationElement element)
- {
- }
-}
-
-/**
- *
- */
-abstract class NSKeyedExtensionRegistryReader extends BaseRegistryReader
-{
- protected static final String ATT_NAME_SPACE = "namespace"; //$NON-NLS-1$
- protected String extensionPointId;
- protected String tagName;
- protected String[] attributeNames;
- protected NSKeyedExtensionRegistry nsKeyedExtensionRegistry;
-
- private NSKeyedExtensionRegistryReader(String extensionPointId, String tagName, NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- this.extensionPointId = extensionPointId;
- this.tagName = tagName;
- this.nsKeyedExtensionRegistry = nsKeyedExtensionRegistry;
- }
-
- public NSKeyedExtensionRegistryReader(String extensionPointId, String tagName, String attributeName, NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- this(extensionPointId, tagName, nsKeyedExtensionRegistry);
- attributeNames = new String[1];
- attributeNames[0] = attributeName;
- }
-
- public NSKeyedExtensionRegistryReader(String extensionPointId, String tagName, String[] attributeNames, NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- this(extensionPointId, tagName, nsKeyedExtensionRegistry);
- this.attributeNames = attributeNames;
- }
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry()
- {
- super.readRegistry(extensionPointId);
- }
-
- /**
- * readElement()
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(tagName))
- {
- String namespace = element.getAttribute(ATT_NAME_SPACE);
- if (namespace != null)
- {
- Bundle bundle = Platform.getBundle(element.getDeclaringExtension().getContributor().getName());
- if (attributeNames.length == 1)
- {
- String className = element.getAttribute(attributeNames[0]);
- if (className != null)
- {
- nsKeyedExtensionRegistry.put(namespace, className, bundle);
- }
- }
- else
- {
- HashMap map = new HashMap();
- for (int i = 0; i < attributeNames.length; i++)
- {
- String attributeName = attributeNames[i];
- String className = element.getAttribute(attributeName);
- if (className != null && className.length() > 0)
- {
- map.put(attributeName, className);
- }
- }
- nsKeyedExtensionRegistry.put(namespace, map, bundle);
- }
- }
- }
- }
-}
-
-/**
- *
- */
-class ElementContentFilterExtensionRegistryReader extends NSKeyedExtensionRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "extensibilityElementFilter"; //$NON-NLS-1$
- protected static final String TAG_NAME = "extensibilityElementFilter"; //$NON-NLS-1$
-
- public ElementContentFilterExtensionRegistryReader(NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- super(EXTENSION_POINT_ID, TAG_NAME, "class", nsKeyedExtensionRegistry); //$NON-NLS-1$
- }
-}
-
-class ContentGeneratorUIExtensionRegistryReader extends BaseRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "contentGeneratorUI"; //$NON-NLS-1$
- protected static final String ELEMENT_CONTENT_GENERATOR = "contentGeneratorUI"; //$NON-NLS-1$
- protected static final String ATT_NAME = "name"; //$NON-NLS-1$
- protected static final String ATT_NAMESPACE = "namespace"; //$NON-NLS-1$
- protected static final String ATT_LABEL = "label"; //$NON-NLS-1$
- protected static final String ATT_PORT_OPTIONS_PAGE_CLASS = "portOptionsPageClass"; //$NON-NLS-1$
- protected static final String ATT_BINDING_OPTIONS_PAGE_CLASS = "bindingOptionsPageClass"; //$NON-NLS-1$
-
- protected ContentGeneratorUIExtensionRegistry registry;
-
- public ContentGeneratorUIExtensionRegistryReader(ContentGeneratorUIExtensionRegistry registry)
- {
- this.registry = registry;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry()
- {
- super.readRegistry(EXTENSION_POINT_ID);
- }
-
- /**
- * readElement()
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(ELEMENT_CONTENT_GENERATOR))
- {
- String name = element.getAttribute(ATT_NAME);
- String namespace = element.getAttribute(ATT_NAMESPACE);
-
- if (name != null && namespace != null)
- {
- ContentGeneratorUIExtension bindingGeneratorExtension = new ContentGeneratorUIExtension(name, namespace);
- bindingGeneratorExtension.setPortOptionsPageClassName(element.getAttribute(ATT_PORT_OPTIONS_PAGE_CLASS));
- bindingGeneratorExtension.setBindingOptionsPageClassName(element.getAttribute(ATT_BINDING_OPTIONS_PAGE_CLASS));
- bindingGeneratorExtension.setLabel(element.getAttribute(ATT_LABEL));
- try
- {
- ClassLoader pluginClasssLoader = element.getDeclaringExtension().getDeclaringPluginDescriptor().getPlugin().getClass().getClassLoader();
- bindingGeneratorExtension.setClassLoader(pluginClasssLoader);
- registry.add(bindingGeneratorExtension);
- }
- catch (Exception e)
- {
- }
- }
- }
- }
-}
-
-class AdapterFactoryExtensionRegistryReader extends BaseRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "adapterFactory"; //$NON-NLS-1$
- protected static final String ELEMENT_ADAPTER_FACTORY = "adapterFactory"; //$NON-NLS-1$
- protected static final String ATT_NAMESPACE = "namespace"; //$NON-NLS-1$
- protected static final String ATT_ADAPTER_FACTORY_CLASS = "adapterFactoryClass"; //$NON-NLS-1$
-
- protected AdapterFactoryExtensionRegistry registry;
-
- public AdapterFactoryExtensionRegistryReader(AdapterFactoryExtensionRegistry registry)
- {
- this.registry = registry;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry()
- {
- super.readRegistry(EXTENSION_POINT_ID);
- }
-
- /**
- * readElement()
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(ELEMENT_ADAPTER_FACTORY))
- {
- String namespace = element.getAttribute(ATT_NAMESPACE);
-
- if (namespace != null)
- {
- AdapterFactoryExtension adapterFactoryExtension = new AdapterFactoryExtension(namespace);
- adapterFactoryExtension.setAdapterFactoryClassName(element.getAttribute(ATT_ADAPTER_FACTORY_CLASS));
- try
- {
- ClassLoader pluginClasssLoader = element.getDeclaringExtension().getDeclaringPluginDescriptor().getPlugin().getClass().getClassLoader();
- adapterFactoryExtension.setClassLoader(pluginClasssLoader);
- registry.add(adapterFactoryExtension);
- }
- catch (Exception e)
- {
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorResourceChangeHandler.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorResourceChangeHandler.java
deleted file mode 100644
index efcfa5058..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLEditorResourceChangeHandler.java
+++ /dev/null
@@ -1,317 +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;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-
-
-public class WSDLEditorResourceChangeHandler
-{
- protected InternalWSDLMultiPageEditor wsdlEditor;
- protected boolean isUpdateRequired;
- protected InternalResourceChangeListener resourceChangeListener;
- protected InternalPartListener partListener;
-
- public WSDLEditorResourceChangeHandler(InternalWSDLMultiPageEditor wsdlEditor)
- {
- this.wsdlEditor = wsdlEditor;
- resourceChangeListener = new InternalResourceChangeListener();
- partListener = new InternalPartListener();
- }
-
- public void attach()
- {
- ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener);
- wsdlEditor.getSite().getWorkbenchWindow().getPartService().addPartListener(partListener);
- }
-
- public void dispose()
- {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- wsdlEditor.getSite().getWorkbenchWindow().getPartService().removePartListener(partListener);
- }
-
- protected Map computeDependencyMap()
- {
- Map map = new HashMap();
- IDescription description = ((InternalWSDLMultiPageEditor) wsdlEditor).getModel();
- Definition definition = (Definition) ((W11Description) description).getTarget();
- ResourceSet resourceSet = definition.eResource().getResourceSet();
- for (Iterator i = resourceSet.getResources().iterator(); i.hasNext();)
- {
- Resource resource = (Resource)i.next();
- if (resource != definition.eResource())
- {
- String uri = resource.getURI().toString();
- if (map.get(uri) == null)
- {
- map.put(uri, uri);
- }
- }
- }
- return map;
- }
-
- public void performReload()
- {
- boolean doReload = false;
- int policy = WSDLEditorPlugin.getInstance().getDependenciesChangedPolicy();
-
- if (policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_PROMPT)
- {
- doReload = MessageDialog.openQuestion(wsdlEditor.getSite().getShell(), Messages._UI_DEPENDENCIES_CHANGED, Messages._UI_DEPENDENCIES_CHANGED_REFRESH); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_RELOAD)
- {
- doReload = true;
- }
-
- if (doReload)
- {
- wsdlEditor.reloadDependencies();
- }
- }
-
- public boolean isListeningToResourceChanges()
- {
- int policy = WSDLEditorPlugin.getInstance().getDependenciesChangedPolicy();
- return policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_PROMPT ||
- policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_RELOAD;
- }
-
-
- class InternalResourceChangeListener implements IResourceChangeListener, IResourceDeltaVisitor
- {
- protected List list = new ArrayList();
- protected boolean isPending = false;
- protected int count = 0;
-
- public void resourceChanged(IResourceChangeEvent event)
- {
- Display display = Display.getCurrent();
-
- if (display != null && isListeningToResourceChanges() && !isUpdateRequired)
- {
- if (event.getType() == IResourceChangeEvent.POST_CHANGE)
- {
- IResourceDelta[] deltas = event.getDelta().getAffectedChildren();
- for (int i = 0; i < deltas.length; i++)
- {
- try
- {
- deltas[i].accept(this);
- }
- catch (Exception e)
- {
- }
- }
- }
- if (list.size() > 0)
- {
- if (!isPending)
- {
- isPending = true;
- display.timerExec(2000, new TimerEvent());
- }
- }
- }
- }
-
- public boolean visit(IResourceDelta delta) throws CoreException
- {
- IResource resource = delta.getResource();
- if (resource.getType() == IResource.FILE)
- {
- if (!list.contains(resource))
- {
- list.add(resource);
- }
- }
- return true;
- }
-
- class TimerEvent implements Runnable
- {
- public TimerEvent()
- {
- //System.out.println("NewTimerEvent(" + wsdlEditor.getDefinition().eResource().getURI() + ") " + count);
- }
-
- public void run()
- {
-// for (Iterator i = list.iterator(); i.hasNext();)
-// {
-// IResource resource = (IResource)i.next();
-// String platformPath = URI.createPlatformResourceURI(resource.getFullPath().toString()).toString();
-// }
-
- Map dependencyMap = computeDependencyMap();
-
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- IResource resource = (IResource)i.next();
- String platformPath = URI.createPlatformResourceURI(resource.getFullPath().toString()).toString();
- if (dependencyMap.get(platformPath) != null)
- {
- isUpdateRequired = true;
- if (wsdlEditor.getSite().getWorkbenchWindow().getPartService().getActivePart() == wsdlEditor)
- {
- isUpdateRequired = false;
- performReload();
- }
- }
- }
-
- isPending = false;
- list = new ArrayList();
- }
- }
- }
-
- class InternalPartListener implements IPartListener
- {
- public void partActivated(IWorkbenchPart part)
- {
- if (part == wsdlEditor)
- {
- if (isUpdateRequired)
- {
- isUpdateRequired = false;
- performReload();
- }
- }
- }
-
- public void partBroughtToTop(IWorkbenchPart part)
- {
- }
-
- public void partClosed(IWorkbenchPart part)
- {
- }
-
-
- public void partDeactivated(IWorkbenchPart part)
- {
- }
-
- public void partOpened(IWorkbenchPart part)
- {
- }
- }
-
-
-}
-
-/*
-class DependencyVisitor
-{
- public void visitImport(Import theImport)
- {
- if (theImport.getEDefinition() != null)
- {
- visitDefinition(theImport.getEDefinition());
- }
- else if (theImport.getESchema() != null)
- {
- visitSchema(theImport.getESchema());
- }
- }
-
- public void visitXSDSchemaDirective(XSDSchemaDirective directive)
- {
- XSDSchema referencedSchema = directive.getResolvedSchema();
- if (referencedSchema != null)
- {
- visitSchema(referencedSchema);
- }
- }
-
- public void visitDefinition(Definition definition)
- {
- if (definition != null)
- {
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- visitImport((Import)i.next());
- }
- Types types = definition.getETypes();
- if (types != null)
- {
-
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement e = (XSDSchemaExtensibilityElement)o;
- if (e.getEXSDSchema() != null)
- {
- visitSchema(e.getEXSDSchema());
- }
- }
- }
- }
- }
- }
-
- public void visitSchema(XSDSchema schema)
- {
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- visitXSDSchemaDirective((XSDSchemaDirective)o);
- }
- }
- }
-}
-
-class ReloadDependencyVisitor extends DependencyVisitor
-{
- public void visitImport(Import theImport)
- {
- ComponentHandler handler = WSDLReconciler.getReconciler(theImport);
- Element element = WSDLUtil.getInstance().getElementForObject(theImport);
- if (element != null && handler != null)
- {
- handler.reconcile(wsdlEditor.getDefinition(), theImport, element);
- }
- }
-
- public void visitXSDSchemaDirective(XSDSchemaDirective directive)
- {
-
- }
-}*/ \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLPreferencePage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLPreferencePage.java
deleted file mode 100644
index 8f72065a7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLPreferencePage.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-
-public class WSDLPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- public WSDLPreferencePage()
- {
- super(FieldEditorPreferencePage.FLAT);
- setPreferenceStore(WSDLEditorPlugin.getInstance().getPreferenceStore());
- }
-
- public void init(IWorkbench workbench)
- {
- }
-
- protected void createFieldEditors()
- {
- Composite parent = getFieldEditorParent();
- GridLayout parentLayout = new GridLayout();
- parentLayout.marginWidth = 0;
- parent.setLayout(parentLayout);
-
-// WorkbenchHelp.setHelp(getControl(), some context id here);
-
- Group group = new Group(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.numColumns = 2;
- group.setLayout(layout);
- group.setText(Messages._UI_PREF_PAGE_CREATING_FILES); //$NON-NLS-1$
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- group.setLayoutData(data);
-
- Composite composite = new Composite(group, SWT.NULL);
- GridData data1 = new GridData();
- data1.verticalAlignment = GridData.FILL;
- data1.horizontalAlignment = GridData.FILL;
- data1.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data1);
-
- String namespaceLabel = Messages._UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE; //$NON-NLS-1$
- StringFieldEditor targetNamespace = new StringFieldEditor(namespaceLabel, namespaceLabel, composite);
- GridLayout compositeLayout = (GridLayout)composite.getLayout();
- compositeLayout.marginWidth = 5; // Default value
- compositeLayout.numColumns = 2;
- addField(targetNamespace);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(targetNamespace.getTextControl(composite), ASDEditorCSHelpIds.WSDL_PREF_DEFAULT_TNS);
-
- String generateLabel = Messages._UI_PREF_PAGE_AUTO_REGENERATE_BINDING; //$NON-NLS-1$
- BooleanFieldEditor generateBindingOnSave = new BooleanFieldEditor(generateLabel, generateLabel, parent);
- addField(generateBindingOnSave);
-
- String showGenerateDialogLabel = Messages._UI_PREF_PAGE_PROMPT_REGEN_BINDING_ON_SAVE; //$NON-NLS-1$
- BooleanFieldEditor showGenerateDialog = new BooleanFieldEditor(showGenerateDialogLabel, showGenerateDialogLabel, parent);
- addField(showGenerateDialog);
-
- /* Do we need this preference below? If so, change WSDLEditorPlugin.java and use this preference in:
- HttpContentGenerator.java
- SoapContentGenerator.java
- SoapPortOptionsPage.java
- */
-// HttpPortOptionsPage.java StringFieldEditor location = new StringFieldEditor("Defualt Location:", "Default Location:", editorGroup1); // Externalize
-// addField(location);
-
- applyDialogFont(parent);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLSelectionMapper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLSelectionMapper.java
deleted file mode 100644
index 5c888d360..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLSelectionMapper.java
+++ /dev/null
@@ -1,39 +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;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public class WSDLSelectionMapper implements ISelectionMapper {
-
- public ISelection mapSelection(ISelection selection) {
- List list = new ArrayList();
- if (selection instanceof StructuredSelection) {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- for (Iterator i = structuredSelection.iterator(); i.hasNext(); ) {
- Object o = i.next();
- if (o instanceof Adapter) {
- list.add(((Adapter)o).getTarget());
- }
- else {
- list.add(o);
- }
- }
- }
- return new StructuredSelection(list);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementAction.java
deleted file mode 100644
index a1161c66a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementAction.java
+++ /dev/null
@@ -1,330 +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.actions;
-
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.NewComponentDialog;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class AddElementAction extends BaseNodeAction {
- protected Node parentNode;
- protected String prefix;
- protected String nodeName;
- protected Element newElement;
- protected Node relativeNode = null;
- protected IEditorPart editorPart;
- protected Definition definition;
- protected Document document;
- protected boolean computeTopLevelRefChild;
-
- protected boolean selectNewlyCreatedObject = true; // We should not be
- // selecting the
- // object in the
- // action..... TODO
-
- public AddElementAction(String text, String imageDescriptorKey, Node parentNode, String nodeName) {
- setText(text);
- setImageDescriptor(WSDLEditorPlugin.getImageDescriptor(imageDescriptorKey));
- this.parentNode = parentNode;
- this.nodeName = nodeName;
- }
-
- public AddElementAction(String text, String imageDescriptorKey, Node parentNode, String prefix, String localName) {
- setText(text);
- setImageDescriptor(WSDLEditorPlugin.getImageDescriptor(imageDescriptorKey));
- this.parentNode = parentNode;
- this.prefix = prefix;
- this.nodeName = localName;
- }
-
- public AddElementAction(String text, Node parentNode, String prefix, String localName) {
- setText(text);
- setImageDescriptor(null);
- this.parentNode = parentNode;
- this.prefix = prefix;
- this.nodeName = localName;
- }
-
- public AddElementAction(Node parentNode, String prefix, String localName, Node relativeNode) {
- this.parentNode = parentNode;
- this.prefix = prefix;
- this.nodeName = localName;
- this.relativeNode = relativeNode;
- }
-
- public void setComputeTopLevelRefChild(boolean isEnabled) {
- computeTopLevelRefChild = isEnabled;
- }
-
- protected void setEditorPart(IEditorPart editorPart) {
- this.editorPart = editorPart;
- }
-
- protected boolean showDialog() {
- return true;
- }
-
- public void run() {
- boolean ok = showDialog();
- if (ok) {
- beginRecording();
- performAddElement();
- endRecording();
- }
- }
-
- protected void performAddElement() {
- if (parentNode != null) {
- newElement = createElement(nodeName);
- addAttributes(newElement);
- if (relativeNode == null && computeTopLevelRefChild) {
- relativeNode = computeTopLevelRefChild(newElement);
- }
-
- if (relativeNode == null) {
- parentNode.appendChild(newElement);
- }
- else {
- parentNode.insertBefore(newElement, relativeNode);
- }
- // format(parentNode);
- format(newElement);
- // Ugly..... We should not be selecting the object in the graph
- // view in the Action.
- // This should be refactored out. We add this boolean check
- // because WSDLSetTypeDialog.java
- // uses AddImportAction.java but we should not be selecting the
- // newly created import....
- if (selectNewlyCreatedObject) {
- selectObjectForNewElement();
- }
- }
- }
-
- // Ugly..... We should not be selecting the object in the graph view in
- // the Action.
- // This should be refactored out. We add this boolean check because
- // WSDLSetTypeDialog.java
- // uses AddImportAction.java but we should not be selecting the newly
- // created import....
- // We should call this method before calling run()
- public void selectObjectForNewElement(boolean select) {
- selectNewlyCreatedObject = select;
- }
-
- public Node getNode() {
- if (parentNode != null) {
- return parentNode;
- }
- else {
- return document;
- }
- }
-
-
- public String getUndoDescription() {
- return Messages._UI_ACTION_ADD; //$NON-NLS-1$
- }
-
-
- protected Element createElement(String nodeName) {
- Document document = parentNode.getOwnerDocument();
-
- Element element = (prefix != null && prefix.length() > 0) ? document.createElement(prefix + ":" + nodeName) : document.createElement(nodeName); //$NON-NLS-1$
-
- return element;
- }
-
- protected void addAttributes(Element newElement) {
- }
-
-
- protected void format(Node parentNode) {
- if (parentNode instanceof IDOMNode) {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((IDOMNode) parentNode);
-
- }
- }
-
- protected Element getDefinitionElement(Element parentElement) {
- Element definitionElement = null;
-
- for (Node node = parentElement.getOwnerDocument().getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) node;
- if (WSDLEditorUtil.getInstance().getWSDLType(element) == WSDLConstants.DEFINITION) {
- definitionElement = element;
- break;
- }
- }
- }
- return definitionElement;
- }
-
- public Element getNewElement() {
- return newElement;
- }
-
- public void setDefinition(Definition definition) {
- this.definition = definition;
- }
-
- public void selectObjectForNewElement() {
- if (editorPart == null) {
- editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- }
- if (editorPart != null && definition != null) {
- Object object = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, newElement);
- if (object != null) {
- ISelectionProvider selectionProvider = (ISelectionProvider) editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null) {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- }
-
- public void selectObject(WSDLElement object) {
- if (editorPart == null) {
- editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- }
- if (editorPart != null && definition != null) {
- if (object != null) {
- ISelectionProvider selectionProvider = (ISelectionProvider) editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null) {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- }
-
- public String showDialogHelper(String title, String defaultName, List usedNames) {
- String result = defaultName;
- NewComponentDialog dialog = new NewComponentDialog(WSDLEditorPlugin.getShell(), title, defaultName, usedNames);
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID) {
- result = dialog.getName();
- }
- else {
- result = null;
- }
- return result;
- }
-
- protected Node computeTopLevelRefChild(Node nodeToAdd) {
- Node result = null;
- int a = getPrecedence(nodeToAdd);
-
- for (Node node = parentNode.getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- int b = getPrecedence(node);
- if (b > a) {
- result = node;
- break;
- }
- }
- }
- return result;
- }
-
- protected void createDefinitionStub() {
- if (document != null) {
- // Create the Definitions element with proper namespace
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
- charSet = "UTF-8"; //$NON-NLS-1$
- }
- document.appendChild(document.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + charSet + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Element root = document.createElement("wsdl:definitions"); //$NON-NLS-1$
- document.appendChild(root);
-
- // Add various namespace attributes here.
- root.setAttribute("xmlns:soap", "http://schemas.xmlsoap.org/wsdl/soap/"); //$NON-NLS-1$ //$NON-NLS-2$
- root.setAttribute("xmlns:tns", getDefaultNamespace()); //$NON-NLS-1$
- root.setAttribute("xmlns:wsdl", "http://schemas.xmlsoap.org/wsdl/"); //$NON-NLS-1$ //$NON-NLS-2$
- root.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$ //$NON-NLS-2$
- root.setAttribute("name", getFileName()); //$NON-NLS-1$
- root.setAttribute("targetNamespace", getDefaultNamespace()); //$NON-NLS-1$
-
- definition.setElement(root);
- parentNode = root;
- prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
- }
- }
-
- private String getDefaultNamespace() {
- String namespace = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(Messages._UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE); //$NON-NLS-1$
- if (!namespace.endsWith("/")) { //$NON-NLS-1$
- namespace = namespace.concat("/"); //$NON-NLS-1$
- }
-
- namespace += getFileName() + "/"; //$NON-NLS-1$
-
- return namespace;
- }
-
- private String getFileName() {
- String fileLocation = definition.getLocation();
- IPath filePath = new Path(fileLocation);
- return filePath.removeFileExtension().lastSegment().toString();
- }
-
- protected static HashMap precedenceMap = createPrecedenceMap();
-
- protected static int getPrecedence(Node node) {
- int result = 2;
- String localName = node.getLocalName();
- if (localName != null) {
- Integer integer = (Integer) precedenceMap.get(localName);
- if (integer != null) {
- result = integer.intValue();
- }
- }
- return result;
- }
-
- protected static HashMap createPrecedenceMap() {
- HashMap hashMap = new HashMap();
- hashMap.put(WSDLConstants.DOCUMENTATION_ELEMENT_TAG, new Integer(1));
- hashMap.put(WSDLConstants.IMPORT_ELEMENT_TAG, new Integer(3));
- hashMap.put(WSDLConstants.TYPES_ELEMENT_TAG, new Integer(4));
- hashMap.put(WSDLConstants.MESSAGE_ELEMENT_TAG, new Integer(5));
- hashMap.put(WSDLConstants.PORT_TYPE_ELEMENT_TAG, new Integer(6));
- hashMap.put(WSDLConstants.BINDING_ELEMENT_TAG, new Integer(7));
- hashMap.put(WSDLConstants.SERVICE_ELEMENT_TAG, new Integer(8));
- return hashMap;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementDeclarationAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementDeclarationAction.java
deleted file mode 100644
index 59f406761..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddElementDeclarationAction.java
+++ /dev/null
@@ -1,54 +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.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class AddElementDeclarationAction extends Action
-{
- protected Definition definition;
- protected String namespace;
- protected String prefix;
-
- public AddElementDeclarationAction(Definition definition, String namespace, String suggestedPrefix)
- {
- this.definition = definition;
- this.namespace = namespace;
- this.prefix = suggestedPrefix;
- }
-
- public void run()
- {
- String existingPrefix = definition.getPrefix(namespace);
- if (existingPrefix != null)
- {
- prefix = existingPrefix;
- }
- else
- {
- prefix = NameUtil.buildUniquePrefix(definition, prefix);
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (definitionElement != null)
- {
- definitionElement.setAttribute("xmlns:" + prefix, namespace); //$NON-NLS-1$
- }
- }
- }
-
- public String getPrefix()
- {
- return prefix;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddImportAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddImportAction.java
deleted file mode 100644
index 952549207..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddImportAction.java
+++ /dev/null
@@ -1,78 +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.actions;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.InternalWSDLMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AddImportAction extends AddElementAction
-{
- protected String namespace;
- protected String location;
- protected String elementDeclarationNamespacePrefix;
-
- public AddImportAction(IEditorPart part, Definition definition, Node parentNode, String prefix)
- {
- this(part, definition, parentNode, prefix, null, null);
- }
-
- public AddImportAction(IEditorPart part, Definition definition, Node parentNode, String prefix, String namespace, String location)
- {
- super(Messages._UI_ACTION_ADD_IMPORT, "icons/import_obj.gif", parentNode, prefix, "import"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- setDefinition(definition);
- setComputeTopLevelRefChild(true);
- this.namespace = namespace;
- this.location = location;
- setEditorPart(part);
-
- if (part instanceof InternalWSDLMultiPageEditor) {
- document = ((IDOMModel) ((InternalWSDLMultiPageEditor) part).getModel()).getDocument();
- }
- }
-
- protected Element createElement(String nodeName)
- {
- if (elementDeclarationNamespacePrefix != null && namespace != null)
- {
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (definitionElement != null)
- {
- definitionElement.setAttribute("xmlns:" + elementDeclarationNamespacePrefix, namespace); //$NON-NLS-1$
- }
- }
- return super.createElement(nodeName);
- }
-
- public void setElementDeclarationNamespacePrefix(String nsPrefix)
- {
- this.elementDeclarationNamespacePrefix = nsPrefix;
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("namespace", namespace != null ? namespace : ""); //$NON-NLS-1$ //$NON-NLS-2$
- newElement.setAttribute("location", location != null ? location : ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void performAddElement() {
- if (parentNode == null || (document != null && document.getChildNodes().getLength() == 0)) {
- createDefinitionStub();
- }
-
- super.performAddElement();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddWSISchemaImportAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddWSISchemaImportAction.java
deleted file mode 100644
index 4502eaf48..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/AddWSISchemaImportAction.java
+++ /dev/null
@@ -1,202 +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.actions;
-
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class AddWSISchemaImportAction extends BaseNodeAction
-{
- protected Definition definition;
- protected Element definitionElement;
- protected String namespace;
- protected String location;
- protected String elementDeclarationNamespacePrefix;
-
- public AddWSISchemaImportAction(Definition definition, String namespace, String location)
- {
- this.definition = definition;
- this.namespace = namespace;
- this.location = location;
- definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- }
-
- public Node getNode()
- {
- return definitionElement;
- }
-
- public String getUndoDescription()
- {
- return Messages._UI_ACTION_ADD_IMPORT; //$NON-NLS-1$
- }
-
- protected Element getOrCreateTypesElement()
- {
- Element typesElement = null;
- if (definition.getTypes() == null)
- {
- if (definitionElement != null)
- {
- AddElementAction addTypesAction = new AddElementAction("", "icons/xsd_obj.gif", definitionElement, definitionElement.getPrefix(), "types"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addTypesAction.setComputeTopLevelRefChild(true);
- addTypesAction.run();
- typesElement = addTypesAction.getNewElement();
- format(typesElement);
- }
- }
- else
- {
- typesElement = WSDLEditorUtil.getInstance().getElementForObject(definition.getTypes());
- }
- return typesElement;
- }
-
- protected Element getImportHolderElement(Element typesElement) {
- Element importHolderElement = null;
- NodeList nodeList = typesElement.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++)
- {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element) node;
- if ("schema".equals(element.getLocalName()) && element.getAttribute("targetNamespace") == null) //$NON-NLS-1$ //$NON-NLS-2$
- {
- importHolderElement = element;
- break;
- }
- }
- }
-
- return importHolderElement;
- }
-
- public Element getOrCreateImportHolderElement(Element typesElement)
- {
- Element importHolderElement = getImportHolderElement(typesElement);
- if (importHolderElement == null)
- {
- AddElementAction addImportHolderAction = new AddElementAction("", "icons/xsd_obj.gif", typesElement, "xsd", "schema") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- {
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("xmlns:xsd", WSDLConstants.XSD_NAMESPACE_URI); //$NON-NLS-1$
- }
- };
- addImportHolderAction.run();
- importHolderElement = addImportHolderAction.getNewElement();
- format(importHolderElement);
- }
- return importHolderElement;
- }
-
- // We don't want to add the import if it's already there
- protected boolean importNotAlreadyExists() {
- boolean notExists = true;
-
- if (definition.getTypes() != null) {
- Element typesElement = WSDLEditorUtil.getInstance().getElementForObject(definition.getTypes());
- Element schemaElement = getImportHolderElement(typesElement);
-
- if (schemaElement != null) {
- // Collect children
- Node node = schemaElement.getFirstChild();
- java.util.Vector schemaChildren = new java.util.Vector();
- if (node != null) {
- Node child = node;
-
- if (!(child instanceof org.eclipse.wst.xml.core.internal.document.TextImpl)) {
- schemaChildren.addElement(child);
- }
-
- while (child.getNextSibling() != null) {
- child = child.getNextSibling();
- if (!(child instanceof org.eclipse.wst.xml.core.internal.document.TextImpl)) {
- schemaChildren.addElement(child);
- }
- }
-
- for (int index = 0; index < schemaChildren.size(); index++) {
- Element schemaChild = (Element) schemaChildren.elementAt(index);
- String schemaLocation = schemaChild.getAttribute("schemaLocation"); //$NON-NLS-1$
- String schemaNamespace = schemaChild.getAttribute("namespace"); //$NON-NLS-1$
-
- if (schemaLocation != null && namespace != null &&
- schemaLocation.equals(location) && schemaNamespace.equals(namespace)) {
- notExists = false;
- break;
- }
- }
- }
- }
- }
-
- return notExists;
- }
-
- public void run()
- {
- if (definitionElement != null && importNotAlreadyExists())
- {
- beginRecording();
- performAddElement();
- endRecording();
- }
- }
- public void performAddElement()
- {
- try
- {
- Element typesElement = getOrCreateTypesElement();
- Element importHolderElement = getOrCreateImportHolderElement(typesElement);
-
- AddElementAction addImportAction = new AddElementAction("", "icons/xsd_obj.gif", importHolderElement, importHolderElement.getPrefix(), "import") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- {
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("namespace", namespace); //$NON-NLS-1$
- newElement.setAttribute("schemaLocation", location); //$NON-NLS-1$
- }
- };
- addImportAction.run();
- Element newElement = addImportAction.getNewElement();
- format(newElement);
- }
- catch (Exception e)
- {
- }
- }
-
- public void setElementDeclarationNamespacePrefix(String nsPrefix)
- {
- this.elementDeclarationNamespacePrefix = nsPrefix;
- }
-
- protected static void format(Node parentNode)
- {
- if (parentNode instanceof IDOMNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((IDOMNode)parentNode);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/BaseNodeAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/BaseNodeAction.java
deleted file mode 100644
index ced35be99..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/BaseNodeAction.java
+++ /dev/null
@@ -1,39 +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.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-public abstract class BaseNodeAction extends Action
-{
- public abstract Node getNode();
- public abstract String getUndoDescription();
-
- public void beginRecording()
- {
- Node node = getNode();
- if (node instanceof IDOMNode)
- {
- ((IDOMNode)node).getModel().beginRecording(this, getUndoDescription());
- }
- }
-
- public void endRecording()
- {
- Node node = getNode();
- if (node instanceof IDOMNode)
- {
- ((IDOMNode)node).getModel().endRecording(this);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/EditNamespacesAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/EditNamespacesAction.java
deleted file mode 100644
index 81ebcfa45..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/EditNamespacesAction.java
+++ /dev/null
@@ -1,125 +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.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.EditNamespacesDialog;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.w3c.dom.Element;
-
-
-public class EditNamespacesAction extends Action
-{
- protected Definition definition;
-
- public EditNamespacesAction(Definition definition)
- {
- setText(Messages._UI_EDIT_NAMESPACES); //$NON-NLS-1$
- this.definition = definition;
- }
-
- public void run()
- {
- DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
- Element element = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (element != null)
- {
- List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
-// List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
- // here we store a copy of the old info for each NamespaceInfo
- // this info will be used in createPrefixMapping() to figure out how to update the document
- // in response to these changes
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();)
- {
- NamespaceInfo info = (NamespaceInfo) i.next();
- NamespaceInfo oldCopy = new NamespaceInfo(info);
- info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
- }
-
- IPath path = new Path(definition.getDocumentBaseURI());
- EditNamespacesDialog dialog = new EditNamespacesDialog(WSDLEditorPlugin.getShell(), path, Messages._UI_EDIT_NAMESPACES_DIALOG_TITLE, definition.getTargetNamespace(), namespaceInfoList); //$NON-NLS-1$
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID)
- {
- element.setAttribute("targetNamespace", dialog.getTargetNamespace()); //$NON-NLS-1$
-
- List newInfoList = dialog.getNamespaceInfoList();
- namespaceInfoManager.removeNamespaceInfo(element);
- namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
-
-/*
- // see if we need to rename any prefixes
- Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
- if (prefixMapping.size() > 0)
- {
- //manager.getModel().aboutToChangeModel();
- ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(element, prefixMapping);
- replacePrefixAction.run();
- //manager.getModel().changedModel();
- }
-*/
- }
- }
- }
-
- protected Map createPrefixMapping(List oldList, List newList)
- {
- Map map = new Hashtable();
-
- Hashtable oldURIToPrefixTable = new Hashtable();
- for (Iterator i = oldList.iterator(); i.hasNext();)
- {
- NamespaceInfo oldInfo = (NamespaceInfo) i.next();
- oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
- }
-
- for (Iterator i = newList.iterator(); i.hasNext();)
- {
- NamespaceInfo newInfo = (NamespaceInfo) i.next();
- NamespaceInfo oldInfo = (NamespaceInfo) oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); //$NON-NLS-1$
-
- // if oldInfo is non null ... there's a matching URI in the old set
- // we can use its prefix to detemine out mapping
- //
- // if oldInfo is null ... we use the 'oldCopy' we stashed away
- // assuming that the user changed the URI and the prefix
- if (oldInfo == null)
- {
- oldInfo = (NamespaceInfo) newInfo.getProperty("oldCopy"); //$NON-NLS-1$
- }
-
- if (oldInfo != null)
- {
- String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
- String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
- if (!oldPrefix.equals(newPrefix))
- {
- map.put(oldPrefix, newPrefix);
- }
- }
- }
- return map;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/IWSDLToolbarAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/IWSDLToolbarAction.java
deleted file mode 100644
index e8fb25f38..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/IWSDLToolbarAction.java
+++ /dev/null
@@ -1,18 +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.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-
-public interface IWSDLToolbarAction extends IAction{
- public void setEditorPart(IEditorPart editorPart);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenInNewEditor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenInNewEditor.java
deleted file mode 100644
index 683e0780c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenInNewEditor.java
+++ /dev/null
@@ -1,64 +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.actions;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper;
-
-public class OpenInNewEditor extends BaseSelectionAction
-{
- public static final String ID = "org.eclipse.wst.wsdl.ui.OpenInNewEditor"; //$NON-NLS-1$
-
- public OpenInNewEditor(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_OPEN_IN_NEW_EDITOR); //$NON-NLS-1$
- setId(ID);
- setImageDescriptor(ASDEditorPlugin.getImageDescriptorFromPlugin("wsdl_file_obj.gif")); //$NON-NLS-1$
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- if (getSelectedObjects().size() > 0)
- {
- Object o = getSelectedObjects().get(0);
- // should make this generic and be able to get the owner from a facade object
- if (o instanceof WSDLBaseAdapter)
- {
- WSDLBaseAdapter baseAdapter = (WSDLBaseAdapter)o;
-
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- Object object = editorPart.getAdapter(Definition.class);
- if (object instanceof Definition)
- {
- EObject eObject = (EObject)baseAdapter.getTarget();
- OpenOnSelectionHelper openHelper = new OpenOnSelectionHelper((Definition)object);
- openHelper.openEditor(eObject);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenWSDLEditorUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenWSDLEditorUtil.java
deleted file mode 100644
index 15c61245a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/OpenWSDLEditorUtil.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.actions;
-
-import java.net.URI;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTReadOnlyFileEditorInput;
-
-/**
- *
- * Convenience Class to open a WSDL resource
- *
- */
-public class OpenWSDLEditorUtil
-{
- public OpenWSDLEditorUtil()
- {
- }
-
- /**
- * Opens the WSDL Editor on a WSDL resource from an HTTP reference
- *
- * @param httpURI : URI in the form of "http://www..."
- * @return IEditorPart of the opened WSDL editor
- */
- public static IEditorPart openHttpFileInEditor(URI httpURI) throws Exception
- {
- return openHttpFileInEditor(httpURI.toString());
- }
-
- private static IEditorPart openHttpFileInEditor(String urlString) throws PartInitException
- {
- try {
- IEditorPart editorPart = null;
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null) {
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- ADTReadOnlyFileEditorInput readOnlyFile = new ADTReadOnlyFileEditorInput(urlString);
- readOnlyFile.setEditorID(WSDLEditorPlugin.WSDL_EDITOR_ID);
- editorPart = page.openEditor(readOnlyFile, WSDLEditorPlugin.WSDL_EDITOR_ID);
- }
- }
- }
- return editorPart;
- }
- catch (PartInitException pie)
- {
- throw pie;
- }
- }
-
- /**
- * Opens the WSDL Editor on a WSDL resource that is in the local file system
- *
- * @param fileURI: The URI file in the form of file://
- * @return IEditorPart of the opened WSDL editor
- * @throws Exception
- */
- public static IEditorPart openFileInEditor(URI fileURI) throws PartInitException
- {
- try {
- IEditorPart editorPart = null;
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null) {
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IPath path = new Path(fileURI.getPath());
- IFileStore fileStore = EFS.getLocalFileSystem().getStore(path);
- if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
- IDE.openEditorOnFileStore(page, fileStore);
- }
- }
- }
- }
- return editorPart;
- }
- catch (PartInitException pie)
- {
- throw pie;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/RenameAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/RenameAction.java
deleted file mode 100644
index befd4d9a3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/RenameAction.java
+++ /dev/null
@@ -1,142 +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.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.visitor.BindingRenamer;
-import org.eclipse.wst.wsdl.ui.internal.visitor.MessageRenamer;
-import org.eclipse.wst.wsdl.ui.internal.visitor.PortTypeRenamer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-//import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class RenameAction //extends BaseNodeAction implements Runnable
-{
- protected Object modelObject;
- protected String newName;
- protected Node node;
-
- public RenameAction(Object modelObject, String newName)
- {
- this.modelObject = modelObject;
- this.newName = newName;
- this.node = WSDLEditorUtil.getInstance().getNodeForObject(modelObject);
- }
-
- /*
- public Node getNode()
- {
- return node;
- }
- */
-
- /*
- public String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_RENAME"); //$NON-NLS-1$
- }
- */
-
- public void run()
- {
- if (modelObject instanceof Operation)
- {
- renameOperationHelper((Operation)modelObject);
- }
- else if (modelObject instanceof Input ||
- modelObject instanceof Output ||
- modelObject instanceof Fault)
- {
- renameIOFHelper((WSDLElement)modelObject);
- }
- else
- {
- renameModelObjectHelper(modelObject, newName);
- }
- }
-
- protected void renameModelObjectHelper(Object modelObject, String theNewName)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(modelObject);
- if (element != null)
- {
- element.setAttribute("name", theNewName); //$NON-NLS-1$
- }
-
- if (modelObject instanceof Message)
- {
- MessageRenamer renamer = new MessageRenamer((Message)modelObject, theNewName);
- renamer.visitBindings();
- }
- else if (modelObject instanceof PortType)
- {
- PortTypeRenamer renamer = new PortTypeRenamer((PortType)modelObject, theNewName);
- renamer.visitBindings();
- }
- else if (modelObject instanceof Binding)
- {
- BindingRenamer renamer = new BindingRenamer((Binding)modelObject, theNewName);
- renamer.visitServices();
- }
- }
-
- protected void renameOperationHelper(Operation operation)
- {
- renameModelObjectHelper(operation, newName);
- }
-
-
- protected void renameIOFHelper(WSDLElement object)
- {
- Definition definition = object.getEnclosingDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
-
- List list = null;
-
- if (object instanceof Input)
- {
- list = util.getBindingInputs((Input)object);
- }
- else if (object instanceof Output)
- {
- list = util.getBindingOutputs((Output)object);
- }
- else // fault
- {
- list = util.getBindingFaults((Fault)object);
- }
-
- if (list != null)
- {
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object bindingObject = i.next();
- renameModelObjectHelper(bindingObject, newName);
- }
- }
-
- renameModelObjectHelper(object, newName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/SmartRenameAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/SmartRenameAction.java
deleted file mode 100644
index 0b1eaab9c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/actions/SmartRenameAction.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.actions;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.wsdl.BindingOperation;
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.binding.soap.SOAPOperation;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Node;
-
-
-/*
- * This class renames 'related' WSDLElements. The scenario is as follows:
- * The user renames a WSDLElement in the editor, say a Message. This class
- * will find the 'related' elements to this Message and rename them as well.
- * It will only rename a 'related' element if the element name (or part of it)
- * is generated.
- *
- * See NameUtil.java
- */
-public class SmartRenameAction extends BaseNodeAction implements Runnable {
- protected Object element;
- protected String newName;
- private List messageReferences; // This variable should be accessed by method getAllMessageReferences()
- protected Node node;
- private boolean renameParent = true;
- private String oldName;
-
- public SmartRenameAction(Object element, String newName) {
- setText("Smart Rename Action"); // Do not translate //$NON-NLS-1$
- this.element = element;
- this.newName = newName;
- this.node = WSDLEditorUtil.getInstance().getNodeForObject(element);
- }
-
- public Node getNode() {
- return node;
- }
-
- public String getUndoDescription() {
- return Messages._UI_ACTION_RENAME; //$NON-NLS-1$
- }
-
- /*
- * boolean argument is used to determine if the top level (parent) object should be renamed
- * itself. Otherwise, only the "child" objects will be renamed.
- */
- public void run(boolean renameParent) {
- this.renameParent = renameParent;
- run();
- }
-
- public void run() {
- RenameAction renamer;
-
- beginRecording();
- if (element instanceof Operation) {
- Operation operation = (Operation) element;
- oldName = operation.getName();
-
- if (oldName.equals(newName)) {
- return;
- }
-
- // Rename Operation
- if (renameParent) {
- renamer = new RenameAction(operation, newName);
- renamer.run();
- }
-
- // Rename Input
- Input input = operation.getEInput();
- /*
- if (input != null && isInputOutputNameGenerated(oldName, input.getName())) {
- renamer = new RenameAction(input, newName);
- renamer.run();
- }
- */
-
- // Rename Output
- Output output = operation.getEOutput();
- /*
- if (output != null && isInputOutputNameGenerated(oldName, output.getName())) {
- renamer = new RenameAction(output, newName);
- renamer.run();
- }
- */
-
-
- //
- WSDLElement wsdlElement = operation.getContainer();
- if (wsdlElement instanceof PortType) {
- PortType portType = (PortType) wsdlElement;
- Map bindings = portType.getEnclosingDefinition().getBindings();
- Collection values = bindings.values();
- Iterator iterator = values.iterator();
- while (iterator.hasNext()) {
- Binding binding = (Binding) iterator.next();
-
- // Find only Bindings which reference the modified PortType-->Operation
- if (binding.getPortType().equals(portType)) {
- String operationInputName = null;
- String operationOutputName = null;
- if(operation.getInput() != null) {
- operationInputName = operation.getInput().getName();
- }
- if(operation.getOutput() != null) {
- operationOutputName = operation.getOutput().getName();
- }
-
- BindingOperation bindingOperation = binding.getBindingOperation(operation.getName(), operationInputName , operationOutputName);
- // There may be no binding content in which case bindingOperation would be null
- if (bindingOperation != null) {
- List extensibilityElements = bindingOperation.getExtensibilityElements();
- Iterator extensibilityElementsIterator = extensibilityElements.iterator();
- while (extensibilityElementsIterator.hasNext()) {
- Object object = extensibilityElementsIterator.next();
- if(object instanceof SOAPOperation) {
- SOAPOperation soapOperation = (SOAPOperation) object;
- String soapActionURI = soapOperation.getSoapActionURI();
-
- // Check if the old soapActionURI is a generated String. If it's not
- // generated, leave it. It means a user has edited and we shouldn't touch it.
- String tns = operation.getEnclosingDefinition().getTargetNamespace();
- if (computeSOAPActionURI(tns, oldName).equals(soapActionURI)) {
- // Chop off the Operation name at the end and append the new name.
- String newSOAPActionURI = soapActionURI.substring(0, soapActionURI.length() - oldName.length());
- newSOAPActionURI = newSOAPActionURI + newName;
- soapOperation.setSoapActionURI(newSOAPActionURI);
- }
- }
- }
- }
- }
- }
- }
-
-
- // Rename Messages and Parts
- Message msg;
-
- // Input
- if (input != null && input.getEMessage() != null) {
- msg = input.getEMessage();
- String oldMessageName = ""; //$NON-NLS-1$
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, "Request")) { //$NON-NLS-1$
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
-
- // Output
- if (output != null && output.getMessage() != null) {
- msg = output.getEMessage();
- String oldMessageName = ""; //$NON-NLS-1$
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, "Response")) { //$NON-NLS-1$
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
-
- }
- }
-
- // Faults
- List faults = operation.getEFaults();
- if (faults != null) {
- Iterator it = faults.iterator();
- while (it.hasNext()) {
- Fault fault = (Fault) it.next();
- msg = fault.getEMessage();
- String oldMessageName = ""; //$NON-NLS-1$
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, fault.getName())) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
- }
- }
- else if (element instanceof Input) {
- Input input = (Input) element;
- oldName = input.getName();
- if (oldName == null) {
- oldName = ""; //$NON-NLS-1$
- }
-
- if (oldName.equals(newName)) {
- return;
- }
-
- if (renameParent) {
- input.setName(newName);
- }
-
-// Rename Messages and Parts
- Message msg;
-
- // Input
- if (input != null && input.getEMessage() != null) {
- msg = input.getEMessage();
- String oldMessageName = ""; //$NON-NLS-1$
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, "Request")) { //$NON-NLS-1$
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
- }
- else if (element instanceof Output) {
- Output output = (Output) element;
- oldName = output.getName();
- if (oldName == null) {
- oldName = ""; //$NON-NLS-1$
- }
-
- if (oldName.equals(newName)) {
- return;
- }
-
- if (renameParent) {
- output.setName(newName);
- }
-
-// Rename Messages and Parts
- Message msg;
-
- // Output
- if (output != null && output.getMessage() != null) {
- msg = output.getEMessage();
- String oldMessageName = ""; //$NON-NLS-1$
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
- if (isMessageNameGenerated(oldMessageName, oldName, "Response")) { //$NON-NLS-1$
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
- }
- else if (element instanceof Fault) {
- Fault fault = (Fault) element;
- Message msg = fault.getEMessage();
- String oldMessageName = ""; //$NON-NLS-1$
- oldName = fault.getName();
-
- if (oldName.equals(newName)) {
- return;
- }
-
- // Rename the Fault
- if (renameParent) {
- renamer = new RenameAction(fault, newName);
- renamer.run();
- }
-
- // Rename the Message and Parts
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- Operation op = (Operation) fault.eContainer();
- if (isMessageNameGenerated(oldMessageName, op.getName(), oldName)) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renameFaultParts(msg.getEParts(), op.getName(), oldName, newName);
- }
- }
- }
- else if (element instanceof Message) {
- Message msg = (Message) element;
- oldName = msg.getQName().getLocalPart();
- String oldMessageName = msg.getQName().getLocalPart();
-
- if (oldName.equals(newName)) {
- return;
- }
-
- String newMessageName = computeNewMessageName(msg, oldName, newName);
- if (renameParent) {
- renameMessageHelper(msg, newMessageName);
- }
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, newMessageName, true);
-// renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- else if (element instanceof Part) {
- Part part = (Part) element;
- String oldPartName = part.getName();
-
- if (oldPartName.equals(newName)) {
- return;
- }
-
- if (renameParent) {
- renamer = new RenameAction(element, newName);
- renamer.run();
- }
-
-// Rename Elements
- renameXSDElement(part, oldPartName, newName);
- }
- else if (element instanceof Port) {
- Port port = (Port) element;
- String oldPortName = port.getName();
-
- if (renameParent) {
- renamer = new RenameAction(element, newName);
- renamer.run();
- }
-
-// Rename Binding
- Binding binding = port.getEBinding();
- if (binding != null && binding.getQName().getLocalPart().equals(oldPortName)) {
- renamer = new RenameAction(binding, newName);
- renamer.run();
- }
- }
- endRecording();
- }
-
- private String computeSOAPActionURI(String tns, String operationName) {
- // We need more investigation here. We should take a look at how this SOAPActionURI
- // is generated in the first place. One issue I see here is the trailing slash of the
- // targetnamespace. More specifically, the lack of one. If there is no trailing slash,
- // does it add one?
- return tns + operationName;
- }
- // boolean isInputOutput should be set to true if the part is an Input or Output.
- // Set false if the part is a Fault.
- private void renamePartsHelper(List partsList, String oldSubString, String newSubString, boolean isInputOutput) {
- RenameAction renamer;
-
- if (partsList != null) {
- Iterator pIt = partsList.iterator();
- while (pIt.hasNext()) {
- Part part = (Part) pIt.next();
- String oldPartName = part.getName();
-
- if (isPartNameGenerated(oldPartName, oldSubString)) {
- String newPartName;
- if (isInputOutput) {
- newPartName = computeNewPartName(part, oldSubString, newSubString);
- }
- else {
- newPartName = computeNewFaultPartName(part, oldSubString, newSubString);
- }
-
- renamer = new RenameAction(part, newPartName);
- renamer.run();
-
- // Rename Elements
-// renameXSDElement(part, oldPartName, newPartName);
- }
-
- // Rename Elements
- renameXSDElement(part, oldSubString, newSubString);
- }
- }
- }
-
- // This method is used to update the Part name when the Fault name is changed. Only
- // change the Part name if the part name is a generated name.
- // Compare to renamePartsHelper(). The renamePartsHelper() method is called when a Fault
- // has NOT been renamed, rather, it is triggered by some other naming (ex. Operation
- // renaming). It will updat Input/Output, AND Fault Parts.
- private void renameFaultParts(List partsList, String baseName, String oldSubString, String newSubString) {
- RenameAction renamer;
-
- if (partsList != null) {
- Iterator pIt = partsList.iterator();
- while (pIt.hasNext()) {
- Part part = (Part) pIt.next();
- String oldPartName = part.getName();
-
- if (isPartNameGenerated(oldPartName, baseName, oldSubString)) {
- String newPartName;
- newPartName = computeNewFaultPartName(part, oldSubString, newSubString);
- renamer = new RenameAction(part, newPartName);
- renamer.run();
-
- // Rename Elements
- renameXSDElement(part, oldPartName, newPartName);
- }
- }
- }
- }
-
- private String computeNewMessageName(Message message, String oldSubString, String newSubString) {
- String string = message.getQName().getLocalPart();
- return replaceSectionWithSubString(string, oldSubString, newSubString, 0);
- }
-
-// private String computeNewFaultMessageName(Message message, String oldSubString, String newSubString) {
-// String string = message.getQName().getLocalPart();
-// return replaceSectionWithSubString(string, oldSubString, newSubString, 1);
-// }
-
- // Method for Input, Output, and Fault Parts
- // See computeNewFaultPartName() for comparison
- private String computeNewPartName(Part part, String oldSubString, String newSubString) {
- String string = part.getName();
- return replaceSectionWithSubString(string, oldSubString, newSubString, 0);
- }
-
- // Method for Fault Parts
- // This method behaves in the exact same way as computeNewPartName() except it starts searching for a match
- // after the first character. This method is intended for users who wish to rename a generated (Fault) part
- // where the Fault name has changed. We start our search after the first character because the generated name
- // of the part is built by appending the Fault name after the Operation name.
- private String computeNewFaultPartName(Part part, String oldSubString, String newSubString) {
- String string = part.getName();
- return replaceSectionWithSubString(string, oldSubString, newSubString, 1);
- }
-
- private String replaceSectionWithSubString(String fullString, String oldSubString, String newSubString, int startSearchIndex) {
- StringBuffer fullSB = new StringBuffer(fullString);
- int index = fullSB.indexOf(oldSubString, startSearchIndex);
- if (index >= 0) {
- return fullSB.replace(index, index + oldSubString.length(), newSubString).toString();
- }
-
- return ""; //$NON-NLS-1$
- }
-
- ////////////////////////////////////////////////////////////////////////////////////////
-
- private static boolean commonNameGeneratorCheck(String targetName, String baseName, String appendName) {
- // First criteria is targetName must start with the baseName
- if (!targetName.startsWith(baseName))
- return false;
-
- if (appendName.trim().length() > 0) {
- // Second criteria. The appended name must be in the targetName and begin right
- // after the baseName location
- if (!targetName.startsWith(appendName, baseName.length()))
- return false;
- }
-
- // Third criteria (if necessary). If baseName + appendName is shorter than targetName,
- // then there must be 'extra' characters at the end of targetName. These characters must
- // make up an integer. If not, it is not a generated string.
- int subLength = baseName.length() + appendName.length();
- if (targetName.length() > subLength) {
- // We have 'extra' characters
- String extras = targetName.substring(subLength);
-
- if(!isDigit(extras))
- return false;
- }
-
- return true;
- }
-
- public static boolean isOperationNameGenerated(String opName, String name) {
- return opName.equals(name);
- }
-
- public static boolean isMessageNameGenerated(String msgName, String baseName, String appendName) {
- return commonNameGeneratorCheck(msgName, baseName, appendName);
- }
-
- public static boolean isInputOutputNameGenerated(String inOutName, String name) {
- return inOutName.equals(name);
- }
-
- public static boolean isFaultNameGenerated(String faultName, String name) {
- return faultName.equals(name);
- }
-
- public static boolean isPartNameGenerated(String partName, String baseName) {
- return commonNameGeneratorCheck(partName, baseName, ""); //$NON-NLS-1$
- }
-
- private boolean isPartNameGenerated(String partName, String baseName, String appendName) {
- return commonNameGeneratorCheck(partName, baseName, appendName);
- }
-
- private static boolean isDigit(String string) {
- boolean rValue = true;
- char[] chars = string.toCharArray();
-
- for (int index = 0; index < chars.length; index++) {
- if (!Character.isDigit(chars[index])) {
- rValue = false;
- break;
- }
- }
-
- return rValue;
- }
-
- /*
- * The following classes aid in renaming a message
- */
- private void renameMessageHelper(Message msg, String newName) {
- List messageRefs = getReferencingMessageReferences(msg, getAllMessageReferences());
-
- RenameAction renamer = new RenameAction(msg, newName);
- renamer.run();
-
- Iterator iterator = messageRefs.iterator();
- while (iterator.hasNext()) {
- MessageReference messageReference = (MessageReference) iterator.next();
- messageReference.setEMessage(msg);
- }
- }
-
- private List getReferencingMessageReferences(Message msg, List messageRefs) {
- Vector referencesVector = new Vector();
- QName messageQName = msg.getQName();
- Iterator iterator = messageRefs.iterator();
-
- while (iterator.hasNext()) {
- MessageReference messageReference = (MessageReference) iterator.next();
- if (messageReference.getEMessage() != null && messageQName.equals(messageReference.getEMessage().getQName())) {
- referencesVector.addElement(messageReference);
- }
- }
-
- return referencesVector;
- }
-
- private List getAllMessageReferences() {
- if (messageReferences == null) {
- messageReferences = new Vector();
- Definition definition = ((WSDLElement) element).getEnclosingDefinition();
- List portTypes = definition.getEPortTypes();
-
- if (portTypes != null) {
- Iterator portTypeIterator = portTypes.iterator();
- while (portTypeIterator.hasNext()) {
- List operationsList = ((PortType) portTypeIterator.next()).getEOperations();
-
- if (operationsList != null) {
- Iterator operationsIterator = operationsList.iterator();
- while (operationsIterator.hasNext()) {
- messageReferences.addAll(getAllMessageReferences((Operation) operationsIterator.next()));
- }
- }
- }
- }
- }
-
- return messageReferences;
- }
-
- private Vector getAllMessageReferences(Operation operation) {
- Vector iofs = new Vector();
- Iterator it = operation.getEFaults().iterator();
- while (it.hasNext()) {
- iofs.addElement(it.next());
- }
-
- if (iofs == null)
- iofs = new Vector();
-
- if (operation.getEInput() != null)
- iofs.addElement(operation.getEInput());
-
- if (operation.getEOutput() != null)
- iofs.addElement(operation.getEOutput());
-
- return iofs;
- }
-
- private void renameXSDElement(Part part, String oldXSDName, String newXSDName) {
- XSDElementDeclaration elementDeclaration = part.getElementDeclaration();
- if (elementDeclaration != null && elementDeclaration.getName().startsWith(oldXSDName)) {
- renameElementDeclarationHelper(elementDeclaration, oldXSDName, newXSDName);
-
- // Here we rename the element reference.
- //
- QName qname = new QName(part.getElementName().getNamespaceURI(), newXSDName);
- part.setElementName(qname);
- }
- else if (elementDeclaration != null && element instanceof Operation) {
- Operation operation = (Operation) element;
- if (AddBaseParameterCommand.getParameterPattern(operation, true) == AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT) {
- if (elementDeclaration.getName().equals(oldName)) {
- renameElementDeclarationHelper(elementDeclaration, oldName, newName);
-
- // Here we rename the element reference.
- //
- QName qname = new QName(part.getElementName().getNamespaceURI(), newName);
- part.setElementName(qname);
- }
- }
- }
- }
-
- private void renameElementDeclarationHelper(XSDElementDeclaration elementDeclaration, String oldXSDName, String newXSDName) {
- if (elementDeclaration != null && elementDeclaration.getName().startsWith(oldXSDName)) {
- String newElementName = replaceSectionWithSubString(elementDeclaration.getName(), oldXSDName, newXSDName, 0);
- elementDeclaration.setName(newElementName);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLAdapterFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLAdapterFactory.java
deleted file mode 100644
index eaa2e4977..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLAdapterFactory.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.binding.http.HTTPAddress;
-import org.eclipse.wst.wsdl.binding.soap.SOAPAddress;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Binding;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11BindingMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11BindingOperation;
-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.adapters.basic.W11Import;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Interface;
-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.adapters.basic.W11Operation;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForAttribute;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForElement;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Service;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
-import org.eclipse.wst.wsdl.ui.internal.adapters.specialized.W11AddressExtensibilityElementAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.specialized.W11ExtensibilityElementAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.adapterfactory.extension.AdapterFactoryExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-public class WSDLAdapterFactory extends AdapterFactoryImpl
-{
- static WSDLAdapterFactory instance;
-
- public static WSDLAdapterFactory getInstance()
- {
- if (instance == null)
- {
- instance = new WSDLAdapterFactory();
- }
- return instance;
- }
-
- public Adapter createAdapter(Notifier target)
- {
- Adapter adapter = null;
-
- if (target instanceof Definition) {
- adapter = new W11Description();
- }
- else if (target instanceof Service) {
- adapter = new W11Service();
- }
- else if (target instanceof Binding) {
- adapter = new W11Binding();
- }
- else if (target instanceof BindingOperation) {
- adapter = new W11BindingOperation();
- }
- else if (target instanceof BindingInput ||
- target instanceof BindingOutput ||
- target instanceof BindingFault)
- {
- adapter = new W11BindingMessageReference();
- }
- else if (target instanceof Port) {
- adapter = new W11EndPoint();
- }
- else if (target instanceof PortType) {
- adapter = new W11Interface();
- }
- else if (target instanceof Operation) {
- adapter = new W11Operation();
- }
- else if (target instanceof MessageReference)
- {
- int kind = -1;
- if (target instanceof Input)
- {
- kind = IMessageReference.KIND_INPUT;
- }
- else if (target instanceof Output)
- {
- kind = IMessageReference.KIND_OUTPUT;
- }
- else if (target instanceof Fault)
- {
- kind = IMessageReference.KIND_FAULT;
- }
- adapter = new W11MessageReference(kind);
- }
- else if (target instanceof Import) {
- adapter = new W11Import();
- }
- else if (target instanceof XSDSchema) {
- adapter = new W11Type();
- }
- else if (target instanceof Message) {
- adapter = new W11Message();
- }
- else if (target instanceof Part)
- {
- adapter = new W11ParameterForPart();
- }
- else if (target instanceof XSDElementDeclaration)
- {
- adapter = new W11ParameterForElement();
- }
- else if (target instanceof XSDAttributeUse)
- {
- adapter = new W11ParameterForAttribute();
- }
- else if (target instanceof Message ||
- target instanceof XSDConcreteComponent)
- {
- // not we only need this adapter to serve as an 'otherThingsToListenTo' adapter
- // for use by the W11MessageReference when computing a parameter list
- adapter = new WSDLBaseAdapter();
- }
- else if (target instanceof SOAPAddress ||
- target instanceof HTTPAddress)
- {
- // TODO.. we need to enable the factory to delegate to extension language adapter factories
- // there should be no references to SOAP or HTTP stuff from within this class
- //
- adapter = new W11AddressExtensibilityElementAdapter();
- }
- else if (target instanceof ExtensibilityElement)
- {
- Adapter extensibilityAdapter = null;
- ExtensibilityElement extElement = (ExtensibilityElement) target;
- String namespace = extElement.getElementType().getNamespaceURI();
- AdapterFactoryExtension extension = WSDLEditorPlugin.getInstance().getAdapterFactoryExtensionRegistry().getExtensionForNamespace(namespace);
- if (extension != null) {
- AdapterFactory factory = extension.getAdapterFactory();
- extensibilityAdapter = factory.adapt(target, Adapter.class);
- }
-
- if (extensibilityAdapter == null) {
- adapter = new W11ExtensibilityElementAdapter();
- }
- else {
- adapter = extensibilityAdapter;
- }
- }
- if (adapter == null)
- {
- System.out.println("NO ADAPTER CREATED FOR " + target); //$NON-NLS-1$
- Thread.dumpStack();
- }
-
- return adapter;
- }
-
- public Adapter adapt(Notifier target)
- {
- return adapt(target, this);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLBaseAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLBaseAdapter.java
deleted file mode 100644
index a0532dc7d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/WSDLBaseAdapter.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11DeleteCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11RenameCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.IActionProvider;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class WSDLBaseAdapter extends AdapterImpl implements IASDObject, ITreeElement, IActionProvider {
- protected List listenerList = new ArrayList();
- protected WSDLBaseAdapter owner;
-
- public void registerListener(IASDObjectListener listener) {
- if (!listenerList.contains(listener))
- {
- listenerList.add(listener);
- }
- }
-
- public void unregisterListener(IASDObjectListener listener) {
- listenerList.remove(listener);
- }
-
- public void populateAdapterList(List notifierList, List adapterList) {
- for (Iterator i = notifierList.iterator(); i.hasNext();) {
- Object o = i.next();
- if (o instanceof Notifier)
- {
- Notifier component = (Notifier)o;
- Adapter adapter = WSDLAdapterFactoryHelper.getInstance().adapt(component);
- adapterList.add(adapter);
-
- if (adapter instanceof WSDLBaseAdapter) {
- ((WSDLBaseAdapter) adapter).setOwner(this);
- }
- }
- else
- {
- System.out.println("populateAdapterListError" + o); //$NON-NLS-1$
- }
- }
- }
-
- public Adapter createAdapter(Notifier notifier) {
- Adapter adapter = WSDLAdapterFactoryHelper.getInstance().adapt(notifier);
-
- if (adapter instanceof WSDLBaseAdapter && ((WSDLBaseAdapter) adapter).owner == null) {
- ((WSDLBaseAdapter) adapter).setOwner(this);
- }
-
- return adapter;
- }
-
- public String getName() {
- return null;
- }
-
- public void setOwner(WSDLBaseAdapter owner) {
- this.owner = owner;
- }
-
- public boolean isAdapterForType(Object type) {
- return type == WSDLAdapterFactoryHelper.getInstance().getWSDLAdapterFactory();
- }
-
- public String[] getActions(Object object) {
- String[] actionIDs = new String[0];
-
- return actionIDs;
- }
-
- public void notifyChanged(Notification msg)
- {
- super.notifyChanged(msg);
- try
- {
- notifyListeners(this, null);
- }
- catch (Exception e)
- {
- // TODO... exception should never happen here.. but they do
- // dumping the stack to the console until we track these down
- e.printStackTrace();
- }
- }
-
- protected void notifyListeners(Object changedObject, String property)
- {
- List clonedListenerList = new ArrayList();
- clonedListenerList.addAll(listenerList);
- for (Iterator i = clonedListenerList.iterator(); i.hasNext(); )
- {
- IASDObjectListener listener = (IASDObjectListener)i.next();
- listener.propertyChanged(this, property);
- }
- }
-
- public Command getSetNameCommand(String newName) {
- return new W11RenameCommand(this, newName);
- }
-
- public boolean isReadOnly() {
- Definition definition = null;
- try {
- IEditorPart editorPart = null;
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- editorPart = page.getActiveEditor();
- }
- }
- if (target instanceof WSDLElement) {
- definition = ((WSDLElement) target).getEnclosingDefinition();
- }
- if (editorPart == null) {
- return fallBackCheckIsReadOnly();
- }
-
- Definition editorDefinition = (Definition) editorPart.getAdapter(Definition.class);
- if (definition != null && definition == editorDefinition) {
- return false;
- }
- else {
- return fallBackCheckIsReadOnly();
- }
- }
- catch(Exception e) {
-
- }
-
- return true;
- }
-
- private boolean fallBackCheckIsReadOnly() {
- Element element = null;
- if (target instanceof WSDLElement) {
- element = ((WSDLElement) target).getElement();
- }
- else if (target instanceof XSDConcreteComponent) {
- element = ((XSDConcreteComponent) target).getElement();
- }
-
- if (element instanceof IDOMNode || element instanceof ElementImpl) {
- return false;
- }
- return true;
- }
-
- public Object getOwner() {
- return owner;
- }
-
- public Command getDeleteCommand() {
- return new W11DeleteCommand(this);
- }
-
- public List getDiagnosticMessages() {
- return new ArrayList();
- }
-
- public ITreeElement[] getChildren() {
- return null;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public String getText() {
- return ""; //$NON-NLS-1$
- }
-
- public Image getImage() {
- return null;
- }
-
- public Image getSecondaryImage() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11AddPartAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11AddPartAction.java
deleted file mode 100644
index b53a24895..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11AddPartAction.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.adapters.actions;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.InternalWSDLMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11MessageReference;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ParameterEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessage;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-
-public class W11AddPartAction extends BaseSelectionAction {
- public static String ID = "ASDAddPartAction"; //$NON-NLS-1$
-
- public W11AddPartAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_PART); //$NON-NLS-1$
- setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/part_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- MessageReference messageRef = null;
- IMessage iMessage = null;
- Message message = null;
-
- if (o instanceof W11MessageReference) {
- messageRef = (MessageReference) ((W11MessageReference) o).getTarget();
- message = messageRef.getEMessage();
- }
- else if (o instanceof W11ParameterForPart) {
- W11ParameterForPart param = (W11ParameterForPart) o;
- if (param.getOwner() instanceof IMessage) {
- iMessage = (IMessage) param.getOwner();
- }
- else if (param.getOwner() instanceof W11MessageReference) {
- messageRef = (MessageReference) ((W11MessageReference) param.getOwner()).getTarget();
- message = messageRef.getEMessage();
- }
-
- if (message == null) {
- Part part = (Part) param.getTarget();
- message = (Message) part.eContainer();
- }
- }
- else if (o instanceof IMessage) {
- iMessage = (IMessage) o;
- }
-
- if (message == null && iMessage == null && messageRef != null) {
- InternalWSDLMultiPageEditor editor = (InternalWSDLMultiPageEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Definition definition = (Definition) ((W11Description) editor.getModel()).getTarget();
- String messageName = NameUtil.buildUniqueMessageName(definition, "NewMessage"); //$NON-NLS-1$
- AddMessageCommand command = new AddMessageCommand(definition, messageName, false);
- command.run();
- message = (Message) command.getWSDLElement();
- messageRef.setEMessage(message);
- }
-
- if (message != null) {
- iMessage = (IMessage) WSDLAdapterFactoryHelper.getInstance().adapt(message);
- }
-
- if (iMessage != null) {
- Command command = iMessage.getAddPartCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object element = ((IASDAddCommand) command).getNewlyAddedComponent();
- selectAndDirectEdit(element);
- }
- }
- }
- }
-
- protected void doDirectEdit(EditPart ep) {
- if (ep instanceof ParameterEditPart) {
- ((ParameterEditPart) ep).performDirectEdit(null);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11OpenImportAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11OpenImportAction.java
deleted file mode 100644
index 46956ec4e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11OpenImportAction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.actions;
-
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Import;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-
-public class W11OpenImportAction extends BaseSelectionAction {
- public static String ID = "ASDOpenImportAction"; //$NON-NLS-1$
-
- public W11OpenImportAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_OPEN_IMPORT); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0 && getSelectedObjects().get(0) instanceof W11Import) {
- Import theImport = getWSDLImport((W11Import) getSelectedObjects().get(0));
-
- Definition definition = theImport.getEnclosingDefinition();
- org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper helper = new org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper(definition);
- helper.openEditor((org.eclipse.emf.ecore.EObject) theImport);
- }
- }
-
- protected boolean calculateEnabled() {
- boolean enabled = super.calculateEnabled();
- if (enabled) {
- if (getSelectedObjects().size() > 0 && getSelectedObjects().get(0) instanceof W11Import) {
- Import theImport = getWSDLImport((W11Import) getSelectedObjects().get(0));
-
- if (theImport != null) {
- String location = theImport.getLocationURI();
-
- if (location == null || location.trim().equals("")) //$NON-NLS-1$
- enabled = false;
- }
- }
- }
-
- return enabled;
- }
-
- private Import getWSDLImport(W11Import w11Import) {
- return (Import) ((W11Import) w11Import).getTarget();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingElementAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingElementAction.java
deleted file mode 100644
index df68ffc19..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingElementAction.java
+++ /dev/null
@@ -1,56 +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.adapters.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class W11SetExistingElementAction extends BaseSelectionAction {
- public static String ID = "ASDSetExistingElementAction"; //$NON-NLS-1$
- protected WSDLBaseAdapter wsdlBaseAdapter;
-
- public W11SetExistingElementAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_EXISTING_ELEMENT); //$NON-NLS-1$
-// setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/message_obj.gif"));
- }
-
- public void run() {
- if (wsdlBaseAdapter == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IParameter && o instanceof WSDLBaseAdapter) {
- wsdlBaseAdapter = (WSDLBaseAdapter) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getXSDElementReferenceEditManager(wsdlBaseAdapter);
- if (wsdlBaseAdapter != null && refManager != null) {
- IComponentDialog dialog = refManager.getBrowseDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(wsdlBaseAdapter.getTarget(), spec);
- }
- }
-
- wsdlBaseAdapter = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingMessageAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingMessageAction.java
deleted file mode 100644
index 0f765d6d8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingMessageAction.java
+++ /dev/null
@@ -1,56 +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.adapters.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class W11SetExistingMessageAction extends BaseSelectionAction {
- public static String ID = "ASDSetMessageInterfaceAction"; //$NON-NLS-1$
- protected IMessageReference messageReference;
-
-
- public W11SetExistingMessageAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_EXISTING_MESSAGE); //$NON-NLS-1$
-// setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/message_obj.gif"));
- }
-
- public void run() {
- if (messageReference == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IMessageReference) {
- messageReference = (IMessageReference) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getMessageReferenceEditManager(messageReference);
- if (messageReference != null && refManager != null) {
- IComponentDialog dialog = refManager.getBrowseDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(messageReference, spec);
- }
- }
-
- messageReference = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingTypeAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingTypeAction.java
deleted file mode 100644
index 8e82b481e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetExistingTypeAction.java
+++ /dev/null
@@ -1,56 +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.adapters.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class W11SetExistingTypeAction extends BaseSelectionAction {
- public static String ID = "ASDSetExistingTypeAction"; //$NON-NLS-1$
- protected WSDLBaseAdapter wsdlBaseAdapter;
-
- public W11SetExistingTypeAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_EXISTING_TYPE); //$NON-NLS-1$
-// setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/message_obj.gif"));
- }
-
- public void run() {
- if (wsdlBaseAdapter == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IParameter && o instanceof WSDLBaseAdapter) {
- wsdlBaseAdapter = (WSDLBaseAdapter) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getXSDTypeReferenceEditManager(wsdlBaseAdapter);
- if (wsdlBaseAdapter != null && refManager != null) {
- IComponentDialog dialog = refManager.getBrowseDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(wsdlBaseAdapter.getTarget(), spec);
- }
- }
-
- wsdlBaseAdapter = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewElementAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewElementAction.java
deleted file mode 100644
index 7882da417..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewElementAction.java
+++ /dev/null
@@ -1,56 +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.adapters.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class W11SetNewElementAction extends BaseSelectionAction {
- public static String ID = "ASDSetNewElementAction"; //$NON-NLS-1$
- protected WSDLBaseAdapter wsdlBaseAdapter;
-
- public W11SetNewElementAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_NEW_ELEMENT); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/service_obj.gif"));
- }
-
- public void run() {
- if (wsdlBaseAdapter == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IParameter && o instanceof WSDLBaseAdapter) {
- wsdlBaseAdapter = (WSDLBaseAdapter) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getXSDElementReferenceEditManager(wsdlBaseAdapter);
- if (wsdlBaseAdapter != null && refManager != null) {
- IComponentDialog dialog = refManager.getNewDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(wsdlBaseAdapter, spec);
- }
- }
-
- wsdlBaseAdapter = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewMessageAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewMessageAction.java
deleted file mode 100644
index 2ef914f24..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewMessageAction.java
+++ /dev/null
@@ -1,59 +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.adapters.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class W11SetNewMessageAction extends BaseSelectionAction {
- public static String ID = "ASDSetNewMessageAction"; //$NON-NLS-1$
- protected IMessageReference messageReference;
-
- public W11SetNewMessageAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_NEW_MESSAGE); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/service_obj.gif"));
- }
-
- public void setIMessageReference(IMessageReference messageReference) {
- this.messageReference = messageReference;
- }
-
- public void run() {
- if (messageReference == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IMessageReference) {
- messageReference = (IMessageReference) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getMessageReferenceEditManager(messageReference);
- if (messageReference != null && refManager != null) {
- IComponentDialog dialog = refManager.getNewDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(messageReference, spec);
- }
- }
-
- messageReference = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewTypeAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewTypeAction.java
deleted file mode 100644
index a40e6f351..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/actions/W11SetNewTypeAction.java
+++ /dev/null
@@ -1,82 +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.adapters.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLXSDTypeReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-
-public class W11SetNewTypeAction extends BaseSelectionAction {
- public static String ID = "ASDSetNewTypeAction"; //$NON-NLS-1$
- protected WSDLBaseAdapter wsdlBaseAdapter;
-
- public W11SetNewTypeAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_NEW_TYPE); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/service_obj.gif"));
- }
-
- public void run() {
- if (wsdlBaseAdapter == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IParameter && o instanceof WSDLBaseAdapter) {
- wsdlBaseAdapter = (WSDLBaseAdapter) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getXSDTypeReferenceEditManager(wsdlBaseAdapter);
- if (wsdlBaseAdapter != null && refManager != null) {
- IComponentDialog dialog = refManager.getNewDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(wsdlBaseAdapter, spec);
- }
- }
-
- wsdlBaseAdapter = null;
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor().getAdapter(XSDTypeReferenceEditManager.class) != null) {
- return (ComponentReferenceEditManager) page.getActiveEditor().getAdapter(XSDTypeReferenceEditManager.class);
- }
- else {
- IEditorInput input = page.getActiveEditor().getEditorInput();
- if (input instanceof IFileEditorInput) {
- WSDLElement element = (WSDLElement) wsdlBaseAdapter.getTarget();
- IDescription description = (IDescription) WSDLAdapterFactoryHelper.getInstance().adapt(element.getEnclosingDefinition());
- return new WSDLXSDTypeReferenceEditManager(((IFileEditorInput) input).getFile(), null, description);
- }
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Binding.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Binding.java
deleted file mode 100644
index a5f28e0d3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Binding.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.internal.generator.ContentGenerator;
-import org.eclipse.wst.wsdl.internal.generator.extension.ContentGeneratorExtensionFactoryRegistry;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11GenerateBindingCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11SetInterfaceCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDGenerateBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetExistingInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetNewInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.BindingContentPlaceHolder;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeCustomizationRegistry;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class W11Binding extends WSDLBaseAdapter implements IBinding {
-
- public IInterface getInterface() {
- PortType portType = ((Binding) target).getEPortType();
- if (portType != null)
- {
- return (IInterface) createAdapter(portType);
- }
- return null;
- }
-
- public List getBindingContentList()
- {
- List adapterList = new ArrayList();
- List list = new ArrayList();
-
- List bindingOperations = copyList(((Binding)target).getEBindingOperations());
- List operations = copyList(((Binding)target).getEPortType().getEOperations());
-
- // Determine if we need placeholders for Operations
- List toAdaptList = new ArrayList();
-
- Iterator bindingOpIt = bindingOperations.iterator();
- while (bindingOpIt.hasNext()) {
- BindingOperation item = (BindingOperation) bindingOpIt.next();
- operations.remove(item.getEOperation());
- }
-
- Iterator operationsIt = operations.iterator();
- while (operationsIt.hasNext()) {
- Operation op = (Operation) operationsIt.next();
- toAdaptList.add(op);
- toAdaptList.add(op.getEInput());
- toAdaptList.add(op.getEOutput());
- toAdaptList.addAll(op.getEFaults());
- }
-
- Iterator it = toAdaptList.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (o != null)
- {
- Object adapted = WSDLAdapterFactoryHelper.getInstance().adapt((Notifier)o);
- BindingContentPlaceHolder placeHolder = new BindingContentPlaceHolder(adapted);
- adapterList.add(placeHolder);
- }
- }
-
- for (Iterator i = ((Binding)target).getEBindingOperations().iterator(); i.hasNext(); )
- {
- BindingOperation bindingOperation = (BindingOperation)i.next();
- Operation operation = bindingOperation.getEOperation();
-
- list.add(bindingOperation);
-
- // Handle Input
- if (bindingOperation.getEBindingInput() != null)
- {
- list.add(bindingOperation.getEBindingInput());
- }
- else if (bindingOperation.getEBindingInput() == null && operation.getEInput() != null) {
- // Need a placeholder
- Object adaptedObject = createAdapter(operation.getEInput());
- BindingContentPlaceHolder temp = new BindingContentPlaceHolder(adaptedObject);
- adapterList.add(temp);
- }
-
- // Handle Output
- if (bindingOperation.getEBindingOutput() != null)
- {
- list.add(bindingOperation.getEBindingOutput());
- }
- else if (bindingOperation.getEBindingOutput() == null && operation.getEOutput() != null) {
- // Need a placeholder
- Object adaptedObject = createAdapter(operation.getEOutput());
- BindingContentPlaceHolder temp = new BindingContentPlaceHolder(adaptedObject);
- adapterList.add(temp);
- }
-
- // Handle Faults
- if (operation != null)
- {
- List faults = copyList(operation.getEFaults());
- List bindingFaults = copyList(bindingOperation.getEBindingFaults());
- for (int index = 0; index < bindingFaults.size(); index++) {
- BindingFault bindingFault = (BindingFault) bindingFaults.get(index);
- list.add(bindingFault);
-
- faults.remove(bindingFault.getEFault());
- }
-
- // Left over faults need placeholders
- Iterator remaningFaults = faults.iterator();
- while (remaningFaults.hasNext()) {
- Object adaptedObject = createAdapter((Fault) remaningFaults.next());
- BindingContentPlaceHolder temp = new BindingContentPlaceHolder(adaptedObject);
- adapterList.add(temp);
- }
- }
- }
-
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- private List copyList(List origList) {
- List newList = new ArrayList();
- Iterator it = origList.iterator();
- while (it.hasNext()) {
- newList.add(it.next());
- }
-
- return newList;
- }
-
- public List getExtensiblityObjects() {
-
- return null;
- }
-
- public String getName() {
- return ((Binding) target).getQName().getLocalPart();
- }
-
- public String getProtocol() {
- Iterator it = ((Binding) target).getEExtensibilityElements().iterator();
- while (it.hasNext()) {
- Object item = it.next();
-
- if (item instanceof WSDLElement) {
- WSDLElement wsdlElement = (WSDLElement) item;
- String namespace = wsdlElement.getElement().getNamespaceURI();
-
- if (namespace != null) {
- ContentGeneratorExtensionFactoryRegistry factoryRegistry = ContentGeneratorExtensionFactoryRegistry.getInstance();
- ContentGenerator contentGenerator = factoryRegistry.getGeneratorClassFromNamespace(namespace);
- if (contentGenerator != null) {
- return contentGenerator.getProtocol();
- }
- }
- }
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public IDescription getOwnerDescription() {
- return (IDescription) owner;
- }
-
- public String[] getActions(Object object) {
- List actionIDs = new ArrayList();
- actionIDs.add(ASDGenerateBindingAction.ID);
- actionIDs.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_PORTTYPE); //$NON-NLS-1$
- actionIDs.add(ASDSetNewInterfaceAction.ID);
- actionIDs.add(ASDSetExistingInterfaceAction.ID);
- actionIDs.add(BaseSelectionAction.SUBMENU_END_ID);
- actionIDs.add(ASDDeleteAction.ID);
- if (isReadOnly()) {
- actionIDs.add(OpenInNewEditor.ID);
- }
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public Command getSetInterfaceCommand(IInterface newInterface) {
- W11Interface w11Interface = (W11Interface) newInterface;
- return new W11SetInterfaceCommand((Binding) target, (PortType) w11Interface.getTarget());
- }
-
- public Command getGenerateBindingCommand() {
- return new W11GenerateBindingCommand((Binding) this.getTarget());
- }
-
- private ILabelProvider getLabelProvider(Node node)
- {
- String namespace = node.getNamespaceURI();
- if (namespace != null)
- {
- NodeCustomizationRegistry registry = XSDEditorPlugin.getDefault().getNodeCustomizationRegistry();
- return registry.getLabelProvider(namespace);
- }
- return null;
- }
-
- public Image getImage()
- {
- Image image = null;
- List list = ((Binding) target).getExtensibilityElements();
- if (list.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement)list.get(0);
- Element element = ee.getElement();
- if (element != null)
- {
- ILabelProvider labelProvider = getLabelProvider(element);
- if (labelProvider != null)
- {
- image= labelProvider.getImage(element);
- }
- }
- }
- if (image == null)
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/binding_obj.gif"); //$NON-NLS-1$
- }
- return image;
- }
-
- public String getText()
- {
- return "binding"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren()
- {
- List list = getBindingOperations();
- ITreeElement[] result = new ITreeElement[list.size()];
- list.toArray(result);
- return result;
- }
-
- public boolean hasChildren() {
- if (getBindingOperations().size() > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public List getBindingOperations()
- {
- List list = new ArrayList();
- populateAdapterList(((Binding)target).getEBindingOperations(), list);
- return list;
- }
-
- public List getBindingOperations(boolean createMissingOperations, boolean showExtraOperations)
- {
- return getBindingOperations();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingMessageReference.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingMessageReference.java
deleted file mode 100644
index b0e86faf3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingMessageReference.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-
-
-public class W11BindingMessageReference extends WSDLBaseAdapter implements IBindingMessageReference, ITreeElement
-{
- public ITreeElement[] getChildren()
- {
- return ITreeElement.EMPTY_LIST;
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public Image getImage()
- {
- String imageName = null;
- if (target instanceof BindingInput)
- {
- imageName = "icons/input_obj.gif"; //$NON-NLS-1$
- }
- else if (target instanceof BindingOutput)
- {
- imageName = "icons/output_obj.gif"; //$NON-NLS-1$
- }
- else //if (target instanceof BindingFault)
- {
- imageName = "icons/fault_obj.gif"; //$NON-NLS-1$
- }
- return WSDLEditorPlugin.getInstance().getImage(imageName);
- }
-
- public String getName()
- {
- String name = null;
- if (target instanceof BindingInput)
- {
- name = ((BindingInput) target).getName();
- }
- else if (target instanceof BindingOutput)
- {
- name = ((BindingOutput) target).getName();
- }
- else if (target instanceof BindingFault)
- {
- name = ((BindingFault) target).getName();
- }
-
- if (name == null) {
- name = ""; //$NON-NLS-1$
- }
-
- return name;
- }
-
- public String getText()
- {
- String text = ""; //$NON-NLS-1$
- if (target instanceof BindingInput)
- {
- text = "binding input"; //$NON-NLS-1$
- }
- else if (target instanceof BindingOutput)
- {
- text = "binding output"; //$NON-NLS-1$
- }
- else if (target instanceof BindingFault)
- {
- text = "binding fault"; //$NON-NLS-1$
- }
-
- return text;
- }
-
- public IMessageReference getMessageReference()
- {
- EObject resultNotifier = null;
- if (target instanceof BindingInput)
- {
- resultNotifier = ComponentReferenceUtil.computeInput((BindingInput)target);
- }
- else if (target instanceof BindingOutput)
- {
- resultNotifier = ComponentReferenceUtil.computeOutput((BindingOutput)target);
- }
- else if (target instanceof BindingFault)
- {
- resultNotifier = ComponentReferenceUtil.computeFault((BindingFault)target);
- }
- return resultNotifier != null ? (IMessageReference)createAdapter(resultNotifier) : null;
- }
-
- public List getExtensiblityObjects()
- {
- return Collections.EMPTY_LIST;
- }
-
- public String[] getActions(Object object) {
- Collection actionIDs = new ArrayList();
-// if (isReadOnly()) {
-// actionIDs.add(OpenInNewEditor.ID);
-// }
- return (String [])actionIDs.toArray(new String[0]);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingOperation.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingOperation.java
deleted file mode 100644
index 5c8de4214..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11BindingOperation.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-
-public class W11BindingOperation extends WSDLBaseAdapter implements IBindingOperation, ITreeElement
-{
-
- public IOperation getOperation()
- {
- BindingOperation bindingOperation = (BindingOperation)target;
- Operation operation = ComponentReferenceUtil.computeOperation(bindingOperation);
- return operation != null ? (IOperation)createAdapter(operation) : null;
- }
-
- public List getBindingMessages()
- {
- List list = new ArrayList();
- BindingOperation bindingOperation = (BindingOperation)target;
- if (bindingOperation.getEBindingInput() != null)
- {
- list.add(bindingOperation.getEBindingInput());
- }
- if (bindingOperation.getEBindingOutput() != null)
- {
- list.add(bindingOperation.getEBindingOutput());
- }
- list.addAll(bindingOperation.getEBindingFaults());
- List result = new ArrayList();
- populateAdapterList(list, result);
- return result;
- }
-
- public String getName()
- {
- BindingOperation bindingOperation = (BindingOperation)target;
- Operation operation = bindingOperation.getEOperation();
- return operation != null ? operation.getName() : null;
- }
-
- public List getExtensiblityObjects()
- {
- return Collections.EMPTY_LIST;
- }
-
- public ITreeElement[] getChildren()
- {
- List list = getBindingMessages();
- ITreeElement[] result = new ITreeElement[list.size()];
- list.toArray(result);
- return result;
- }
-
- public boolean hasChildren() {
- if (getBindingMessages().size() > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public Image getImage()
- {
- String imageName = "icons/operationbinding_obj.gif"; //$NON-NLS-1$
- return WSDLEditorPlugin.getInstance().getImage(imageName);
- }
-
- public String getText()
- {
- return "binding operation"; //$NON-NLS-1$
- }
-
- public String[] getActions(Object object) {
- Collection actionIDs = new ArrayList();
- if (isReadOnly()) {
- actionIDs.add(OpenInNewEditor.ID);
- }
- return (String [])actionIDs.toArray(new String[0]);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11CategoryAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11CategoryAdapter.java
deleted file mode 100644
index 7a1337d4b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11CategoryAdapter.java
+++ /dev/null
@@ -1,144 +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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddImportAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddMessageAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddSchemaAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddServiceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class W11CategoryAdapter extends WSDLBaseAdapter implements ICategoryAdapter, ITreeElement, IASDObjectListener {
- public final static int IMPORTS = 1;
- public final static int TYPES = 2;
- public final static int SERVICES = 3;
- public final static int BINDINGS = 5;
- public final static int INTERFACES = 6;
- public final static int MESSAGES = 7;
-
- public static String IMPORTS_HEADER_TEXT = Messages._UI_FOLDER_IMPORTS; //$NON-NLS-1$
- public static String TYPES_HEADER_TEXT = Messages._UI_FOLDER_TYPES; //$NON-NLS-1$
- public static String SERVICE_HEADER_TEXT = Messages._UI_FOLDER_SERVICES; //$NON-NLS-1$
- public static String BINDING_HEADER_TEXT = Messages._UI_FOLDER_BINDINGS; //$NON-NLS-1$
- public static String INTERFACE_HEADER_TEXT = Messages._UI_PORT_TYPE; //$NON-NLS-1$
- public static String MESSAGE_HEADER_TEXT = Messages._UI_FOLDER_MESSAGES; //$NON-NLS-1$
-
- protected String text;
- protected Image image;
- protected int groupType;
- protected Collection children;
- protected IDescription description;
-
- public W11CategoryAdapter(IDescription description, String label, Image image, Collection children, int groupType) {
- this.text = label;
- this.image = image;
- this.description = description;
- this.target = ((W11Description) description).getTarget();
- this.children = children;
- this.groupType = groupType;
- }
-
- public Definition getDefinition() {
- return (Definition) target;
- }
-
- public IDescription getOwnerDescription() {
- return description;
- }
-
- public int getGroupType() {
- return groupType;
- }
-
- public Image getImage() {
- return image;
- }
-
- public String getText() {
- return text;
- }
-
- public ITreeElement[] getChildren() {
- return (ITreeElement[]) children.toArray(new ITreeElement[0]);
- }
-
- public void setChildren(Collection list) {
- children = list;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return true;
- }
-
- public String[] getActions(Object object) {
- Collection actionIDs = new ArrayList();
-
- switch (groupType) {
- case IMPORTS : {
- actionIDs.add(ASDAddImportAction.ID);
- break;
- }
- case TYPES : {
- actionIDs.add(ASDAddSchemaAction.ID);
- break;
- }
- case SERVICES : {
- actionIDs.add(ASDAddServiceAction.ID);
- break;
- }
- case BINDINGS : {
- actionIDs.add(ASDAddBindingAction.ID);
- break;
- }
- case INTERFACES : {
- actionIDs.add(ASDAddInterfaceAction.ID);
- break;
- }
- case MESSAGES : {
- actionIDs.add(ASDAddMessageAction.ID);
- break;
- }
- }
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public void propertyChanged(Object object, String property) {
- if (getText().equals(property))
- notifyListeners(this, property);
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public boolean hasChildren() {
- if (getChildren().length > 0) {
- return true;
- }
-
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Description.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Description.java
deleted file mode 100644
index 626c9a492..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Description.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLPackage;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddBindingCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddImportCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddInterfaceCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddSchemaCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddServiceCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11EditNamespacesCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddServiceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.w3c.dom.Element;
-
-public class W11Description extends WSDLBaseAdapter implements IDescription {
- protected List categories = new ArrayList();
-
- protected W11CategoryAdapter getCategory(int categoryId) {
- return getCategory(categoryId, getCategoryAdapters());
- }
-
- protected W11CategoryAdapter getCategory(int categoryId, List list) {
- Iterator it = list.iterator();
- while (it.hasNext()) {
- W11CategoryAdapter adapter = (W11CategoryAdapter) it.next();
- if (adapter.getGroupType() == categoryId) {
- return adapter;
- }
- }
-
- return null;
- }
-
- protected List getCategoryAdapters() {
- // just set categoryadapters' children if category adapters are
- // already created
- if (categories.size() == 0) {
- categories = createCategoryAdapters();
- }
- else {
- W11CategoryAdapter category = getCategory(W11CategoryAdapter.IMPORTS, categories);
- category.setChildren(getImports());
-
- category = getCategory(W11CategoryAdapter.TYPES, categories);
- addListenerToTypes(category);
-
- category = getCategory(W11CategoryAdapter.SERVICES, categories);
- category.setChildren(getServices());
-
- category = getCategory(W11CategoryAdapter.BINDINGS, categories);
- category.setChildren(getBindings());
-
- category = getCategory(W11CategoryAdapter.INTERFACES, categories);
- category.setChildren(getInterfaces());
-
- category = getCategory(W11CategoryAdapter.MESSAGES, categories);
- category.setChildren(getMessages());
- }
- return categories;
- }
-
- // TODO: rmah: right now it looks like the definition needs to know too much about the categories
- // We should make the categories more self-sufficient.... so it knows how to compute it's children
- // based on it's kind
- protected List createCategoryAdapters() {
- List categories = new ArrayList();
-
- List importList = getImports();
-// List schemaList = getTypes();
- List serviceList = getServices();
- List bindingList = getBindings();
- List interfaceList = getInterfaces();
- List messageList = getMessages();
-
- String categoryTitle = W11CategoryAdapter.IMPORTS_HEADER_TEXT;
- Image categoryImage = WSDLEditorPlugin.getInstance().getImage("icons/importheader_obj.gif"); //$NON-NLS-1$
- W11CategoryAdapter category = new W11CategoryAdapter(this, categoryTitle, categoryImage, importList, W11CategoryAdapter.IMPORTS);
- registerListener(category);
- categories.add(category);
-
- categoryTitle = W11CategoryAdapter.TYPES_HEADER_TEXT;
- categoryImage = WSDLEditorPlugin.getInstance().getImage("icons/types_obj.gif"); //$NON-NLS-1$
- category = new W11TypesCategoryAdapter(this, categoryTitle, categoryImage, W11CategoryAdapter.TYPES);
- addListenerToTypes(category);
- registerListener(category);
- categories.add(category);
-
- categoryTitle = W11CategoryAdapter.SERVICE_HEADER_TEXT;
- categoryImage = WSDLEditorPlugin.getInstance().getImage("icons/serviceheader_obj.gif"); //$NON-NLS-1$
- category = new W11CategoryAdapter(this, categoryTitle, categoryImage, serviceList, W11CategoryAdapter.SERVICES);
- registerListener(category);
- categories.add(category);
-
- categoryTitle = W11CategoryAdapter.BINDING_HEADER_TEXT;
- categoryImage = WSDLEditorPlugin.getInstance().getImage("icons/bindingheader_obj.gif"); //$NON-NLS-1$
- category = new W11CategoryAdapter(this, categoryTitle, categoryImage, bindingList, W11CategoryAdapter.BINDINGS);
- registerListener(category);
- categories.add(category);
-
- categoryTitle = W11CategoryAdapter.INTERFACE_HEADER_TEXT;
- categoryImage = WSDLEditorPlugin.getInstance().getImage("icons/porttypeheader_obj.gif"); //$NON-NLS-1$
- category = new W11CategoryAdapter(this, categoryTitle, categoryImage, interfaceList, W11CategoryAdapter.INTERFACES);
- registerListener(category);
- categories.add(category);
-
- categoryTitle = W11CategoryAdapter.MESSAGE_HEADER_TEXT;
- categoryImage = WSDLEditorPlugin.getInstance().getImage("icons/messageheader_obj.gif"); //$NON-NLS-1$
- category = new W11CategoryAdapter(this, categoryTitle, categoryImage, messageList, W11CategoryAdapter.MESSAGES);
- registerListener(category);
- categories.add(category);
-
- return categories;
- }
-
- // Special case:
- // We need to have the Types object inform our facade (W11TypesCategoryAdapter) of it's
- // changes. This is different from the rest of the W11CategoryAdapters which listens
- // to the Definition object.
- private void addListenerToTypes(W11CategoryAdapter category) {
- Definition def = (Definition) this.getTarget();
- Types types = def.getETypes();
- if (types != null && !types.eAdapters().contains(category)) {
- types.eAdapters().add(category);
- }
- }
-
- public String getTargetNamespace() {
- return ((Definition) target).getTargetNamespace();
- }
-
- public String getTargetNamespacePrefix() {
- String tns = getTargetNamespace();
- return ((Definition) target).getPrefix(tns);
- }
-
- public List getServices() {
- List adapterList = new ArrayList();
- ComponentReferenceUtil util = new ComponentReferenceUtil((Definition) getTarget());
- List services = util.getServices();
- populateAdapterList(services, adapterList);
-
- return adapterList;
- }
-
- public List getBindings() {
- List adapterList = new ArrayList();
- ComponentReferenceUtil util = new ComponentReferenceUtil((Definition) getTarget());
- List bindings = util.getBindings();
- populateAdapterList(bindings, adapterList);
-
- return adapterList;
- }
-
- public List getInterfaces() {
- List adapterList = new ArrayList();
- ComponentReferenceUtil util = new ComponentReferenceUtil((Definition) getTarget());
- List portTypes = util.getPortTypes();
- populateAdapterList(portTypes, adapterList);
-
- return adapterList;
- }
-
- public List getImports() {
- List adapterList = new ArrayList();
- populateAdapterList(((Definition) target).getEImports(), adapterList);
-
- return adapterList;
- }
-
- public List getTypes() {
- List adapterList = new ArrayList();
- Types types = ((Definition) target).getETypes();
- if (types != null)
- {
- populateAdapterList(types.getSchemas(), adapterList);
- }
- return adapterList;
- }
-
- public List getMessages() {
- List adapterList = new ArrayList();
- ComponentReferenceUtil util = new ComponentReferenceUtil((Definition) getTarget());
- List messages = util.getMessages();
- populateAdapterList(messages, adapterList);
-
- return adapterList;
- }
-
- public String getName() {
- String name = ""; //$NON-NLS-1$
-
- Definition definition = ((Definition) target);
- if (definition.getQName() != null) {
- name = definition.getQName().getLocalPart();
- }
- return name;
- }
-
- public String[] getActions(Object object) {
- String[] actionIDs = new String[3];
- actionIDs[0] = ASDAddServiceAction.ID;
- actionIDs[1] = ASDAddBindingAction.ID;
- actionIDs[2] = ASDAddInterfaceAction.ID;
-
- return actionIDs;
- }
-
- public Command getAddImportCommand() {
- return new W11AddImportCommand((Definition) target);
- }
-
- public Command getAddSchemaCommand() {
- return new W11AddSchemaCommand((Definition) target);
- }
-
- public Command getAddServiceCommand() {
- return new W11AddServiceCommand((Definition) target);
- }
-
- public Command getAddBindingCommand() {
- return new W11AddBindingCommand((Definition) target);
- }
-
- public Command getAddInterfaceCommand() {
- return new W11AddInterfaceCommand((Definition) target);
- }
-
- public Command getAddMessageCommand() {
- return new W11AddMessageCommand((Definition) target);
- }
-
- public Command getEditNamespacesCommand() {
- return new W11EditNamespacesCommand((Definition) target);
- }
-
- public List getNamespacesInfo() {
- DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
- Element element = WSDLEditorUtil.getInstance().getElementForObject((Definition) target);
- return namespaceInfoManager.getNamespaceInfoList(element);
- }
-
- public Image getImage() {
- return null;
- }
-
- public String getText() {
- return "definition"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List children = getCategoryAdapters();
- return (ITreeElement[]) children.toArray(new ITreeElement[0]);
- }
-
- public boolean hasChildren() {
- if (getChildren().length > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public void notifyChanged(final Notification msg) {
- // TODO: rmah: This code should be moved into W11CategoryAdapter
- class CategoryNotification extends NotificationImpl {
- protected Object category;
-
- public CategoryNotification(Object category) {
- super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
- this.category = category;
- }
-
- public Object getNotifier() {
- return category;
- }
-
- public Object getFeature() {
- return msg.getFeature();
- }
- }
-
- if (msg.getFeature() == WSDLPackage.eINSTANCE.getDefinition_EImports()) {
- W11CategoryAdapter adapter = getCategory(W11CategoryAdapter.IMPORTS);
- Assert.isTrue(adapter != null);
- adapter.setChildren(getImports());
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- }
- else if (msg.getFeature() == WSDLPackage.eINSTANCE.getDefinition_ETypes()) {
- W11CategoryAdapter adapter = getCategory(W11CategoryAdapter.TYPES);
- Assert.isTrue(adapter != null);
- adapter.setChildren(getImports());
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- }
- else if (msg.getFeature() == WSDLPackage.eINSTANCE.getDefinition_EServices()) {
- W11CategoryAdapter adapter = getCategory(W11CategoryAdapter.SERVICES);
- Assert.isTrue(adapter != null);
- adapter.setChildren(getServices());
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- }
- else if (msg.getFeature() == WSDLPackage.eINSTANCE.getDefinition_EBindings()) {
- W11CategoryAdapter adapter = getCategory(W11CategoryAdapter.BINDINGS);
- Assert.isTrue(adapter != null);
- adapter.setChildren(getBindings());
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- }
- else if (msg.getFeature() == WSDLPackage.eINSTANCE.getDefinition_EPortTypes()) {
- W11CategoryAdapter adapter = getCategory(W11CategoryAdapter.INTERFACES);
- Assert.isTrue(adapter != null);
- adapter.setChildren(getInterfaces());
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- }
- else if (msg.getFeature() == WSDLPackage.eINSTANCE.getDefinition_EMessages()) {
- W11CategoryAdapter adapter = getCategory(W11CategoryAdapter.MESSAGES);
- Assert.isTrue(adapter != null);
- adapter.setChildren(getMessages());
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- }
- else {
- notifyListeners(null, null);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11EndPoint.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11EndPoint.java
deleted file mode 100644
index a3cab4fae..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11EndPoint.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.internal.generator.ContentGenerator;
-import org.eclipse.wst.wsdl.internal.generator.extension.ContentGeneratorExtensionFactoryRegistry;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11SetAddressCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11SetBindingCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.specialized.W11AddressExtensibilityElementAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddEndPointAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetExistingBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetNewBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IService;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-
-public class W11EndPoint extends WSDLBaseAdapter implements IEndPoint, IASDObjectListener {
-
- protected List addressExtensiblityElements = null;
- protected List thingsToListenTo = null;
-
- public String getAddress() {
- List list = getAddressExtensiblityElements();
- if (list.size() > 0)
- {
- W11AddressExtensibilityElementAdapter addressEE = (W11AddressExtensibilityElementAdapter)list.get(0);
- return addressEE.getLocationURI();
- }
- return ""; //$NON-NLS-1$
- }
-
- public List getApplicableProtocol() {
- ContentGeneratorExtensionFactoryRegistry factoryRegistry = ContentGeneratorExtensionFactoryRegistry.getInstance();
- List protocols = factoryRegistry.getBindingExtensionNames();
- return protocols;
- }
-
- public void setProtocol(String newProtocol) {
- ContentGeneratorExtensionFactoryRegistry factoryRegistry = ContentGeneratorExtensionFactoryRegistry.getInstance();
- ContentGenerator contentGenerator = factoryRegistry.getGeneratorClassFromName(newProtocol);
- if (contentGenerator != null) {
- String currentAddress = getAddress();
- if (currentAddress != null) {
- contentGenerator.setAddressLocation(currentAddress);
- }
-
- Port port = getPort();
- // go ahead and add required namespaces first before generating port content
- CreateWSDLElementHelper.addRequiredNamespaces(contentGenerator, port.getEnclosingDefinition());
- contentGenerator.generatePortContent(port);
- }
- }
-
- protected List getAddressExtensiblityElements()
- {
- addressExtensiblityElements = new ArrayList();
- thingsToListenTo = new ArrayList();
- Port port = (Port) getTarget();
- for (Iterator it = port.getEExtensibilityElements().iterator(); it.hasNext(); )
- {
- Notifier item = (Notifier)it.next();
- Adapter adapter = createAdapter(item);
- if (adapter instanceof W11AddressExtensibilityElementAdapter)
- {
- addressExtensiblityElements.add(adapter);
- }
- if (adapter instanceof IASDObject)
- {
- thingsToListenTo.add(adapter);
- }
- }
- for (Iterator i = thingsToListenTo.iterator(); i.hasNext(); )
- {
- IASDObject object = (IASDObject)i.next();
- object.registerListener(this);
- }
-
- return addressExtensiblityElements;
- }
-
- protected void clearAddressExtensiblityElements()
- {
- if (thingsToListenTo != null)
- {
- for (Iterator i = thingsToListenTo.iterator(); i.hasNext(); )
- {
- IASDObject object = (IASDObject)i.next();
- object.unregisterListener(this);
- }
- }
- thingsToListenTo = null;
- addressExtensiblityElements = null;
- }
-
- public IBinding getBinding() {
- if (getPort().getEBinding() != null) {
- return (IBinding) createAdapter(getPort().getEBinding());
- }
-
- return null;
- }
-
- public String getName() {
- return getPort().getName();
- }
-
- public String getTypeName() {
- return getAddress();
- }
-
- public Object getType() {
- return getBinding();
- }
-
- private Port getPort() {
- return (Port) target;
- }
-
- public IService getOwnerService() {
- return (IService) owner;
- }
-
- public String[] getActions(Object object) {
- Collection actionIDs = new ArrayList();
-
- actionIDs.add(ASDAddEndPointAction.ID);
- actionIDs.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_BINDING); //$NON-NLS-1$
- actionIDs.add(ASDSetNewBindingAction.ID);
- actionIDs.add(ASDSetExistingBindingAction.ID);
- actionIDs.add(BaseSelectionAction.SUBMENU_END_ID);
- actionIDs.add(ASDDeleteAction.ID);
- if (isReadOnly()) {
- actionIDs.add(OpenInNewEditor.ID);
- }
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public Command getSetBindingCommand(IBinding binding) {
- W11Binding w11Binding = (W11Binding) binding;
- return new W11SetBindingCommand((Port) target, (Binding) w11Binding.getTarget());
- }
-
- public Command getSetAddressCommand(String newAddress) {
- return new W11SetAddressCommand((Port) this.getTarget(), newAddress);
- }
-
- public void propertyChanged(Object object, String property)
- {
- // this is called when one of the 'address' extensibility element adapters we're listening to changes
- //
- clearAddressExtensiblityElements();
- notifyListeners(this, null);
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/port_obj.gif"); //$NON-NLS-1$
- }
-
- public String getText() {
- return "port"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- return ITreeElement.EMPTY_LIST;
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public String getProtocol() {
- String protocol = ""; //$NON-NLS-1$
-
- List list = getAddressExtensiblityElements();
- if (list.size() > 0) {
- W11AddressExtensibilityElementAdapter addressEE = (W11AddressExtensibilityElementAdapter)list.get(0);
- Object target = addressEE.getTarget();
- if (target instanceof WSDLElement) {
- WSDLElement wsdlElement = (WSDLElement) target;
- String namespace = wsdlElement.getElement().getNamespaceURI();
-
- if (namespace != null) {
- ContentGeneratorExtensionFactoryRegistry factoryRegistry = ContentGeneratorExtensionFactoryRegistry.getInstance();
- ContentGenerator contentGenerator = factoryRegistry.getGeneratorClassFromNamespace(namespace);
- if (contentGenerator != null) {
- protocol = contentGenerator.getProtocol();
- }
- }
- }
- }
-
- return protocol;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Import.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Import.java
deleted file mode 100644
index 10081e6c9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Import.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11OpenImportAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IImport;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class W11Import extends WSDLBaseAdapter implements IImport {
-
- public Import getImport() {
- return (Import) target;
- }
-
- public String getNamespace() {
- return getImport().getNamespaceURI();
- }
-
- public String getNamespacePrefix() {
- return getImport().getEnclosingDefinition().getPrefix(getNamespace());
- }
-
- public String getLocation() {
- return getImport().getLocationURI();
- }
-
- public IDescription getOwnerDescription() {
- return (IDescription) owner;
- }
-
- public String getName() {
- Import theImport = (Import) target;
- return theImport.getLocationURI();
- }
-
- public String[] getActions(Object object) {
- String[] actionIDs = new String[2];
- actionIDs[0] = W11OpenImportAction.ID;
- actionIDs[1] = ASDDeleteAction.ID;
- return actionIDs;
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/import_obj.gif"); //$NON-NLS-1$
- }
-
- public String getText() {
- return "import"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- return ITreeElement.EMPTY_LIST;
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Interface.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Interface.java
deleted file mode 100644
index 90ced902b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Interface.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddOperationCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddOperationAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class W11Interface extends WSDLBaseAdapter implements IInterface {
-
- public List getOperations() {
- List adapterList = new ArrayList();
- populateAdapterList(((PortType) target).getEOperations(), adapterList);
-
- return adapterList;
- }
-
- public String getName() {
- return ((PortType) target).getQName().getLocalPart();
- }
-
- public String[] getActions(Object object) {
- List actionIDs = new ArrayList();
- actionIDs.add(ASDAddOperationAction.ID);
- actionIDs.add(ASDDeleteAction.ID);
- if (isReadOnly()) {
- actionIDs.add(OpenInNewEditor.ID);
- }
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public Command getAddOperationCommand() {
- return new W11AddOperationCommand((PortType) target);
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/porttype_obj.gif"); //$NON-NLS-1$
- }
-
- public String getText() {
- return "portType"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List operations = getOperations();
- ITreeElement[] treeElements = new ITreeElement[operations.size()];
-
- for (int index = 0; index < operations.size(); index++) {
- treeElements[index] = (ITreeElement) operations.get(index);
- }
-
- return treeElements;
- }
-
- public boolean hasChildren() {
- if (getChildren().length > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Message.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Message.java
deleted file mode 100644
index 6c1b9a55c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Message.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11AddPartAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddPartCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessage;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-
-
-public class W11Message extends WSDLBaseAdapter implements IMessage {
-
- public List getParts() {
- List adapterList = new ArrayList();
-// populateAdapterList(((Message) target).getEParts(), adapterList);
- Iterator parts = ((Message) target).getEParts().iterator();
- while (parts.hasNext()) {
- Notifier component = (Notifier) parts.next();
- Adapter adapter = WSDLAdapterFactoryHelper.getInstance().adapt(component);
- adapterList.add(adapter);
- }
-
- return adapterList;
- }
-
- public IDescription getOwnerDescription() {
- return (IDescription) owner;
- }
-
- public String getName() {
- if (((Message) target).getQName() != null) {
- return ((Message) target).getQName().getLocalPart();
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public String[] getActions(Object object) {
- List actionIDs = new ArrayList();
- actionIDs.add(W11AddPartAction.ID);
- actionIDs.add(ASDDeleteAction.ID);
- if (isReadOnly()) {
- actionIDs.add(OpenInNewEditor.ID);
- }
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public Command getAddPartCommand() {
- return new W11AddPartCommand((Message) target);
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/message_obj.gif"); //$NON-NLS-1$
- }
-
- public String getText() {
- return "message"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List parts = getParts();
- ITreeElement[] treeElements = new ITreeElement[parts.size()];
-
- for (int index = 0; index < parts.size(); index++) {
- treeElements[index] = (ITreeElement) parts.get(index);
- }
-
- return treeElements;
- }
-
- public boolean hasChildren() {
- if (getChildren().length > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11MessageReference.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11MessageReference.java
deleted file mode 100644
index 47da4d3a1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11MessageReference.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11AddPartAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingMessageAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewMessageAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddFaultParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddInputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddOutputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11ReorderParametersCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.visitor.W11FindInnerElementVisitor;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddFaultAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddOperationAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ModelDiagnosticInfo;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.visitor.WSDLVisitorForParameters;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-
-public class W11MessageReference extends WSDLBaseAdapter implements IMessageReference, IASDObjectListener
-{
- protected int messageKind = -1;
- protected List parameters = null;
- protected List otherThingsToListenTo = null;
-
- public W11MessageReference(int messageKind)
- {
- this.messageKind = messageKind;
- }
-
- public IOperation getOwnerOperation()
- {
- return (IOperation) owner;
- }
-
- /*
- private String getMessageString(String key, Object[] args) {
- String string = null;
-
- Object object = WSDLEditorPlugin.getInstance().getProductCustomizationProvider();
- if (object instanceof ProductCustomizationProvider) {
- ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)object;
- String newString = productCustomizationProvider.getProductString(key, args);
- if (newString != null) {
- string = newString;
- }
- }
-
- return string;
- }
- */
-
- // Convenience method
- public MessageReference getMessageReference()
- {
- return (MessageReference) target;
- }
-
- protected void computeMessageKind()
- {
- if (getMessageReference() instanceof Input)
- {
- messageKind = KIND_INPUT;
- }
- else if (getMessageReference() instanceof Output)
- {
- messageKind = KIND_OUTPUT;
- }
- else if (getMessageReference() instanceof Fault)
- messageKind = KIND_FAULT;
- }
-
- public int getKind()
- {
- if (messageKind == -1)
- {
- computeMessageKind();
- }
- return messageKind;
- }
-
- public String getName()
- {
- MessageReference messageRef = getMessageReference();
- if (messageRef.getName() != null) {
- return messageRef.getName();
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public List getParameters()
- {
- List parameters = new ArrayList();
- List parts = new ArrayList();
- MessageReference messageRef = getMessageReference();
- if (messageRef != null) {
- if (messageRef.getEMessage() != null) {
- if (messageRef.getEMessage().getEParts() != null) {
- parts = messageRef.getEMessage().getEParts();
- }
- }
- }
-
- populateAdapterList(parts, parameters);
-
- otherThingsToListenTo = new ArrayList();
- WSDLVisitorForParameters visitorForParameters = new WSDLVisitorForParameters();
- visitorForParameters.visitMessageReference(messageRef);
- populateAdapterList(visitorForParameters.concreteComponents, otherThingsToListenTo);
- populateAdapterList(visitorForParameters.thingsToListenTo, otherThingsToListenTo);
-
- // now we listen to all the 'things we need to listen to'
- //
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IASDObject)
- {
- IASDObject asdObject = (IASDObject) adapter;
- asdObject.registerListener(this);
- }
- }
-
- return parameters;
- }
-
- public void propertyChanged(Object object, String property)
- {
- // this method is called when one of the 'otherThingsToListenTo' has changed
- // when one of these things changes it means our paramter list may have changes
- // so we need to recompute it
-// Object notifier = null;
-// if (object instanceof Adapter)
-// {
-// notifier = ((Adapter)object).getTarget();
-// }
-// System.out.println("something in the 'otherThingsToListenTo' list has changed " + notifier);
- clearParameters();
- notifyListeners(this, null);
- }
-
- protected void clearParameters()
- {
- if (otherThingsToListenTo != null)
- {
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IASDObject)
- {
- IASDObject asdObject = (IASDObject) adapter;
- asdObject.unregisterListener(this);
- }
- }
- }
- parameters = null;
- otherThingsToListenTo = null;
- }
-
- public void notifyChanged(Notification msg)
- {
- clearParameters();
- super.notifyChanged(msg);
- }
-
- public String[] getActions(Object object)
- {
- List actions = new ArrayList();
- actions.add(ASDAddOperationAction.ID);
- actions.addAll(((W11Operation) getOwnerOperation()).getValidInputOutpuActions());
- actions.add(ASDAddFaultAction.ID);
- actions.add(W11AddPartAction.ID);
- actions.add(ASDDeleteAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_MESSAGE); //$NON-NLS-1$
- actions.add(W11SetNewMessageAction.ID);
- actions.add(W11SetExistingMessageAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_END_ID);
-// if (isReadOnly()) {
-// actions.add(OpenInNewEditor.ID);
-// }
-
- String[] actionIDs = new String[actions.size()];
- for (int index = 0; index < actions.size(); index++) {
- actionIDs[index] = (String) actions.get(index);
- }
-
- return actionIDs;
- }
-
- public Command getReorderParametersCommand(IParameter leftSibling, IParameter rightSibling, IParameter movingParameter) {
- return new W11ReorderParametersCommand(leftSibling, rightSibling, movingParameter);
- }
-
- public Command getAddParamterCommand() {
- Command command = null;
- Operation operation = (Operation)getMessageReference().eContainer();
- if (getKind() == KIND_INPUT)
- {
- command = new W11AddInputParameterCommand(operation);
- }
- else if (getKind() == KIND_OUTPUT)
- {
- command = new W11AddOutputParameterCommand(operation);
- }
- else
- {
- command = new W11AddFaultParameterCommand(operation, (Fault)getMessageReference());
- }
- return command;
- }
-
- public Image getImage() {
- if (getKind() == KIND_INPUT)
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/input_obj.gif"); //$NON-NLS-1$
- }
- else if (getKind() == KIND_OUTPUT)
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/output_obj.gif"); //$NON-NLS-1$
- }
- else if (getKind() == KIND_FAULT)
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/fault_obj.gif"); //$NON-NLS-1$
- }
- return null;
- }
-
- public String getText() {
- if (getKind() == KIND_INPUT)
- {
- return "input"; //$NON-NLS-1$
- }
- else if (getKind() == KIND_OUTPUT)
- {
- return "output"; //$NON-NLS-1$
- }
- else if (getKind() == KIND_FAULT)
- {
- return getName();
- }
- return ""; //$NON-NLS-1$
- }
-
- /*
- * @deprecated. This method will be removed in the near future.
- * Use getSimplifiedParameters().
- */
- public List getParameters2()
- {
- return getSimplifiedDiagnosticMessages();
- }
-
- public List getSimplifiedParameters()
- {
- if (parameters == null)
- {
- parameters = new ArrayList();
- otherThingsToListenTo = new ArrayList();
- WSDLVisitorForParameters visitorForParameters = new WSDLVisitorForParameters();
- visitorForParameters.visitMessageReference(getMessageReference());
- populateAdapterList(visitorForParameters.concreteComponents, parameters);
- populateAdapterList(visitorForParameters.thingsToListenTo, otherThingsToListenTo);
-
- // now we listen to all the 'things we need to listen to'
- //
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IASDObject)
- {
- IASDObject asdObject = (IASDObject) adapter;
- asdObject.registerListener(this);
- }
- }
- }
-
- return parameters;
- }
-
- public ITreeElement[] getChildren() {
- /*
- List parts = getParameters();
- ITreeElement[] treeElements = new ITreeElement[parts.size()];
-
- for (int index = 0; index < parts.size(); index++) {
- treeElements[index] = (ITreeElement) parts.get(index);
- }
- */
- return ITreeElement.EMPTY_LIST;
- }
-
- public boolean hasChildren() {
- if (getChildren().length > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- private void processAdvancedW11MessageReference() {
- diagnosticMessages = new ArrayList();
-
- MessageReference messageRef = (MessageReference) getTarget();
- List parts = new ArrayList();
- if (messageRef.getEMessage() != null) {
- if (messageRef.getEMessage().getEParts() != null) {
- parts = messageRef.getEMessage().getEParts();
- }
- }
-
- // messageRef can not be null, given above
- if (messageRef.getEMessage() == null) {
- addErrorDiagnosticMessage(getUndefinedArg1String("message")); //$NON-NLS-1$
- }
- else if (parts.size() <= 0) {
- String[] args = new String[1];
- args[0] = "part"; //$NON-NLS-1$
- addWarningDiagnosticMessage(getNoObjectSpecifiedArgsString(args));
- }
- }
-
- private void processSimplifiedW11MessageReference() {
- diagnosticMessages = new ArrayList();
-
- MessageReference messageRef = (MessageReference) getTarget();
- if (messageRef == null || messageRef.getEMessage() == null) {
- addErrorDiagnosticMessage(getUndefinedArg1String("message")); //$NON-NLS-1$
- }
- else if (messageRef.getEMessage().getEParts().size() <= 0) {
- addWarningDiagnosticMessage(getNoParametersSpecifiedString());
- }
- else {
- Part part = (Part) messageRef.getEMessage().getEParts().get(0);
- XSDElementDeclaration xsdElement = part.getElementDeclaration();
- if (xsdElement == null || xsdElement.getSchema() == null) {
- // No XSD Element
- addErrorDiagnosticMessage(getUndefinedArg1String("element")); //$NON-NLS-1$
- }
- else {
- MyInnerElementVisitor visitor = new MyInnerElementVisitor();
- visitor.findErrorsAndWarnings(xsdElement);
- diagnosticMessages.addAll(visitor.getDiagnosticMessages());
- }
- }
- }
-
- private void addErrorDiagnosticMessage(String txt) {
- diagnosticMessages.add(new ModelDiagnosticInfo(txt, ModelDiagnosticInfo.ERROR_TYPE, null));
- }
-
- private void addWarningDiagnosticMessage(String txt) {
- diagnosticMessages.add(new ModelDiagnosticInfo(txt, ModelDiagnosticInfo.WARNING_TYPE, null));
- }
-
- protected List diagnosticMessages = new ArrayList();
-
- public List getDiagnosticMessages() {
- processAdvancedW11MessageReference();
- return diagnosticMessages;
- }
-
- public List getSimplifiedDiagnosticMessages() {
- processSimplifiedW11MessageReference();
- return diagnosticMessages;
- }
-
- private class MyInnerElementVisitor extends W11FindInnerElementVisitor {
- private List diagMessages = new ArrayList();
-
- public void findErrorsAndWarnings(XSDElementDeclaration xsdElement) {
- if (xsdElement.getTypeDefinition() == null || xsdElement.getTypeDefinition().getSchema() == null) {
- // No XSD type (non anonymous) defined
- diagMessages.add(new ModelDiagnosticInfo(getUndefinedArg1String("type"), ModelDiagnosticInfo.ERROR_TYPE, null)); //$NON-NLS-1$
- }
-
- XSDElementDeclaration innerElement = super.getInnerXSDElement(xsdElement);
- if (innerElement.equals(xsdElement)) {
- diagMessages.add(new ModelDiagnosticInfo(getNoParametersSpecifiedString(), ModelDiagnosticInfo.WARNING_TYPE, null));
- }
- }
-
- public List getDiagnosticMessages() {
- return diagMessages;
- }
- }
-
- private String getNoObjectSpecifiedArgsString(String[] args) {
- String string = NLS.bind(Messages._UI_LABEL_NO_OBJECT_SPECIFIED_ARG1, args);
- String customizedMessage = getProductCustomizedMessage("_UI_LABEL_NO_OBJECT_SPECIFIED_ARG1", args); //$NON-NLS-1$
- if (customizedMessage != null && !customizedMessage.equals("")) //$NON-NLS-1$
- string = customizedMessage;
- return string;
- }
-
- private String getUndefinedArg1String(String arg) {
- String[] args = new String[1];
- args[0] = arg;
- String string = NLS.bind(Messages._UI_LABEL_UNDEFINED_ARG1, args);
- String customizedMessage = getProductCustomizedMessage("_UI_LABEL_UNDEFINED_ARG1", args); //$NON-NLS-1$
- if (customizedMessage != null && !customizedMessage.equals("")) //$NON-NLS-1$
- string = customizedMessage;
- return string;
- }
-
- private String getNoParametersSpecifiedString() {
- String[] args = new String[0];
- String string = NLS.bind(Messages._UI_LABEL_NO_PARAMETERS_SPECIFIED, args);
- String customizedMessage = getProductCustomizedMessage("_UI_LABEL_NO_PARAMETERS_SPECIFIED", args); //$NON-NLS-1$
- if (customizedMessage != null && !customizedMessage.equals("")) //$NON-NLS-1$
- string = customizedMessage;
- return string;
- }
-
- /**
- * Returns a customed product-based message for the given key and arguments
- * or null if none exists.
- * @param key
- * @param args
- * @return String customized message or null if none exists
- */
- private String getProductCustomizedMessage(String key, Object[] args) {
- String productMessage = null;
-
- Object object = WSDLEditorPlugin.getInstance().getProductCustomizationProvider();
- if (object instanceof ProductCustomizationProvider) {
- ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)object;
- String customizedString = null;
- if (args == null) {
- customizedString = productCustomizationProvider.getProductString(key);
- }
- else {
- customizedString = productCustomizationProvider.getProductString(key, args);
- }
-
- if (customizedString != null && !customizedString.equals("")) { //$NON-NLS-1$
- productMessage = customizedString;
- }
- }
-
- return productMessage;
- }
- }
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Operation.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Operation.java
deleted file mode 100644
index 7e9a6f93d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Operation.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.wsdl.OperationType;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.ui.internal.DefaultEditorMode;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddFaultParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddInputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddOutputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11ReorderMessageReferencesCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddFaultAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddInputAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddOperationAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddOutputAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-
-public class W11Operation extends WSDLBaseAdapter implements IOperation {
- public List getMessages()
- {
- List modelAdapterList = new ArrayList(getOperation().getEFaults().size() + 2);
-
- Input input = getOperation().getEInput();
- Output output = getOperation().getEOutput();
-
- OperationType operationType = getOperation().getStyle();
- if (operationType != null) {
- if (operationType.equals(OperationType.REQUEST_RESPONSE) && input != null && output != null) {
- // Input, Output
- modelAdapterList.add(createAdapter(input));
- modelAdapterList.add(createAdapter(output));
- }
- else if (operationType.equals(OperationType.SOLICIT_RESPONSE) && input != null && output != null) {
- // Output, Input
- modelAdapterList.add(createAdapter(output));
- modelAdapterList.add(createAdapter(input));
- }
- else if (operationType.equals(OperationType.ONE_WAY) && input != null) {
- // Input
- modelAdapterList.add(createAdapter(input));
- }
- else if (operationType.equals(OperationType.NOTIFICATION) && output != null) {
- //Output
- modelAdapterList.add(createAdapter(output));
- }
- }
-
- for (Iterator i = getOperation().getEFaults().iterator(); i.hasNext();) {
- EObject o = (EObject) i.next();
- modelAdapterList.add(createAdapter(o));
- }
-
- return modelAdapterList;
- }
-
- // Convienence method
- public Operation getOperation()
- {
- return (Operation) target;
- }
-
- public String getName()
- {
- return getOperation().getName();
- }
-
- public IInterface getOwnerInterface()
- {
- return (IInterface)owner;
- }
-
- public String[] getActions(Object object) {
- List actions = new ArrayList();
- actions.add(ASDAddOperationAction.ID);
- actions.addAll(getValidInputOutpuActions());
- actions.add(ASDAddFaultAction.ID);
- actions.add(ASDDeleteAction.ID);
- if (isReadOnly()) {
- actions.add(OpenInNewEditor.ID);
- }
-
- String[] actionIDs = new String[actions.size()];
- for (int index = 0; index < actions.size(); index++) {
- actionIDs[index] = (String) actions.get(index);
- }
-
- return actionIDs;
- }
-
- public Command getAddInputCommand() {
- W11AddInputParameterCommand command = new W11AddInputParameterCommand(getOperation());
-
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- EditorModeManager manager = (EditorModeManager) editor.getAdapter(EditorModeManager.class);
- if (manager.getCurrentMode().getId() != DefaultEditorMode.class.getName()) {
- command.setParameterPattern(AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT);
- }
-
- return command;
- }
-
- public Command getAddOutputCommand() {
- W11AddOutputParameterCommand command = new W11AddOutputParameterCommand(getOperation());
-
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- EditorModeManager manager = (EditorModeManager) editor.getAdapter(EditorModeManager.class);
- if (manager.getCurrentMode().getId() != DefaultEditorMode.class.getName()) {
- command.setParameterPattern(AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT);
- }
-
- return command;
- }
-
- public Command getAddFaultCommand(Object fault) {
- W11AddFaultParameterCommand command = new W11AddFaultParameterCommand(getOperation(), null);
-
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- EditorModeManager manager = (EditorModeManager) editor.getAdapter(EditorModeManager.class);
- if (manager.getCurrentMode().getId() != DefaultEditorMode.class.getName()) {
- command.setParameterPattern(AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT);
- }
-
- return command;
- }
-
- public Command getReorderMessageReferencesCommand(IMessageReference leftSibling, IMessageReference rightSibling, IMessageReference movingMessageRef) {
- return new W11ReorderMessageReferencesCommand(leftSibling, rightSibling, movingMessageRef);
- }
-
- public List getValidInputOutpuActions() {
- List list = new ArrayList();
-
- if (getOperation().getEInput() == null) {
- list.add(ASDAddInputAction.ID);
- }
- if (getOperation().getEOutput() == null) {
- list.add(ASDAddOutputAction.ID);
- }
-
- return list;
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/operation_obj.gif"); //$NON-NLS-1$
- }
-
- public String getText() {
- return "operation"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List messages = getMessages();
- ITreeElement[] treeElements = new ITreeElement[messages.size()];
-
- for (int index = 0; index < messages.size(); index++) {
- treeElements[index] = (ITreeElement) messages.get(index);
- }
-
- return treeElements;
- }
-
- public boolean hasChildren() {
- if (getChildren().length > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForAttribute.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForAttribute.java
deleted file mode 100644
index fc8228f88..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForAttribute.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11DeleteParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-//import com.ibm.ccl.soa.sdo.wsdl.ui.internal.commands.SDOW11DeleteCommand;
-
-public class W11ParameterForAttribute extends WSDLBaseAdapter implements IParameter {
-
- protected XSDAttributeUse getXSDAttributeUse() {
- return (XSDAttributeUse) target;
- }
-
- protected XSDAttributeDeclaration getXSDAtttributeDeclaration() {
- XSDAttributeUse attrUse = getXSDAttributeUse();
- return attrUse.getAttributeDeclaration();
- }
-
- public Object getOwner() {
- return (IMessageReference) owner;
- }
-
- public String getName() {
- return getXSDAtttributeDeclaration().getName();
- }
-
- public String getComponentName() {
- XSDAttributeDeclaration attrDecl = getXSDAtttributeDeclaration();
-
- if (attrDecl.getType() != null) {
- return attrDecl.getType().getName();
- }
-
- return "error: could not get type name"; //$NON-NLS-1$
- }
-
- public String getComponentNameQualifier() {
- XSDTypeDefinition td = getXSDAtttributeDeclaration().getTypeDefinition();
- return td != null ? td.getTargetNamespace() : null;
- }
-
- public String[] getActions(Object object) {
- List actions = new ArrayList();
- //list.add(ASDAddOperationAction.ID);
- //list.add(ASDAddInputAction.ID);
- //list.add(ASDAddOutputAction.ID);
- //list.add(ASDAddFaultAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_TYPE); //$NON-NLS-1$
- actions.add(W11SetNewTypeAction.ID);
- actions.add(W11SetExistingTypeAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_END_ID);
-
- actions.add(ASDDeleteAction.ID);
- String[] result = new String[actions.size()];
- actions.toArray(result);
- return result;
- }
-
- public Command getDeleteCommand() {
- return new W11DeleteParameterCommand(this);
- }
-
- public Command getSetTypeCommand(String id) {
- return null;
- }
-
- public Image getImage() {
- return null;
- }
-
- public String getText() {
- return getParameterString("attribute"); //$NON-NLS-1$
- }
-
- private String getParameterString(String txt) {
- String string = ""; //$NON-NLS-1$
- Object object = WSDLEditorPlugin.getInstance().getProductCustomizationProvider();
- if (object instanceof ProductCustomizationProvider) {
- ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)object;
- String newString = productCustomizationProvider.getProductString("_UI_LABEL_PARAMETER_ARG", new Object[]{txt}); //$NON-NLS-1$
- if (newString != null) {
- string = newString;
- }
- }
-
- return string;
- }
-
- public ITreeElement[] getChildren() {
- return new ITreeElement[0];
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForElement.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForElement.java
deleted file mode 100644
index bc5417320..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForElement.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11DeleteParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11RenameCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11SetTypeCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class W11ParameterForElement extends WSDLBaseAdapter implements IParameter
-{
- protected XSDElementDeclaration getXSDElementDeclaration()
- {
- return ((XSDElementDeclaration) target).getResolvedElementDeclaration();
- }
-
- public String getName()
- {
- return getXSDElementDeclaration().getName();
- }
-
- public String getComponentName()
- {
- String compName = "";// + Messages.getString("_UI_LABEL_NO_TYPE_SPECIFIED") + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- XSDTypeDefinition anonymousType = getXSDElementDeclaration().getAnonymousTypeDefinition();
- XSDTypeDefinition td = getXSDElementDeclaration().getTypeDefinition();
-
- if (anonymousType != null) {
- compName = "**anonymous**"; //$NON-NLS-1$
- }
-
- return (td != null && td.getName() != null) ? td.getName() : compName;
- }
-
- public String getComponentNameQualifier()
- {
- XSDTypeDefinition td = getXSDElementDeclaration().getTypeDefinition();
- return td != null ? td.getTargetNamespace() : null;
- }
-
- public String[] getActions(Object object) {
- List actions = new ArrayList();
- //list.add(ASDAddOperationAction.ID);
- //list.add(ASDAddInputAction.ID);
- //list.add(ASDAddOutputAction.ID);
- //list.add(ASDAddFaultAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_TYPE); //$NON-NLS-1$
- actions.add(W11SetNewTypeAction.ID);
- actions.add(W11SetExistingTypeAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_END_ID);
-
- actions.add(ASDDeleteAction.ID);
- String[] result = new String[actions.size()];
- actions.toArray(result);
- return result;
- }
-
- public Command getDeleteCommand()
- {
- return new W11DeleteParameterCommand(this);
- }
-
- public Command getSetTypeCommand(String actionId) {
- return new W11SetTypeCommand(this.getTarget(), actionId);
- }
-
- public Command getSetNameCommand(String newName) {
- return new W11RenameCommand(this, newName) {
- public void execute() {
- try {
- beginRecording(getXSDElementDeclaration().getElement());
- getXSDElementDeclaration().setName(newName);
- }
- finally {
- endRecording(getXSDElementDeclaration().getElement());
- }
- }
- };
- }
-
- public Object getOwner()
- {
- return (IMessageReference) owner;
- }
-
- public Image getImage() {
- return null;
- }
-
- public String getText() {
- return getParameterString("element"); //$NON-NLS-1$
- }
-
- private String getParameterString(String txt) {
- String string = ""; //$NON-NLS-1$
- Object object = WSDLEditorPlugin.getInstance().getProductCustomizationProvider();
- if (object instanceof ProductCustomizationProvider) {
- ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)object;
- String newString = productCustomizationProvider.getProductString("_UI_LABEL_PARAMETER_ARG", new Object[]{txt}); //$NON-NLS-1$
- if (newString != null) {
- string = newString;
- }
- }
-
- return string;
- }
-
- public ITreeElement[] getChildren() {
- return new ITreeElement[0];
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForPart.java
deleted file mode 100644
index dcbae2e37..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11ParameterForPart.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11AddPartAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingElementAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetExistingTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewElementAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.actions.W11SetNewTypeAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11SetElementCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11SetTypeCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddFaultAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddOperationAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ModelDiagnosticInfo;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-
-
-public class W11ParameterForPart extends WSDLBaseAdapter implements IParameter
-{
- protected Part getPart()
- {
- return (Part) target;
- }
-
- public String getName()
- {
- return getPart().getName();
- }
-
- public String getComponentName()
- {
- if (getPart().getElementDeclaration() != null)
- {
- return getPart().getElementDeclaration().getName();
- }
- else if (getPart().getTypeDefinition() != null)
- {
- return getPart().getTypeDefinition().getName();
- }
- else
- {
- return getNoNameSpecifiedString();
- }
- }
-
- private String getNoNameSpecifiedString() {
- return ""; //$NON-NLS-1$
- }
-
- public String getComponentNameQualifier()
- {
- if (getPart().getElementDeclaration() != null)
- {
- return getPart().getElementDeclaration().getTargetNamespace();
- }
- else if (getPart().getTypeDefinition() != null)
- {
- return getPart().getTypeDefinition().getTargetNamespace();
- }
- else
- {
- return ""; //$NON-NLS-1$
- }
- }
-
- public String[] getActions(Object object) {
- if (object instanceof MultiPageEditorPart) {
- IOperation operation = ((IMessageReference) getOwner()).getOwnerOperation();
-
- List actions = new ArrayList();
- actions.add(W11AddPartAction.ID);
- actions.add(ASDAddOperationAction.ID);
- actions.addAll(((W11Operation) operation).getValidInputOutpuActions());
- actions.add(ASDAddFaultAction.ID);
-
- actions.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_TYPE); //$NON-NLS-1$
- actions.add(W11SetNewTypeAction.ID);
- actions.add(W11SetExistingTypeAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_END_ID);
-
- actions.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_ELEMENT); //$NON-NLS-1$
- actions.add(W11SetNewElementAction.ID);
- actions.add(W11SetExistingElementAction.ID);
- actions.add(BaseSelectionAction.SUBMENU_END_ID);
-
- actions.add(ASDDeleteAction.ID);
-
- if (isReadOnly()) {
- actions.add(OpenInNewEditor.ID);
- }
-
- String[] actionIDs = new String[actions.size()];
- for (int index = 0; index < actions.size(); index++) {
- actionIDs[index] = (String) actions.get(index);
- }
-
- return actionIDs;
- }
- if (object instanceof ContentOutline) {
- String[] actionIDs = new String[2];
- actionIDs[0] = W11AddPartAction.ID;
- actionIDs[1] = ASDDeleteAction.ID;
-
- return actionIDs;
- }
-
- return new String[0];
- }
-
- public Object getOwner()
- {
- return owner;
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/part_obj.gif"); //$NON-NLS-1$
- }
-
- public Image getSecondaryImage() {
-
- if (getPart().getElementDeclaration() != null)
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/element_obj.gif"); //$NON-NLS-1$
- }
- else if (getPart().getTypeDefinition() != null)
- {
- if (getPart().getTypeDefinition() instanceof XSDComplexTypeDefinition)
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/complextype_obj.gif"); //$NON-NLS-1$
- }
- else
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/simpletype_obj.gif"); //$NON-NLS-1$
- }
- }
- else
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/part_obj.gif"); //$NON-NLS-1$
- }
- }
-
- public String getText() {
- return "part"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- return new ITreeElement[0];
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public Command getSetTypeCommand(String actionId) {
- return new W11SetTypeCommand((Part) this.getTarget(), actionId);
- }
-
- public Command getSetElementCommand(String actionId) {
- return new W11SetElementCommand((Part) this.getTarget(), actionId);
- }
-
- // TODO: We should move the isType() method to the IParameter Interface........
- public boolean isType() {
- Part part = (Part) target;
- if (part.getTypeDefinition() != null) {
- return true;
- }
-
- return false;
- }
-
- public List getDiagnosticMessages() {
- List errors = new ArrayList();
- Part part = (Part) getTarget();
- if (part.getElementDeclaration() == null && part.getTypeDefinition() == null) {
- String[] args = new String[2];
- args[0] = "element"; //$NON-NLS-1$
- args[1] = "type"; //$NON-NLS-1$
-
- String string = NLS.bind(Messages._UI_LABEL_OR_UNDEFINED_ARG2, args);
- String customizedMessage = getProductCustomizedMessage("_UI_LABEL_OR_UNDEFINED_ARG2", args); //$NON-NLS-1$
- if (customizedMessage != null && !customizedMessage.equals("")) //$NON-NLS-1$
- string = customizedMessage;
-
- ModelDiagnosticInfo info = new ModelDiagnosticInfo(string, ModelDiagnosticInfo.ERROR_TYPE, null);
- errors.add(info);
- }
-
- return errors;
- }
-
- /**
- * Returns a customed product-based message for the given key and arguments
- * or null if none exists.
- * @param key
- * @param args
- * @return String customized message or null if none exists
- */
- private String getProductCustomizedMessage(String key, Object[] args) {
- String productMessage = null;
-
- Object object = WSDLEditorPlugin.getInstance().getProductCustomizationProvider();
- if (object instanceof ProductCustomizationProvider) {
- ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)object;
- String customizedString = null;
- if (args == null) {
- customizedString = productCustomizationProvider.getProductString(key);
- }
- else {
- customizedString = productCustomizationProvider.getProductString(key, args);
- }
-
- if (customizedString != null && !customizedString.equals("")) { //$NON-NLS-1$
- productMessage = customizedString;
- }
- }
-
- return productMessage;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Service.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Service.java
deleted file mode 100644
index 2fe0a300c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Service.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddEndPointCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddEndPointAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IService;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.asd.util.EndPointComparator;
-
-public class W11Service extends WSDLBaseAdapter implements IService {
-
- public List getEndPoints() {
- List adapterList = new ArrayList();
- List endPoints = new ArrayList();
- Iterator it = ((Service) target).getEPorts().iterator();
- while (it.hasNext()) {
- endPoints.add(it.next());
- }
-
- populateAdapterList(endPoints, adapterList);
- Collections.sort(adapterList, new EndPointComparator());
-
- return adapterList;
- }
-
- public String getName() {
- return ((Service) target).getQName().getLocalPart();
- }
-
- public List getFields() {
- return getEndPoints();
- }
-
- public IDescription getOwnerDescription() {
- return (IDescription) owner;
- }
-
- public String[] getActions(Object object) {
- List actionIDs = new ArrayList();
- actionIDs.add(ASDAddEndPointAction.ID);
- actionIDs.add(ASDDeleteAction.ID);
-
- if (isReadOnly()) {
- actionIDs.add(OpenInNewEditor.ID);
- }
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public Command getAddEndPointCommand() {
- return new W11AddEndPointCommand((Service)target);
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/service_obj.gif"); //$NON-NLS-1$
- }
-
- public String getText() {
- return "service"; //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List endPoints = getEndPoints();
- ITreeElement[] treeElements = new ITreeElement[endPoints.size()];
-
- for (int index = 0; index < endPoints.size(); index++) {
- treeElements[index] = (ITreeElement) endPoints.get(index);
- }
-
- return treeElements;
- }
-
- public boolean hasChildren() {
- if (getChildren().length > 0) {
- return true;
- }
-
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Type.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Type.java
deleted file mode 100644
index 720ddf119..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11Type.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.basic;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDOpenSchemaAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IType;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.xsd.XSDSchema;
-
-public class W11Type extends WSDLBaseAdapter implements IType {
- public IDescription getOwnerDescription() {
- return (IDescription) owner;
- }
-
- public String getName() {
- XSDSchema schema= (XSDSchema) target;
- return schema.getTargetNamespace();
- }
-
- public String[] getActions(Object object) {
- String[] actionIDs = new String[2];
- actionIDs[0] = ASDOpenSchemaAction.ID;
- actionIDs[1] = ASDDeleteAction.ID;
- return actionIDs;
- }
-
- public Image getImage() {
- return WSDLEditorPlugin.getInstance().getImage("icons/xsd_obj.gif"); //$NON-NLS-1$
- }
-
- public String getText() {
- return "schema"; //$NON-NLS-1$
- }
- public ITreeElement[] getChildren() {
- return new ITreeElement[0];
- }
-
- public boolean hasChildren() {
- return false;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11TypesCategoryAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11TypesCategoryAdapter.java
deleted file mode 100644
index 2a85419e2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/basic/W11TypesCategoryAdapter.java
+++ /dev/null
@@ -1,29 +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.adapters.basic;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class W11TypesCategoryAdapter extends W11CategoryAdapter {
- public W11TypesCategoryAdapter(IDescription description, String label, Image image, int groupType) {
- super(description, label,image, Collections.EMPTY_LIST, groupType);
- }
-
- public ITreeElement[] getChildren() {
- List types = ((W11Description) getOwnerDescription()).getTypes();
- return (ITreeElement[]) types.toArray(new ITreeElement[0]);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddBindingCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddBindingCommand.java
deleted file mode 100644
index e35d56051..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddBindingCommand.java
+++ /dev/null
@@ -1,58 +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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBindingCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class W11AddBindingCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private String newName;
- private Binding newBinding;
-
- public W11AddBindingCommand(Definition definition) {
- super(Messages._UI_ACTION_ADD_BINDING, definition);
- }
-
- public void setNewBindingName(String newName) {
- this.newName = newName;
- }
-
- public Binding getNewBinding() {
- return newBinding;
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
- super.execute();
- if (newName == null || newName.equals("")) { //$NON-NLS-1$
- newName = NameUtil.buildUniqueBindingName(definition, "NewBinding"); //$NON-NLS-1$
- }
-
- AddBindingCommand command = new AddBindingCommand(definition, newName);
- command.run();
-
- newBinding = (Binding) command.getWSDLElement();
- formatChild(newBinding.getElement());
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return newBinding;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddEndPointCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddEndPointCommand.java
deleted file mode 100644
index 064e37216..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddEndPointCommand.java
+++ /dev/null
@@ -1,58 +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.adapters.commands;
-
-import java.util.List;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.wizards.PortWizard;
-
-public class W11AddEndPointCommand extends W11TopLevelElementCommand implements IASDAddCommand
-{
- private Service service;
- private Port port;
-
- public W11AddEndPointCommand(Service service) {
- super(Messages._UI_ACTION_ADD, service.getEnclosingDefinition());
- this.service = service;
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
-
- PortWizard wizard = new PortWizard(service);
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.create();
-
- int result = wizardDialog.open();
- if (result == Window.OK && service.getEPorts().size() > 0) {
- List ports = service.getEPorts();
- port = (Port) ports.get(ports.size() - 1);
-
- formatChild(port.getElement());
- }
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return port;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddFaultParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddFaultParameterCommand.java
deleted file mode 100644
index 745ce0b93..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddFaultParameterCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddFaultParameterCommand;
-
-public class W11AddFaultParameterCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- protected Operation operation;
- protected Fault fault;
- protected Object newObject;
- private int parameterPattern = -1;
-
- public W11AddFaultParameterCommand(Operation operation, Fault fault) {
- super(Messages._UI_ACTION_ADD_FAULT, operation.getEnclosingDefinition());
- this.operation = operation;
- this.fault = fault;
- }
-
- public void setParameterPattern(int pattern) {
- parameterPattern = pattern;
- }
-
- public void execute() {
- try {
- beginRecording(operation.getElement());
-
- if (parameterPattern == -1) {
- // Determine which Pattern we should use. For example, ADDBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT
- parameterPattern = AddFaultParameterCommand.getParameterPatternForFault(operation, fault);
- if (parameterPattern == -1) {
- parameterPattern = AddBaseParameterCommand.getParameterPattern(operation);
- }
- }
-
- AddFaultParameterCommand command = new AddFaultParameterCommand(operation, fault);
- command.setStyle(parameterPattern);
- command.run();
- fault = (Fault) command.getMessageReference();
- newObject = command.getNewlyAddedComponentPart();
-
- if (command.getXSDElementDeclaration() != null) {
- // Try to grab the "inner" XSDElement
- newObject = getNewXSDElement(command.getXSDElementDeclaration());
- }
- }
- finally {
- endRecording(operation.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return newObject;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddImportCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddImportCommand.java
deleted file mode 100644
index bda2f8e1a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddImportCommand.java
+++ /dev/null
@@ -1,45 +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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddImportCommand;
-
-public class W11AddImportCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private Object component;
-
- public W11AddImportCommand(Definition definition) {
- super(Messages._UI_ACTION_ADD_IMPORT, definition);
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
-
- super.execute();
- String namespace = ""; //$NON-NLS-1$
- String location = ""; //$NON-NLS-1$
- AddImportCommand command = new AddImportCommand(definition, namespace, location);
- command.run();
- formatChild(command.getWSDLElement().getElement());
- component = command.getWSDLElement();
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return 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/adapters/commands/W11AddInputParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddInputParameterCommand.java
deleted file mode 100644
index 5243c2828..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddInputParameterCommand.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddInputParameterCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class W11AddInputParameterCommand extends W11TopLevelElementCommand implements IASDAddCommand{
- protected Operation operation;
- private Object input;
- private int parameterPattern = -1;
-
- public W11AddInputParameterCommand(Operation operation) {
- super(Messages._UI_ACTION_ADD_INPUT, operation.getEnclosingDefinition());
- this.operation = operation;
- }
-
- public void setParameterPattern(int pattern) {
- parameterPattern = pattern;
- }
-
- public void execute() {
- try {
- beginRecording(operation.getElement());
-
- if (parameterPattern == -1) {
- // Determine which Pattern we should use. For example, ADDBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT
- parameterPattern = AddBaseParameterCommand.getParameterPattern(operation, true);
- if (parameterPattern == -1) {
- parameterPattern = AddBaseParameterCommand.getParameterPattern(operation);
- }
- }
-
- AddInputParameterCommand command = new AddInputParameterCommand(operation, parameterPattern);
- command.run();
- input = command.getNewlyAddedComponentPart();
-
- formatChild(operation.getEInput().getElement());
- if (command.getXSDElementDeclaration() != null) {
- // Try to grab the "inner" XSDElement
- input = getNewXSDElement(command.getXSDElementDeclaration());
- formatChild(getXSDParent(command.getXSDElementDeclaration()).getElement());
- }
- }
- finally {
- endRecording(operation.getElement());
- }
- }
-
- protected XSDConcreteComponent getXSDParent(XSDConcreteComponent xsd) {
- XSDConcreteComponent parent = xsd.getSchema();
- return parent;
- }
-
- public Object getNewlyAddedComponent() {
- return input;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddInterfaceCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddInterfaceCommand.java
deleted file mode 100644
index fcef7d00a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddInterfaceCommand.java
+++ /dev/null
@@ -1,66 +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.adapters.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPortTypeCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-
-public class W11AddInterfaceCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private String newName;
- private PortType newPortType;
-
- public W11AddInterfaceCommand(Definition definition) {
- super(Messages._UI_ACTION_ADD_PORTTYPE, definition);
- }
-
- public void setNewPortTypeName(String newName) {
- this.newName = newName;
- }
-
- public PortType getNewPortType() {
- return newPortType;
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
- super.execute();
- if (newName == null || newName.equals("")) { //$NON-NLS-1$
- newName = NameUtil.buildUniquePortTypeName(definition, "NewPortType"); //$NON-NLS-1$
- }
- // Add the Port Type
- AddPortTypeCommand command = new AddPortTypeCommand(definition, newName, false);
- command.run();
-
- newPortType = (PortType) command.getWSDLElement();
-
- // Add the Operation
- IInterface iInterface = (IInterface) WSDLAdapterFactoryHelper.getInstance().adapt(newPortType);
- Command addOperationCommand = iInterface.getAddOperationCommand();
- addOperationCommand.execute();
- formatChild(newPortType.getElement());
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return newPortType;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddMessageCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddMessageCommand.java
deleted file mode 100644
index 29844e3de..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddMessageCommand.java
+++ /dev/null
@@ -1,57 +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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class W11AddMessageCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private String newName;
- private Message message;
-
- public W11AddMessageCommand(Definition definition) {
- super(Messages._UI_ACTION_ADD_MESSAGE, definition);
- }
-
- public void setNewMessageName(String newName) {
- this.newName = newName;
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
- super.execute();
- if (newName == null || newName.equals("")) { //$NON-NLS-1$
- newName = NameUtil.buildUniqueMessageName(definition, "NewMessage"); //$NON-NLS-1$
- }
-
- AddMessageCommand command = new AddMessageCommand(definition, newName, true);
- command.run();
- message = (Message) command.getWSDLElement();
- formatChild(message.getElement());
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- public Message getNewMessage() {
- return message;
- }
-
- public Object getNewlyAddedComponent() {
- return message;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOperationCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOperationCommand.java
deleted file mode 100644
index 2ae0aabeb..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOperationCommand.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.commands;
-
-import javax.wsdl.OperationType;
-
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddFaultCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddInputCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddInputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageReferenceCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOperationCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOutputCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOutputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class W11AddOperationCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private PortType portType;
- private Operation operation;
-
- public W11AddOperationCommand(PortType portType) {
- super(Messages._UI_ACTION_ADD_OPERATION, portType.getEnclosingDefinition());
- this.portType = portType;
- }
-
- public void execute() {
- try {
- beginRecording(portType.getElement());
-
- String name = NameUtil.getOperationName(portType);
- AddOperationCommand operationCommand = new AddOperationCommand(portType, name);
- operationCommand.run();
- operation = (Operation) operationCommand.getWSDLElement();
-
- createMessage(operation, IMessageReference.KIND_INPUT);
- createMessage(operation, IMessageReference.KIND_OUTPUT);
-
- createParameter(operation, null, IMessageReference.KIND_INPUT);
- createParameter(operation, null, IMessageReference.KIND_OUTPUT);
-
- operation.setStyle(OperationType.REQUEST_RESPONSE);
- formatChild(operation.getElement());
- }
- finally {
- endRecording(portType.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return operation;
- }
-
- private MessageReference createMessage(Operation operation, int messageKind) {
- MessageReference messageRef = null;
- AddMessageReferenceCommand messageRefCommand = null;
- if (messageKind == IMessageReference.KIND_INPUT)
- {
- messageRefCommand = new AddInputCommand(operation, null);
- }
- else if (messageKind == IMessageReference.KIND_OUTPUT)
- {
- messageRefCommand = new AddOutputCommand(operation, null);
- }
- else if (messageKind == IMessageReference.KIND_FAULT)
- {
- messageRefCommand = new AddFaultCommand(operation, NameUtil.getFaultName(operation));
- }
- messageRefCommand.run();
- messageRef = (MessageReference) messageRefCommand.getWSDLElement();
-
-// AddMessageCommand command = new AddMessageCommand(messageRef.getEnclosingDefinition(), NameUtil.getMessageName(messageRef));
-// command.run();
-// messageRef.setEMessage((Message) command.getWSDLElement());
-
- return messageRef;
- }
-
- private void createParameter(Operation operation, Part part, int kind) {
- IParameter parameter = null;
- AddBaseParameterCommand addParameterCommand = null;
-
- if (kind == IMessageReference.KIND_INPUT) {
- int parameterPattern = AddBaseParameterCommand.getParameterPattern(portType, true);
- if (parameterPattern == -1) {
- parameterPattern = AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT;
- }
- addParameterCommand = new AddInputParameterCommand(operation, parameterPattern, true);
- }
- else if (kind == IMessageReference.KIND_OUTPUT) {
- int parameterPattern = AddBaseParameterCommand.getParameterPattern(portType, false);
- if (parameterPattern == -1) {
- parameterPattern = AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT;
- }
- addParameterCommand = new AddOutputParameterCommand(operation, parameterPattern);
- }
-
- if (parameter == null && addParameterCommand != null) {
- addParameterCommand.run();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOutputParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOutputParameterCommand.java
deleted file mode 100644
index 2a8d1e2f1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddOutputParameterCommand.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOutputParameterCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class W11AddOutputParameterCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- protected Operation operation;
- private Object output;
- private int parameterPattern = -1;
-
- public W11AddOutputParameterCommand(Operation operation) {
- super(Messages._UI_ACTION_ADD_OUTPUT, operation.getEnclosingDefinition());
- this.operation = operation;
- }
-
- public void setParameterPattern(int pattern) {
- parameterPattern = pattern;
- }
-
- public void execute() {
- try {
- beginRecording(operation.getElement());
-
- if (parameterPattern == -1) {
- // Determine which Pattern we should use. For example, ADDBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT
- parameterPattern = AddBaseParameterCommand.getParameterPattern(operation, false);
- if (parameterPattern == -1) {
- parameterPattern = AddBaseParameterCommand.getParameterPattern(operation);
- }
- }
-
- AddOutputParameterCommand command = new AddOutputParameterCommand(operation, parameterPattern);
- command.run();
- output = command.getNewlyAddedComponentPart();
-
- formatChild(operation.getEOutput().getElement());
- if (command.getXSDElementDeclaration() != null) {
- // Try to grab the "inner" XSDElement
- output = getNewXSDElement(command.getXSDElementDeclaration());
- formatChild(getXSDParent(command.getXSDElementDeclaration()).getElement());
- }
- }
- finally {
- endRecording(operation.getElement());
- }
- }
-
- protected XSDConcreteComponent getXSDParent(XSDConcreteComponent xsd) {
- XSDConcreteComponent parent = xsd;
-
- for (int index = 0; index < 4; index++) {
- XSDConcreteComponent previous = parent;
- parent = parent.getContainer();
- if (parent == null) {
- parent = previous;
- break;
- }
- }
-
- return parent;
- }
-
- public Object getNewlyAddedComponent() {
- return output;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddPartCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddPartCommand.java
deleted file mode 100644
index 6504cfcab..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddPartCommand.java
+++ /dev/null
@@ -1,46 +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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPartCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class W11AddPartCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private Message message;
- private Part part;
-
- public W11AddPartCommand(Message message) {
- super(Messages._UI_ACTION_ADD_PART, message.getEnclosingDefinition());
- this.message = message;
- }
-
- public void execute() {
- try {
- beginRecording(message.getElement());
-
- AddPartCommand command = new AddPartCommand(message, NameUtil.buildUniquePartName(message, "NewPart")); //$NON-NLS-1$
- command.run();
- part = (Part) command.getWSDLElement();
- formatChild(part.getElement());
- }
- finally {
- endRecording(message.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return part;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddSchemaCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddSchemaCommand.java
deleted file mode 100644
index 272633862..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddSchemaCommand.java
+++ /dev/null
@@ -1,69 +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.adapters.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDSchemaCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class W11AddSchemaCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private Object schema;
-
- public W11AddSchemaCommand(Definition definition) {
- super(Messages._UI_ACTION_ADD_SCHEMA, definition);
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
- super.execute();
-
- String tns = definition.getTargetNamespace();
- List existingNamespaces = new ArrayList();
- Types types = definition.getETypes();
-
- if (types != null) {
- Iterator eeIt = types.getEExtensibilityElements().iterator();
- while (eeIt.hasNext()) {
- Object item = eeIt.next();
- if (item instanceof XSDSchemaExtensibilityElement) {
- XSDSchemaExtensibilityElement eeElement = (XSDSchemaExtensibilityElement) item;
- if (eeElement.getSchema() != null) {
- String ns = eeElement.getSchema().getTargetNamespace();
- existingNamespaces.add(ns);
- }
- }
- }
- }
- tns = NameUtil.getUniqueNameHelper(tns, existingNamespaces);
-
- AddXSDSchemaCommand command = new AddXSDSchemaCommand(definition, tns);
- command.run();
- formatChild(command.getWSDLElement().getElement());
- schema = command.getWSDLElement();
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return schema;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddServiceCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddServiceCommand.java
deleted file mode 100644
index 71ce32761..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11AddServiceCommand.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.commands;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.internal.generator.BindingGenerator;
-import org.eclipse.wst.wsdl.internal.generator.ContentGenerator;
-import org.eclipse.wst.wsdl.internal.generator.PortGenerator;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.IASDAddCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddServiceCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.ServicePolicyHelper;
-
-public class W11AddServiceCommand extends W11TopLevelElementCommand implements IASDAddCommand {
- private Service service;
-
- public W11AddServiceCommand(Definition definition) {
- super(Messages._UI_ACTION_ADD_SERVICE, definition);
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
- super.execute();
- String newName = NameUtil.buildUniqueServiceName(definition);
- AddServiceCommand command = new AddServiceCommand(definition, newName, false);
- command.run();
- service = (Service) command.getWSDLElement();
-
- PortGenerator portGenerator = new PortGenerator(service);
-
- // set the default content generator
- ContentGenerator contentGenerator = null;
- IProject project = getProject(definition);
- String protocol = ServicePolicyHelper.getDefaultBinding(project);
- if (protocol != null) {
- ContentGeneratorUIExtensionRegistry registry = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry();
- ContentGeneratorUIExtension ext = registry.getExtensionForNamespace(protocol);
- if (ext != null) {
- contentGenerator = BindingGenerator.getContentGenerator(ext.getNamespace());
- }
- }
- // unable to determine default content generator, try again
- if (contentGenerator == null) {
- // Get the first available content generator
- List protocols = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry().getBindingExtensionNames();
- if (protocols.size() >= 1) {
- protocol = (String)protocols.get(0);
- ContentGeneratorUIExtension ext = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry().getExtensionForName(protocol);
- if (ext != null) {
- contentGenerator = BindingGenerator.getContentGenerator(ext.getNamespace());
- }
- }
- }
- portGenerator.setContentGenerator(contentGenerator);
- portGenerator.setName(NameUtil.buildUniquePortName(service, "NewPort")); //$NON-NLS-1$
- // go ahead and add required namespaces first before generating port
- CreateWSDLElementHelper.addRequiredNamespaces(contentGenerator, definition);
- portGenerator.generatePort();
-
- formatChild(service.getElement());
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- public Object getNewlyAddedComponent() {
- return service;
- }
-
- private IProject getProject(Definition definition) {
- IProject project = null;
-
- String location = definition.getLocation();
- URL url = null;
- try {
- url = new URL(location);
- }
- catch (MalformedURLException e) {
- e.printStackTrace();
- }
- if (url != null) {
- URL fileURL = null;
- try {
- fileURL = FileLocator.toFileURL(url);
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- if (fileURL != null) {
- IPath path = new Path(fileURL.getPath());
- IFile files[] = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(path);
- IFile file = null;
- if (files.length > 0) {
- // just get the first file
- file = files[0];
- }
- project = file.getProject();
- }
- }
- return project;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteCommand.java
deleted file mode 100644
index be923c844..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteCommand.java
+++ /dev/null
@@ -1,124 +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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Binding;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11EndPoint;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Interface;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Operation;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Service;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IImport;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessage;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public class W11DeleteCommand extends W11TopLevelElementCommand {
- protected WSDLBaseAdapter object;
-
- public W11DeleteCommand(WSDLBaseAdapter object) {
- super(Messages._UI_ACTION_DELETE, null);
- this.object = object;
- }
-
- public void execute() {
- Element element = null;
- if (object.getTarget() instanceof WSDLElement) {
- element = ((WSDLElement) object.getTarget()).getElement();
- }
- else if (object.getTarget() instanceof XSDConcreteComponent) {
- element = ((XSDConcreteComponent) object.getTarget()).getElement();
- }
-
- try {
- beginRecording(element);
-
- if (object instanceof W11Service) {
- Service service = (Service) object.getTarget();
- service.getEnclosingDefinition().getEServices().remove(service);
- }
- else if (object instanceof W11EndPoint) {
- Service service = (Service) ((W11Service) ((W11EndPoint) object).getOwnerService()).getTarget();
- Port port = (Port) object.getTarget();
- service.getEPorts().remove(port);
- }
- else if (object instanceof W11Binding) {
- Binding binding = (Binding) object.getTarget();
- binding.getEnclosingDefinition().getEBindings().remove(binding);
- }
- else if (object instanceof W11Interface) {
- PortType portType = (PortType) object.getTarget();
- portType.getEnclosingDefinition().getEPortTypes().remove(portType);
- }
- else if (object instanceof W11Operation) {
- PortType portType = (PortType) ((W11Interface) ((W11Operation) object).getOwnerInterface()).getTarget();
- Operation operation = (Operation) object.getTarget();
- portType.getEOperations().remove(operation);
- }
- else if (object instanceof IParameter) {
- Part part = (Part) object.getTarget();
- Message message = (Message) part.eContainer();
- message.getEParts().remove(part);
- }
- else if (object instanceof IImport) {
- Import theImport = (Import) object.getTarget();
- theImport.getEnclosingDefinition().getEImports().remove(theImport);
- }
- else if (object instanceof W11Type) {
- W11Type w11Type = (W11Type) object;
- XSDSchema schema = (XSDSchema) w11Type.getTarget();
- XSDSchemaExtensibilityElement eeElement = (XSDSchemaExtensibilityElement) schema.eContainer();
- Types type = (Types) eeElement.getContainer();
- type.getEExtensibilityElements().remove(eeElement);
- }
- else if (object instanceof IMessageReference) {
- MessageReference messageRef = (MessageReference) object.getTarget();
- Operation operation = (Operation)messageRef.eContainer();
- if (messageRef instanceof Input) {
- operation.setEInput(null);
- }
- else if (messageRef instanceof Output) {
- operation.setEOutput(null);
- }
- else if (messageRef instanceof Fault) {
- operation.getEFaults().remove(messageRef);
- }
- }
- else if (object instanceof IMessage) {
- Message message = (Message) object.getTarget();
- message.getEnclosingDefinition().getEMessages().remove(message);
- }
- }
- finally {
- endRecording(element);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteParameterCommand.java
deleted file mode 100644
index 90125c529..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11DeleteParameterCommand.java
+++ /dev/null
@@ -1,113 +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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11MessageReference;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-
-public class W11DeleteParameterCommand extends W11TopLevelElementCommand {
- private IParameter parameter;
-
- public W11DeleteParameterCommand(IParameter param) {
- super(Messages._UI_ACTION_DELETE, null);
- this.parameter = param;
- }
-
- public void execute() {
- Object object = ((WSDLBaseAdapter) parameter).getTarget();
- Element element = null;
- if (object instanceof XSDElementDeclaration) {
- element = ((XSDElementDeclaration) object).getElement();
- }
- else if (object instanceof WSDLElement) {
- element = ((Part) object).getElement();
- }
-
- if (element != null) {
- try {
- beginRecording(element);
- delete();
- }
- finally {
- endRecording(element);
- }
- }
- }
-
- private void delete() {
- Object object = ((WSDLBaseAdapter) parameter).getTarget();
-
- if (object instanceof XSDElementDeclaration) {
- XSDConcreteComponent xsdComponent = ((XSDElementDeclaration) object).getContainer();
-
- if (xsdComponent instanceof XSDParticle) {
- XSDParticle particle = (XSDParticle) xsdComponent;
- if (particle.getContainer() instanceof XSDModelGroup) {
- XSDModelGroup modelGroup = (XSDModelGroup) particle.getContainer();
- if (modelGroup.getContents().size() >= 2) {
- modelGroup.getContents().remove(particle);
- }
- else {
- modelGroup.getContents().remove(particle);
- // TODO: We need the line below to delete the Message and Part
-// removeMessageAndPart(wParameter.getPart());
- // TODO: Remove the XSD components as well.....
- }
- }
- }
- else if (xsdComponent instanceof XSDSchema){
- // TODO: We need the line below to delete the Message and Part
-// removeMessageAndPart(wParameter.getPart()); // Delete the part as well
- XSDSchema xsdSchema = (XSDSchema) xsdComponent;
- xsdSchema.getContents().remove(object);
- }
- }
- else if (object instanceof Part) {
- removeMessageAndPart((Part) object);
- }
- else if (object instanceof Message) {
- removeMessageAndPart((Part) ((Message) object).getEParts().get(0));
- }
-
- // Do we want to remove the Input/Output/Fault MessageReference as well if
- // there are no more "inputs"?....
- }
-
- protected void removeMessageAndPart(Part part) {
- W11MessageReference wMessage = null;
- /*
- if (parameter instanceof W11ParameterForElement) {
- wMessage = (W11MessageReference) ((W11ParameterForElement) parameter).getOwner();
- }
- else */if (parameter instanceof W11ParameterForPart) {
- wMessage = (W11MessageReference) ((W11ParameterForPart) parameter).getOwner();
- }
-
- Message message = wMessage.getMessageReference().getEMessage();
- message.getEParts().remove(part);
-
- ((Definition) part.getEnclosingDefinition()).getEMessages().remove(message);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11EditNamespacesCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11EditNamespacesCommand.java
deleted file mode 100644
index 533a1e631..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11EditNamespacesCommand.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.w3c.dom.Element;
-
-public class W11EditNamespacesCommand extends W11TopLevelElementCommand {
- private List namespacesInfoList;
- private String targetNamespace;
- private String targetNamespacePrefix;
-
- public W11EditNamespacesCommand(Definition definition) {
- super(Messages._UI_EDIT_NAMESPACES, definition);
- }
-
- public void setNamespacesInfo(List namespaces) {
- namespacesInfoList = namespaces;
- }
-
- public void setTargetNamespace(String tns) {
- targetNamespace = tns;
- }
-
- public void setTargetNamespacePrefix(String prefix) {
- targetNamespacePrefix = prefix;
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
- super.execute();
- if (targetNamespacePrefix != null) {
- Element element = definition.getElement();
-
- // Remove the old prefix
- String oldPrefix = definition.getPrefix(definition.getTargetNamespace());
- element.removeAttribute("xmlns:"+oldPrefix); //$NON-NLS-1$
-
- // Set the new prefix
- element.setAttribute("xmlns:" + targetNamespacePrefix, definition.getTargetNamespace()); //$NON-NLS-1$
- }
- if (targetNamespace != null) {
- String newValue = targetNamespace;
- String prefix = definition.getPrefix(definition.getTargetNamespace());
- definition.setTargetNamespace(newValue);
- definition.getElement().setAttribute("xmlns:" + prefix, newValue); //$NON-NLS-1$
- }
-
- if (namespacesInfoList != null) {
- DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
-
- /*
- List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
-// List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
- // here we store a copy of the old info for each NamespaceInfo
- // this info will be used in createPrefixMapping() to figure out how to update the document
- // in response to these changes
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();)
- {
- NamespaceInfo info = (NamespaceInfo) i.next();
- NamespaceInfo oldCopy = new NamespaceInfo(info);
- info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
- }
- */
-
- namespaceInfoManager.removeNamespaceInfo(definition.getElement());
- namespaceInfoManager.addNamespaceInfo(definition.getElement(), namespacesInfoList, false);
-
- /*
- // see if we need to rename any prefixes
- Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
- if (prefixMapping.size() > 0)
- {
- //manager.getModel().aboutToChangeModel();
- ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(element, prefixMapping);
- replacePrefixAction.run();
- //manager.getModel().changedModel();
- }
- */
- }
-
- /*
- // Could not modify (more specifically remove) namespaces via model.....
- // should revisit this
- if (targetNamespace != null || targetNamespacePrefix != null) {
- Map map = definition.getNamespaces();
- String oldTargetNamespace = definition.getTargetNamespace();
- String oldPrefix = null;
-
- Iterator it = map.keySet().iterator();
- while (it.hasNext()) {
- String key = (String) it.next();
- Object value = map.get(key);
- if (value != null && oldTargetNamespace != null && value.equals(oldTargetNamespace)) {
- oldPrefix = key;
- break;
- }
- }
-
- if (oldPrefix != null && !oldPrefix.equals(targetNamespacePrefix)) {
- map.remove(oldPrefix);
- definition.updateElement();
- }
-
- String tns = "";
- String prefix = "";
- if (targetNamespace != null) {
- tns = targetNamespace;
- }
- if (targetNamespacePrefix != null) {
- prefix = targetNamespacePrefix;
- }
- definition.addNamespace(prefix, tns);
- definition.setTargetNamespace(tns);
-// map.put(prefix, tns);
- }
- */
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- /*
- protected Map createPrefixMapping(List oldList, List newList)
- {
- Map map = new Hashtable();
-
- Hashtable oldURIToPrefixTable = new Hashtable();
- for (Iterator i = oldList.iterator(); i.hasNext();)
- {
- NamespaceInfo oldInfo = (NamespaceInfo) i.next();
- oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
- }
-
- for (Iterator i = newList.iterator(); i.hasNext();)
- {
- NamespaceInfo newInfo = (NamespaceInfo) i.next();
- NamespaceInfo oldInfo = (NamespaceInfo) oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); //$NON-NLS-1$
-
- // if oldInfo is non null ... there's a matching URI in the old set
- // we can use its prefix to detemine out mapping
- //
- // if oldInfo is null ... we use the 'oldCopy' we stashed away
- // assuming that the user changed the URI and the prefix
- if (oldInfo == null)
- {
- oldInfo = (NamespaceInfo) newInfo.getProperty("oldCopy"); //$NON-NLS-1$
- }
-
- if (oldInfo != null)
- {
- String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
- String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
- if (!oldPrefix.equals(newPrefix))
- {
- map.put(oldPrefix, newPrefix);
- }
- }
- }
- return map;
- }
- */
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11GenerateBindingCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11GenerateBindingCommand.java
deleted file mode 100644
index f7211fca9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11GenerateBindingCommand.java
+++ /dev/null
@@ -1,46 +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.adapters.commands;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.wizards.BindingWizard;
-
-public class W11GenerateBindingCommand extends W11TopLevelElementCommand {
- protected Binding binding;
-
- public W11GenerateBindingCommand(Binding binding) {
- super(Messages._UI_GENERATE_BINDING_CONTENT, binding.getEnclosingDefinition());
- this.binding = binding;
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
-
- BindingWizard wizard = new BindingWizard(binding.getEnclosingDefinition(), binding, BindingWizard.KIND_REGENERATE_BINDING);
- wizard.setBindingName(ComponentReferenceUtil.getName(binding));
- wizard.setPortTypeName(ComponentReferenceUtil.getPortTypeReference(binding));
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.create();
- if (wizardDialog.open() == Window.OK) {
- formatChild(binding.getElement());
- }
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11RenameCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11RenameCommand.java
deleted file mode 100644
index 9b59ca69d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11RenameCommand.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.commands;
-
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Binding;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11BindingMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11BindingOperation;
-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.adapters.basic.W11Interface;
-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.adapters.basic.W11Operation;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Service;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.visitor.BindingRenamer;
-import org.eclipse.wst.wsdl.ui.internal.visitor.MessageRenamer;
-import org.eclipse.wst.wsdl.ui.internal.visitor.PortTypeRenamer;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.ui.internal.refactor.PerformUnsavedRefactoringOperation;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
-import org.w3c.dom.Element;
-
-public class W11RenameCommand extends W11TopLevelElementCommand {
- protected WSDLBaseAdapter object;
- protected String newName = ""; //$NON-NLS-1$
-
- public W11RenameCommand(WSDLBaseAdapter object, String newName) {
- super(Messages._UI_ACTION_RENAME, (object.getTarget() instanceof WSDLElement) ? ((WSDLElement) object.getTarget()).getEnclosingDefinition() : null);
- this.object = object;
- this.newName = newName;
- }
-
- public void execute() {
- try {
- beginRecording(definition.getElement());
- String origName = null;
-
- if (object instanceof W11Description) {
- Definition definition = (Definition) object.getTarget();
- W11TopLevelElementCommand.ensureDefinition(definition);
- String ns = definition.getQName().getNamespaceURI();
- definition.setQName(new QName(ns, newName));
- }
- else if (object instanceof W11Service) {
- Service service = (Service) object.getTarget();
- String ns = service.getQName().getNamespaceURI();
- service.setQName(new QName(ns, newName));
- }
- else if (object instanceof W11EndPoint) {
- Port port = (Port) object.getTarget();
- port.setName(newName);
- }
- else if (object instanceof W11Binding) {
- Binding binding = (Binding) object.getTarget();
- origName = binding.getQName().getLocalPart();
- }
- else if (object instanceof W11Interface) {
- PortType portType = (PortType) object.getTarget();
- origName = portType.getQName().getLocalPart();
- }
- else if (object instanceof W11Operation) {
- Operation operation = (Operation) object.getTarget();
- SmartRenameAction action = new SmartRenameAction(operation, newName);
- renameOperationHelper(operation);
- action.run();
- }
- else if (object instanceof W11MessageReference) {
- WSDLElement element = (WSDLElement) ((W11MessageReference) object).getTarget();
- renameIOFHelper(element);
- }
- else if (object instanceof W11Message) {
- Message message = (Message) ((W11Message) object).getTarget();
-// Iterator parts = message.getEParts().iterator();
- origName = message.getQName().getLocalPart();
-
- SmartRenameAction action = new SmartRenameAction(message, newName);
- action.run(false);
-// while (parts.hasNext()) {
-// SmartRenameAction action = new SmartRenameAction(parts.next(), newName);
-// action.run();
-// }
- }
- else if (object instanceof W11ParameterForPart) {
- Part part = (Part) ((W11ParameterForPart) object).getTarget();
- SmartRenameAction action = new SmartRenameAction(part, newName);
- action.run();
- }
- else if (object instanceof W11BindingOperation) {
- BindingOperation bindingOperation = (BindingOperation) ((W11BindingOperation) object).getTarget();
- bindingOperation.setName(newName);
- bindingOperation.getEOperation().setName(newName);
- // TODO: We should go off and rename the associated PortType Operation
- }
- else if (object instanceof W11BindingMessageReference) {
- Object bindingMessageRef = ((W11BindingMessageReference) object).getTarget();
- if (bindingMessageRef instanceof BindingInput) {
- ((BindingInput) bindingMessageRef).setName(newName);
- ((BindingInput) bindingMessageRef).getEInput().setName(newName);
- // TODO: We should go off and rename the associated Porttype MessageReference
- }
- else if (bindingMessageRef instanceof BindingOutput) {
- ((BindingOutput) bindingMessageRef).setName(newName);
- ((BindingOutput) bindingMessageRef).getEOutput().setName(newName);
- // TODO: We should go off and rename the associated Porttype Output
- }
- else if (bindingMessageRef instanceof BindingFault) {
- ((BindingFault) bindingMessageRef).setName(newName);
- ((BindingFault) bindingMessageRef).getEFault().setName(newName);
- // TODO: We should go off and rename the associated Porttype Fault
- }
- }
-
- Object target = object.getTarget();
- if (target instanceof WSDLElement && origName != null) {
- WSDLElement component = (WSDLElement) target;
- String namespace = component.getEnclosingDefinition().getTargetNamespace();
-
- RefactoringComponent refactoringComponent = new XMLRefactoringComponent(
- component,
- (IDOMElement)component.getElement(),
- origName,
- namespace);
-
- RenameComponentProcessor processor = new RenameComponentProcessor(refactoringComponent, newName, true);
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- PerformUnsavedRefactoringOperation refactorOperation = new PerformUnsavedRefactoringOperation(refactoring);
- refactorOperation.run(null);
-
- // rmah : due to the ordering in which refactoring is called
- // (i.e. the reference changes before the declaration changes)
- // our model references may be messed up at this point.
- // The line of code below gets the model to fix up its references.
- ((DefinitionImpl) component.getEnclosingDefinition()).reconcileReferences(true);
- }
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- // TODO: We should look at using the refactor mechanism to do this renaming....
- private void renameOperationHelper(Operation operation) {
- Definition definition = operation.getEnclosingDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
- Iterator it = util.getBindingOperations(operation).iterator();
-
- while (it.hasNext()) {
- BindingOperation bindingOperation = (BindingOperation) it.next();
- Element element = WSDLEditorUtil.getInstance().getElementForObject(bindingOperation);
- if (element != null)
- {
- element.setAttribute("name", newName); //$NON-NLS-1$
- }
- // TODO: We should go through the model to rename.... Not the Element...
- // bindingOperation.setName(newName);
- }
- }
-
- // TODO: We should look at using the refactor mechanism to do this renaming....
- private void renameIOFHelper(WSDLElement object)
- {
- Definition definition = object.getEnclosingDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
- List list = null;
-
- if (object instanceof Input)
- {
- list = util.getBindingInputs((Input)object);
- }
- else if (object instanceof Output)
- {
- list = util.getBindingOutputs((Output)object);
- }
- else // fault
- {
- list = util.getBindingFaults((Fault)object);
- }
-
- if (list != null)
- {
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object bindingObject = i.next();
- renameModelObjectHelper(bindingObject, newName);
- }
- }
-
- renameModelObjectHelper(object, newName);
- }
-
- // TODO: We should look at using the refactor mechanism to do this renaming....
- private void renameModelObjectHelper(Object modelObject, String theNewName)
- {
- // TODO: We should go through the model to rename.... Not the Element...
- Element element = WSDLEditorUtil.getInstance().getElementForObject(modelObject);
- if (element != null)
- {
- element.setAttribute("name", theNewName); //$NON-NLS-1$
- }
-
- if (modelObject instanceof Message)
- {
- MessageRenamer renamer = new MessageRenamer((Message)modelObject, theNewName);
- renamer.visitBindings();
- }
- else if (modelObject instanceof PortType)
- {
- PortTypeRenamer renamer = new PortTypeRenamer((PortType)modelObject, theNewName);
- renamer.visitBindings();
- }
- else if (modelObject instanceof Binding)
- {
- BindingRenamer renamer = new BindingRenamer((Binding)modelObject, theNewName);
- renamer.visitServices();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderMessageReferencesCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderMessageReferencesCommand.java
deleted file mode 100644
index 5ce820e81..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderMessageReferencesCommand.java
+++ /dev/null
@@ -1,122 +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.adapters.commands;
-
-import javax.wsdl.OperationType;
-
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Operation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-
-public class W11ReorderMessageReferencesCommand extends W11TopLevelElementCommand {
- protected IMessageReference leftSibling;
- protected IMessageReference rightSibling;
- protected IMessageReference movingParameter;
-
- public W11ReorderMessageReferencesCommand(IMessageReference leftSibling, IMessageReference rightSibling, IMessageReference movingParameter) {
- super(Messages._UI_ACTION_REORDER_MESSAGE_REFERENCE, null);
- this.leftSibling = leftSibling;
- this.rightSibling = rightSibling;
- this.movingParameter = movingParameter;
- }
-
- public void execute() {
- IMessageReference leftSibElement = null;
- IMessageReference movingChild = null;
-
- if (leftSibling instanceof IMessageReference) {
- leftSibElement = (IMessageReference) leftSibling;
- }
- if (movingParameter instanceof IMessageReference) {
- movingChild = (IMessageReference) movingParameter;
- }
-
- W11Operation w11Operation = (W11Operation) movingChild.getOwnerOperation();
- Operation operation = (Operation) w11Operation.getTarget();
-
- try {
- beginRecording(operation.getElement());
-
- if (movingChild.getKind() == IMessageReference.KIND_INPUT) {
- if (leftSibElement == null) {
- // Input/Output style
- setInputOutputOrder(operation, true);
- }
- else if (leftSibElement != null && leftSibElement.getKind() == IMessageReference.KIND_INPUT) {
- if (rightSibling.getKind() == IMessageReference.KIND_OUTPUT) {
- // Input/Output style
- setInputOutputOrder(operation, true);
- }
- }
- else {
- // Output/Input style
- setInputOutputOrder(operation, false);
- }
- }
- else if (movingChild.getKind() == IMessageReference.KIND_OUTPUT) {
- if (leftSibElement == null) {
- // Output/Input style
- setInputOutputOrder(operation, false);
- }
- else if (leftSibElement != null && leftSibElement.getKind() == IMessageReference.KIND_OUTPUT) {
- if (rightSibling.getKind() == IMessageReference.KIND_INPUT) {
- // Output/Input style
- setInputOutputOrder(operation, false);
- }
- }
- else {
- // Input/Output style
- setInputOutputOrder(operation, true);
- }
- }
- }
- finally {
- endRecording(operation.getElement());
- }
- }
-
- // boolean inputFirst = true if the Input is the first in the order of Input and Output
- private void setInputOutputOrder(Operation operation, boolean inputFirst) {
- // We need to determine more info before we can set the style
- if (inputFirst && operation.getEInput() != null) {
- // Check if there is an Output
- if (operation.getEOutput() != null) {
- // Order is: Input, Output
- setOperationStyle(operation, OperationType.REQUEST_RESPONSE);
- }
- else {
- // Order is: Input
- setOperationStyle(operation, OperationType.ONE_WAY);
- }
- }
- else if (operation.getEOutput() != null) {
- // Check if there is an Input
- if (operation.getEInput() != null) {
- // Order is: Output, Input
- setOperationStyle(operation, OperationType.SOLICIT_RESPONSE);
- }
- else {
- // Order is: Output
- setOperationStyle(operation, OperationType.NOTIFICATION);
- }
- }
- }
-
- private void setOperationStyle(Operation operation, OperationType operationType) {
- // If there is no style to begin with, don't set one now
- if (operation.getStyle() == null) {
- return;
- }
-
- operation.setStyle(operationType);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderParametersCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderParametersCommand.java
deleted file mode 100644
index 3075e8249..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11ReorderParametersCommand.java
+++ /dev/null
@@ -1,171 +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.adapters.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForAttribute;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForElement;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-
-public class W11ReorderParametersCommand extends W11TopLevelElementCommand {
- protected IParameter leftSibling;
- protected IParameter rightSibling;
- protected IParameter movingParameter;
-
- public W11ReorderParametersCommand(IParameter leftSibling, IParameter rightSibling, IParameter movingParameter) {
- super(Messages._UI_ACTION_REORDER_PART, null);
- this.leftSibling = leftSibling;
- this.rightSibling = rightSibling;
- this.movingParameter = movingParameter;
- }
-
- public void execute() {
- if (leftSibling instanceof W11ParameterForPart ||
- rightSibling instanceof W11ParameterForPart ||
- movingParameter instanceof W11ParameterForPart) {
- executeForPart();
- }
- else if (leftSibling instanceof W11ParameterForElement ||
- rightSibling instanceof W11ParameterForElement ||
- movingParameter instanceof W11ParameterForElement) {
- executeForElement();
- }
- else if (leftSibling instanceof W11ParameterForAttribute ||
- rightSibling instanceof W11ParameterForAttribute ||
- movingParameter instanceof W11ParameterForAttribute) {
-// executeForElement();
- }
- }
-
- private void executeForElement() {
- XSDElementDeclaration leftSibElement = null;
- XSDElementDeclaration rightSibElement = null;
- XSDElementDeclaration movingChild = null;
-
- XSDParticle movingParticle = null;
- XSDParticle leftParticle = null;
- XSDParticle rightParticle = null;
-
- if (leftSibling instanceof W11ParameterForElement) {
- leftSibElement = (XSDElementDeclaration) ((W11ParameterForElement) leftSibling).getTarget();
- leftParticle = (XSDParticle) leftSibElement.eContainer();
- }
- if (rightSibling instanceof W11ParameterForElement) {
- rightSibElement = (XSDElementDeclaration) ((W11ParameterForElement) rightSibling).getTarget();
- rightParticle = (XSDParticle) rightSibElement.eContainer();
- }
- if (movingParameter instanceof W11ParameterForElement) {
- movingChild = (XSDElementDeclaration) ((W11ParameterForElement) movingParameter).getTarget();
- movingParticle = (XSDParticle) movingChild.eContainer();
- }
-
- if (movingChild.equals(leftSibElement) || movingChild.equals(rightSibElement)) {
- return;
- }
-
- if (movingChild != null) {
- try {
- beginRecording(movingParticle.getElement());
-
- XSDModelGroup container = (XSDModelGroup) movingParticle.getContainer();
- List particles = container.getContents();
-
- particles.remove(movingParticle);
-
- int leftIndex = -1, rightIndex = -1;
- if (leftParticle != null) {
- leftIndex = particles.indexOf(leftParticle);
- }
- if (rightParticle!= null) {
- rightIndex = particles.indexOf(rightParticle);
- }
-
- if (leftIndex == -1) {
- // Add moving child to the front
- particles.add(0, movingParticle);
- }
- else if (rightIndex == -1) {
- // Add moving child to the end
- particles.add(movingParticle);
- }
- else {
- // Add moving child after the occurence of the left sibling
- particles.add(leftIndex + 1, movingParticle);
- }
- }
- finally {
- endRecording(movingParticle.getElement());
- }
- }
- }
-
- private void executeForPart() {
- Part leftSibElement = null;
- Part rightSibElement = null;
- Part movingChild = null;
-
- if (leftSibling instanceof W11ParameterForPart) {
- leftSibElement = (Part) ((W11ParameterForPart) leftSibling).getTarget();
- }
- if (rightSibling instanceof W11ParameterForPart) {
- rightSibElement = (Part) ((W11ParameterForPart) rightSibling).getTarget();
- }
- if (movingParameter instanceof W11ParameterForPart) {
- movingChild = (Part) ((W11ParameterForPart) movingParameter).getTarget();
- }
-
- if (movingChild.equals(leftSibElement) || movingChild.equals(rightSibElement)) {
- return;
- }
-
- if (movingChild != null) {
- try {
- beginRecording(movingChild.getElement());
- Message message = (Message) movingChild.eContainer();
- List parts = message.getEParts();
-
- parts.remove(movingChild);
-
- int leftIndex = -1, rightIndex = -1;
- if (leftSibElement != null) {
- leftIndex = parts.indexOf(leftSibElement);
- }
- if (rightSibElement != null) {
- rightIndex = parts.indexOf(rightSibElement);
- }
-
- if (leftIndex == -1) {
- // Add moving child to the front
- parts.add(0, movingChild);
- }
- else if (rightIndex == -1) {
- // Add moving child to the end
- parts.add(movingChild);
- }
- else {
- // Add moving child after the occurence of the left sibling
- parts.add(leftIndex + 1, movingChild);
- }
- }
- finally {
- endRecording(movingChild.getElement());
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetAddressCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetAddressCommand.java
deleted file mode 100644
index a883f1ce9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetAddressCommand.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.specialized.W11AddressExtensibilityElementAdapter;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class W11SetAddressCommand extends W11TopLevelElementCommand {
- private Port port;
- private String newAddress;
-
- public W11SetAddressCommand(Port port, String newAddress) {
- super(Messages._UI_ACTION_EDIT_PORT_ADDRESS, port.getEnclosingDefinition());
- this.port = port;
- this.newAddress = newAddress;
- }
-
- public void execute() {
- try {
- beginRecording(port.getElement());
-
- // Should the actual set address code live in it's 'own separate' command??
- if (!setAddress()) {
- createNewExtensibilityElement();
- setAddress();
- }
- }
- finally {
- endRecording(port.getElement());
- }
- }
-
- private boolean setAddress() {
- boolean success = false;
-
- if (port.getEExtensibilityElements().size() > 0) {
- Iterator eeIt = port.getEExtensibilityElements().iterator();
- while (eeIt.hasNext()) {
- Notifier notifier = (Notifier)eeIt.next();
- Adapter adapter = WSDLAdapterFactoryHelper.getInstance().adapt(notifier);
- if (adapter instanceof W11AddressExtensibilityElementAdapter) {
- ((W11AddressExtensibilityElementAdapter)adapter).setLocationURI(newAddress);
- success = true;
- }
- }
- }
-
- return success;
- }
-
- /*
- * TODO: rmah: We need to clean the code below.....
- * Things should be wrapped up and placed in a common location. Currently, this is
- * from the AddEEMenuActionContriubor.java class
- */
- private void createNewExtensibilityElement() {
- List modelQueryActionList = new ArrayList();
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(port.getElement().getOwnerDocument());
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration(port.getElement());
-
- if (ed != null)
- {
- // add insert child node actions
- //
- int ic = ModelQuery.INCLUDE_CHILD_NODES;
- int vc = ModelQuery.VALIDITY_STRICT;
-
- modelQuery.getInsertActions(port.getElement(), ed, -1, ic, vc, modelQueryActionList);
- }
-
- createNewExtensibilityElementHelper1(modelQueryActionList);
- }
-
- private void createNewExtensibilityElementHelper1(List modelQueryActionList)
- {
- for (Iterator i = modelQueryActionList.iterator(); i.hasNext(); )
- {
- ModelQueryAction action = (ModelQueryAction)i.next();
- CMNode cmnode = action.getCMNode();
- if (cmnode != null)
- {
- boolean isOtherNamespace = false;
- CMDocument cmDocument = (CMDocument)cmnode.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- isOtherNamespace = namespaceURI != null && !namespaceURI.equals(WSDLConstants.WSDL_NAMESPACE_URI);
- }
-
- if (isOtherNamespace)
- {
- int cmNodeType = cmnode.getNodeType();
- if (action.getKind() == ModelQueryAction.INSERT)
- {
- switch (cmNodeType)
- {
- case CMNode.ELEMENT_DECLARATION :
- {
- createNewExtensibilityElementHelper2((CMElementDeclaration)cmnode, action.getParent(), action.getStartIndex());
- return;
- }
- }
- }
- }
- }
- }
- }
-
- public void createNewExtensibilityElementHelper2(CMNode cmnode, Node parent, int index)
- {
- if (cmnode != null && parent != null)
- {
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document)parent : parent.getOwnerDocument();
-
- DOMContentBuilder builder = new DOMContentBuilderImpl(document);
- builder.setProperty(DOMContentBuilder.PROPERTY_BUILD_BLANK_TEXT_NODES, Boolean.TRUE);
- builder.setBuildPolicy(DOMContentBuilder.BUILD_ONLY_REQUIRED_CONTENT);
- builder.build(parent, cmnode);
- insertNodesAtIndex(parent, builder.getResult(), index, true);
- }
- }
-
- public void insertNodesAtIndex(Node parent, List list, int index, boolean format)
- {
- NodeList nodeList = parent.getChildNodes();
- if (index == -1)
- {
- index = nodeList.getLength();
- }
- Node refChild = (index < nodeList.getLength()) ? nodeList.item(index) : null;
-
- // here we consider the case where the previous node is a 'white space' Text node
- // we should really do the insert before this node
- //
- int prevIndex = index - 1;
- Node prevChild = (prevIndex < nodeList.getLength()) ? nodeList.item(prevIndex) : null;
- if (isWhitespaceTextNode(prevChild))
- {
- refChild = prevChild;
- }
-
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Node newNode = (Node)i.next();
-
- if (newNode.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Element parentElement = (Element)parent;
- parentElement.setAttributeNode((Attr)newNode);
- }
- else
- {
- parent.insertBefore(newNode, refChild);
- }
- }
-
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Node newNode = (Node)i.next();
- if (format)
- {
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((IDOMNode)newNode);
- }
- }
- //setViewerSelection(list);
- }
-
- protected boolean isWhitespaceTextNode(Node node)
- {
- return (node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().trim().length() == 0);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetBindingCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetBindingCommand.java
deleted file mode 100644
index 812ad3137..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetBindingCommand.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.commands;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.internal.generator.ContentGenerator;
-import org.eclipse.wst.wsdl.internal.generator.extension.ContentGeneratorExtensionFactoryRegistry;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Binding;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11EndPoint;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-
-public class W11SetBindingCommand extends W11TopLevelElementCommand {
- private Port port;
- private Binding binding;
-
- public W11SetBindingCommand(Port port, Binding binding) {
- super(Messages._UI_ACTION_SET_BINDING, port.getEnclosingDefinition());
- this.port = port;
- this.binding = binding;
- }
-
- public void execute() {
- try {
- beginRecording(port.getElement());
- port.setEBinding(binding);
-
- updatePortProtocol(port, binding);
- }
- finally {
- endRecording(port.getElement());
- }
- }
-
- public static void updatePortProtocol(Port port, Binding binding) {
- String bindingProtocol = getBindingProtocol(binding);
- if (bindingProtocol != null) {
- W11EndPoint portProtocol = getPortProtocol(port);
- if ((portProtocol == null) || !(bindingProtocol.equals(portProtocol.getProtocol()))) {
- String portAddress = null;
- if (portProtocol != null) {
- portAddress = portProtocol.getAddress();
- }
- if (portAddress == null) {
- portAddress = "http://www.example.org"; //$NON-NLS-1$
- }
-
- ContentGeneratorExtensionFactoryRegistry factoryRegistry = ContentGeneratorExtensionFactoryRegistry.getInstance();
- ContentGenerator contentGenerator = factoryRegistry.getGeneratorClassFromName(bindingProtocol);
- if (contentGenerator != null) {
- contentGenerator.setAddressLocation(portAddress);
- contentGenerator.generatePortContent(port);
- }
- }
- }
- }
-
- private static String getBindingProtocol(Binding binding) {
- Notifier notifier = (Notifier)binding;
- Adapter adapter = WSDLAdapterFactoryHelper.getInstance().adapt(notifier);
- if (adapter instanceof W11Binding) {
- return ((W11Binding)adapter).getProtocol();
- }
-
- return null;
- }
-
- private static W11EndPoint getPortProtocol(Port port) {
- Notifier notifier = (Notifier)port;
- Adapter adapter = WSDLAdapterFactoryHelper.getInstance().adapt(notifier);
- if (adapter instanceof W11EndPoint) {
- return (W11EndPoint)adapter;
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetElementCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetElementCommand.java
deleted file mode 100644
index 3d4987ea7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetElementCommand.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.commands;
-
-import java.util.List;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.InternalWSDLMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLXSDElementReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDElementReferenceEditManager;
-import org.eclipse.xsd.XSDSchema;
-
-public class W11SetElementCommand extends W11TopLevelElementCommand {
- private Part parent;
- private String action;
- private boolean continueApply;
-
- public W11SetElementCommand(Part parent, String action) {
- super(Messages._UI_ACTION_SET_ELEMENT, parent.getEnclosingDefinition());
- this.parent = parent;
- this.action = action;
- }
-
- public void execute()
- {
- try {
- beginRecording(definition.getElement());
-
- ComponentReferenceEditManager componentReferenceEditManager = getComponentReferenceEditManager();
- continueApply = true;
- if (action.equals(IParameter.SET_NEW_ACTION_ID))
- {
- ComponentSpecification newValue = (ComponentSpecification)invokeDialog(componentReferenceEditManager.getNewDialog());
-
- // Set the reference to the new type
- if (continueApply)
- componentReferenceEditManager.modifyComponentReference(parent, newValue);
- }
- else
- {
- ComponentSpecification newValue = (ComponentSpecification)invokeDialog(componentReferenceEditManager.getBrowseDialog());
- if (continueApply)
- componentReferenceEditManager.modifyComponentReference(parent, newValue);
- }
- formatChild(parent.getElement());
- }
- finally {
- endRecording(definition.getElement());
- }
- }
-
- private Object invokeDialog(IComponentDialog dialog)
- {
- Object newValue = null;
-
- if (dialog == null)
- {
- return null;
- }
-
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- }
- else
- {
- continueApply = false;
- }
-
- return newValue;
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = ASDEditorPlugin.getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);
-
- if (editor instanceof InternalWSDLMultiPageEditor)
- {
- InternalWSDLMultiPageEditor wsdlEditor = (InternalWSDLMultiPageEditor) editor;
-
- List types = wsdlEditor.getModel().getTypes();
- XSDSchema[] schemas = new XSDSchema[types.size()];
- for (int index = 0; index < types.size(); index++) {
- W11Type type = (W11Type) types.get(index);
- schemas[index] = (XSDSchema) type.getTarget();
- }
-
- ((WSDLXSDElementReferenceEditManager) result).setSchemas(schemas);
-
- return result;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetInterfaceCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetInterfaceCommand.java
deleted file mode 100644
index 41882d54a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetInterfaceCommand.java
+++ /dev/null
@@ -1,36 +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.adapters.commands;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-
-public class W11SetInterfaceCommand extends W11TopLevelElementCommand {
- private Binding binding;
- private PortType portType;
-
- public W11SetInterfaceCommand(Binding binding, PortType portType) {
- super(Messages._UI_ACTION_SET_PORTTYPE, binding.getEnclosingDefinition());
- this.binding = binding;
- this.portType = portType;
- }
-
- public void execute() {
- try {
- beginRecording(binding.getElement());
- binding.setEPortType(portType);
- }
- finally {
- endRecording(binding.getElement());
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetTypeCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetTypeCommand.java
deleted file mode 100644
index ae8f6094e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11SetTypeCommand.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.adapters.commands;
-
-import java.util.List;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.InternalWSDLMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLXSDTypeReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class W11SetTypeCommand extends W11TopLevelElementCommand {
- private Object parent;
- private String action;
- private boolean continueApply;
-
- public W11SetTypeCommand(Object parent, String action) {
- super(Messages._UI_ACTION_SET_TYPE, null);
- this.parent = parent;
- this.action = action;
- }
-
- public void execute()
- {
- try {
- if (parent instanceof WSDLElement) {
- beginRecording(((WSDLElement) parent).getElement());
- }
-
- ComponentReferenceEditManager componentReferenceEditManager = getComponentReferenceEditManager();
- continueApply = true;
- if (action.equals(IParameter.SET_NEW_ACTION_ID))
- {
- ComponentSpecification newValue = (ComponentSpecification)invokeDialog(componentReferenceEditManager.getNewDialog());
-
- // Set the reference to the new type
- if (continueApply)
- componentReferenceEditManager.modifyComponentReference(parent, newValue);
- }
- else
- {
- ComponentSpecification newValue = (ComponentSpecification)invokeDialog(componentReferenceEditManager.getBrowseDialog());
- if (continueApply)
- componentReferenceEditManager.modifyComponentReference(parent, newValue);
- }
-
- // Format
- if (parent instanceof WSDLElement) {
- formatChild(((WSDLElement) parent).getElement());
- }
- else if (parent instanceof XSDConcreteComponent) {
- formatChild(((XSDConcreteComponent) parent).getElement());
- }
- }
- finally {
- if (parent instanceof WSDLElement) {
- endRecording(((WSDLElement) parent).getElement());
- }
- }
- }
-
- private Object invokeDialog(IComponentDialog dialog)
- {
- Object newValue = null;
-
- if (dialog == null)
- {
- return null;
- }
-
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- }
- else
- {
- continueApply = false;
- }
-
- return newValue;
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = ASDEditorPlugin.getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
-
- if (editor instanceof InternalWSDLMultiPageEditor)
- {
- InternalWSDLMultiPageEditor wsdlEditor = (InternalWSDLMultiPageEditor) editor;
-
- List types = wsdlEditor.getModel().getTypes();
- XSDSchema[] schemas = new XSDSchema[types.size()];
- for (int index = 0; index < types.size(); index++) {
- W11Type type = (W11Type) types.get(index);
- schemas[index] = (XSDSchema) type.getTarget();
- }
-
- ((WSDLXSDTypeReferenceEditManager) result).setSchemas(schemas);
-
- return result;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11TopLevelElementCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11TopLevelElementCommand.java
deleted file mode 100644
index 3369b8033..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/commands/W11TopLevelElementCommand.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.adapters.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.visitor.W11FindInnerElementVisitor;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-
-public class W11TopLevelElementCommand extends Command
-{
- private static final String XML = "xml"; //$NON-NLS-1$
- protected Definition definition;
-
- public W11TopLevelElementCommand(String label, Definition definition)
- {
- super(label);
- this.definition = definition;
- }
-
- protected void beginRecording(Object element) {
- if (element instanceof IDOMNode) {
- ((IDOMNode) element).getModel().beginRecording(this, getUndoDescription());
- }
- }
-
- protected void endRecording(Object element) {
- if (element instanceof IDOMNode) {
- ((IDOMNode) element).getModel().endRecording(this);
- }
- }
-
- protected String getUndoDescription() {
- return getLabel();
- }
-
- protected void formatChild(Element child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
-
- public void execute()
- {
- ensureDefinition(definition);
- }
-
- protected XSDElementDeclaration getNewXSDElement(XSDElementDeclaration xsdElement) {
- W11FindInnerElementVisitor visitor = new W11FindInnerElementVisitor();
- return visitor.getInnerXSDElement(xsdElement);
- }
-
- public static void ensureDefinition(Definition definition)
- {
- Document document = definition.getDocument();
-
- Element definitionsElement = document.getDocumentElement();
-
- if (definitionsElement == null)
- {
- String targetNamespace = getDefaultNamespace(definition);
- definition.setQName(new QName(null, getFileName(definition)));
- definition.setTargetNamespace(targetNamespace);
- definition.addNamespace("wsdl", WSDLConstants.WSDL_NAMESPACE_URI); //$NON-NLS-1$
- definition.updateElement();
- // Moving these above updateElement() seems to cause grief with the model.
- definition.addNamespace("tns", targetNamespace); //$NON-NLS-1$
- definition.addNamespace("xsd", WSDLConstants.XSD_NAMESPACE_URI); //$NON-NLS-1$
- definitionsElement = definition.getElement();
- }
-
- ensureXMLDirective(document);
- }
-
- private static void ensureXMLDirective(Document document)
- {
- if (hasXMLDirective(document))
- {
- return;
- }
-
- Node firstChild = document.getFirstChild();
- ProcessingInstruction xmlDeclaration = getXMLDeclaration(document);
- document.insertBefore(xmlDeclaration, firstChild);
- }
-
- private static boolean hasXMLDirective(Document document)
- {
- Node firstChild = document.getFirstChild();
-
- if (firstChild == null)
- {
- return false;
- }
-
- if (firstChild.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE)
- {
- return false;
- }
-
- ProcessingInstruction processingInstruction = (ProcessingInstruction)firstChild;
-
- if (!processingInstruction.getTarget().equals(XML))
- {
- return false;
- }
-
- return true;
- }
-
- private static ProcessingInstruction getXMLDeclaration(Document document)
- {
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals("")) //$NON-NLS-1$
- {
- charSet = "UTF-8"; //$NON-NLS-1$
- }
- ProcessingInstruction xmlDeclaration = document.createProcessingInstruction(XML, "version=\"1.0\" encoding=\"" + charSet + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- return xmlDeclaration;
-
- }
- private static String getDefaultNamespace(Definition definition)
- {
- String namespace = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(Messages._UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE);
-
- if (!namespace.endsWith("/")) //$NON-NLS-1$
- {
- namespace = namespace.concat("/"); //$NON-NLS-1$
- }
-
- namespace += getFileName(definition) + "/"; //$NON-NLS-1$
-
- return namespace;
-
- }
-
- private static String getFileName(Definition definition)
- {
- String fileLocation = definition.getLocation();
- IPath filePath = new Path(fileLocation);
- return filePath.removeFileExtension().lastSegment().toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11AddressExtensibilityElementAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11AddressExtensibilityElementAdapter.java
deleted file mode 100644
index 7a36fc5e9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11AddressExtensibilityElementAdapter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.adapters.specialized;
-
-import org.eclipse.wst.wsdl.binding.http.HTTPAddress;
-import org.eclipse.wst.wsdl.binding.soap.SOAPAddress;
-
-public class W11AddressExtensibilityElementAdapter extends W11ExtensibilityElementAdapter
-{
- // TODO... make this class abstract and provide concrete implementations in
- // SOAP and HTTP packages. The WSDLAdapterFactory needs to know to delegate to extension
- // adapters to support the addition of more extension languages
- //
- public String getLocationURI()
- {
- String address = ""; //$NON-NLS-1$
- if (target instanceof SOAPAddress)
- {
- address = ((SOAPAddress) target).getLocationURI();
- }
- else if (target instanceof HTTPAddress)
- {
- address = ((HTTPAddress) target).getLocationURI();
- }
- return address;
- }
-
- public void setLocationURI(String address)
- {
- if (target instanceof SOAPAddress)
- {
- ((SOAPAddress) target).setLocationURI(address);
- }
- else if (target instanceof HTTPAddress)
- {
- ((HTTPAddress) target).setLocationURI(address);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11ExtensibilityElementAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11ExtensibilityElementAdapter.java
deleted file mode 100644
index 0dd4fb990..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/specialized/W11ExtensibilityElementAdapter.java
+++ /dev/null
@@ -1,18 +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.adapters.specialized;
-
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-
-public class W11ExtensibilityElementAdapter extends WSDLBaseAdapter
-{
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java
deleted file mode 100644
index c9a52483f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.adapters.visitor;
-
-import org.eclipse.xsd.XSDElementDeclaration;
-
-/*
- * Class used to find and return the "inner" XSDElement when given an XSDElement.
- * This class extends W11XSDVisitor which removes the need for this class to reimplement
- * the actual traversal of the XSD Model to locate the inner XSDElement.
- *
- * By default, this class will locate the inner XSDElement at depth 2. However, this depth
- * can be changed by calling setElementDepth(newDepth).
- */
-public class W11FindInnerElementVisitor extends W11XSDVisitor {
- protected XSDElementDeclaration elementAtDepth;
- protected int elementDepth = 2;
- protected int depth = 1;
-
- public XSDElementDeclaration getInnerXSDElement(XSDElementDeclaration xsdElement) {
- elementAtDepth = xsdElement;
- depth = 1;
- visitElementDeclaration(xsdElement);
-
- return elementAtDepth;
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element) {
- if (depth == elementDepth) {
- elementAtDepth = element;
- }
- depth++;
-
- super.visitElementDeclaration(element);
- }
-
- public void setElementDepth(int elementDepth) {
- this.elementDepth = elementDepth;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitor.java
deleted file mode 100644
index 8ce92457c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitor.java
+++ /dev/null
@@ -1,212 +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.adapters.visitor;
-
-import java.util.Iterator;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class W11XSDVisitor
-{
- public W11XSDVisitor()
- {
- }
-
- protected XSDSchema schema;
-
- public void visitSchema(XSDSchema schema)
- {
- this.schema = schema;
- for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
- visitAttributeDeclaration(attr);
- }
- for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
- {
- XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
- visitTypeDefinition(type);
- }
- for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
- visitElementDeclaration(element);
- }
- for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
- {
- XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
- visitIdentityConstraintDefinition(identityConstraint);
- }
- for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
- visitModelGroupDefinition(modelGroup);
- }
- for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
- visitAttributeGroupDefinition(attributeGroup);
- }
- for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
- {
- XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
- visitNotationDeclaration(element);
- }
-
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- }
-
- public void visitTypeDefinition(XSDTypeDefinition type)
- {
- if (type instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
- }
- else if (type instanceof XSDComplexTypeDefinition)
- {
- visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- }
- else if (element.getAnonymousTypeDefinition() != null)
- {
- visitTypeDefinition(element.getAnonymousTypeDefinition());
- }
- }
-
- public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
- {
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- if (!modelGroupDef.isModelGroupDefinitionReference())
- {
- if (modelGroupDef.getModelGroup() != null)
- {
- visitModelGroup(modelGroupDef.getModelGroup());
- }
- }
- else
- {
- XSDModelGroup modelGroup = modelGroupDef.getResolvedModelGroupDefinition().getModelGroup();
- if (modelGroup != null)
- {
- visitModelGroup(modelGroup);
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)o;
- visitAttributeDeclaration(attrUse.getContent());
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
-
- public void visitNotationDeclaration(XSDNotationDeclaration notation)
- {
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
- {
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- if (type.getContent() != null)
- {
- XSDComplexTypeContent complexContent = type.getContent();
- if (complexContent instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
- }
- else if (complexContent instanceof XSDParticle)
- {
- visitParticle((XSDParticle) complexContent);
- }
- }
- }
-
- public void visitParticle(XSDParticle particle)
- {
- visitParticleContent(particle.getContent());
- }
-
- public void visitParticleContent(XSDParticleContent particleContent)
- {
- if (particleContent instanceof XSDModelGroupDefinition)
- {
- visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
- }
- else if (particleContent instanceof XSDModelGroup)
- {
- visitModelGroup((XSDModelGroup)particleContent);
- }
- else if (particleContent instanceof XSDElementDeclaration)
- {
- visitElementDeclaration((XSDElementDeclaration)particleContent);
- }
- else if (particleContent instanceof XSDWildcard)
- {
- visitWildcard((XSDWildcard)particleContent);
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- if (modelGroup.getContents() != null)
- {
- for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- visitParticle(particle);
- }
- }
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitorForFields.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitorForFields.java
deleted file mode 100644
index 02e6dd4cd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11XSDVisitorForFields.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.adapters.visitor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-
-public class W11XSDVisitorForFields extends W11XSDVisitor
-{
- public W11XSDVisitorForFields()
- {
- }
-
- List concreteComponentList = new ArrayList();
- List thingsWeNeedToListenTo = new ArrayList();
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- super.visitComplexTypeDefinition(type);
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
- if (attrGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
- concreteComponentList.add(attrUse);
- }
- else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)attrGroupContent;
- thingsWeNeedToListenTo.add(attrGroup);
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
- }
-
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- super.visitModelGroup(modelGroup);
- thingsWeNeedToListenTo.add(modelGroup);
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attributeUse = (XSDAttributeUse)o;
- concreteComponentList.add(attributeUse);
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
- thingsWeNeedToListenTo.add(attrGroup);
- if (attrGroup.isAttributeGroupDefinitionReference())
- {
- attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- //super.visitElementDeclaration(element);
- concreteComponentList.add(element);
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- super.visitAttributeDeclaration(attr);
- concreteComponentList.add(attr);
- }
-
-
- public List getConcreteComponentList()
- {
- return concreteComponentList;
- }
-
-
- public List getThingsWeNeedToListenTo()
- {
- return thingsWeNeedToListenTo;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBaseParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBaseParameterCommand.java
deleted file mode 100644
index cd587c179..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBaseParameterCommand.java
+++ /dev/null
@@ -1,558 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.XSDComponentHelper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Element;
-
-public abstract class AddBaseParameterCommand {
- public static int PART_ELEMENT_SEQ_ELEMENT = 0;
- public static int PART_ELEMENT = 1;
- public static int PART_COMPLEXTYPE_SEQ_ELEMENT = 2;
- public static int PART_COMPLEXTYPE = 3;
- public static int PART_SIMPLETYPE = 4;
-
- protected int style = 0;
- protected Operation operation;
- protected XSDElementDeclaration newXSDElement;
- protected Part newPart;
-
- protected String newAnonymousXSDElementName;
- protected String newXSDElementName;
- protected String newWSDLMessageName;
- protected String newWSDLPartName;
-
- public abstract void run();
- public abstract MessageReference getMessageReference();
-
- public AddBaseParameterCommand(Operation operation, int style) {
- this.operation = operation;
- this.style = style;
- }
-
- public void setStyle(int style) {
- this.style = style;
- }
-
- public XSDElementDeclaration getXSDElementDeclaration() {
- return newXSDElement;
- }
-
- protected boolean isPartElementReference() {
- if (style == PART_ELEMENT || style == PART_ELEMENT_SEQ_ELEMENT) {
- return true;
- }
-
- return false;
- }
-
- protected XSDElementDeclaration createPartElementSeqElementPattern(Part part, XSDElementDeclaration partElement) {
- XSDElementDeclaration returnedXSDElement = null;
-
- XSDElementDeclaration originalElement = null;
- XSDElementDeclaration anonXSDElement = null;
-
- // Create the XSDElement (anonymous) referenced by the Part if necessary
- if (partElement == null || partElement.getAnonymousTypeDefinition() == null || partElement.getSchema() == null) {
- anonXSDElement = XSDComponentHelper.createAnonymousXSDElementDefinition(getAnonymousXSDElementBaseName(), part);
-// part.setElementDeclaration(anonXSDElement);
- String prefixedName = getPrefixedComponentName(part.getEnclosingDefinition(), anonXSDElement);
- ComponentReferenceUtil.setComponentReference(part, false, prefixedName);
- part.setTypeDefinition(null);
-
- if (partElement != null && partElement.getSchema() != null) {
- originalElement = partElement;
- // Remove the 'original' XSDElement as a Global Element
- partElement.getSchema().getContents().remove(partElement);
- }
- }
- else {
- anonXSDElement = partElement;
- }
-
- // Add the 'original' XSDElement if it's type wasn't anonymous
- if (originalElement != null) {
- XSDComponentHelper.addXSDElementToModelGroup(anonXSDElement, originalElement);
- }
-
- // Create a new XSDElement
- XSDModelGroup modelGroup = XSDComponentHelper.getXSDModelGroup(anonXSDElement, part.getEnclosingDefinition());
- returnedXSDElement = XSDComponentHelper.createXSDElementDeclarationCommand(null, getNewXSDElementBaseName(), modelGroup);
-
- // Add the newly created XSDElement to the ModelGroup
- XSDComponentHelper.addXSDElementToModelGroup(anonXSDElement, returnedXSDElement);
-
- formatChild(anonXSDElement.getElement());
- return returnedXSDElement;
- }
-
- protected XSDElementDeclaration createPartElementReferenceComponents(Part part) {
- XSDElementDeclaration returnedXSDElement = null;
- XSDElementDeclaration partElement = part.getElementDeclaration();
-
- if (style == PART_ELEMENT_SEQ_ELEMENT) {
- returnedXSDElement = createPartElementSeqElementPattern(part, partElement);
- }
- else if (style == PART_ELEMENT) {
- if (partElement == null) {
- returnedXSDElement = XSDComponentHelper.createXSDElementDeclarationCommand(part.getEnclosingDefinition(), getNewXSDElementBaseName(), part);
- if (returnedXSDElement != null && !returnedXSDElement.equals(part.getElementDeclaration())) {
-// part.setElementDeclaration(returnedXSDElement);
- String prefixedName = getPrefixedComponentName(part.getEnclosingDefinition(), returnedXSDElement);
- ComponentReferenceUtil.setComponentReference(part, false, prefixedName);
- }
- }
- else {
- returnedXSDElement = createPartElementSeqElementPattern(part, partElement);
- }
- }
-
- return returnedXSDElement;
- }
-
- protected XSDElementDeclaration createPartComplexTypeReference(Part part) {
- XSDElementDeclaration returnedXSDElement = null;
-
- if (style == PART_COMPLEXTYPE_SEQ_ELEMENT) {
- XSDTypeDefinition originalType = null;
- XSDComplexTypeDefinition topLevelType = null;
-
- // Create the ComplexType referenced by the Part if necessary
- if (part.getTypeDefinition() == null || part.getTypeDefinition() instanceof XSDSimpleTypeDefinition) {
- XSDSchema schema = XSDComponentHelper.getXSDSchema(part.getEnclosingDefinition());
- String topLevelName = NameUtil.getXSDComplexTypeName(part.getName(), schema);
- topLevelType = XSDComponentHelper.createXSDComplexTypeDefiniion(topLevelName, part);
-
- if (part.getTypeDefinition() instanceof XSDSimpleTypeDefinition) {
- originalType = part.getTypeDefinition();
- }
- }
- else if (part.getTypeDefinition() instanceof XSDComplexTypeDefinition){
- topLevelType = (XSDComplexTypeDefinition) part.getTypeDefinition();
- }
-
- // Create a new XSDElement
- XSDModelGroup modelGroup = XSDComponentHelper.getXSDModelGroup(topLevelType);
- returnedXSDElement = XSDComponentHelper.createXSDElementDeclarationCommand(null, getNewXSDElementBaseName(), modelGroup);
-
- // Add the 'original' XSDElement if it's type wasn't anonymous
- if (originalType != null) {
- // Create another new XSDElement to 'contain' the originally referenced XSDSimpleType
- XSDElementDeclaration origXSDElement = XSDComponentHelper.createXSDElementDeclarationCommand(null, getNewXSDElementBaseName(), modelGroup);
- origXSDElement.setTypeDefinition(originalType);
- }
-
- // Change Part reference
-// part.setTypeDefinition(topLevelType);
- String prefixedName = getPrefixedComponentName(part.getEnclosingDefinition(), topLevelType);
- ComponentReferenceUtil.setComponentReference(part, true, prefixedName);
- formatChild(topLevelType.getElement());
- }
- else if (style == PART_COMPLEXTYPE) {
- XSDComplexTypeDefinition complexType = null;
- if (part.getTypeDefinition() == null) {
- // Create a new ComplexType
- XSDSchema schema = XSDComponentHelper.getXSDSchema(part.getEnclosingDefinition());
- String complexName = NameUtil.getXSDComplexTypeName(part.getName(), schema);
- complexType = XSDComponentHelper.createXSDComplexTypeDefiniion(complexName, part);
-
- // Create an XSDElement for the ComplexType
- XSDModelGroup xsdModelGroup = XSDComponentHelper.getXSDModelGroup(complexType);
- returnedXSDElement = XSDComponentHelper.createXSDElementDeclarationCommand(null, getNewXSDElementBaseName(), xsdModelGroup);
- }
- else {
- // TODO: What should we do here..... We can default to the PART_ELEMENT_SEQ_ELEMENT style
- // since it handles 'multiple' XSDElements.... OR ..... we can 'overwrite and set a new
- // XSDElement
- }
-
- if (complexType != null && !complexType.equals(part.getTypeDefinition())) {
-// part.setTypeDefinition(complexType);
- String prefixedName = getPrefixedComponentName(part.getEnclosingDefinition(), complexType);
- ComponentReferenceUtil.setComponentReference(part, true, prefixedName);
- formatChild(complexType.getElement());
- }
- }
-
- return returnedXSDElement;
- }
- /*
- * Create if necessary a Message and Part for the given MessageReference
- * and return it's Part
- */
- protected Part createWSDLComponents(MessageReference messageRef) {
- Message message = messageRef.getEMessage();
- Part part = null;
-
- if (message == null || message.eContainer() == null) {
- // Create Message
- AddMessageCommand command = new AddMessageCommand(messageRef.getEnclosingDefinition(), getWSDLMessageName());
- command.run();
- message = (Message) command.getWSDLElement();
- messageRef.setEMessage(message);
- }
-
- if (message.getEParts().size() == 0) {
- // Create Part
- String partName = getWSDLPartName();
- if (style == PART_ELEMENT_SEQ_ELEMENT) {
- partName = getDocLitWrappedPartName();
- }
- AddPartCommand command = new AddPartCommand(message, partName);
- command.run();
- part = (Part) command.getWSDLElement();
- }
- else {
- // there is an existing Part
-// part = (Part) message.getEParts().get(0);
- }
- formatChild(message.getElement());
-
- return part;
- }
-
- protected String getDocLitWrappedPartName() {
- return "parameters"; //$NON-NLS-1$
- }
-
- protected XSDElementDeclaration createXSDObjects(Part part) {
- XSDElementDeclaration returnedXSDElement = null;
- if (isPartElementReference()) {
- // Is a Part --> Element reference
- if (part == null && getMessageReference() != null && getMessageReference().getEMessage() != null) {
- part = (Part) getMessageReference().getEMessage().getEParts().get(0);
- }
-
- returnedXSDElement = createPartElementReferenceComponents(part);
- }
- else {
- // Is a Part --> Complex Type reference
-// returnedXSDElement = createPartComplexTypeReference(part);
-
- // If it's a Part --> Type reference, adding a new parameter always means adding a new Part
- // with a string reference. Because of this case, we should really rename this method instead
- // of createXSDObjects() since we may end up creating a Part.
- if (part == null && getMessageReference() != null && getMessageReference().getEMessage() != null) {
- List partNames = new ArrayList();
- Message message = getMessageReference().getEMessage();
- Iterator it = message.getEParts().iterator();
- while (it.hasNext()) {
- Part item = (Part) it.next();
- partNames.add(item.getName());
- }
- String partName = NameUtil.getUniqueNameHelper(getWSDLPartName(), partNames);
- AddPartCommand command = new AddPartCommand(message, partName);
- command.run();
- newPart = (Part) command.getWSDLElement();
- }
- }
-
- return returnedXSDElement;
- }
-
- protected String getPrefixedComponentName(Definition definition, XSDNamedComponent component) {
- String name = component.getName();
- String tns = component.getTargetNamespace();
- List prefixes = getPrefixes(definition, tns);
- if (prefixes.size() > 0) {
- name = prefixes.get(0) + ":" + name; //$NON-NLS-1$
- }
-
- return name;
- }
-
- private List getPrefixes(Definition definition, String namespace) {
- List list = new ArrayList();
- Map map = definition.getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();) {
- String prefix = (String) i.next();
- String theNamespace = (String) map.get(prefix);
- if (theNamespace != null && theNamespace.equals(namespace)) {
- list.add(prefix);
- }
- }
- return list;
- }
-
- public static int getParameterPattern(WSDLElement element) {
- int pattern = -1;
-
- if (element instanceof Operation) {
- pattern = getPattern((Operation) element);
-
- PortType pt = (PortType) ((Operation) element).getContainer();
- if (pattern == -1) {
- // let's try to search other Operations in the same PortType
- Iterator opIt = pt.getEOperations().iterator();
- while (pattern == -1 && opIt.hasNext()) {
- Operation item = (Operation) opIt.next();
- if (!item.equals(element)) {
- pattern = getPattern(item);
- }
- }
- }
-
- if (pattern == -1) {
- // let's try to search other Operations in OTHER PortTypes
- Iterator ptIt = pt.getEnclosingDefinition().getEPortTypes().iterator();
- while (pattern == -1 && ptIt.hasNext()) {
- PortType item = (PortType) ptIt.next();
- if (!item.equals(pt)) {
- pattern = getPattern(item);
- }
- }
- }
- }
- else if (element instanceof PortType) {
- PortType pt = (PortType) element;
- pattern = getPattern(pt);
-
- if (pattern == -1) {
- // let's try to search other Operations in OTHER PortTypes
- Iterator ptIt = pt.getEnclosingDefinition().getEPortTypes().iterator();
- while (pattern == -1 && ptIt.hasNext()) {
- PortType item = (PortType) ptIt.next();
- if (!item.equals(pt)) {
- pattern = getPattern(item);
- }
- }
- }
- }
-
- if (pattern == -1) {
- pattern = AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT;
- }
-
- return pattern;
- }
-
- public static int getParameterPattern(WSDLElement element, boolean useInput) {
- int pattern = -1;
-
- if (element instanceof Operation) {
- Operation op = (Operation) element;
- if (useInput && op.getEInput() != null) {
- pattern = getPattern(op.getEInput().getEMessage());
- }
- if (!useInput && op.getEOutput() != null){
- pattern = getPattern(op.getEOutput().getEMessage());
- }
-
- PortType pt = (PortType) op.getContainer();
- if (pattern == -1) {
- // let's try to search other Operations in the same PortType
- Iterator opIt = pt.getEOperations().iterator();
- while (pattern == -1 && opIt.hasNext()) {
- Operation item = (Operation) opIt.next();
- if (!item.equals(element)) {
- if (useInput && item.getEInput() != null) {
- pattern = getPattern(item.getEInput().getEMessage());
- }
- if (!useInput && item.getEOutput() != null){
- pattern = getPattern(item.getEOutput().getEMessage());
- }
- }
- }
- }
-
- if (pattern == -1) {
- // let's try to search other Operations in OTHER PortTypes
- Iterator ptIt = pt.getEnclosingDefinition().getEPortTypes().iterator();
- while (pattern == -1 && ptIt.hasNext()) {
- PortType item = (PortType) ptIt.next();
- if (!item.equals(pt)) {
- pattern = getPattern(item, useInput);
- }
- }
- }
- }
- else if (element instanceof PortType) {
- PortType pt = (PortType) element;
- pattern = getPattern(pt, useInput);
-
- if (pattern == -1) {
- // let's try to search other Operations in OTHER PortTypes
- Iterator ptIt = pt.getEnclosingDefinition().getEPortTypes().iterator();
- while (pattern == -1 && ptIt.hasNext()) {
- PortType item = (PortType) ptIt.next();
- if (!item.equals(pt)) {
- pattern = getPattern(item, useInput);
- }
- }
- }
- }
-
- return pattern;
- }
-
- private static int getPattern(PortType portType) {
- int pattern = -1;
- Iterator opIt = portType.getEOperations().iterator();
- while (pattern == -1 && opIt.hasNext()) {
- Operation op = (Operation) opIt.next();
- pattern = getPattern(op);
- }
-
- return pattern;
- }
-
- private static int getPattern(PortType portType, boolean useInput) {
- int pattern = -1;
- Iterator opIt = portType.getEOperations().iterator();
- while (pattern == -1 && opIt.hasNext()) {
- Operation op = (Operation) opIt.next();
- if (useInput && op.getEInput() != null) {
- pattern = getPattern(op.getEInput().getEMessage());
- }
- if (!useInput && op.getEOutput() != null) {
- pattern = getPattern(op.getEOutput().getEMessage());
- }
- }
-
- return pattern;
- }
-
- private static int getPattern(Operation operation) {
- int pattern = -1;
-
- Input input = operation.getEInput();
- Output output = operation.getEOutput();
- List faults = operation.getEFaults();
-
- if (input != null) {
- pattern = getPattern(input.getEMessage());
- }
-
- if (pattern == -1 && output != null) {
- pattern = getPattern(output.getEMessage());
- }
-
- if (pattern == -1 && faults.size() > 0) {
- Iterator faultIt = faults.iterator();
- while (pattern == -1 && faultIt.hasNext()) {
- Fault fault = (Fault) faultIt.next();
- pattern = getPattern(fault.getEMessage());
- }
- }
-
- return pattern;
- }
-
- private static int getPattern(Message message) {
- int pattern = -1;
- if (message != null) {
- Iterator parts = message.getEParts().iterator();
- while (parts.hasNext()) {
- Part part = (Part) parts.next();
- if (part.getElementDeclaration() != null) {
- pattern = AddBaseParameterCommand.PART_ELEMENT;
-
- XSDElementDeclaration xsdElement = part.getElementDeclaration();
- if (isSequencePattern(xsdElement.getTypeDefinition())) {
- pattern = AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT;
- }
- break;
- }
- else if (part.getTypeDefinition() != null) {
- pattern = AddBaseParameterCommand.PART_SIMPLETYPE;
-
- if (part.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
- pattern = AddBaseParameterCommand.PART_COMPLEXTYPE;
-
- XSDComplexTypeDefinition xsdType = (XSDComplexTypeDefinition) part.getTypeDefinition();
- if (isSequencePattern(xsdType)) {
- pattern = AddBaseParameterCommand.PART_COMPLEXTYPE_SEQ_ELEMENT;
- }
- }
- break;
- }
- }
- }
-
- return pattern;
- }
-
- private static boolean isSequencePattern(XSDTypeDefinition type) {
- boolean isSequencePattern = false;
-
- if (type instanceof XSDComplexTypeDefinition) {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) type;
-
- if (complexType.getContent() instanceof XSDParticle) {
- XSDParticle particle = (XSDParticle) complexType.getContent();
- if (particle.getContent() instanceof XSDModelGroup) {
- isSequencePattern = true;
- }
- }
- }
-
- return isSequencePattern;
- }
-
- protected void formatChild(Element child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
-
- public Part getNewlyAddedComponentPart() {
- return newPart;
- }
-
- protected abstract String getAnonymousXSDElementBaseName();
- protected abstract String getNewXSDElementBaseName();
- protected abstract String getWSDLMessageName();
- protected abstract String getWSDLPartName();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingCommand.java
deleted file mode 100644
index 21251bb3e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingCommand.java
+++ /dev/null
@@ -1,47 +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.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-
-public final class AddBindingCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private Binding binding;
-
- public AddBindingCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public WSDLElement getWSDLElement()
- {
- return binding;
- }
-
- public void run()
- {
- binding = WSDLFactory.eINSTANCE.createBinding();
- binding.setQName(new QName(definition.getTargetNamespace(),localName));
- binding.setEnclosingDefinition(definition);
- definition.addBinding(binding);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingFaultCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingFaultCommand.java
deleted file mode 100644
index 0099bb306..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingFaultCommand.java
+++ /dev/null
@@ -1,43 +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.commands;
-
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingFaultCommand extends WSDLElementCommand
-{
- BindingFault bindingFault;
- BindingOperation bindingOperation;
- String name;
-
- public AddBindingFaultCommand(BindingOperation bindingOperation, String name)
- {
- this.bindingOperation = bindingOperation;
- this.name = name;
- }
-
- public void run()
- {
- bindingFault = WSDLFactory.eINSTANCE.createBindingFault();
- bindingFault.setName(name);
- bindingFault.setEnclosingDefinition(bindingOperation.getEnclosingDefinition());
- bindingOperation.addBindingFault((BindingFault)bindingFault);
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingFault;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingInputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingInputCommand.java
deleted file mode 100644
index fa8825bd1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingInputCommand.java
+++ /dev/null
@@ -1,42 +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.commands;
-
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingInputCommand extends WSDLElementCommand
-{
- BindingInput bindingInput;
- BindingOperation bindingOperation;
- String name;
-
- public AddBindingInputCommand(BindingOperation bindingOperation, String name)
- {
- this.bindingOperation = bindingOperation;
- this.name = name;
- }
-
- public void run()
- {
- bindingInput = WSDLFactory.eINSTANCE.createBindingInput();
- bindingInput.setName(name);
- bindingInput.setEnclosingDefinition(bindingOperation.getEnclosingDefinition());
- bindingOperation.setBindingInput((BindingInput)bindingInput);
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingInput;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOperationCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOperationCommand.java
deleted file mode 100644
index 09a4644d7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOperationCommand.java
+++ /dev/null
@@ -1,104 +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.commands;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingOperationCommand extends WSDLElementCommand
-{
- private Binding binding;
-
- private String name;
- private String bindingInputName = ""; //$NON-NLS-1$
- private String bindingOutputName = ""; //$NON-NLS-1$
- private String bindingFaultName =""; //$NON-NLS-1$
-
- private BindingOperation bindingOperation;
-
- private boolean createBindingInput = false;
- private boolean createBindingOutput = false;
- private boolean createBindingFault = false;
-
- public AddBindingOperationCommand(Binding binding,String name)
- {
- this.binding = binding;
- this.name = name;
- }
-
- public AddBindingOperationCommand
- (Binding binding,
- String name,
- boolean createBindingInput,
- boolean createBindingOutput,
- boolean createBindingFault)
- {
- this.binding = binding;
- this.name = name;
- this.createBindingInput = createBindingInput;
- this.createBindingOutput = createBindingOutput;
- this.createBindingFault = createBindingFault;
- }
-
- public void run()
- {
- bindingOperation = WSDLFactory.eINSTANCE.createBindingOperation();
- bindingOperation.setName(name);
- bindingOperation.setEnclosingDefinition(binding.getEnclosingDefinition());
- binding.addBindingOperation(bindingOperation);
-
- WSDLElementCommand command = null;
- if (createBindingInput)
- {
- command = new AddBindingInputCommand(bindingOperation,bindingInputName);
- command.run();
- }
-
- if (createBindingOutput)
- {
- command = new AddBindingOutputCommand(bindingOperation,bindingOutputName);
- command.run();
- }
-
- if (createBindingFault)
- {
- command = new AddBindingFaultCommand(bindingOperation,bindingFaultName);
- command.run();
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingOperation;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public void setBindingInputName(String name)
- {
- this.bindingInputName = name;
- }
-
- public void setBindingOutputName(String name)
- {
- this.bindingOutputName = name;
- }
-
- public void setBindingFaultName(String name)
- {
- this.bindingFaultName = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOutputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOutputCommand.java
deleted file mode 100644
index 480da5079..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOutputCommand.java
+++ /dev/null
@@ -1,43 +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.commands;
-
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingOutputCommand extends WSDLElementCommand
-{
- BindingOutput bindingOutput;
- BindingOperation bindingOperation;
- String name;
-
- public AddBindingOutputCommand(BindingOperation bindingOperation, String name)
- {
- this.bindingOperation = bindingOperation;
- this.name = name;
- }
-
- public void run()
- {
- bindingOutput = WSDLFactory.eINSTANCE.createBindingOutput();
- bindingOutput.setName(name);
- bindingOutput.setEnclosingDefinition(bindingOperation.getEnclosingDefinition());
- bindingOperation.setBindingOutput((BindingOutput)bindingOutput);
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingOutput;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddExtensionElementCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddExtensionElementCommand.java
deleted file mode 100644
index 7869f9076..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddExtensionElementCommand.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.commands;
-
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionCommand;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddExtensionElementCommand extends AddExtensionCommand
-{
- ExtensibleElement input;
- XSDElementDeclaration element;
- Element appInfo;
- Element newElement;
-
- public AddExtensionElementCommand(String label, ExtensibleElement input, XSDElementDeclaration element)
- {
- super(label);
- this.input = input;
- this.element = element;
- }
-
- public void execute()
- {
- super.execute();
- Element parentElement = input.getElement();
- Document doc = parentElement.getOwnerDocument();
-
- Element newElement = doc.createElementNS(extensionsSchemaSpec.getNamespaceURI(), element.getName());
-
- String prefix = addNamespaceDeclarationIfRequired(doc.getDocumentElement(), "p", extensionsSchemaSpec.getNamespaceURI()); //$NON-NLS-1$
- newElement.setPrefix(prefix);
- parentElement.appendChild(newElement);
- }
-
- public void undo()
- {
- // TODO (cs) do we need to implement?
- }
- public Object getNewObject()
- {
- return newElement;
- }
-
- private String addNamespaceDeclarationIfRequired(Element rootElement, String prefixHint, String namespace)
- {
- String prefix = null;
- NamespaceTable namespaceTable = new NamespaceTable(rootElement.getOwnerDocument());
- namespaceTable.addElement(rootElement);
- prefix = namespaceTable.getPrefixForURI(namespace);
- if (prefix == null)
- {
- String basePrefix = prefixHint;
- prefix = basePrefix;
- String xmlnsColon = "xmlns:"; //$NON-NLS-1$
- String attributeName = xmlnsColon + prefix;
- int count = 0;
- while (rootElement.getAttribute(attributeName) != null)
- {
- count++;
- prefix = basePrefix + count;
- attributeName = xmlnsColon + prefix;
- }
- rootElement.setAttribute(attributeName, namespace);
- }
- return prefix;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultCommand.java
deleted file mode 100644
index 1853f0653..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultCommand.java
+++ /dev/null
@@ -1,79 +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.commands;
-
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddFaultCommand extends AddMessageReferenceCommand
-{
- private Fault originalFault;
-
- public AddFaultCommand(Operation operation, String name)
- {
- super(operation,name);
- }
-
- public AddFaultCommand(Operation operation, String name, boolean createMessage)
- {
- super(operation,name,createMessage);
- }
-
- /*
- * Constructor used to create a Fault based on the given Fault. In essence, this will
- * create a copy of the given Fault.
- */
- public AddFaultCommand(Operation operation, Fault originalFault, String name) {
- super(operation, name, false);
-
- this.originalFault = originalFault;
- }
-
- public void run()
- {
- messageReference = WSDLFactory.eINSTANCE.createFault();
- messageReference.setName(name);
- messageReference.setEnclosingDefinition(operation.getEnclosingDefinition());
- operation.addFault((Fault)messageReference);
-
- // TBD - add binding fault
-
- if (originalFault == null) {
- if (createMessage)
- createMessage();
- }
- else {
- // Do necessary copying of data from original Fault to new Fault
- if (originalFault.getEMessage() != null) {
-// String originalMsgName = originalFault.getEMessage().getQName().getLocalPart();
-//
-// boolean gened = false;
-// if (originalFault.eContainer() instanceof Operation)
-// gened = SmartRenameAction.isMessageNameGenerated(originalMsgName, ((Operation) originalFault.eContainer()).getName(), "");
-//
-// String newMsgName = "";
-// if (gened) {
-// newMsgName = NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference);
-// }
-// else {
-// Definition definition = operation.getEnclosingDefinition();
-// Message tMessage = originalFault.getEMessage();
-// newMsgName = NameUtil.buildUniqueMessageName(definition, tMessage.getQName().getLocalPart());
-// }
-
- createMessage(originalFault, NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference));
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultParameterCommand.java
deleted file mode 100644
index e88072de4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultParameterCommand.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.commands;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class AddFaultParameterCommand extends AddBaseParameterCommand {
- protected Fault fault;
- private String faultName;
-
- public static int getParameterPatternForFault(Operation operation, Fault fault) {
- int pattern = -1;
- if (fault != null) {
- pattern = getPattern(fault.getEMessage());
- }
- if (pattern == -1) {
- pattern = AddBaseParameterCommand.getParameterPattern(operation);
- }
-
- return pattern;
- }
-
- private static int getPattern(Message message) {
- int pattern = -1;
- if (message != null) {
- Iterator parts = message.getEParts().iterator();
- while (parts.hasNext()) {
- Part part = (Part) parts.next();
- if (part.getElementDeclaration() != null) {
- pattern = AddBaseParameterCommand.PART_ELEMENT;
-
- XSDElementDeclaration xsdElement = part.getElementDeclaration();
- if (isSequencePattern(xsdElement.getTypeDefinition())) {
- pattern = AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT;
- }
- break;
- }
- else if (part.getTypeDefinition() != null) {
- pattern = AddBaseParameterCommand.PART_SIMPLETYPE;
-
- if (part.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
- pattern = AddBaseParameterCommand.PART_COMPLEXTYPE;
-
- XSDComplexTypeDefinition xsdType = (XSDComplexTypeDefinition) part.getTypeDefinition();
- if (isSequencePattern(xsdType)) {
- pattern = AddBaseParameterCommand.PART_COMPLEXTYPE_SEQ_ELEMENT;
- }
- }
- break;
- }
- }
- }
-
- return pattern;
- }
-
- private static boolean isSequencePattern(XSDTypeDefinition type) {
- boolean isSequencePattern = false;
-
- if (type instanceof XSDComplexTypeDefinition) {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) type;
-
- if (complexType.getContent() instanceof XSDParticle) {
- XSDParticle particle = (XSDParticle) complexType.getContent();
- if (particle.getContent() instanceof XSDModelGroup) {
- isSequencePattern = true;
- }
- }
- }
-
- return isSequencePattern;
- }
-
- public AddFaultParameterCommand(Operation operation, Fault fault) {
- super(operation, AddBaseParameterCommand.PART_ELEMENT);
- this.fault = fault;
- }
-
- /*
- *
- */
- public void run() {
- if (fault == null) {
- AddFaultCommand command = new AddFaultCommand(operation, getFaultName());
- command.run();
- fault = (Fault) command.getWSDLElement();
- }
-
- Part part = createWSDLComponents(fault);
- newPart = part;
-
- // Create necessary XSD Objects starting with the Part reference
- newXSDElement = createXSDObjects(part);
- }
-
- protected String getAnonymousXSDElementBaseName() {
- if (newAnonymousXSDElementName == null) {
- newAnonymousXSDElementName = operation.getName() + "_" + getFaultName(); //$NON-NLS-1$
- }
-
- return newAnonymousXSDElementName;
- }
-
- protected String getNewXSDElementBaseName() {
- if (newXSDElementName == null) {
- newXSDElementName = operation.getName() + "_" + getFaultName(); //$NON-NLS-1$
- }
-
- return newXSDElementName;
- }
-
- protected String getWSDLMessageName() {
- if (newWSDLMessageName == null) {
- newWSDLMessageName = operation.getName() + "_" + getFaultName() + "Msg"; //$NON-NLS-1$ //$NON-NLS-2$
- List usedNames = NameUtil.getUsedMessageNames(operation.getEnclosingDefinition());
- newWSDLMessageName = NameUtil.getUniqueNameHelper(newWSDLMessageName, usedNames);
- }
-
- return newWSDLMessageName;
- }
-
- protected String getWSDLPartName() {
- if (newWSDLPartName == null) {
- newWSDLPartName = getFaultName();
- }
-
- return newWSDLPartName;
- }
-
- private String getFaultName() {
- if (faultName == null) {
- if (fault != null) {
- faultName = fault.getName();
- }
- else {
- faultName = NameUtil.getFaultName(operation);
- }
- }
-
- return faultName;
- }
-
- public MessageReference getMessageReference() {
- return fault;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddImportCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddImportCommand.java
deleted file mode 100644
index 8439dbfbd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddImportCommand.java
+++ /dev/null
@@ -1,58 +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.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddImportCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String namespace;
- private String location;
- private Import importElement;
-
- public AddImportCommand
- (Definition definition,
- String namespace,
- String location)
- {
- this.definition = definition;
- this.namespace = namespace;
- this.location = location;
- }
-
- public WSDLElement getWSDLElement()
- {
- return importElement;
- }
-
- public void run()
- {
- importElement = WSDLFactory.eINSTANCE.createImport();
- importElement.setNamespaceURI(namespace);
- importElement.setLocationURI(location);
- importElement.setEnclosingDefinition(definition);
- definition.addImport(importElement);
- }
-
- public void setNamespaceURI(String namespace)
- {
- this.namespace = namespace;
- }
-
- public void setLocationURI(String location)
- {
- this.location = location;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputCommand.java
deleted file mode 100644
index db575f2c9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputCommand.java
+++ /dev/null
@@ -1,83 +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.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddInputCommand extends AddMessageReferenceCommand
-{
- private Input originalInput;
-
- public AddInputCommand(Operation operation, String name)
- {
- super(operation,name);
- }
-
- public AddInputCommand(Operation operation, String name, boolean createMessage)
- {
- super(operation,name,createMessage);
- }
-
- /*
- * Constructor used to create an Input based on the given Input. In essence, this will
- * create a copy of the given Input.
- */
- public AddInputCommand(Operation operation, Input originalInput, String name) {
- super(operation, name, false);
-
- this.originalInput = originalInput;
- }
-
- public void run()
- {
- messageReference = WSDLFactory.eINSTANCE.createInput();
- // messageReference.setName(name);
- messageReference.setEnclosingDefinition(operation.getEnclosingDefinition());
- operation.setInput((Input)messageReference);
-
- // TBD - add binding input
-
- if (originalInput == null) {
- if (createMessage)
- createMessage();
- }
- else {
- // Do necessary copying of data from original Input to new Input
- if (originalInput.getEMessage() != null) {
- String originalMsgName = originalInput.getEMessage().getQName().getLocalPart();
-
- boolean gened = false;
- if (originalInput.eContainer() instanceof Operation)
- gened = SmartRenameAction.isMessageNameGenerated(originalMsgName, ((Operation) originalInput.eContainer()).getName(), "Request"); //$NON-NLS-1$
-
- String newMsgName = ""; //$NON-NLS-1$
- if (gened) {
- newMsgName = NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference);
- }
- else {
- Definition definition = operation.getEnclosingDefinition();
- Message tMessage = originalInput.getEMessage();
- newMsgName = NameUtil.buildUniqueMessageName(definition, tMessage.getQName().getLocalPart());
- }
-
- createMessage(originalInput, newMsgName);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputParameterCommand.java
deleted file mode 100644
index 6f7d311d7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddInputParameterCommand.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.commands;
-
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.adapters.visitor.W11FindInnerElementVisitor;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.XSDComponentHelper;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class AddInputParameterCommand extends AddBaseParameterCommand {
- protected boolean createXSDObjects = true;
- protected boolean reuseExistingMessage = false;
- private Input input;
- public AddInputParameterCommand(Operation operation, int style) {
- super(operation, style);
- }
-
- public AddInputParameterCommand(Operation operation, int style, boolean reuseMessage) {
- super(operation, style);
- reuseExistingMessage = reuseMessage;
- }
-
- /*
- *
- */
- public void run() {
- Part part = null;
- if (operation.getEInput() != null) {
- input = operation.getEInput();
- }
- else {
- AddInputCommand command = new AddInputCommand(operation, null);
- command.run();
- input = (Input) command.getWSDLElement();
- }
-
- if (style == AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT) {
- part = createDocLitWrappedWSDLComponents(input);
- }
- else {
- part = createWSDLComponents(input);
- }
-
- newPart = part;
- // Create necessary XSD Objects starting with the Part reference
- if (createXSDObjects)
- newXSDElement = createXSDObjects(part);
- }
-
- protected Part createDocLitWrappedWSDLComponents(MessageReference messageRef) {
- Message message = messageRef.getEMessage();
- Part part = null;
-
- if (reuseExistingMessage && message == null) {
- // See if we can use an existing Message
- Message existingMessage = null;
- String messageName = getIdealMessageName(messageRef);
- Iterator messages = messageRef.getEnclosingDefinition().getEMessages().iterator();
- while (messages.hasNext()) {
- Message item = (Message) messages.next();
- QName itemName = item.getQName();
- if (itemName != null && itemName.getLocalPart() != null && messageName.equals(itemName.getLocalPart())) {
- existingMessage = item;
- break;
- }
- }
-
- if (existingMessage != null) {
- if (existingMessage.getEParts().size() > 0) {
- // See if existing Message has a Part referencing an XSD Element with the proper name
- Part existingPart = (Part) existingMessage.getEParts().get(0);
- if (!(existingPart.getName().equals(getDocLitWrappedPartName()))) {
- message = null;
- }
- else {
- XSDElementDeclaration existingElement = existingPart.getElementDeclaration();
- if (existingElement != null && existingElement.getName().equals(operation.getName())) {
- // There is an existing XSD Element with the proper name
- // See if the XSD Element has an anonymous type with a sequence and an XSD Element
- W11FindInnerElementVisitor visitor = new W11FindInnerElementVisitor();
- XSDElementDeclaration innerElement = visitor.getInnerXSDElement(existingElement);
- if (!innerElement.equals(existingElement)) {
- // Found an existing inner XSD Element
- createXSDObjects = false;
-
- // set the MessageReference --> Message reference
- messageRef.setEMessage(existingMessage);
- message = existingMessage;
- }
- }
- }
- }
- }
- }
-
- if (message == null || message.eContainer() == null) {
- // Create Message
- AddMessageCommand command = new AddMessageCommand(messageRef.getEnclosingDefinition(), getWSDLMessageName());
- command.run();
- message = (Message) command.getWSDLElement();
- messageRef.setEMessage(message);
- }
-
-
- if (message.getEParts().size() == 0) {
- // Create Part
- String partName = getDocLitWrappedPartName();
- AddPartCommand command = new AddPartCommand(message, partName);
- command.run();
- part = (Part) command.getWSDLElement();
- }
- else {
- part = (Part) message.getEParts().get(0);
- }
- formatChild(message.getElement());
-
- return part;
- }
-
- protected String getAnonymousXSDElementBaseName() {
- if (newAnonymousXSDElementName == null) {
- if (this.style == AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT) {
- newAnonymousXSDElementName = operation.getName();
- }
- else {
- newAnonymousXSDElementName = getWSDLPartName();
- }
- }
-
- return newAnonymousXSDElementName;
- }
-
- protected String getNewXSDElementBaseName() {
- if (newXSDElementName == null) {
- newXSDElementName = "in"; //$NON-NLS-1$
-// newXSDElementName = getWSDLPartName();
- }
-
- return newXSDElementName;
- }
-
- protected String getWSDLMessageName() {
- if (newWSDLMessageName == null) {
- if (operation.getEInput() != null) {
- newWSDLMessageName= NameUtil.getMessageName(operation.getEInput());
- }
- }
-
- return newWSDLMessageName;
- }
-
- protected String getWSDLPartName() {
- if (newWSDLPartName == null) {
- newWSDLPartName = NameUtil.getPartName(operation.getEInput());
- }
-
- return newWSDLPartName;
- }
-
- protected XSDElementDeclaration createPartElementSeqElementPattern(Part part, XSDElementDeclaration partElement) {
- XSDElementDeclaration returnedXSDElement = null;
-
- XSDElementDeclaration originalElement = null;
- XSDElementDeclaration anonXSDElement = null;
-
- // Create the XSDElement (anonymous) referenced by the Part if necessary
- if (partElement == null || partElement.getAnonymousTypeDefinition() == null) {
- //Find an existing XSDElement to use if possible
- XSDElementDeclaration existingElement = null;
- String idealElementName = getAnonymousXSDElementBaseName();
- XSDSchema schema = XSDComponentHelper.getXSDSchema(part.getEnclosingDefinition());
- if (schema != null) {
- Iterator it = schema.getElementDeclarations().iterator();
- while (existingElement == null && it.hasNext()) {
- XSDElementDeclaration item = (XSDElementDeclaration) it.next();
- if (item.getName().equals(idealElementName)) {
- // found an element we can use. Confirm it has a doc-lit-wrapped pattern
- // See if the XSD Element has an anonymous type with a sequence and an XSD Element
- existingElement = item;
-
- XSDTypeDefinition xsdType = item.getAnonymousTypeDefinition();
- if (xsdType != null) {
- List contents = xsdType.eContents();
- if (contents.size() > 0 && contents.get(0) instanceof XSDParticle) {
- XSDParticle particle = (XSDParticle) contents.get(0);
- List particleContents = particle.eContents();
- if (particleContents.size() > 0 && particleContents.get(0) instanceof XSDModelGroup) {
- XSDModelGroup modelGroup = (XSDModelGroup) particleContents.get(0);
- List modelContents = modelGroup.eContents();
- if (modelContents.size() > 0 && modelContents.get(0) instanceof XSDParticle) {
- XSDParticle innerParticle = (XSDParticle) modelContents.get(0);
- List innerContents = innerParticle.eContents();
- if (innerContents.size() > 0 && innerContents.get(0) instanceof XSDElementDeclaration) {
- // inner XSD Element exists
- // reuse existing element
- String prefixedName = getPrefixedComponentName(part.getEnclosingDefinition(), existingElement);
- ComponentReferenceUtil.setComponentReference(part, false, prefixedName);
- return existingElement;
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (existingElement == null) {
- anonXSDElement = XSDComponentHelper.createAnonymousXSDElementDefinition(getAnonymousXSDElementBaseName(), part);
-// part.setElementDeclaration(anonXSDElement);
- String prefixedName = getPrefixedComponentName(part.getEnclosingDefinition(), anonXSDElement);
- ComponentReferenceUtil.setComponentReference(part, false, prefixedName);
- part.setTypeDefinition(null);
-
- if (partElement != null && partElement.getSchema() != null) {
- originalElement = partElement;
- // Remove the 'original' XSDElement as a Global Element
- partElement.getSchema().getContents().remove(partElement);
- }
- }
- else {
- anonXSDElement = existingElement;
- // reuse existing element
- String prefixedName = getPrefixedComponentName(part.getEnclosingDefinition(), existingElement);
- ComponentReferenceUtil.setComponentReference(part, false, prefixedName);
- }
- }
- else {
- anonXSDElement = partElement;
- }
-
- // Create a new XSDElement
- XSDModelGroup modelGroup = XSDComponentHelper.getXSDModelGroup(anonXSDElement, part.getEnclosingDefinition());
- returnedXSDElement = XSDComponentHelper.createXSDElementDeclarationCommand(null, getNewXSDElementBaseName(), modelGroup);
-
- // Add the newly created XSDElement to the ModelGroup
- XSDComponentHelper.addXSDElementToModelGroup(anonXSDElement, returnedXSDElement);
-
- // Add the 'original' XSDElement if it's type wasn't anonymous
- if (originalElement != null) {
- XSDComponentHelper.addXSDElementToModelGroup(anonXSDElement, originalElement);
- }
- formatChild(anonXSDElement.getElement());
- return returnedXSDElement;
- }
-
- private String getIdealMessageName(MessageReference messageRef) {
- String messageName = "NewMessage"; //$NON-NLS-1$
- messageName = operation.getName() + "Request"; //$NON-NLS-1$
-
- return messageName;
- }
-
- public MessageReference getMessageReference() {
- return input;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageCommand.java
deleted file mode 100644
index 87bda0532..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageCommand.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.commands;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-
-
-public final class AddMessageCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private Message message;
- private Message originalMessage;
-
- private boolean createPart = false;
- private final String DEFAULT_PART_NAME = "NewPart"; //$NON-NLS-1$
-
- public AddMessageCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public AddMessageCommand
- (Definition definition,
- String localName,
- boolean createPart)
- {
- this.definition = definition;
- this.localName = localName;
- this.createPart = createPart;
- }
-
- /*
- * Constructor used to create a Message based on the given Message. In essence, this will
- * create a copy of the given Message.
- */
- public AddMessageCommand(Definition definition, Message originalMessage, String localName, boolean copyPart) {
- this.definition = definition;
- this.localName = localName;
- this.createPart = copyPart;
- this.originalMessage = originalMessage;
- }
-
- public void run()
- {
- message = WSDLFactory.eINSTANCE.createMessage();
- message.setQName(new QName(definition.getTargetNamespace(),localName));
- message.setEnclosingDefinition(definition);
- definition.addMessage(message);
-
- if (originalMessage == null) {
- if (createPart)
- {
- AddPartCommand command =
- new AddPartCommand(message,DEFAULT_PART_NAME,WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"string",true); //$NON-NLS-1$
- command.run();
- }
- }
- else {
- if (originalMessage.getEParts() != null) {
- Iterator it = originalMessage.getEParts().iterator();
-
- while (it.hasNext()) {
- Part part = (Part) it.next();
- AddPartCommand command;
- if (SmartRenameAction.isPartNameGenerated(part.getName(), originalMessage.getQName().getLocalPart()))
- command = new AddPartCommand(message, part, NameUtil.buildUniquePartName(message, message.getQName().getLocalPart()));
- else
- command = new AddPartCommand(message, part, part.getName());
-
-
- command.run();
- }
- }
- }
- }
-
- public void setLocalName(String name)
- {
- this.localName = name;
- }
-
- public WSDLElement getWSDLElement()
- {
- return message;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageReferenceCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageReferenceCommand.java
deleted file mode 100644
index ae939f7e1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageReferenceCommand.java
+++ /dev/null
@@ -1,71 +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.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLElement;
-
-abstract public class AddMessageReferenceCommand extends WSDLElementCommand
-{
- protected String name;
- protected MessageReference messageReference;
- protected Operation operation;
- protected boolean createMessage = false;
- private final String DEFAULT_MESSAGE_NAME = "NewMessage"; //$NON-NLS-1$
-
- public AddMessageReferenceCommand(Operation operation, String name)
- {
- this.operation = operation;
- this.name = name;
- }
-
- public AddMessageReferenceCommand(Operation operation, String name, boolean createMessage)
- {
- this.operation = operation;
- this.name = name;
- this.createMessage = createMessage;
- }
-
- protected void createMessage()
- {
- Definition definition = operation.getEnclosingDefinition();
- AddMessageCommand command =
- new AddMessageCommand(definition,DEFAULT_MESSAGE_NAME,createMessage);
- command.run();
- messageReference.setEMessage((Message)command.getWSDLElement());
- }
-
- /*
- * Overloaded createMessage(arg) method. Similar to to createMessage() but takes in a MessageReference.
- * Method used to create a copy of the original Message (contained in the passed in MessageReference).
- */
- protected void createMessage(MessageReference originalMRef, String newMessageRefName) {
- Definition definition = operation.getEnclosingDefinition();
- Message tMessage = originalMRef.getEMessage();
- AddMessageCommand command =
- new AddMessageCommand(definition, tMessage, newMessageRefName, true);
- command.run();
- messageReference.setEMessage((Message)command.getWSDLElement());
- }
-
- public WSDLElement getWSDLElement()
- {
- return messageReference;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOperationCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOperationCommand.java
deleted file mode 100644
index aef70d0b3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOperationCommand.java
+++ /dev/null
@@ -1,145 +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.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddOperationCommand extends WSDLElementCommand
-{
- private PortType portType;
- private String name;
- private Operation operation;
- private Operation originalOperation;
- private boolean copyInOutFault;
-
- private boolean createInput = false;
- private boolean createOutput = false;
- private boolean createFault = false;
-
- private final String DEFAULT_INPUT_NAME = ""; //$NON-NLS-1$
- private final String DEFAULT_OUTPUT_NAME = ""; //$NON-NLS-1$
- private final String DEFAULT_FAULT_NAME = ""; //$NON-NLS-1$
-
- public AddOperationCommand
- (PortType portType,
- String name)
- {
- this.portType = portType;
- this.name = name;
- }
-
- public AddOperationCommand
- (PortType portType,
- String name,
- boolean createInput,
- boolean createOutput,
- boolean createFault)
- {
- this.portType = portType;
- this.name = name;
- this.createInput = createInput;
- this.createOutput = createOutput;
- this.createFault = createFault;
- }
-
- /*
- * Constructor used to create an Operation based on the given Operation. In essence, this will
- * create a copy of the given Operation.
- */
- public AddOperationCommand(PortType portType, Operation originalOperation, String name, boolean copyInOutFault) {
- this.portType = portType;
- this.originalOperation = originalOperation;
- this.name = name;
- this.copyInOutFault = copyInOutFault;
- }
-
- public void run()
- {
- operation = WSDLFactory.eINSTANCE.createOperation();
- operation.setName(name);
- operation.setEnclosingDefinition(portType.getEnclosingDefinition());
- portType.addOperation(operation);
-
- if (originalOperation == null) {
- WSDLElementCommand command = null;
- if (createInput)
- {
- command = new AddInputCommand(operation,DEFAULT_INPUT_NAME,true);
- command.run();
- }
-
- if (createOutput)
- {
- command = new AddOutputCommand(operation,DEFAULT_OUTPUT_NAME,true);
- command.run();
- }
-
- if (createFault)
- {
- command = new AddFaultCommand(operation,DEFAULT_FAULT_NAME,true);
- command.run();
- }
- }
- else {
- // Do necessary copying of data from original operation to new operation
- // Paramater ordering? Documentation? This part still needs to be worked on
- // Copy 'kids' if necessary
- if (copyInOutFault) {
- WSDLElementCommand command = null;
-
- if (originalOperation.getEOutput() != null)
- {
- Output output = originalOperation.getEOutput();
- command = new AddOutputCommand(operation, output, NameUtil.buildUniqueOutputName(portType, operation.getName(), "")); //$NON-NLS-1$
- command.run();
- }
-
- if (originalOperation.getEInput() != null)
- {
- Input input = originalOperation.getEInput();
- command = new AddInputCommand(operation, input, NameUtil.buildUniqueInputName(portType, operation.getName(), "")); //$NON-NLS-1$
- command.run();
- }
-
- if (originalOperation.getEFaults() != null)
- {
- Iterator it = originalOperation.getEFaults().iterator();
- while (it.hasNext()) {
- Fault fault = (Fault) it.next();
- command = new AddFaultCommand(operation, fault, NameUtil.buildUniqueFaultName(originalOperation, fault.getName()));
- command.run();
- }
- }
-
- }
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return operation;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputCommand.java
deleted file mode 100644
index 28811d23d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputCommand.java
+++ /dev/null
@@ -1,82 +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.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddOutputCommand extends AddMessageReferenceCommand
-{
- private Output originalOutput;
-
- public AddOutputCommand(Operation operation, String name)
- {
- super(operation,name);
- }
-
- public AddOutputCommand(Operation operation, String name, boolean createMessage)
- {
- super(operation,name,createMessage);
- }
-
- /*
- * Constructor used to create an Output based on the given Output. In essence, this will
- * create a copy of the given Output.
- */
- public AddOutputCommand(Operation operation, Output originalOutput, String name) {
- super(operation, name, false);
-
- this.originalOutput = originalOutput;
- }
-
- public void run()
- {
- messageReference = WSDLFactory.eINSTANCE.createOutput();
-// messageReference.setName(name);
- messageReference.setEnclosingDefinition(operation.getEnclosingDefinition());
- operation.setOutput((Output)messageReference);
-
- // TBD - add binding output
-
- if (originalOutput == null) {
- if (createMessage)
- createMessage();
- }
- else {
- // Do necessary copying of data from original Output to new Output
- if (originalOutput.getEMessage() != null) {
- String originalMsgName = originalOutput.getEMessage().getQName().getLocalPart();
-
- boolean gened = false;
- if (originalOutput.eContainer() instanceof Operation)
- gened = SmartRenameAction.isMessageNameGenerated(originalMsgName, ((Operation) originalOutput.eContainer()).getName(), "Response"); //$NON-NLS-1$
-
- String newMsgName = ""; //$NON-NLS-1$
- if (gened) {
- newMsgName = NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference);
- }
- else {
- Definition definition = operation.getEnclosingDefinition();
- Message tMessage = originalOutput.getEMessage();
- newMsgName = NameUtil.buildUniqueMessageName(definition, tMessage.getQName().getLocalPart());
- }
-
- createMessage(originalOutput, newMsgName);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputParameterCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputParameterCommand.java
deleted file mode 100644
index 3085bfd4a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputParameterCommand.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.commands;
-
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class AddOutputParameterCommand extends AddBaseParameterCommand {
- private Output output;
-
- public AddOutputParameterCommand(Operation operation, int style) {
- super(operation, style);
- }
-
- /*
- *
- */
- public void run() {
- Part part = null;
- if (operation.getEOutput() != null) {
- output = operation.getEOutput();
- part = createWSDLComponents(operation.getEOutput());
- }
- else {
- AddOutputCommand command = new AddOutputCommand(operation, null);
- command.run();
- output = (Output) command.getWSDLElement();
- part = createWSDLComponents(output);
- }
-
- newPart = part;
- // Create necessary XSD Objects starting with the Part reference
- newXSDElement = createXSDObjects(part);
- }
-
- protected String getAnonymousXSDElementBaseName() {
- if (newAnonymousXSDElementName == null) {
- if (this.style == AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT) {
- newAnonymousXSDElementName = operation.getName() + "Response"; //$NON-NLS-1$;
- }
- else {
- newAnonymousXSDElementName = getWSDLPartName();
- }
- }
-
- return newAnonymousXSDElementName;
- }
-
- protected String getNewXSDElementBaseName() {
- if (newXSDElementName == null) {
- newXSDElementName = "out"; //$NON-NLS-1$
-// newXSDElementName = getWSDLPartName();
- }
-
- return newXSDElementName;
- }
-
- protected String getWSDLMessageName() {
- if (newWSDLMessageName == null) {
- if (operation.getEOutput() != null) {
- newWSDLMessageName= NameUtil.getMessageName(operation.getEOutput());
- }
- }
-
- return newWSDLMessageName;
- }
-
- protected String getWSDLPartName() {
- if (newWSDLPartName == null) {
- newWSDLPartName = NameUtil.getPartName(operation.getEOutput());
- }
-
- return newWSDLPartName;
- }
-
- public MessageReference getMessageReference() {
- return output;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPartCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPartCommand.java
deleted file mode 100644
index f4908a64e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPartCommand.java
+++ /dev/null
@@ -1,209 +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.commands;
-
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.internal.impl.PartImpl;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-public final class AddPartCommand extends WSDLElementCommand
-{
- private Message message;
- private String name;
- private Part part;
- private Part originalPart;
-
- private QName typeOrElementName;
- private boolean useType = true;
-
- public AddPartCommand
- (Message message,
- String name)
- {
- this.message = message;
- this.name = name;
- }
-
- public AddPartCommand
- (Message message,
- String name,
- String namespace,
- String localName,
- boolean useType)
- {
- this.message = message;
- this.name = name;
- this.useType = useType;
- typeOrElementName = new QName(namespace,localName);
- }
-
- /*
- * Constructor used to create a Part based on the given Part. In essence, this will
- * create a copy of the given Part.
- */
- public AddPartCommand
- (Message message,
- Part originalPart,
- String name)
- {
- this.message = message;
- this.name = name;
- this.originalPart = originalPart;
- }
-
- /**
- * @deprecated
- */
- public AddPartCommand
- (Message message,
- String name,
- String namespace,
- String localName)
- {
- this.message = message;
- this.name = name;
- typeOrElementName = new QName(namespace,localName);
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public WSDLElement getWSDLElement()
- {
- return part;
- }
-
- public void run()
- {
- if (typeOrElementName == null)
- typeOrElementName = createDefaultTypeName();
-
- // Add namespace to the Definitions if it is not there yet.
- addNamespaceDeclaration();
-
- part = WSDLFactory.eINSTANCE.createPart();
- part.setName(name);
-
- if (originalPart == null) {
- if (useType)
- part.setTypeName(typeOrElementName);
- else
- part.setElementName(typeOrElementName);
- }
- else {
- if (originalPart.getTypeName() != null)
- part.setTypeName(originalPart.getTypeName());
-
- String newElementName = null;
- if (originalPart.getElementName() != null) {
-
- boolean createNewElement = true;
- if (originalPart.getElementDeclaration() != null && originalPart.getElementDeclaration().getElement() != null) {
- if (!(originalPart.getElementDeclaration().getElement() instanceof IDOMNode)) {
- createNewElement = false;
- }
- }
-
- if (createNewElement) {
- newElementName = getNewNameHelper(name, originalPart.getEnclosingDefinition(), false);
- part.setElementName(new QName(originalPart.getElementName().getNamespaceURI(), newElementName));
-
- if (originalPart.getEnclosingDefinition() != null) {
- if (newElementName == null) {
- newElementName = getNewNameHelper(name, originalPart.getEnclosingDefinition(), false);
- }
-
- AddXSDElementDeclarationCommand elementAction = new AddXSDElementDeclarationCommand(originalPart.getEnclosingDefinition(), newElementName);
- elementAction.run();
- }
- }
- else {
- part.setElementName(new QName(originalPart.getElementName().getNamespaceURI(), originalPart.getElementName().getLocalPart()));
- }
- }
- }
-
- part.setEnclosingDefinition(message.getEnclosingDefinition());
- ((PartImpl)part).reconcileReferences(false);
- message.addPart(part);
- }
-
- private void addNamespaceDeclaration()
- {
- Definition definition = message.getEnclosingDefinition();
- if (!definition.getNamespaces().containsValue(typeOrElementName.getNamespaceURI()))
- {
- definition.addNamespace("p",typeOrElementName.getNamespaceURI()); //$NON-NLS-1$
-// ((WSDLElementImpl)definition).updateElement(false);
- }
- }
-
- private QName createDefaultTypeName()
- {
- QName qname = new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"string"); //$NON-NLS-1$
- return qname;
- }
-
- private String getNewNameHelper(String base, Definition def, boolean isType)
- {
- String name = base;
- int count = 0;
-
- // Ugly.... Redo this...
- // Get a list of Elements...
- List elementList = null;
- if (def.getETypes() != null) {
- List xsdsList = def.getETypes().getEExtensibilityElements();
- if (xsdsList != null) {
- Iterator xsdsIterator = xsdsList.iterator();
- XSDSchemaExtensibilityElement xsdElement = (XSDSchemaExtensibilityElement) xsdsIterator.next();
- XSDSchema schema = xsdElement.getSchema();
- if (schema != null) {
- elementList = schema.getElementDeclarations();
- }
- }
- }
-
- if (elementList != null) {
- int index = 0;
- while (index < elementList.size()) {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) elementList.get(index);
-
- if (name.equals(elementDeclaration.getName())) {
- count++;
- name = name + count;
- index = 0;
- }
- else {
- index++;
- }
- }
- }
-
- return name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortCommand.java
deleted file mode 100644
index c326901bf..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortCommand.java
+++ /dev/null
@@ -1,49 +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.commands;
-
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddPortCommand extends WSDLElementCommand
-{
- private Service service;
- private String name;
- private Port port;
-
- public AddPortCommand
- (Service service,
- String name)
- {
- this.service = service;
- this.name = name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public WSDLElement getWSDLElement()
- {
- return port;
- }
-
- public void run()
- {
- port = WSDLFactory.eINSTANCE.createPort();
- port.setName(name);
- port.setEnclosingDefinition(service.getEnclosingDefinition());
- service.addPort(port);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortTypeCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortTypeCommand.java
deleted file mode 100644
index b26feb543..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddPortTypeCommand.java
+++ /dev/null
@@ -1,75 +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.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-
-public final class AddPortTypeCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private PortType portType;
-
- private boolean createOperation = false;
- private final String DEFAULT_OPERATION_NAME = "NewOperation"; //$NON-NLS-1$
-
- public AddPortTypeCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public AddPortTypeCommand
- (Definition definition,
- String localName,
- boolean createOperation)
- {
- this.definition = definition;
- this.localName = localName;
- this.createOperation = createOperation;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.ui.internal.commands.WSDLElementAction#getWSDLElement()
- */
- public WSDLElement getWSDLElement()
- {
- return portType;
- }
-
- public void run()
- {
- portType = WSDLFactory.eINSTANCE.createPortType();
- portType.setQName(new QName(definition.getTargetNamespace(),localName));
- portType.setEnclosingDefinition(definition);
- definition.addPortType(portType);
-
- if (createOperation)
- {
- AddOperationCommand command =
- new AddOperationCommand(portType,DEFAULT_OPERATION_NAME,true,true,false);
- command.run();
- }
- }
-
- public void setLocalName(String name)
- {
- localName = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddServiceCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddServiceCommand.java
deleted file mode 100644
index 955cf1893..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddServiceCommand.java
+++ /dev/null
@@ -1,72 +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.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-
-public final class AddServiceCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private Service service;
-
- private boolean createPort = false;
- private final String DEFAULT_PORT_NAME = "NewPort"; //$NON-NLS-1$
-
- public AddServiceCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public AddServiceCommand
- (Definition definition,
- String localName,
- boolean createPort)
- {
- this.definition = definition;
- this.localName = localName;
- this.createPort = createPort;
- }
-
- public WSDLElement getWSDLElement()
- {
- return service;
- }
-
- public void run()
- {
- service = WSDLFactory.eINSTANCE.createService();
- service.setQName(new QName(definition.getTargetNamespace(),localName));
- service.setEnclosingDefinition(definition);
- definition.addService(service);
-
- if (createPort)
- {
- AddPortCommand command =
- new AddPortCommand(service,DEFAULT_PORT_NAME);
- command.run();
- }
- }
-
- public void setLocalName(String name)
- {
- localName = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddTypesCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddTypesCommand.java
deleted file mode 100644
index d87e58c52..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddTypesCommand.java
+++ /dev/null
@@ -1,43 +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.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-// Definition must not have "types" element to run this command.
-public final class AddTypesCommand extends WSDLElementCommand
-{
- private Definition definition;
- private Types types;
-
- public AddTypesCommand(Definition definition)
- {
- this.definition = definition;
- }
-
- public void run()
- {
- if ((types = definition.getETypes()) != null)
- return; // "types" already exists.
-
- types = WSDLFactory.eINSTANCE.createTypes();
- types.setEnclosingDefinition(definition);
- definition.setTypes(types);
- }
-
- public WSDLElement getWSDLElement()
- {
- return types;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddUnknownExtensibilityElementCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddUnknownExtensibilityElementCommand.java
deleted file mode 100644
index f0487bc15..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddUnknownExtensibilityElementCommand.java
+++ /dev/null
@@ -1,80 +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.commands;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.UnknownExtensibilityElement;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.internal.impl.UnknownExtensibilityElementImpl;
-
-public final class AddUnknownExtensibilityElementCommand extends WSDLElementCommand
-{
- private ExtensibleElement extensibleElement;
- private String namespaceURI;
- private String localName;
- private UnknownExtensibilityElement extensibilityElement;
- private Map properties;
-
- public AddUnknownExtensibilityElementCommand
- (ExtensibleElement extensibleElement,
- String namespaceURI,
- String localName)
- {
- this.extensibleElement = extensibleElement;
- this.namespaceURI = namespaceURI;
- this.localName = localName;
- }
-
- public AddUnknownExtensibilityElementCommand
- (ExtensibleElement extensibleElement,
- String namespaceURI,
- String localName,
- Map properties)
- {
- this.extensibleElement = extensibleElement;
- this.namespaceURI = namespaceURI;
- this.localName = localName;
- this.properties = properties;
- }
-
- public WSDLElement getWSDLElement()
- {
- return extensibilityElement;
- }
-
- public void run()
- {
- extensibilityElement = WSDLFactory.eINSTANCE.createUnknownExtensibilityElement();
- extensibilityElement.setElementType(new QName(namespaceURI,localName));
-
- if (properties != null)
- {
- Iterator iterator = properties.entrySet().iterator();
- Map.Entry entry = null;
- while (iterator.hasNext())
- {
- entry = (Map.Entry)iterator.next();
- String attribute = (String)entry.getKey();
- String value = (String)entry.getValue();
- ((UnknownExtensibilityElementImpl)extensibilityElement).setAttribute(attribute,value);
- }
- }
-
- extensibilityElement.setEnclosingDefinition(extensibleElement.getEnclosingDefinition());
- extensibleElement.addExtensibilityElement(extensibilityElement);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDElementDeclarationCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDElementDeclarationCommand.java
deleted file mode 100644
index ce14e6757..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDElementDeclarationCommand.java
+++ /dev/null
@@ -1,147 +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.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-// This class is used to create a new XSDElementDeclaration in the targetNamespace.
-public final class AddXSDElementDeclarationCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String targetNamespace;
- private String elementName;
- private XSDSchema schema;
- private XSDElementDeclaration xsdElement;
-
- /**
- * TODO:
- * We have a potential problem here.... What if the definition targetnamespace is null....
- */
- public AddXSDElementDeclarationCommand(Definition definition, String elementName)
- {
- this.definition = definition;
- this.targetNamespace = definition.getTargetNamespace();
- this.elementName = elementName;
- }
-
- /**
- * @deprecated
- * Use AddXSDElementDeclarationCommand(Definition definition, String typeName)
- */
- public AddXSDElementDeclarationCommand
- (Definition definition,
- String targetNamespace,
- String elementName)
- {
- this.definition = definition;
- this.targetNamespace = targetNamespace;
- this.elementName = elementName;
- }
-
- public void run()
- {
- XSDSchema xsdSchema = getSchema();
- XSDElementDeclaration elementDecl =
- XSDFactory.eINSTANCE.createXSDElementDeclaration();
- elementDecl.setName(elementName);
-
- XSDSimpleTypeDefinition simpleTypeDefinition = getXSDStringType(xsdSchema);
- elementDecl.setTypeDefinition(simpleTypeDefinition);
- xsdSchema.getContents().add(elementDecl);
-
- xsdElement = elementDecl;
- }
-
- public void run(String newElementName) {
- elementName = newElementName;
- run();
- }
-
- /*
- * Specify which Schema to use when creating the Type.
- * Call this method before calling run(). Otherwise it will use the first
- * Schema it finds.
- */
- public void setSchema(XSDSchema schema) {
- this.schema = schema;
- }
-
- /*
- * Return the Schema used to create the Type
- */
- public XSDSchema getSchema() {
- if (schema == null) {
- return getXSDSchema(targetNamespace);
- }
- else {
- return schema;
- }
- }
-
- private XSDSimpleTypeDefinition getXSDStringType(XSDSchema schema)
- {
- return schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
- }
-
- private XSDSchema getXSDSchema(String targetNamespace)
- {
- XSDSchema xsdSchema;
-
- // Do we have a schema already?
- Iterator iterator = getTypes().getSchemas(targetNamespace).iterator();
- if (iterator.hasNext())
- {
- xsdSchema = (XSDSchema)iterator.next(); // Get the first one.
- return xsdSchema;
- }
- else
- {
- // Create a new schema because there's none.
- AddXSDSchemaCommand command = new AddXSDSchemaCommand(definition,targetNamespace);
- command.run();
- return ((XSDSchemaExtensibilityElement)command.getWSDLElement()).getSchema();
- }
- }
-
- private Types getTypes()
- {
- // Types is created if it does not exist yet.
- Types types = (Types)definition.getTypes();
- if (types != null)
- return types;
- else
- {
- AddTypesCommand command = new AddTypesCommand(definition);
- command.run();
- return (Types)command.getWSDLElement();
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return null;
- }
-
- public XSDElementDeclaration getXSDElement()
- {
- return xsdElement;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDSchemaCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDSchemaCommand.java
deleted file mode 100644
index 207916449..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDSchemaCommand.java
+++ /dev/null
@@ -1,84 +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.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-
-
-
-public final class AddXSDSchemaCommand extends WSDLElementCommand
-{
- private Definition definition;
- private XSDSchemaExtensibilityElement extensibilityElement;
- private String targetNamespace;
-
- public AddXSDSchemaCommand(Definition definition)
- {
- this.definition = definition;
- this.targetNamespace = definition.getTargetNamespace();
- }
-
- public AddXSDSchemaCommand(Definition definition, String targetNamespace)
- {
- this.definition = definition;
- this.targetNamespace = targetNamespace;
- }
-
- public void run()
- {
- extensibilityElement = WSDLFactory.eINSTANCE.createXSDSchemaExtensibilityElement();
- extensibilityElement.setEnclosingDefinition(definition);
-
- XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
- xsdSchema.setSchemaForSchemaQNamePrefix("xsd"); //$NON-NLS-1$
- xsdSchema.setTargetNamespace(targetNamespace);
- // Choose the prefix Choose the prefix used for this schema's namespace and the schema for schema's namespace.
- //
- java.util.Map qNamePrefixToNamespaceMap = xsdSchema.getQNamePrefixToNamespaceMap();
-// qNamePrefixToNamespaceMap.put("p", xsdSchema.getTargetNamespace());
- qNamePrefixToNamespaceMap.put
- (xsdSchema.getSchemaForSchemaQNamePrefix(),org.eclipse.xsd.util.XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- extensibilityElement.setSchema(xsdSchema);
-
- // TBD - Check if multiple schemas with the same targetNamespace can co-exist.
- Types types = getTypes();
- types.addExtensibilityElement(extensibilityElement);
-
- if (definition.getETypes() == null) {
- definition.setETypes(types);
- }
- }
-
- private Types getTypes()
- {
- // Types is created if it does not exist.
- Types types = (Types)definition.getTypes();
- if (types != null)
- return types;
- else
- {
- types = WSDLFactory.eINSTANCE.createTypes();
- types.setEnclosingDefinition(definition);
- return types;
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return extensibilityElement;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDTypeDefinitionCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDTypeDefinitionCommand.java
deleted file mode 100644
index 5cd7cea45..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDTypeDefinitionCommand.java
+++ /dev/null
@@ -1,162 +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.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-// This class is used to create a new XSDTypeDefinition in the targetNamespace.
-public final class AddXSDTypeDefinitionCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String targetNamespace;
- private String typeName;
- private XSDSchema schema;
- private XSDTypeDefinition xsdType;
- private boolean isComplexType = true;
-
- /**
- * TODO:
- * We have a potential problem here.... What if the definition targetnamespace is null....
- */
- public AddXSDTypeDefinitionCommand(Definition definition, String typeName)
- {
- this.definition = definition;
- this.targetNamespace = definition.getTargetNamespace();
- this.typeName = typeName;
- }
-
- public AddXSDTypeDefinitionCommand(Definition definition, String typeName, boolean isComplexType)
- {
- this(definition, typeName);
- this.isComplexType = isComplexType;
- }
-
- /**
- * @deprecated
- * Use AddXSDTypeDefinitionCommand(Definition definition, String typeName)
- */
- public AddXSDTypeDefinitionCommand
- (Definition definition,
- String targetNamespace,
- String typeName)
- {
- this.definition = definition;
- this.targetNamespace = targetNamespace;
- this.typeName = typeName;
- }
-
- public void run()
- {
- XSDSchema xsdSchema = getSchema();
- XSDTypeDefinition typeDef;
-
- if (isComplexType) {
- typeDef = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- }
- else {
- typeDef = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- }
-
- typeDef.setName(typeName);
- xsdSchema.getContents().add(typeDef);
-
- xsdType = typeDef;
- }
-
- public void run(String newTypeName) {
- typeName = newTypeName;
- run();
- }
-
- /*
- * Specifiy if we should create a complex or simple type. This should should be
- * called before run().
- * Overrides the value set when the constructor
- * AddXSDTypeDefinitionCommand(Definition definition, String typeName, boolean isComplexType)
- * is used.
- */
- public void isComplexType(boolean isComplexType) {
- this.isComplexType = isComplexType;
- }
-
- /*
- * Specify which Schema to use when creating the Type.
- * Call this method before calling run(). Otherwise it will use the first
- * Schema it finds.
- */
- public void setSchema(XSDSchema schema) {
- this.schema = schema;
- }
-
- /*
- * Return the Schema used to create the Type
- */
- public XSDSchema getSchema() {
- if (schema == null) {
- return getXSDSchema(targetNamespace);
- }
- else {
- return schema;
- }
- }
-
- private XSDSchema getXSDSchema(String targetNamespace)
- {
- XSDSchema xsdSchema;
-
- // Do we have a schema already?
- Iterator iterator = getTypes().getSchemas(targetNamespace).iterator();
- if (iterator.hasNext())
- {
- xsdSchema = (XSDSchema)iterator.next(); // Get the first one.
- return xsdSchema;
- }
- else
- {
- // Create a new schema because there's none.
- AddXSDSchemaCommand command = new AddXSDSchemaCommand(definition,targetNamespace);
- command.run();
- return ((XSDSchemaExtensibilityElement)command.getWSDLElement()).getSchema();
- }
- }
-
- private Types getTypes()
- {
- // Types is created if it does not exist yet.
- Types types = (Types)definition.getTypes();
- if (types != null)
- return types;
- else
- {
- AddTypesCommand command = new AddTypesCommand(definition);
- command.run();
- return (Types)command.getWSDLElement();
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return null;
- }
-
- public XSDTypeDefinition getXSDElement()
- {
- return xsdType;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/WSDLElementCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/WSDLElementCommand.java
deleted file mode 100644
index a01805165..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/commands/WSDLElementCommand.java
+++ /dev/null
@@ -1,19 +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.commands;
-
-import org.eclipse.wst.wsdl.WSDLElement;
-
-public abstract class WSDLElementCommand
-{
- public abstract WSDLElement getWSDLElement();
- public abstract void run();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/AddressPortOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/AddressPortOptionsPage.java
deleted file mode 100644
index bb8fcc26b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/AddressPortOptionsPage.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.contentgenerator.ui;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.internal.generator.BaseGenerator;
-import org.eclipse.wst.wsdl.internal.generator.ContentGenerator;
-import org.eclipse.wst.wsdl.internal.generator.PortGenerator;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage;
-
-public class AddressPortOptionsPage implements ContentGeneratorOptionsPage, ModifyListener
-{
- protected Text addressField;
- protected Composite control;
- protected PortGenerator generator;
- protected WizardPage wizardPage;
-
- public void init(BaseGenerator generator){
- if (generator instanceof PortGenerator) {
- this.generator = (PortGenerator) generator;
- }
- }
-
- public void setWizardPage(WizardPage wizardPage) {
- this.wizardPage = wizardPage;
- }
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- separator.setLayoutData(gd);
-
- Label addressLabel = new Label(control, SWT.NONE);
- addressLabel.setText(Messages._UI_LABEL_ADDRESS + ":"); //$NON-NLS-1$
- addressField = new Text(control, SWT.BORDER);
- addressField.setText(ContentGenerator.ADDRESS_LOCATION);
- addressField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- addressField.addModifyListener(this);
-
- generator.setAddressLocation(addressField.getText());
-
- return control;
- }
-
- public boolean isOverwriteApplicable()
- {
- return false;
- }
-
- public void modifyText(ModifyEvent e)
- {
- generator.setAddressLocation(addressField.getText());
- }
-
- public void setOptionsOnGenerator() {
- }
-
- public Composite getControl() {
- return control;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/BaseContentGeneratorOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/BaseContentGeneratorOptionsPage.java
deleted file mode 100644
index f10562d63..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/BaseContentGeneratorOptionsPage.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.contentgenerator.ui;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.ws.internal.plugin.WSPlugin;
-import org.eclipse.wst.ws.internal.preferences.PersistentWSIContext;
-import org.eclipse.wst.wsdl.internal.generator.BaseGenerator;
-import org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage;
-
-public abstract class BaseContentGeneratorOptionsPage implements ContentGeneratorOptionsPage, SelectionListener, IMessageProvider {
- protected Composite control;
- protected BaseGenerator generator;
- protected WizardPage wizardPage;
- protected IFile targetFile;
-
- public abstract void setOptionsOnGenerator();
-
- public Composite getControl() {
- return control;
- }
-
- public void init(BaseGenerator baseGenerator) {
- generator = baseGenerator;
- }
-
- public boolean isOverwriteApplicable() {
- return true;
- }
-
- public void setWizardPage(WizardPage wizardPage) {
- this.wizardPage = wizardPage;
- }
-
- public void widgetSelected(SelectionEvent event) {
- setOptionsOnGenerator();
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
-
- public void setTargetIFile(IFile targetFile) {
- this.targetFile = targetFile;
- }
-
- public String getMessage() {
- return ""; //$NON-NLS-1$
- }
-
- public int getMessageType() {
- return IMessageProvider.NONE;
- }
-
- public String getWSIPreferences() {
- IProject targetProject = targetFile.getProject();
- PersistentWSIContext WSISSBcontext = WSPlugin.getInstance().getWSISSBPContext();
-
- if (WSISSBcontext.projectStopNonWSICompliances(targetProject)) {
- return (PersistentWSIContext.STOP_NON_WSI);
- }
- else if (WSISSBcontext.projectWarnNonWSICompliances(targetProject)) {
- return (PersistentWSIContext.WARN_NON_WSI);
- }
- else {
- return (PersistentWSIContext.IGNORE_NON_WSI);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpBindingOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpBindingOptionsPage.java
deleted file mode 100644
index 5175b7f4e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpBindingOptionsPage.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.contentgenerator.ui;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.binding.http.internal.generator.HTTPContentGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-
-public class HttpBindingOptionsPage extends BaseContentGeneratorOptionsPage
-{
- protected Button getButton;
- protected Button postButton;
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
-
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(Messages._UI_LABEL_HTTP_BINDING_OPTIONS); //$NON-NLS-1$
-
- getButton = new Button(control, SWT.RADIO);
- getButton.setText("HTTP GET"); //$NON-NLS-1$
- getButton.setSelection(true);
-
- postButton = new Button(control, SWT.RADIO);
- postButton.setText("HTTP POST"); //$NON-NLS-1$
-
- if (generator.getName() != null)
- {
- Definition definition = generator.getDefinition();
- QName qname = new QName(definition.getTargetNamespace(), generator.getName());
- Binding binding = (Binding) definition.getBinding(qname);
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String verb = element.getAttribute("verb"); //$NON-NLS-1$
- if ("POST".equals(verb)) //$NON-NLS-1$
- {
- getButton.setSelection(false);
- postButton.setSelection(true);
- }
- }
- }
- }
-
- postButton.addSelectionListener(this);
- getButton.addSelectionListener(this);
- setOptionsOnGenerator();
-
- return control;
- }
-
- public void setOptionsOnGenerator() {
- if (generator.getContentGenerator() instanceof HTTPContentGenerator) {
- HTTPContentGenerator httpGenerator = (HTTPContentGenerator) generator.getContentGenerator();
-
- if (postButton.getSelection()) {
- httpGenerator.setVerb(HTTPContentGenerator.VERB_POST);
- }
- else if (getButton.getSelection()) {
- httpGenerator.setVerb(HTTPContentGenerator.VERB_GET);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/ISoapStyleInfo.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/ISoapStyleInfo.java
deleted file mode 100644
index bb7a5a2d9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/ISoapStyleInfo.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.contentgenerator.ui;
-
-public interface ISoapStyleInfo {
- public boolean isDocumentLiteralPattern();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapBindingOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapBindingOptionsPage.java
deleted file mode 100644
index bdc161256..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapBindingOptionsPage.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.contentgenerator.ui;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.binding.soap.internal.generator.SOAPContentGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.ServicePolicyHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.wizards.WSDLNewFileOptionsPage;
-import org.w3c.dom.Element;
-
-
-public class SoapBindingOptionsPage extends BaseContentGeneratorOptionsPage implements ISoapStyleInfo
-{
- protected Button docLiteral;
- protected Button rpcLiteral;
- protected Button rpcEncoded;
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(Messages._UI_LABEL_SOAP_BINDING_OPTIONS); //$NON-NLS-1$
-
- docLiteral = new Button(control, SWT.RADIO);
- docLiteral.setText(Messages._UI_RADIO_DOCUMENT_LITERAL); //$NON-NLS-1$
- docLiteral.setSelection(true);
-
- rpcLiteral = new Button(control, SWT.RADIO);
- rpcLiteral.setText(Messages._UI_RADIO_RPC_LITERAL); //$NON-NLS-1$
-
- rpcEncoded = new Button(control, SWT.RADIO);
- rpcEncoded.setText(Messages._UI_RADIO_RPC_ENCODED); //$NON-NLS-1$
-
- if (generator.getName() != null)
- {
- Definition definition = generator.getDefinition();
- QName qname = new QName(definition.getTargetNamespace(), generator.getName());
- Binding binding = (Binding) definition.getBinding(qname);
-
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
-
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String style = element.getAttribute("style"); //$NON-NLS-1$
-
- if ("rpc".equals(style)) //$NON-NLS-1$
- {
- // Try to determine if it's RPC Literal or RPC Encoded
- String use = "encoded"; //$NON-NLS-1$
- List operations = binding.getEBindingOperations();
- if (operations.size() > 0) {
- element = null;
- BindingOperation operation = (BindingOperation) operations.get(0);
- if (operation.getEBindingInput() != null && operation.getEBindingInput().getEExtensibilityElements().size() > 0) {
- Object object = operation.getEBindingInput().getEExtensibilityElements().get(0);
- element = WSDLEditorUtil.getInstance().getElementForObject(object);
- }
- else if (operation.getEBindingOutput() != null && operation.getEBindingOutput().getEExtensibilityElements().size() > 0) {
- Object object = operation.getEBindingOutput().getEExtensibilityElements().get(0);
- element = WSDLEditorUtil.getInstance().getElementForObject(object);
- }
- else if (operation.getEBindingFaults().size() > 0) {
- BindingFault fault = (BindingFault) operation.getEBindingFaults().get(0);
- List faultEE = fault.getExtensibilityElements();
-
- if (faultEE.size() > 0) {
- element = WSDLEditorUtil.getInstance().getElementForObject(faultEE.get(0));
- }
- }
-
- if (element != null) {
- use = element.getAttribute("use"); //$NON-NLS-1$
- }
- }
-
- if (use != null && "literal".equals(use)) { //$NON-NLS-1$
- docLiteral.setSelection(false);
- rpcLiteral.setSelection(true);
- rpcEncoded.setSelection(false);
- }
- else {
- docLiteral.setSelection(false);
- rpcLiteral.setSelection(false);
- rpcEncoded.setSelection(true);
- }
- }
- }
- }
- }
-
- docLiteral.addSelectionListener(this);
- rpcLiteral.addSelectionListener(this);
- rpcEncoded.addSelectionListener(this);
- setOptionsOnGenerator();
-
- return control;
- }
-
- public void setOptionsOnGenerator() {
- if (generator.getContentGenerator() instanceof SOAPContentGenerator) {
- SOAPContentGenerator soapGenerator = (SOAPContentGenerator) generator.getContentGenerator();
- if (docLiteral.getSelection()) {
- soapGenerator.setStyle(SOAPContentGenerator.STYLE_DOCUMENT);
- soapGenerator.setUse(SOAPContentGenerator.USE_LITERAL);
- }
- else if (rpcLiteral.getSelection()) {
- soapGenerator.setStyle(SOAPContentGenerator.STYLE_RPC);
- soapGenerator.setUse(SOAPContentGenerator.USE_LITERAL);
- }
- else if (rpcEncoded.getSelection()) {
- soapGenerator.setStyle(SOAPContentGenerator.STYLE_RPC);
- soapGenerator.setUse(SOAPContentGenerator.USE_ENCODED);
- }
- }
- }
-
- public void widgetSelected(SelectionEvent event) {
- setOptionsOnGenerator();
-
- if (wizardPage != null) {
- boolean isComplete = wizardPage.isPageComplete();
- if (wizardPage instanceof WSDLNewFileOptionsPage) {
- // A selection made by one of these widgets may impact the
- // completness of a Wizard.
- isComplete = ((WSDLNewFileOptionsPage) wizardPage)
- .validatePage();
- }
- wizardPage.setPageComplete(isComplete);
- }
- }
-
- public String getMessage() {
- String message = null;
- if (rpcEncoded != null && rpcEncoded.getSelection()) {
- if (wizardPage instanceof WSDLNewFileOptionsPage) {
- IProject project = ((WSDLNewFileOptionsPage) wizardPage)
- .getProject();
- IServicePolicy policy = ((WSDLNewFileOptionsPage) wizardPage)
- .getServicePolicy();
- int messageType = ServicePolicyHelper.getMessageSeverity(
- project, policy);
- if (messageType == IMessageProvider.ERROR) {
- message = Messages._ERROR_WSI_COMPLIANCE_RPC_ENCODING;
- } else if (messageType == IMessageProvider.WARNING) {
- message = Messages._WARN_WSI_COMPLIANCE_RPC_ENCODING;
- }
- }
- }
- if (message == null)
- message = ""; //$NON-NLS-1$
- return message;
- }
-
- public int getMessageType() {
- int messageType = IMessageProvider.NONE;
-
- if (rpcEncoded != null && rpcEncoded.getSelection()) {
- if (wizardPage instanceof WSDLNewFileOptionsPage) {
- IProject project = ((WSDLNewFileOptionsPage) wizardPage)
- .getProject();
- IServicePolicy policy = ((WSDLNewFileOptionsPage) wizardPage)
- .getServicePolicy();
- messageType = ServicePolicyHelper.getMessageSeverity(project,
- policy);
- }
- }
- return messageType;
- }
-
- public boolean isDocumentLiteralPattern() {
- return docLiteral.getSelection();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/EditNamespacesDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/EditNamespacesDialog.java
deleted file mode 100644
index ad4eba5c0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/EditNamespacesDialog.java
+++ /dev/null
@@ -1,126 +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.dialogs;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesTargetFieldDialog;
-
-public class EditNamespacesDialog extends Dialog
-{
- protected Button okButton;
- protected String title;
- protected String targetNamespace;
- protected List namespaceInfoList;
- protected CommonEditNamespacesTargetFieldDialog editWSDLNamespacesControl;
- protected IPath resourceLocation;
- // protected Label errorMessageLabel;
- // protected String errorMessage;
-
- //protected Label errorMessageLabel;
-
- public EditNamespacesDialog(Shell parentShell, IPath resourceLocation, String title, String targetNamespace, List namespaceList)
- {
- super(parentShell);
- this.resourceLocation = resourceLocation;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.title = title;
- this.targetNamespace = targetNamespace;
- this.namespaceInfoList = namespaceList;
- }
-
- public int createAndOpen()
- {
- create();
- getShell().setText(title);
- setBlockOnOpen(true);
- return open();
- }
-
- protected Control createContents(Composite parent)
- {
- Control control = super.createContents(parent);
- updateErrorMessage();
- return control;
- }
-
- protected void createButtonsForButtonBar(Composite parent)
- {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createDialogArea(Composite parent)
- {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- editWSDLNamespacesControl = new CommonEditNamespacesTargetFieldDialog(dialogArea, resourceLocation);
- editWSDLNamespacesControl.setNamespaceInfoList(namespaceInfoList);
- editWSDLNamespacesControl.setTargetNamespace(targetNamespace);
-
- return dialogArea;
- }
-
- public void modifyText(ModifyEvent e)
- {
- updateErrorMessage();
- }
-
- protected String computeErrorMessage(String name)
- {
- return null;
- }
-
- protected void updateErrorMessage()
- {
- String errorMessage = null;
- /*
- String name = nameField.getText().trim();
- if (name.length() > 0)
- {
- errorMessage = computeErrorMessage(name);
- }
- else
- {
- errorMessage = "";
- }*/
-
- //errorMessageLabel.setText(errorMessage != null ? errorMessage : "");
- okButton.setEnabled(errorMessage == null);
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == IDialogConstants.OK_ID)
- {
- targetNamespace = editWSDLNamespacesControl.getTargetNamespace();
- }
- super.buttonPressed(buttonId);
- }
-
- public List getNamespaceInfoList()
- {
- return namespaceInfoList;
- }
-
- public String getTargetNamespace()
- {
- return targetNamespace;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/GenerateBindingOnSaveDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/GenerateBindingOnSaveDialog.java
deleted file mode 100644
index 70ceaf9d4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/GenerateBindingOnSaveDialog.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.dialogs;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class GenerateBindingOnSaveDialog extends MessageDialog implements SelectionListener {
- private static String dialogTitle = Messages._UI_REGEN_BINDINDS_ON_SAVE; //$NON-NLS-1$
- private static String dialogMessage = Messages._UI_REGEN_BINDINGS_ON_SAVE_QUESTIONMARK; //$NON-NLS-1$
- private static String[] buttons = new String[]{Messages._UI_YES_LABEL, Messages._UI_NO_LABEL, Messages._UI_CANCEL_LABEL}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- private Button rememberDecisionBox;
- private boolean rememberDecision = false;
-
- public GenerateBindingOnSaveDialog(Shell shell) {
- super(shell, dialogTitle, null, dialogMessage, MessageDialog.QUESTION, buttons, 0);
- }
-
-
- protected Control createCustomArea(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- comp.setLayout(layout);
- comp.setData(new GridData());
-
- // Spacer
- new Label(comp, SWT.NONE);
- new Label(comp, SWT.NONE);
-
- rememberDecisionBox = new Button(comp, SWT.CHECK);
- rememberDecisionBox.setText(Messages._UI_REMEMBER_MY_DECISION_LABEL);
- rememberDecisionBox.addSelectionListener(this);
-
- return parent;
- }
-
- private void storePromptPreference(int swtValue) {
- // Store the new preference for displaying this dialog.
- if (rememberDecision) {
- WSDLEditorPlugin.getInstance().getPluginPreferences().setValue(Messages._UI_PREF_PAGE_PROMPT_REGEN_BINDING_ON_SAVE, false); //$NON-NLS-1$
-
- String generateID = Messages._UI_PREF_PAGE_AUTO_REGENERATE_BINDING; //$NON-NLS-1$
- if (swtValue == SWT.YES) {
- WSDLEditorPlugin.getInstance().getPluginPreferences().setValue(generateID, true);
- }
- else if (swtValue == SWT.NO) {
- WSDLEditorPlugin.getInstance().getPluginPreferences().setValue(generateID, false);
- }
- }
- }
-
- public int open() {
- int rValue = super.open();
-
- if (rValue ==0) {
- storePromptPreference(SWT.YES);
- return SWT.YES;
- }
- else if (rValue == 1) {
- storePromptPreference(SWT.NO);
- return SWT.NO;
- }
- else if (rValue == 2) {
- storePromptPreference(SWT.CANCEL);
- return SWT.CANCEL;
- }
-
- return rValue;
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == rememberDecisionBox) {
- rememberDecision = rememberDecisionBox.getSelection();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {}
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/NewComponentDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/NewComponentDialog.java
deleted file mode 100644
index 2e8687bb7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/NewComponentDialog.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.dialogs;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-
-/*
- * TODO: rmah: look at removing this class. Doesn't look like it's used.
- */
-public class NewComponentDialog extends Dialog implements ModifyListener
-{
- protected Text nameField;
- protected Button okButton;
- protected String name;
- protected String title;
- protected Label errorMessageLabel;
- protected List usedNames;
-
- public NewComponentDialog(Shell parentShell, String title, String defaultName)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- name = defaultName;
- this.title = title;
- }
-
- public NewComponentDialog(Shell parentShell, String title, String defaultName, List usedNames)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- name = defaultName;
- this.title = title;
- this.usedNames = usedNames;
- }
-
- public int createAndOpen()
- {
- create();
- getShell().setText(title);
- setBlockOnOpen(true);
- return open();
- }
-
- protected Control createContents(Composite parent)
- {
- Control control = super.createContents(parent);
- nameField.forceFocus();
- nameField.selectAll();
- updateErrorMessage();
- return control;
- }
-
-
- protected void createButtonsForButtonBar(Composite parent)
- {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected void createHeaderContent(Composite parent)
- {
- }
-
- protected void createExtendedContent(Composite parent)
- {
- }
-
- protected Control createDialogArea(Composite parent)
- {
- Composite dialogArea = (Composite)super.createDialogArea(parent);
-
- createHeaderContent(dialogArea);
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gdFill= new GridData();
- gdFill.horizontalAlignment= GridData.FILL;
- gdFill.grabExcessHorizontalSpace= true;
- gdFill.verticalAlignment= GridData.FILL;
- gdFill.grabExcessVerticalSpace= true;
- composite.setLayoutData(gdFill);
-
- Label nameLabel = new Label(composite, SWT.NONE);
- nameLabel.setText(Messages._UI_LABEL_NAME); //$NON-NLS-1$
-
- nameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- gd.widthHint = 200;
- nameField.setLayoutData(gd);
- nameField.setText(name);
- nameField.addModifyListener(this);
-
- createExtendedContent(dialogArea);
-
- // error message
- errorMessageLabel = new Label(dialogArea, SWT.NONE);
- errorMessageLabel.setText(""); //$NON-NLS-1$
- GridData gd2 = new GridData();
- gd2.horizontalAlignment= GridData.FILL;
- gd2.grabExcessHorizontalSpace= true;
- gd2.widthHint = 200;
- errorMessageLabel.setLayoutData(gd2);
-// Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-// errorMessageLabel.setForeground(color);
-
- return dialogArea;
- }
-
- public void modifyText(ModifyEvent e)
- {
- updateErrorMessage();
- }
-
- protected String computeErrorMessage(String name)
- {
- if (usedNames == null)
- return null;
-
- Iterator iterator = usedNames.iterator();
- while (iterator.hasNext()) {
- if (name.equalsIgnoreCase((String) iterator.next())) {
- return Messages._UI_LABEL_WARNING_DUPLICATE_NAME_EXISTS; //$NON-NLS-1$
- }
- }
-
- return null;
- }
-
- protected void updateErrorMessage()
- {
- String errorMessage = null;
- String name = nameField.getText().trim();
- if (name.length() > 0)
- {
- errorMessage = computeErrorMessage(name);
- }
- else
- {
- errorMessage = ""; //$NON-NLS-1$
- }
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-// okButton.setEnabled(errorMessage == null);
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == IDialogConstants.OK_ID)
- {
- name = nameField.getText();
- }
- super.buttonPressed(buttonId);
- }
-
- public String getName()
- {
- return name;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/ProtocolComponentControl.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/ProtocolComponentControl.java
deleted file mode 100644
index 7daf26564..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/ProtocolComponentControl.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.dialogs;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.wsdl.internal.generator.BaseGenerator;
-import org.eclipse.wst.wsdl.internal.generator.BindingGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage;
-
-public abstract class ProtocolComponentControl extends Composite implements SelectionListener, ModifyListener
-{
- protected BaseGenerator generator;
-
- protected Text componentNameField;
- protected Combo refNameCombo;
- protected Button refBrowseButton;
- protected Combo protocolCombo;
- protected Button overwriteButton;
- protected PageBook pageBook;
- protected Composite emptySettingsPage;
- protected Map pageMap = new HashMap();
-
- protected String name;
- protected String refName;
-
- protected String UNSPECIFIED = Messages._UI_UNSPECIFIED; //$NON-NLS-1$
-
- public ProtocolComponentControl(Composite parent, BaseGenerator generator, boolean showOverwriteButton)
- {
- super(parent, SWT.NONE);
- this.generator = generator;
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- setLayout(layout);
- setLayoutData(createGridData(true, 1));
-
- Composite labelValueComposite = new Composite(this, SWT.NONE);
- labelValueComposite.setLayout(new GridLayout(2, false));
- labelValueComposite.setLayoutData(createGridData(false, 1));
-
- // row 1
- //
- Label componentNameLabel = new Label(labelValueComposite, SWT.NONE);
- componentNameLabel.setText(getComponentNameLabelText()); //$NON-NLS-1$
-
- componentNameField = new Text(labelValueComposite, SWT.BORDER);
- GridData gdName= new GridData();
- gdName.horizontalAlignment= GridData.FILL;
- gdName.grabExcessHorizontalSpace= true;
- componentNameField.setLayoutData(gdName);
- componentNameField.addModifyListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(componentNameField, ASDEditorCSHelpIds.PROTOCOL_COMPONENT_NAME_TEXT);
- //createPlaceHolder(labelValueComposite);
-
- // row 2
- //
- Label refNameLabel = new Label(labelValueComposite, SWT.NONE);
- refNameLabel.setText(getRefNameLabelText()); //$NON-NLS-1$
- refNameCombo = new Combo(labelValueComposite, SWT.READ_ONLY);
- GridData gdRefName= new GridData();
- gdRefName.horizontalAlignment= GridData.FILL;
- gdRefName.grabExcessHorizontalSpace= true;
- refNameCombo.setLayoutData(gdRefName);
- refNameCombo.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(refNameCombo, ASDEditorCSHelpIds.PROTOCOL_COMPONENT_REF_COMBO);
-
- //refBrowseButton = new Button(labelValueComposite, SWT.NONE);
- //refBrowseButton.setText(" ... ");
- //GridData gd = new GridData();
- //gd.grabExcessHorizontalSpace = false;
- //gd.heightHint = 17;
- //gd.widthHint = 24;
- //refBrowseButton.setLayoutData(gd);
- //refBrowseButton.addSelectionListener(this);
- //createPlaceHolder(labelValueComposite);
-
- // row 3
- //
- Label protocolLabel = new Label(labelValueComposite, SWT.NONE);
- protocolLabel.setText(Messages._UI_LABEL_BINDING_PROTOCOL); //$NON-NLS-1$
- protocolCombo = new Combo(labelValueComposite, SWT.READ_ONLY);
- GridData gdProtocol= new GridData();
- gdProtocol.horizontalAlignment= GridData.FILL;
- gdProtocol.grabExcessHorizontalSpace= true;
- protocolCombo.setLayoutData(gdProtocol);
- protocolCombo.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(protocolCombo, ASDEditorCSHelpIds.PROTOCOL_COMPONENT_PROTOCOL_COMBO);
- //createPlaceHolder(labelValueComposite);
-
- // optional overwrite button
- //
- if (showOverwriteButton)
- {
- overwriteButton = new Button(this, SWT.CHECK);
- overwriteButton.setText(Messages._UI_CHECKBOX_OVERWRITE); //$NON-NLS-1$
- overwriteButton.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(overwriteButton, ASDEditorCSHelpIds.pROTOCOL_COMPONENT_OVERWRITE_CHECKBOX);
- }
-
- // protocol specific settings
- //
- pageBook = new PageBook(this, SWT.NONE);
- GridData gdFill= new GridData();
- gdFill.horizontalAlignment= GridData.FILL;
- gdFill.grabExcessHorizontalSpace= true;
- gdFill.verticalAlignment= GridData.FILL;
- gdFill.grabExcessVerticalSpace= true;
- pageBook.setLayoutData(gdFill);
-
- emptySettingsPage = new Composite(pageBook, SWT.NONE);
- for (int i = 0; i < 6; i++)
- {
- new Label(emptySettingsPage, SWT.NONE);
- }
- }
-
- public void initFields()
- {
- // prime the fields
- //
- componentNameField.setText(getDefaultName());
- updateRefNameCombo();
- updateProtocolCombo();
- updatePageBook(protocolCombo.getText());
- }
-
- public Text getComponentNameField()
- {
- return componentNameField;
- }
-
- public String getComponentNameLabelText()
- {
- return Messages._UI_LABEL_NAME; //$NON-NLS-1$
- }
-
- private GridData createGridData(boolean both, int span)
- {
- GridData gd = new GridData(both ? GridData.FILL_BOTH : GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- return gd;
- }
-
- // implements SelectionListener
- //
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- if (event.widget == overwriteButton && overwriteButton != null)
- {
- generator.setOverwrite(overwriteButton.getSelection());
- }
- else if (event.widget == refNameCombo)
- {
- int index = refNameCombo.getSelectionIndex();
- String refName = refNameCombo.getItem(index);
- if (refName.equals(UNSPECIFIED)) {
- generator.setRefName(""); //$NON-NLS-1$
- }
- else {
- generator.setRefName(refName);
- }
- }
- else if (event.widget == protocolCombo)
- {
- int index = protocolCombo.getSelectionIndex();
- String protocol = (index != -1) ? protocolCombo.getItem(index) : null;
-
- ContentGeneratorUIExtension ext = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry().getExtensionForLabel(protocol);
- if (ext != null)
- {
- String namespace = ext.getNamespace();
- generator.setContentGenerator(BindingGenerator.getContentGenerator(namespace));
- } else
- {
- generator.setContentGenerator(null);
- }
- updatePageBook(protocol);
- }
- }
-
- private static final String IS_OVERWRITE_APPLICABLE = "IS_OVERWRITE_APPLICABLE"; //$NON-NLS-1$
- protected void updatePageBook(String protocol)
- {
- if (protocol != null)
- {
- ContentGeneratorOptionsPage page = (ContentGeneratorOptionsPage) pageMap.get(protocol);
- if (page == null)
- {
- page = createContentGeneratorOptionsPage(protocol);
-
- if (page != null)
- {
- page.init(generator);
- Control control = page.createControl(pageBook);
- control.setData(IS_OVERWRITE_APPLICABLE, new Boolean(page.isOverwriteApplicable()));
- pageMap.put(protocol, page);
- }
- }
-
- boolean enableOverwriteButton = true;
- if (page != null)
- {
- if (overwriteButton != null)
- {
- Boolean data = (Boolean) page.getControl().getData(IS_OVERWRITE_APPLICABLE);
- enableOverwriteButton = data == null || data.equals(Boolean.TRUE);
- }
- pageBook.showPage(page.getControl());
- pageBook.layout();
- pageBook.getParent().layout();
-
- page.setOptionsOnGenerator();
- }
- else
- {
- pageBook.showPage(emptySettingsPage);
- }
-
- if (overwriteButton != null)
- {
- if (enableOverwriteButton)
- {
- overwriteButton.setEnabled(true);
- overwriteButton.setSelection(generator.getOverwrite());
- }
- else
- {
- overwriteButton.setEnabled(false);
- overwriteButton.setSelection(true);
- }
- }
- }
- }
-
- protected void updateProtocolCombo()
- {
- protocolCombo.removeAll();
- protocolCombo.add(UNSPECIFIED);
-
- ContentGeneratorUIExtensionRegistry registry = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry();
- List bindingNames = registry.getBindingExtensionNames();
-
- String protocolText = generator.getProtocol();
- ContentGeneratorUIExtension extt = registry.getExtensionForName(protocolText);
- if (extt != null)
- {
- protocolText = extt.getLabel();
- }
-
- for (Iterator i = bindingNames.iterator(); i.hasNext();)
- {
- String protocol = (String) i.next();
- ContentGeneratorUIExtension ext = registry.getExtensionForName(protocol);
- if (ext != null)
- {
- String label = ext.getLabel();
- if (label != null)
- protocolCombo.add(label);
- }
- }
-
- if (protocolText == null && protocolCombo.getItemCount() > 0)
- {
- protocolText = protocolCombo.getItem(0);
- }
- protocolCombo.setText(protocolText);
- }
-
- protected void updateRefNameCombo()
- {
- refNameCombo.removeAll();
-
- refNameCombo.add(UNSPECIFIED);
- for (Iterator i = getRefNames().iterator(); i.hasNext();)
- {
- refNameCombo.add((String) i.next());
- }
-
- if (refNameCombo.getItemCount() > 0)
- {
- String refText = generator.getRefName();
- refNameCombo.setText(refText != null ? refText : UNSPECIFIED);
- }
- }
-
- public void modifyText(ModifyEvent e)
- {
- generator.setName(componentNameField.getText());
- }
-
- public abstract List getRefNames();
- public abstract String getRefNameLabelText();
- public abstract String getDefaultName();
- // TODO: We don't need the String argument for createContentGeneratorOptionsPage() method.
- // Remove when WTP allows API changes.
- public abstract ContentGeneratorOptionsPage createContentGeneratorOptionsPage(String protocol);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11BrowseComponentDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11BrowseComponentDialog.java
deleted file mode 100644
index 49ec10df8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11BrowseComponentDialog.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialog;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ScopedComponentSearchListDialog;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLBindingSearchListProvider;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLComponentDescriptionProvider;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLInterfaceSearchListProvider;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLMessageSearchListProvider;
-import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class W11BrowseComponentDialog implements IComponentDialog {
- private QualifiedName qualifiedName;
- private ComponentSpecification selection;
- private W11Description description;
-
- public W11BrowseComponentDialog(QualifiedName qualifiedName, IFile iFile, W11Description description) {
- this.qualifiedName = qualifiedName;
- this.description = description;
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification) {
- }
-
- public ComponentSpecification getSelectedComponent() {
- return selection;
- }
-
- public int createAndOpen() {
- Definition definition = (Definition) description.getTarget();
-
- Shell shell = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- int returnValue = Window.CANCEL;
- ComponentSearchListDialog dialog = null;
- if (qualifiedName == IWSDLSearchConstants.BINDING_META_NAME)
- {
- WSDLComponentDescriptionProvider descriptionProvider = new WSDLComponentDescriptionProvider();
- final WSDLBindingSearchListProvider searchListProvider = new WSDLBindingSearchListProvider(definition);
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_FILTER);
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
-
- String dialogTitle = Messages._UI_TITLE_SPECIFY_BINDING; //$NON-NLS-1$
- dialog = new ScopedComponentSearchListDialog(shell, dialogTitle, configuration);
-
- IFile file = getFile();
- if (file != null) {
- ((ScopedComponentSearchListDialog) dialog).setCurrentResource(file);
- }
- }
- else if (qualifiedName == IWSDLSearchConstants.PORT_TYPE_META_NAME)
- {
- WSDLComponentDescriptionProvider descriptionProvider = new WSDLComponentDescriptionProvider();
- final WSDLInterfaceSearchListProvider searchListProvider = new WSDLInterfaceSearchListProvider(definition);
-
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_FILTER);
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
- //configuration.setNewComponentHandler(new NewTypeButtonHandler());
-
- String dialogTitle = Messages._UI_TITLE_SPECIFY_PORTTYPE; //$NON-NLS-1$
- dialog = new ScopedComponentSearchListDialog(shell, dialogTitle, configuration);
-
- IFile file = getFile();
- if (file != null) {
- ((ScopedComponentSearchListDialog) dialog).setCurrentResource(file);
- }
- }
- else if (qualifiedName == IWSDLSearchConstants.MESSAGE_META_NAME)
- {
- WSDLComponentDescriptionProvider descriptionProvider = new WSDLComponentDescriptionProvider();
- final WSDLMessageSearchListProvider searchListProvider = new WSDLMessageSearchListProvider(definition);
-
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_FILTER);
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
- //configuration.setNewComponentHandler(new NewTypeButtonHandler());
-
- String dialogTitle = Messages._UI_TITLE_SPECIFY_MESSAGE; //$NON-NLS-1$
- dialog = new ScopedComponentSearchListDialog(shell, dialogTitle, configuration);
-
- IFile file = getFile();
- if (file != null) {
- ((ScopedComponentSearchListDialog) dialog).setCurrentResource(file);
- }
- }
-
- if (dialog != null)
- {
- dialog.setBlockOnOpen(true);
- dialog.create();
- returnValue = dialog.open();
- if (returnValue == Window.OK)
- {
- selection = dialog.getSelectedComponent();
- }
- }
- return returnValue;
- }
-
- private IFile getFile() {
- IFile file = null;
- IEditorInput input = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput();
- if (input instanceof IFileEditorInput) {
- file = ((IFileEditorInput) input).getFile();
- }
-
- return file;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11NewComponentDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11NewComponentDialog.java
deleted file mode 100644
index c0219a76e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11NewComponentDialog.java
+++ /dev/null
@@ -1,135 +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.dialogs;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddBindingCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddInterfaceCommand;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewComponentDialog;
-
-public class W11NewComponentDialog implements IComponentDialog {
- protected NewComponentDialog dialog;
- protected QualifiedName qualifiedName;
- protected IFile iFile;
- protected W11Description description;
- protected IASDObject newObject;
-
- public W11NewComponentDialog(QualifiedName qualifiedName, IFile iFile, W11Description description) {
- this.qualifiedName = qualifiedName;
- this.iFile = iFile;
- this.description = description;
-
- Shell shell = Display.getCurrent().getActiveShell();
- if (qualifiedName == IWSDLSearchConstants.BINDING_META_NAME) {
- String dialogTitle = Messages._UI_LABEL_NEW_BINDING; //$NON-NLS-1$
- String baseName = NameUtil.buildUniqueBindingName(getDefinition(), "NewBinding"); //$NON-NLS-1$
- List usedNames = NameUtil.getUsedBindingNames(getDefinition());
- dialog = new NewComponentDialog(shell, dialogTitle, baseName, usedNames);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, ASDEditorCSHelpIds.NEW_BINDING_DIALOG);
- }
- else if (qualifiedName == IWSDLSearchConstants.PORT_TYPE_META_NAME) {
- String dialogTitle = Messages._UI_LABEL_NEW_PORTTYPE; //$NON-NLS-1$
- String baseName = NameUtil.buildUniquePortTypeName(getDefinition(), "NewPortType"); //$NON-NLS-1$
- List usedNames = NameUtil.getUsedPortTypeNames(getDefinition());
- dialog = new NewComponentDialog(shell, dialogTitle, baseName, usedNames);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, ASDEditorCSHelpIds.NEW_PORTTYPE_DIALOG);
- }
- else if (qualifiedName == IWSDLSearchConstants.MESSAGE_META_NAME) {
- String dialogTitle = Messages._UI_LABEL_NEW_MESSAGE; //$NON-NLS-1$
- String baseName = NameUtil.buildUniqueMessageName(getDefinition(), "NewMessage"); //$NON-NLS-1$
- List usedNames = NameUtil.getUsedMessageNames(getDefinition());
- dialog = new NewComponentDialog(shell, dialogTitle, baseName, usedNames);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, ASDEditorCSHelpIds.NEW_MESSAGE_DIALOG);
- }
- }
-
- private Definition getDefinition() {
- return (Definition) description.getTarget();
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification) {
- }
-
- public ComponentSpecification getSelectedComponent() {
- String qualifier = getDefinition().getPrefix(getDefinition().getTargetNamespace());
- String name = dialog.getName();
- ComponentSpecification spec = new ComponentSpecification(qualifier, name, iFile);
- spec.setObject(newObject);
- return spec;
- }
-
- public int createAndOpen() {
- int rValue = dialog.createAndOpen();
-
- if (rValue == Window.OK) {
- // Create the new Object
- if (qualifiedName == IWSDLSearchConstants.BINDING_META_NAME) {
- W11AddBindingCommand command = (W11AddBindingCommand) description.getAddBindingCommand();
- command.setNewBindingName(dialog.getName());
- execute(command);
-
- Object newWSDLObject = command.getNewBinding();
- newObject = (IASDObject) WSDLAdapterFactoryHelper.getInstance().adapt((Notifier) newWSDLObject);
- }
- else if (qualifiedName == IWSDLSearchConstants.PORT_TYPE_META_NAME) {
- W11AddInterfaceCommand command = (W11AddInterfaceCommand) description.getAddInterfaceCommand();
- command.setNewPortTypeName(dialog.getName());
- execute(command);
-
- Object newWSDLObject = command.getNewPortType();
- newObject = (IASDObject) WSDLAdapterFactoryHelper.getInstance().adapt((Notifier) newWSDLObject);
- }
- else if (qualifiedName == IWSDLSearchConstants.MESSAGE_META_NAME) {
- W11AddMessageCommand command = (W11AddMessageCommand) description.getAddMessageCommand();
- command.setNewMessageName(dialog.getName());
- execute(command);
-
- Object newWSDLObject = command.getNewMessage();
- newObject = (IASDObject) WSDLAdapterFactoryHelper.getInstance().adapt((Notifier) newWSDLObject);
- }
- }
-
- return rValue;
- }
-
- private void execute(Command command) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor().getAdapter(CommandStack.class) != null) {
- CommandStack stack = (CommandStack) page.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
- }
- else {
- command.execute();
- }
- }
-}
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 58345dbb8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/W11BindingReferenceEditManager.java
+++ /dev/null
@@ -1,115 +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.Binding;
-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.adapters.commands.W11SetBindingCommand;
-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$
-
- Binding newBinding = port.getEBinding();
- W11SetBindingCommand.updatePortProtocol(port, newBinding);
- }
- 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 94fe3435c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBaseSearchListProvider.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.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-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.core.search.scope.SearchScope;
-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.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-
-public abstract class WSDLBaseSearchListProvider implements IComponentSearchListProvider {
-
- protected Definition definition;
-
- 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;
- }
-
- //TODO (trung) make this one abstract when we are in development phase again
- protected List getSearchingComponents(Definition importDefinition) {
- return new ArrayList();
- }
-
- protected void getImportedComponents(IComponentList list, QualifiedName metaName, HashMap exclusions) {
- Iterator importsIt = getWSDLFileImports(definition.getEImports()).iterator();
- while (importsIt.hasNext()) {
- Import importItem = (Import) importsIt.next();
- String location = importItem.getDefinition().getDocumentBaseURI();
- exclusions.put(location, Boolean.TRUE );
- Definition importDefinition = importItem.getEDefinition();
- if (importDefinition != null)
- {
- List importedComponents = getSearchingComponents(importDefinition);
- createWSDLComponentObjects(list, importedComponents, metaName);
- }
- }
- }
-
- protected void searchOutsideCurrentResource(IComponentList list, SearchScope scope, QualifiedName metaName, Map exclusions) {
- if (scope != null) {
- WSDLComponentFinder finder = new WSDLComponentFinder(metaName);
- Iterator it = finder.getWorkbenchResourceComponents(scope).iterator();
- while (it.hasNext()) {
- ComponentSpecification item = (ComponentSpecification) it.next();
- String itemURI = URIHelper.getPlatformURI(item.getFile());
- if (exclusions.get(itemURI) == null){
- list.add(item);
- }
- }
- }
- }
-}
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 a43c715a5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLBindingSearchListProvider.java
+++ /dev/null
@@ -1,44 +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.HashMap;
-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.ui.internal.search.IWSDLSearchConstants;
-
-public class WSDLBindingSearchListProvider extends WSDLBaseSearchListProvider {
- 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);
-
- // Files excluded if we search with the search engine later
- HashMap exclusions = new HashMap();
- exclusions.put(definition.getDocumentBaseURI(), Boolean.TRUE);
-
- // Grab directly imported components and update the exclusions 'list'
- getImportedComponents(list, IWSDLSearchConstants.BINDING_META_NAME, exclusions);
-
- searchOutsideCurrentResource(list, scope, IWSDLSearchConstants.BINDING_META_NAME, exclusions);
- }
-
- protected List getSearchingComponents(Definition importDefinition) {
- return importDefinition.getEBindings();
- }
-}
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 f3e8268e0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLInterfaceSearchListProvider.java
+++ /dev/null
@@ -1,44 +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.HashMap;
-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.ui.internal.search.IWSDLSearchConstants;
-
-public class WSDLInterfaceSearchListProvider extends WSDLBaseSearchListProvider {
- 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);
-
- // Files excluded if we search with the search engine later
- HashMap exclusions = new HashMap();
- exclusions.put(definition.getDocumentBaseURI(), Boolean.TRUE);
-
- // Grab directly imported components and update the exclusions 'list'
- getImportedComponents(list, IWSDLSearchConstants.PORT_TYPE_META_NAME, exclusions);
-
- searchOutsideCurrentResource(list, scope, IWSDLSearchConstants.PORT_TYPE_META_NAME, exclusions);
- }
-
- protected List getSearchingComponents(Definition importDefinition) {
- return importDefinition.getEPortTypes();
- }
-}
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 c28d4ec9a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLMessageSearchListProvider.java
+++ /dev/null
@@ -1,44 +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.HashMap;
-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.ui.internal.search.IWSDLSearchConstants;
-
-public class WSDLMessageSearchListProvider extends WSDLBaseSearchListProvider {
- 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);
-
- // Files excluded if we search with the search engine later
- HashMap exclusions = new HashMap();
- exclusions.put(definition.getDocumentBaseURI(), Boolean.TRUE);
-
- // Grab directly imported components and update the exclusions 'list'
- getImportedComponents(list, IWSDLSearchConstants.MESSAGE_META_NAME, exclusions);
-
- searchOutsideCurrentResource(list, scope, IWSDLSearchConstants.MESSAGE_META_NAME, exclusions);
- }
-
- protected List getSearchingComponents(Definition importDefinition) {
- return importDefinition.getEMessages();
- }
-} \ 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 6d83bb466..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDElementReferenceEditManager.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.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.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-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.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 WSDLXSDElementReferenceEditManager(IFile currentFile, XSDSchema[] schemas, IDescription description) {
- super(currentFile, null);
- if (schemas == null || schemas.length == 0) {
- setSchemas(getInlineSchemas(description));
- }
- }
-
- 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 XSDSchema[] getInlineSchemas(IDescription description) {
- List types = description.getTypes();
- XSDSchema[] schemas = new XSDSchema[types.size()];
- for (int index = 0; index < types.size(); index++) {
- W11Type type = (W11Type) types.get(index);
- schemas[index] = (XSDSchema) type.getTarget();
- }
-
- return schemas;
- }
-}
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 620e53330..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/edit/WSDLXSDTypeReferenceEditManager.java
+++ /dev/null
@@ -1,111 +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.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.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-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.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog;
-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 WSDLXSDTypeReferenceEditManager(IFile currentFile, XSDSchema[] schemas, IDescription description) {
- super(currentFile, null);
- if (schemas == null || schemas.length == 0) {
- setSchemas(getInlineSchemas(description));
- }
- }
-
- public IComponentDialog getNewDialog()
- {
- if (schemas.length > 0) {
- NewTypeDialog newTypeDialog = new NewTypeDialog(schemas[0]);
- newTypeDialog.allowAnonymousType(false);
- return newTypeDialog;
- }
- else {
- NewTypeDialog newTypeDialog = new NewTypeDialog();
- newTypeDialog.allowAnonymousType(false);
- return 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()) {
- 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;
- }
-
- private XSDSchema[] getInlineSchemas(IDescription description) {
- List types = description.getTypes();
- XSDSchema[] schemas = new XSDSchema[types.size()];
- for (int index = 0; index < types.size(); index++) {
- W11Type type = (W11Type) types.get(index);
- schemas[index] = (XSDSchema) type.getTarget();
- }
-
- return schemas;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibilityItemTreeProviderRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibilityItemTreeProviderRegistry.java
deleted file mode 100644
index 29d180f79..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibilityItemTreeProviderRegistry.java
+++ /dev/null
@@ -1,33 +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.extensions;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-
-/**
- * This class reads the plugin manifests and registers each extensibility item tree provider
- */
-public class ExtensibilityItemTreeProviderRegistry extends NSKeyedExtensionRegistry
-{
- protected static final String LABEL_PROVIDER_PROPERTY = "labelProviderClass"; //$NON-NLS-1$
- protected static final String CONTENT_PROVIDER_PROPERTY = "contentProviderClass"; //$NON-NLS-1$
- protected static final String[] ATT_NAMES = { "labelProviderClass", "contentProviderClass" }; //$NON-NLS-1$ //$NON-NLS-2$
-
- public ILabelProvider getLabelProvider(String namespace)
- {
- return (ILabelProvider) getProperty(namespace, LABEL_PROVIDER_PROPERTY);
- }
-
- public ITreeChildProvider getContentProvider(String namespace)
- {
- return (ITreeChildProvider) getProperty(namespace, CONTENT_PROVIDER_PROPERTY);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibleTypeSystemProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibleTypeSystemProvider.java
deleted file mode 100644
index 9d4cbdfeb..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ExtensibleTypeSystemProvider.java
+++ /dev/null
@@ -1,85 +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.extensions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.util.XSDTypeSystemProvider;
-import org.eclipse.xsd.XSDSchema;
-
-public class ExtensibleTypeSystemProvider implements ITypeSystemProvider
-{
- protected WSDLEditorExtension[] extensions;
- protected ITypeSystemProvider[] typeSystemProviders;
-
- protected final static Object[] EMPTY_ARRAY = {};
-
- public ExtensibleTypeSystemProvider()
- {
- typeSystemProviders = new ITypeSystemProvider[1];
- typeSystemProviders[0] = new XSDTypeSystemProvider();
- }
-
- public List getAvailableTypeNames(Definition definition, int typeNameCategory)
- {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getAvailableTypeNames(definition, typeNameCategory));
- }
- return list;
- }
-
- public List getAvailableTypes(Definition definition, XSDSchema schema, int typeNameCategory)
- {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getAvailableTypes(definition, schema, typeNameCategory));
- }
- return list;
- }
-
- public List getAvailableElementNames(Definition definition)
- {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getAvailableElementNames(definition));
- }
- return list;
- }
-
- public int getCategoryForTypeName(Definition definition, String typeName)
- {
- int result = UNKNOWN_TYPE;
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- result = typeSystemProviders[i].getCategoryForTypeName(definition, typeName);
- if (result != UNKNOWN_TYPE)
- {
- break;
- }
- }
- return result;
- }
-
- public List getPrefixedNames(Definition definition, String namespace, String localName) {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getPrefixedNames(definition, namespace, localName));
- }
- return list;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeAssociationProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeAssociationProvider.java
deleted file mode 100644
index 23f0ae011..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeAssociationProvider.java
+++ /dev/null
@@ -1,20 +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.extensions;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public interface INodeAssociationProvider
-{
- public Object getModelObject(Object parentModelObject, Element[] elementChain, int start, int[] end);
- public Node getNode(Object modelObject);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeReconciler.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeReconciler.java
deleted file mode 100644
index 4692d3e6e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/INodeReconciler.java
+++ /dev/null
@@ -1,21 +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.extensions;
-
-import org.w3c.dom.Element;
-
-/**
- * @depreacted
- */
-public interface INodeReconciler
-{
- public void notifyChanged(Object modelObject, Element element, int eventType, Object feature, Object oldValue, Object newValue, int index);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITreeChildProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITreeChildProvider.java
deleted file mode 100644
index 8ebf532b3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITreeChildProvider.java
+++ /dev/null
@@ -1,23 +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.extensions;
-
-/**
- * This class allows extension writers to provide specialize tree content behaviour.
- * It is intended to behave similar to the org.eclipse.jface.viewers.ITreeContentProvider.
- * The major difference is that this class is simplified so that only one method is involved.
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
-public interface ITreeChildProvider
-{
- public Object[] getChildren(Object object);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITypeSystemProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITypeSystemProvider.java
deleted file mode 100644
index ba148204a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/ITypeSystemProvider.java
+++ /dev/null
@@ -1,30 +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.extensions;
-
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.xsd.XSDSchema;
-
-public interface ITypeSystemProvider
-{
- public static final int UNKNOWN_TYPE = 0x0;
- public static final int BUILT_IN_TYPE = 0x1;
- public static final int USER_DEFINED_SIMPLE_TYPE = 0x2;
- public static final int USER_DEFINED_COMPLEX_TYPE = 0x4;
-
- public List getAvailableTypeNames(Definition definition, int typeNameCategory);
- public List getAvailableElementNames(Definition definition);
- public List getAvailableTypes(Definition definition, XSDSchema schema, int typeNameCategory);
- public int getCategoryForTypeName(Definition definition, String typeName);
- public List getPrefixedNames(Definition definition, String namespace, String localName);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/NSKeyedExtensionRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/NSKeyedExtensionRegistry.java
deleted file mode 100644
index d0db78dad..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/NSKeyedExtensionRegistry.java
+++ /dev/null
@@ -1,142 +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.extensions;
-
-import java.util.HashMap;
-
-import org.osgi.framework.Bundle;
-
-public class NSKeyedExtensionRegistry
-{
- protected HashMap map = new HashMap();
- private static final String PLUGIN_LOADING_ERROR = "PLUGIN_LOADING_ERROR"; //$NON-NLS-1$
-
- public NSKeyedExtensionRegistry()
- {
- }
-
- public void put(String namespaceURI, String className, Bundle bundle)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- if (info == null)
- {
- info = new SinglePropertyExtensionInfo(className, bundle);
- map.put(namespaceURI, info);
- }
- }
-
- public void put(String namespaceURI, HashMap propertyToClassNameMap, Bundle bundle)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- if (info == null)
- {
- info = new MultiPropertyExtensionInfo(propertyToClassNameMap, bundle);
- map.put(namespaceURI, info);
- }
- }
-
- /**
- *
- * @deprecated
- */
- public Object get(String namespaceURI)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- return info != null ? info.getObject("") : null; //$NON-NLS-1$
- }
-
- public Object getProperty(String namespaceURI, String property)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- return info != null ? info.getObject(property) : null;
- }
-
- private abstract class ExtensionInfo
- {
- protected Bundle bundle;
-
- public ExtensionInfo(Bundle bundle)
- {
- this.bundle = bundle;
- }
-
- public abstract Object getObject(String property);
- }
-
- private class SinglePropertyExtensionInfo extends ExtensionInfo
- {
- protected String className;
- protected Object object;
- protected boolean error;
-
- public SinglePropertyExtensionInfo(String className, Bundle bundle)
- {
- super(bundle);
- this.className = className;
- }
-
- public Object getObject(String property)
- {
- if (object == null)
- {
- try
- {
- Class theClass = bundle.loadClass(className);
- object = theClass.newInstance();
- }
- catch (Exception e)
- {
- object = PLUGIN_LOADING_ERROR;
- e.printStackTrace();
- }
- }
- return object != PLUGIN_LOADING_ERROR ? object : null;
- }
- }
-
- private class MultiPropertyExtensionInfo extends ExtensionInfo
- {
- protected HashMap propertyToClassNameTable;
- protected HashMap propertyToObjectTable = new HashMap();
-
- public MultiPropertyExtensionInfo(HashMap propertToClassNameTable, Bundle bundle)
- {
- super(bundle);
- this.propertyToClassNameTable = propertToClassNameTable;
- }
-
- public Object getObject(String property)
- {
- Object result = null;
- String className = (String) propertyToClassNameTable.get(property);
- if (className != null)
- {
- result = propertyToObjectTable.get(property);
- if (result == null)
- {
- try
- {
- Class theClass = bundle.loadClass(className);
- result = theClass.newInstance();
- propertyToObjectTable.put(property, result);
- }
- catch (Exception e)
- {
- propertyToObjectTable.put(property, PLUGIN_LOADING_ERROR);
- result = PLUGIN_LOADING_ERROR;
- e.printStackTrace();
- }
- }
- }
- return result != PLUGIN_LOADING_ERROR ? result : null;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorConfiguration.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorConfiguration.java
deleted file mode 100644
index 4be005c19..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorConfiguration.java
+++ /dev/null
@@ -1,193 +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.extensions;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.IWSDLToolbarAction;
-
-public class WSDLEditorConfiguration {
- public static final String WSDLEDITORCONFIGURATIONEXTENSIONID = "org.eclipse.wst.wsdl.ui.WSDLEditorExtensionConfiguration"; //$NON-NLS-1$
- public static final String INTERNALEDITORCONFIGURATION_EXTENSIONID = "org.eclipse.wst.wsdl.ui.internalEditorConfiguration"; //$NON-NLS-1$
- public static final String CLASSNAME = "class"; //$NON-NLS-1$
- public static final String ADAPTERFACTORY = "adapterFactory"; //$NON-NLS-1$
- public static final String TOOLBARACTION = "toolbarAction"; //$NON-NLS-1$
- public static final String FIGUREFACTORY = "figureFactory"; //$NON-NLS-1$
- public static final String EDITPARTFACTORY = "editPartFactory"; //$NON-NLS-1$
-
- List definedExtensionsList = null;
-
- public WSDLEditorConfiguration()
- {
-
- }
-
- public AdapterFactory getAdapterFactory()
- {
- if (definedExtensionsList == null)
- {
- readWSDLConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((WSDLEditorExtensionProperties) definedExtensionsList.get(0)).getAdapterFactory();
- }
- return null;
- }
-
- public EditPartFactory getEditPartFactory()
- {
- if (definedExtensionsList == null)
- {
- readWSDLConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((WSDLEditorExtensionProperties) definedExtensionsList.get(0)).getEditPartFactory();
- }
- return null;
- }
-
-// public IExtendedFigureFactory getFigureFactory()
-// {
-// if (definedExtensionsList == null)
-// {
-// readWSDLConfigurationRegistry();
-// }
-// if (!definedExtensionsList.isEmpty())
-// {
-// return ((WSDLEditorExtensionProperties) definedExtensionsList.get(0)).getFigureFactory();
-// }
-// return null;
-// }
-
- public List getToolbarActions()
- {
- if (definedExtensionsList == null)
- {
- readWSDLConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((WSDLEditorExtensionProperties) definedExtensionsList.get(0)).getActionList();
- }
- return Collections.EMPTY_LIST;
- }
-
- protected Object loadClass(IConfigurationElement element, String classString)
- {
- String pluginId = element.getDeclaringExtension().getContributor().getName();
-
- try
- {
- Class theClass = Platform.getBundle(pluginId).loadClass(classString);
- Object instance = theClass.newInstance();
-
- return instance;
- }
- catch (Exception e)
- {
-
- }
- return null;
- }
-
- public void readWSDLConfigurationRegistry()
- {
- definedExtensionsList = new ArrayList();
- updateList(INTERNALEDITORCONFIGURATION_EXTENSIONID);
- updateList(WSDLEDITORCONFIGURATIONEXTENSIONID);
- }
-
- public void updateList(String ID)
- {
- IConfigurationElement[] wsdlEditorExtensionList = Platform.getExtensionRegistry().getConfigurationElementsFor(ID);
-
- boolean definedExtensionsExist = (wsdlEditorExtensionList != null && wsdlEditorExtensionList.length > 0);
-
- definedExtensionsList = new ArrayList();
-
- if (definedExtensionsExist)
- {
- for (int i = 0; i < wsdlEditorExtensionList.length; i++)
- {
- WSDLEditorExtensionProperties properties = new WSDLEditorExtensionProperties();
- definedExtensionsList.add(properties);
-
- IConfigurationElement element = wsdlEditorExtensionList[i];
- String adapterFactoryClass = element.getAttribute(ADAPTERFACTORY);
- if (adapterFactoryClass != null)
- {
- Object object = loadClass(element, adapterFactoryClass);
- if (object instanceof AdapterFactory)
- {
- properties.setAdapterFactory((AdapterFactory) object);
- }
- }
-
-// String figureFactoryClass = element.getAttribute(FIGUREFACTORY);
-// if (figureFactoryClass != null)
-// {
-// Object object = loadClass(element, figureFactoryClass);
-// IExtendedFigureFactory figureFactory = null;
-// if (object instanceof IExtendedFigureFactory)
-// {
-// figureFactory = (IExtendedFigureFactory) object;
-// properties.setFigureFactoryList(figureFactory);
-// }
-// }
-
- String editPartFactoryClass = element.getAttribute(EDITPARTFACTORY);
- if (editPartFactoryClass != null)
- {
- Object object = loadClass(element, editPartFactoryClass);
- EditPartFactory editPartFactory = null;
- if (object instanceof EditPartFactory)
- {
- editPartFactory = (EditPartFactory) object;
- properties.setEditPartFactoryList(editPartFactory);
- }
- }
-
- IConfigurationElement[] toolbarActions = element.getChildren(TOOLBARACTION);
- List actionList = new ArrayList();
- if (toolbarActions != null)
- {
- for (int j = 0; j < toolbarActions.length; j++)
- {
- IConfigurationElement actionElement = toolbarActions[j];
- String actionClass = actionElement.getAttribute(CLASSNAME);
- IWSDLToolbarAction action = null;
- if (actionClass != null)
- {
- Object object = loadClass(actionElement, actionClass);
- if (object instanceof IWSDLToolbarAction)
- {
- action = (IWSDLToolbarAction) object;
- actionList.add(action);
- }
- }
- }
- }
- properties.setActionList(actionList);
-
-
-
- }
- }
- }
- }
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtension.java
deleted file mode 100644
index 40bc944ef..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtension.java
+++ /dev/null
@@ -1,36 +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.extensions;
-
-import org.eclipse.ui.IEditorPart;
-
-public interface WSDLEditorExtension
-{
- public static final int OUTLINE_TREE_CONTENT_PROVIDER = 1; // req'd for model based ext
- public static final int OUTLINE_LABEL_PROVIDER = 2; // req'd for model based ext
-
- public static final int MENU_ACTION_CONTRIBUTOR = 3; // node
- public static final int DETAILS_VIEWER_PROVIDER = 4; // node
-
- public static final int EDIT_PART_FACTORY = 5; // req'd for model based ext
- public static final int TYPE_SYSTEM_PROVIDER = 6; // req'd for type system ext
- public static final int NODE_RECONCILER = 7; // req'd for model based ext
- public static final int NODE_ASSOCIATION_PROVIDER = 8; // req'd for model based ext
- public static final int MODEL_QUERY_CONTRIBUTOR = 9; // req'd for model based ext
-
- public static final int PROPERTY_SOURCE_PROVIDER = 10; // req'd for model based ext
- public static final int PROPERTY_SECTION_DESCRIPTOR_PROVIDER = 11; // req'd for model based ext
- public static final int XSD_DELETE_ACTION = 12;
-
- boolean isExtensionTypeSupported(int type);
- boolean isApplicable(Object modelObject);
- Object createExtensionObject(int type, IEditorPart editor);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtensionProperties.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtensionProperties.java
deleted file mode 100644
index 9d8459a83..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLEditorExtensionProperties.java
+++ /dev/null
@@ -1,69 +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.extensions;
-
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.gef.EditPartFactory;
-
-public class WSDLEditorExtensionProperties
-{
- AdapterFactory adapterFactory;
-// IExtendedFigureFactory figureFactory;
- EditPartFactory editPartFactory;
- List actionList;
-
- public WSDLEditorExtensionProperties()
- {
-
- }
-
- public void setActionList(List actionList)
- {
- this.actionList = actionList;
- }
-
- public void setAdapterFactory(AdapterFactory adapterFactory)
- {
- this.adapterFactory = adapterFactory;
- }
-
- public void setEditPartFactoryList(EditPartFactory editPartFactory)
- {
- this.editPartFactory = editPartFactory;
- }
-
-// public void setFigureFactoryList(IExtendedFigureFactory figureFactory)
-// {
-// this.figureFactory = figureFactory;
-// }
-
- public List getActionList()
- {
- return actionList;
- }
-
- public AdapterFactory getAdapterFactory()
- {
- return adapterFactory;
- }
-
- public EditPartFactory getEditPartFactory()
- {
- return editPartFactory;
- }
-
-// public IExtendedFigureFactory getFigureFactory()
-// {
-// return figureFactory;
-// }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLNodeAssociationProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLNodeAssociationProvider.java
deleted file mode 100644
index d567e8bb9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/extensions/WSDLNodeAssociationProvider.java
+++ /dev/null
@@ -1,80 +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.extensions;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.xsd.impl.XSDComponentImpl;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class WSDLNodeAssociationProvider implements INodeAssociationProvider
-{
- public Object getModelObject(Object parentModelObject, Element[] elementChain, int start, int[] end)
- {
- Object currentObject = parentModelObject;
- for (int i = start; i < elementChain.length; i++)
- {
- Object o = getModelObjectHelper(currentObject, elementChain[i]);
- if (o == null)
- {
- end[0] = i;
- break;
- }
- else
- {
- currentObject = o;
- }
- }
- return currentObject != parentModelObject ? currentObject : null;
- }
-
- public Node getNode(Object modelObject)
- {
- if (modelObject instanceof WSDLElement)
- return ((WSDLElementImpl)modelObject).getElement();
- else
- return null;
- }
-
- protected Object getModelObjectHelper(Object parentObject, Element elementNode)
- {
- Object result = null;
- Collection childComponentList = ((WSDLElementImpl) parentObject).getWSDLContents();
- for (Iterator i = childComponentList.iterator(); i.hasNext();)
- {
- Object o = i.next();
- Element element = null;
-
- if (o != null)
- {
- if (o instanceof WSDLElementImpl)
- {
- element = ((WSDLElementImpl)o).getElement();
- }
- else if (o instanceof XSDComponentImpl)
- {
- element = ((XSDComponentImpl)o).getElement();
- }
- }
-
- if (element == elementNode)
- {
- result = o;
- break;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/ExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/ExtensiblityElementFilter.java
deleted file mode 100644
index 81314773d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/ExtensiblityElementFilter.java
+++ /dev/null
@@ -1,18 +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.filter;
-
-import org.w3c.dom.Element;
-
-public interface ExtensiblityElementFilter
-{
- public boolean isValidContext(Element parentElement, String localName);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/HttpExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/HttpExtensiblityElementFilter.java
deleted file mode 100644
index c608f661c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/HttpExtensiblityElementFilter.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.filter;
-
-import org.w3c.dom.Element;
-
-
-public class HttpExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- public HttpExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = true;
-
- String parentElementName = parentElement.getLocalName();
- if (parentElementName.equals("binding")) //$NON-NLS-1$
- {
- result = localName.equals("binding"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("operation")) //$NON-NLS-1$
- {
- result = localName.equals("operation"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("input") || //$NON-NLS-1$
- parentElementName.equals("output")) //$NON-NLS-1$
- {
- result = localName.equals("body") || //$NON-NLS-1$
- localName.equals("header"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("fault")) //$NON-NLS-1$
- {
- result = localName.equals("fault"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("port")) //$NON-NLS-1$
- {
- result = localName.equals("address"); //$NON-NLS-1$
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/MimeExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/MimeExtensiblityElementFilter.java
deleted file mode 100644
index 389e01123..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/MimeExtensiblityElementFilter.java
+++ /dev/null
@@ -1,46 +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.filter;
-
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.w3c.dom.Element;
-
-
-public class MimeExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- private static final String MIME_NAMESPACE_URI="http://schemas.xmlsoap.org/wsdl/mime/"; //$NON-NLS-1$
- public MimeExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = false;
-
- String parentElementName = parentElement.getLocalName();
- String parentElementNamespace = parentElement.getNamespaceURI();
-
- if (WSDLConstants.WSDL_NAMESPACE_URI.equals(parentElementNamespace))
- {
- if (parentElementName.equals("input") || parentElementName.equals("output")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- result = localName.equals("content") || //$NON-NLS-1$
- localName.equals("multipartRelated") || //$NON-NLS-1$
- localName.equals("mimeXml"); //$NON-NLS-1$
- }
- }
- else if (MIME_NAMESPACE_URI.equals(parentElementNamespace))
- {
- result = true;
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/SoapExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/SoapExtensiblityElementFilter.java
deleted file mode 100644
index ade3eb727..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/SoapExtensiblityElementFilter.java
+++ /dev/null
@@ -1,61 +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.filter;
-
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.w3c.dom.Element;
-
-public class SoapExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- public SoapExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = true;
-
- String parentElementName = parentElement.getLocalName();
- if (parentElement.getNamespaceURI().equals(WSDLConstants.WSDL_NAMESPACE_URI))
- {
- // here we assume the parent element is the WSDL binding
- // skeleton and that the 'localName' is the SOAP extension element
- //
- if (parentElementName.equals("binding")) //$NON-NLS-1$
- {
- result = localName.equals("binding"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("operation")) //$NON-NLS-1$
- {
- result = localName.equals("operation"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("input") || //$NON-NLS-1$
- parentElementName.equals("output")) //$NON-NLS-1$
- {
- result = localName.equals("body") || //$NON-NLS-1$
- localName.equals("header"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("fault")) //$NON-NLS-1$
- {
- result = localName.equals("fault"); //$NON-NLS-1$
- }
- else if (parentElementName.equals("port")) //$NON-NLS-1$
- {
- result = localName.equals("address"); //$NON-NLS-1$
- }
- else
- {
- result = false;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/XSDExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/XSDExtensiblityElementFilter.java
deleted file mode 100644
index acdab76b3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/filter/XSDExtensiblityElementFilter.java
+++ /dev/null
@@ -1,31 +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.filter;
-
-import org.w3c.dom.Element;
-
-public class XSDExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- public XSDExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = false;
- String parentElementName = parentElement.getLocalName();
- if (parentElementName.equals("types")) //$NON-NLS-1$
- {
- result = localName.equals("schema"); //$NON-NLS-1$
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/back.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/back.gif
deleted file mode 100644
index 24d1a279e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/back.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_not_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_not_obj.gif
deleted file mode 100644
index f1c73106a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_not_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_obj.gif
deleted file mode 100644
index 62ad9becb..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bind_asct_val_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/binding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/binding_obj.gif
deleted file mode 100644
index 896e2f055..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/binding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bindingheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bindingheader_obj.gif
deleted file mode 100644
index 1ffe54e33..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/bindingheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/browsebutton.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/browsebutton.gif
deleted file mode 100644
index e2402f88f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/complextype_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/complextype_obj.gif
deleted file mode 100644
index 007f8522a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/complextype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/delete_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/delete_obj.gif
deleted file mode 100644
index b6922ac11..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/delete_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/element_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/element_obj.gif
deleted file mode 100644
index dd45f08fb..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/element_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/error_co.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/error_co.gif
deleted file mode 100644
index 119dcccd5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/error_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fault_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fault_obj.gif
deleted file mode 100644
index f228117f2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fault_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/file_obj.gif
deleted file mode 100644
index efa7a3801..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fldr_el.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fldr_el.gif
deleted file mode 100644
index 801c13388..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/fldr_el.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/forward.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/forward.gif
deleted file mode 100644
index eab699e38..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/forward.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/hidebinding.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/hidebinding.gif
deleted file mode 100644
index c846cd8d8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/hidebinding.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpaddress_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpaddress_obj.gif
deleted file mode 100644
index fb20c389d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpaddress_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpbinding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpbinding_obj.gif
deleted file mode 100644
index 4428ef395..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpbinding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpoperation_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpoperation_obj.gif
deleted file mode 100644
index 1c404181d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpoperation_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlencoded_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlencoded_obj.gif
deleted file mode 100644
index ed5050f22..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlencoded_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlreplacement_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlreplacement_obj.gif
deleted file mode 100644
index 273587ea9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/httpurlreplacement_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/import_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/import_obj.gif
deleted file mode 100644
index b7275aa56..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/import_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/importheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/importheader_obj.gif
deleted file mode 100644
index 6000cb80f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/importheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/input_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/input_obj.gif
deleted file mode 100644
index fe6b34989..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/input_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/message_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/message_obj.gif
deleted file mode 100644
index 2dce48373..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/message_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/messageheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/messageheader_obj.gif
deleted file mode 100644
index 02a711cee..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/messageheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespace_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespace_obj.gif
deleted file mode 100644
index 7e3f274d0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespace_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespacedecl_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespacedecl_obj.gif
deleted file mode 100644
index 2b79d2749..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/namespacedecl_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/new_wsdl_wiz.png b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/new_wsdl_wiz.png
deleted file mode 100644
index 4100110ec..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/new_wsdl_wiz.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operation_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operation_obj.gif
deleted file mode 100644
index 5818a3088..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operation_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operationbinding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operationbinding_obj.gif
deleted file mode 100644
index ae386c636..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/operationbinding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_no.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_no.gif
deleted file mode 100644
index f6b9f8a59..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_no.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_obj.gif
deleted file mode 100644
index bd0918ce1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_yes.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_yes.gif
deleted file mode 100644
index 9cacb96dc..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/output_yes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/page_banner.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/page_banner.gif
deleted file mode 100644
index aebc0b2a3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/page_banner.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/part_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/part_obj.gif
deleted file mode 100644
index 5219dfa87..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/part_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/port_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/port_obj.gif
deleted file mode 100644
index 379498b0a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/port_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttype_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttype_obj.gif
deleted file mode 100644
index 21325ca77..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttypeheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttypeheader_obj.gif
deleted file mode 100644
index 9afcc01e1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/porttypeheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtcmplxpltyp_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtcmplxpltyp_obj.gif
deleted file mode 100644
index db866437f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtcmplxpltyp_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtelemt_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtelemt_obj.gif
deleted file mode 100644
index 782d108fe..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtelemt_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtsmpltyp_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtsmpltyp_obj.gif
deleted file mode 100644
index 8ffc7c57b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/prtsmpltyp_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/quickassist.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/quickassist.gif
deleted file mode 100644
index 94ae2a0ee..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/quickassist.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/service_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/service_obj.gif
deleted file mode 100644
index 5216b3f2d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/service_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/serviceheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/serviceheader_obj.gif
deleted file mode 100644
index 8b4814cb8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/serviceheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/simpletype_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/simpletype_obj.gif
deleted file mode 100644
index e45dbb1d8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/simpletype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soap_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soap_obj.gif
deleted file mode 100644
index fd426ed2d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soap_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapaddress_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapaddress_obj.gif
deleted file mode 100644
index 4880ba795..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapaddress_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapatt_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapatt_obj.gif
deleted file mode 100644
index d0b366181..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapatt_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbinding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbinding_obj.gif
deleted file mode 100644
index 115f6bf2b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbinding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbody_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbody_obj.gif
deleted file mode 100644
index b2d01aad0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapbody_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapfault_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapfault_obj.gif
deleted file mode 100644
index 856b1f7d4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapfault_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheader_obj.gif
deleted file mode 100644
index f72ea3b20..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheaderfault_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheaderfault_obj.gif
deleted file mode 100644
index 2f0e1906f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapheaderfault_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapoperation_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapoperation_obj.gif
deleted file mode 100644
index bcc191469..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/soapoperation_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/types_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/types_obj.gif
deleted file mode 100644
index d1f6f889d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/types_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/validate.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/validate.gif
deleted file mode 100644
index 2b347ac45..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/wsdl_file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/wsdl_file_obj.gif
deleted file mode 100644
index 75b1f92b4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/wsdl_file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_file_obj.gif
deleted file mode 100644
index 13dcfceaf..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_obj.gif
deleted file mode 100644
index 13dcfceaf..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/icons/xsd_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/HTTPLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/HTTPLabelProvider.java
deleted file mode 100644
index fb8defd1d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/HTTPLabelProvider.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.label.providers;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.w3c.dom.Node;
-
-
-public class HTTPLabelProvider extends LabelProvider
-{
- protected final static String ADDRESS = "address"; //$NON-NLS-1$
- protected final static String BINDING = "binding"; //$NON-NLS-1$
- protected final static String OPERATION = "operation"; //$NON-NLS-1$
- protected final static String URL_ENCODED = "urlEncoded"; //$NON-NLS-1$
- protected final static String URL_REPLACEMENT = "urlReplacement"; //$NON-NLS-1$
-
- protected HashMap map = new HashMap();
-
- public HTTPLabelProvider()
- {
- map.put(ADDRESS, "icons/httpaddress_obj.gif"); //$NON-NLS-1$
- map.put(BINDING, "icons/httpbinding_obj.gif"); //$NON-NLS-1$
- map.put(OPERATION, "icons/httpoperation_obj.gif"); //$NON-NLS-1$
- map.put(URL_ENCODED, "icons/httpurlencoded_obj.gif"); //$NON-NLS-1$
- map.put(URL_REPLACEMENT, "icons/httpurlreplacement_obj.gif"); //$NON-NLS-1$
- }
-
- public Image getImage(Object object)
- {
- Node node = (Node)object;
- String imageName = (String)map.get(node.getLocalName());
- return imageName != null ? WSDLEditorPlugin.getInstance().getImage(imageName) : null;
- }
-
- public String getText(Object object)
- {
- Node node = (Node)object;
- return node.getNodeName();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/SOAPLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/SOAPLabelProvider.java
deleted file mode 100644
index dd60eef0e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/label/providers/SOAPLabelProvider.java
+++ /dev/null
@@ -1,56 +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.label.providers;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.w3c.dom.Node;
-
-
-public class SOAPLabelProvider extends LabelProvider
-{
- protected final static String ADDRESS = "address"; //$NON-NLS-1$
- protected final static String BODY = "body"; //$NON-NLS-1$
- protected final static String BINDING = "binding"; //$NON-NLS-1$
- protected final static String FAULT = "fault"; //$NON-NLS-1$
- protected final static String HEADER = "header"; //$NON-NLS-1$
- protected final static String HEADER_FAULT = "headerfault"; //$NON-NLS-1$
- protected final static String OPERATION = "operation"; //$NON-NLS-1$
-
- protected HashMap map = new HashMap();
-
- public SOAPLabelProvider()
- {
- map.put(ADDRESS, "icons/soapaddress_obj.gif"); //$NON-NLS-1$
- map.put(BINDING, "icons/soapbinding_obj.gif"); //$NON-NLS-1$
- map.put(BODY, "icons/soapbody_obj.gif"); //$NON-NLS-1$
- map.put(FAULT, "icons/soapfault_obj.gif"); //$NON-NLS-1$
- map.put(HEADER, "icons/soapheader_obj.gif"); //$NON-NLS-1$
- map.put(HEADER_FAULT, "icons/soapheaderfault_obj.gif"); //$NON-NLS-1$
- map.put(OPERATION, "icons/soapoperation_obj.gif"); //$NON-NLS-1$
- }
-
- public Image getImage(Object object)
- {
- Node node = (Node)object;
- String imageName = (String)map.get(node.getLocalName());
- return imageName != null ? WSDLEditorPlugin.getInstance().getImage(imageName) : null;
- }
-
- public String getText(Object object)
- {
- Node node = (Node)object;
- return node.getNodeName();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/messages.properties b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/messages.properties
deleted file mode 100644
index 4febcc745..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/messages.properties
+++ /dev/null
@@ -1,123 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 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
-###############################################################################
-# NLS_MESSAGEFORMAT_VAR
-_UI_DEPENDENCIES_CHANGED=Dependencies Changed
-_UI_DEPENDENCIES_CHANGED_REFRESH=One or more dependencies have changed. Do you want to refresh the editor to reflect these changes?
-_UI_EDIT_NAMESPACES_DIALOG_TITLE=Edit Namespaces
-_UI_PREF_PAGE_CREATING_FILES=Creating files
-_UI_REMEMBER_MY_DECISION_LABEL=Remember my decision
-_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE=Default Target Namespace:
-_UI_REGEN_BINDINGS_ON_SAVE_QUESTIONMARK=Regenerate Bindings On Save?
-_UI_LABEL_WARNING_DUPLICATE_NAME_EXISTS=Warning: duplicate name already exists
-_UI_LABEL_NAMESPACE_URIS_TO_BE_INCLUDED=Namespace URIs to be included
-_UI_PREF_PAGE_AUTO_REGENERATE_BINDING=Regenerate Binding on save
-_UI_PREF_PAGE_PROMPT_REGEN_BINDING_ON_SAVE=Prompt Regenerate Binding on save
-_UI_EDIT_NAMESPACES=Edit Namespaces...
-_UI_ACTION_ADD_IMPORT=Add Import
-_UI_ACTION_ADD_BINDING=Add Binding
-_UI_ACTION_ADD_PART=Add Part
-_UI_ACTION_ADD_XML_SCHEMA_ELEMENT=Add XML Schema Element
-_UI_ACTION_REORDER_PART=Reorder Part
-_UI_ACTION_REORDER_MESSAGE_REFERENCE=Reorder Message Reference
-_UI_ACTION_OPEN_IN_NEW_EDITOR=Open In New Editor
-_UI_ACTION_EXISTING_MESSAGE=Existing Message...
-_UI_ACTION_EXISTING_ELEMENT=Existing Element...
-_UI_ERROR_NAMESPACE_INVALID=The target namespace is invalid
-_UI_ERROR_FILE_ALREADY_EXISTS=File already exists: {0}
-_UI_DESCRIPTION_NEW_WSDL_FILE=Specify the attributes for the new WSDL file.
-_UI_REGEN_BINDINDS_ON_SAVE=Regenerate Bindings On Save
-_UI_RADIO_DOCUMENT_LITERAL=document literal
-_UI_TITLE_SPECIFY_PORTTYPE=Specify Port Type
-_UI_LABEL_BINDING_PROTOCOL=Protocol:
-_UI_LABEL_INLINE_SCHEMA_OF=Inline Schema of
-_UI_LABEL_TARGET_NAMESPACE=Target namespace:
-_UI_LABEL_PREFIX_WITH_COLON=Prefix:
-_UI_LABEL_CREATE_WSDL_SKELETON=Create WSDL Skeleton
-_UI_LABEL_CREATE_NEW_WSDL_FILE=Create a new WSDL File
-_UI_LABEL_SOAP_BINDING_OPTIONS=SOAP Binding Options
-_UI_LABEL_HTTP_BINDING_OPTIONS=HTTP Binding Options
-_UI_LABEL_ADD_EXTENSION_ELEMENT=Add Extension Element
-_UI_SPECIFY_BINDING_DETAILS_LABEL=Specify the details of the binding that will be created
-_UI_SPECIFY_PORT_DETAILS_TO_BE_CREATED=Specify the details of the port that will be created
-_UI_LABEL_NEW_BINDING=New Binding
-_UI_LABEL_NEW_PORTTYPE=New PortType
-_UI_LABEL_REFERENCE_KIND=Reference Kind
-_UI_LABEL_NEW_MESSAGE=New Message
-_UI_RADIO_RPC_ENCODED=rpc encoded
-_UI_RADIO_RPC_LITERAL=rpc literal
-_UI_ACTION_EXISTING_TYPE=Existing Type...
-_UI_SPECIFY_PORT_DETAILS=Specify Port Details
-_UI_TITLE_SPECIFY_BINDING=Specify Binding
-_UI_TITLE_SPECIFY_BINDING_DETAILS=Specify Binding Details
-_UI_ERROR_FILE_MUST_END_WITH_WSDL=Error: File must end with wsdl
-_UI_TITLE_SPECIFY_MESSAGE=Specify Message
-_UI_TITLE_NEW_WSDL_FILE=New WSDL File
-_UI_NAME_INVALID_CHAR_END=')
-_UI_ACTION_RENAME=Rename
-_UI_FOLDER_TYPES=Types
-_UI_CANCEL_LABEL=Cancel
-_UI_ACTION_NEW_TYPE=New Type...
-_UI_ACTION_SET_TYPE=Set Type
-_UI_FOLDER_IMPORTS=Imports
-_UI_FOLDER_SERVICES=Services
-_UI_FOLDER_BINDINGS=Bindings
-_UI_FOLDER_INTERFACES=Interfaces
-_UI_FOLDER_PORTTYPES=PortTypes
-_UI_FOLDER_MESSAGES=Messages
-_UI_ACTION_NEW_MESSAGE=New Message...
-_UI_ACTION_NEW_ELEMENT=New Element...
-_UI_ACTION_SET_ELEMENT=Set Element
-_UI_ACTION_SET_MESSAGE=Set Message
-_UI_ACTION_SET_BINDING=Set Binding
-_UI_CHECKBOX_OVERWRITE=Overwrite existing binding information
-_UI_ACTION_SET_PORTTYPE=Set PortType
-_UI_ACTION_EDIT_PORT_ADDRESS=Edit Address
-_UI_ACTION_ADD=Add
-_UI_ACTION_OPEN_IMPORT=Open Import
-_UI_UNSPECIFIED=(unspecified)
-_UI_LABEL_NAME=Name
-_UI_LABEL_TYPE=Type
-_UI_BUTTON_NEW=New...
-_UI_LABEL_ELEMENT=Element
-_UI_BUTTON_BROWSE=Browse...
-_UI_BINDING_WIZARD=Binding Wizard
-_UI_BINDING=Binding
-_UI_LABEL_MESSAGE=Message
-_UI_LABEL_REMOVE=Remove
-_UI_TITLE_SELECT=Select
-_UI_TITLE_SELECT_FILE = Select File
-_UI_DESCRIPTION_SELECT_WSDL_OR_XSD = Select a WSDL or XSD file to import.
-_UI_TITLE_OPTIONS=Options
-_UI_YES_LABEL=Yes
-_UI_PORT_TYPE=Port Type
-_UI_PORT_WIZARD=Port Wizard
-_UI_NO_LABEL=No
-_UI_ADD=Add...
-_UI_HELP=Help
-_UI_LABEL_NAME_FILTER=Name (? = character, * = any string):
-_WARN_NAME_MUST_CONTAIN_AT_LEAST_ONE_CHAR=IWAX1415W Name field must contain at least one character
-_WARN_NAME_HAS_SPACE=IWAX1402W Name field cannot contain a space
-_WARN_NAME_INVALID_FIRST=IWAX1403W First character in name field must be one of the following ('_', ':', 'letter')
-_WARN_NAME_INVALID_CHAR=IWAX1404W Name field contains invalid character ('
-_WARN_WSI_COMPLIANCE_PROTOCOL=WS-I compliance warning: protocol should be {0}
-_ERROR_WSI_COMPLIANCE_PROTOCOL=WS-I compliance error: protocol must be {0}
-_WARN_WSI_COMPLIANCE_RPC_ENCODING=WS-I compliance warning: binding should not be rpc encoded
-_ERROR_WSI_COMPLIANCE_RPC_ENCODING=WS-I compliance error: binding cannot be rpc encoded
-_WSI_COMPLIANCE_LINK_TEXT=Modify project compliance setting
-
-_UI_LABEL_UNDEFINED_ARG1={0} undefined
-_UI_LABEL_OR_UNDEFINED_ARG2={0} or {1} undefined
-_UI_LABEL_NO_OBJECT_SPECIFIED_ARG1=no {0} specified
-_UI_LABEL_NO_PARAMETERS_SPECIFIED=no parameters specified
-
-_UI_LABEL_DEFAULT = default
-
-_UI_EDITOR_NAME=WSDL Editor
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/EditorModeSectionFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/EditorModeSectionFilter.java
deleted file mode 100644
index 88a70dd9c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/EditorModeSectionFilter.java
+++ /dev/null
@@ -1,16 +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.properties.sections;
-
-public abstract class EditorModeSectionFilter
-{
- public abstract boolean isApplicable(Class sectionClass, Object object);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ExtensionsSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ExtensionsSection.java
deleted file mode 100644
index 3b31f0450..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ExtensionsSection.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddExtensionElementCommand;
-import org.eclipse.wst.wsdl.ui.internal.filter.ExtensiblityElementFilter;
-import org.eclipse.wst.wsdl.ui.internal.text.WSDLModelAdapter;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.RemoveExtensionNodeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.AbstractExtensionsSection;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.AddExtensionsComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.DOMExtensionTreeContentProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.DOMExtensionTreeLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionsSchemasRegistry;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeCustomizationRegistry;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class W11ExtensionsSection extends AbstractExtensionsSection
-{
- WSDLModelAdapter modelAdapter;
-
- public W11ExtensionsSection()
- {
- super();
- setExtensionTreeLabelProvider(new WSDLExtensionTreeLabelProvider());
- setExtensionTreeContentProvider(new WSDLExtensionTreeContentProvider());
- }
-
- protected AddExtensionCommand getAddExtensionCommand(Object o)
- {
- AddExtensionCommand addExtensionCommand = null;
- ExtensibleElement extensibleElement = getExtensibleElement(input);
- if (extensibleElement != null)
- {
- if (o instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) o;
- addExtensionCommand = new AddExtensionElementCommand(Messages._UI_LABEL_ADD_EXTENSION_ELEMENT, extensibleElement, element); //$NON-NLS-1$
- }
- else if (o instanceof XSDAttributeDeclaration)
- {
- // TODO (cs) need to implement this
- }
- }
- return addExtensionCommand;
- }
-
- protected Command getRemoveExtensionCommand(Object o)
- {
- if (o instanceof Node)
- {
- return new RemoveExtensionNodeCommand("remove", (Node)o); //$NON-NLS-1$
- }
- return null;
- }
-
-
- // TODO (cs) the AbstractExtensionsSection is polluted with XSD specic stuff
- // need to clean that up!!
- // TODO (cs) we should avoid referencing WSDL model objects ... go thru facade instead
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- isReadOnly = true;
- ExtensibleElement extensibleElement = getExtensibleElement(input);
- if (extensibleElement != null)
- {
- Element element = extensibleElement.getElement();
- if (element instanceof ElementImpl)
- {
- isReadOnly = false;
- modelAdapter = WSDLModelAdapter.lookupOrCreateModelAdapter(element.getOwnerDocument());
- modelAdapter.getModelReconcileAdapter().addListener(internalNodeAdapter);
- }
- }
- addButton.setEnabled(!isReadOnly);
- removeButton.setEnabled(!isReadOnly);
- }
-
- public void dispose()
- {
- super.dispose();
- if (modelAdapter != null)
- {
- modelAdapter.getModelReconcileAdapter().removeListener(internalNodeAdapter);
- }
- }
-
- // TODO (cs) in the future we need to 'fix' things so that we can rid of this method
- // we need a way to do all of this via the facade so that we don't have any direct
- // dependency on the WSDL1.1 model./ Similarly this class shouldn't need to 'know'
- // about AbstractModelCollection this is an underlying detail that needs to be hidden
- //
- private static ExtensibleElement getExtensibleElement(Object o)
- {
- if (o instanceof AbstractModelCollection)
- {
- o = ((AbstractModelCollection)o).getModel();
- }
- if (o instanceof Adapter)
- {
- // TODO (cs) we need a way to do all of this via the facade
- // so that we don't have any direct dependency on the WSDL1.1 model
- // of course at the moment we call this class the W11ExtensionSections
- // so that's not a problem. In the future though we'll want to reuse this
- // class for WSDL 2.0.
- //
- o = ((Adapter)o).getTarget();
- }
- if (o instanceof ExtensibleElement)
- {
- return (ExtensibleElement)o;
- }
- return null;
- }
-
- protected AddExtensionsComponentDialog createAddExtensionsComponentDialog()
- {
- ExtensibleElement extensibleElement = getExtensibleElement(input);
- if (extensibleElement != null)
- {
- AddExtensionsComponentDialog dialog = new AddExtensionsComponentDialog(composite.getShell(), getExtensionsSchemasRegistry());
- dialog.addElementsTableFilter(new AddExtensionsComponentDialogFilter(extensibleElement.getElement()));
- return dialog;
- }
- return null;
- }
-
- protected ExtensionsSchemasRegistry getExtensionsSchemasRegistry()
- {
- return WSDLEditorPlugin.getInstance().getExtensionsSchemasRegistry();
- }
-
- protected IPreferenceStore getPrefStore()
- {
- return WSDLEditorPlugin.getInstance().getPreferenceStore();
- }
-
- static class WSDLExtensionTreeContentProvider extends DOMExtensionTreeContentProvider
- {
- public java.lang.Object[] getElements(java.lang.Object inputElement)
- {
- ExtensibleElement extensibleElement = getExtensibleElement(inputElement);
- if (extensibleElement != null)
- {
- List domElementList = new ArrayList();
- for (Iterator i = extensibleElement.getExtensibilityElements().iterator(); i.hasNext(); )
- {
- ExtensibilityElement element = (ExtensibilityElement)i.next();
- // add the DOM element
- domElementList.add(element.getElement());
- }
- return domElementList.toArray();
- }
- return Collections.EMPTY_LIST.toArray();
- }
- }
-
- static class WSDLExtensionTreeLabelProvider extends DOMExtensionTreeLabelProvider
- {
- private ILabelProvider getLabelProvider(Node node)
- {
- String namespace = node.getNamespaceURI();
- if (namespace != null)
- {
- NodeCustomizationRegistry registry = XSDEditorPlugin.getDefault().getNodeCustomizationRegistry();
- return registry.getLabelProvider(namespace);
- }
- return null;
- }
-
- public Image getImage(Object object)
- {
- if (object instanceof Element)
- {
- Element element = (Element)object;
- ILabelProvider provider = getLabelProvider(element);
- if (provider != null)
- {
- return provider.getImage(element);
- }
- }
- return super.getImage(object);
- }
-
- public String getText(Object object)
- {
- if (object instanceof Element)
- {
- Element element = (Element)object;
- ILabelProvider provider = getLabelProvider(element);
- if (provider != null)
- {
- return provider.getText(element);
- }
- }
- return super.getText(object);
- }
- }
- /**
- * This filter is to be used by the dialog invoked when addButton is pressed
- */
- private class AddExtensionsComponentDialogFilter extends ViewerFilter
- {
- private Element hostElement;
-
- public AddExtensionsComponentDialogFilter(Element hostElement)
- {
- this.hostElement = hostElement;
- }
-
- public boolean select(Viewer viewer, Object parentElement, Object element)
- {
- if (element instanceof XSDElementDeclaration)
- {
- String namespace = ((XSDElementDeclaration) element).getTargetNamespace();
- String name = ((XSDElementDeclaration) element).getName();
- ExtensiblityElementFilter filter = (ExtensiblityElementFilter) WSDLEditorPlugin.getInstance().getExtensiblityElementFilterRegistry().getProperty(namespace, ""); //$NON-NLS-1$
- if (filter != null)
- {
- return filter.isValidContext(hostElement, name);
- }
- return true;
- }
- return true;
- }
- }
-
- protected boolean isTreeViewerInputElement(Element element)
- {
- ExtensibleElement extensibleElement = getExtensibleElement(input);
- return extensibleElement != null && extensibleElement.getElement() == element;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSection.java
deleted file mode 100644
index 3b08b38bf..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSection.java
+++ /dev/null
@@ -1,234 +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.properties.sections;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11MessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.NameSection;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class W11MessageReferenceSection extends NameSection {
- protected static String NEW_STRING = Messages._UI_BUTTON_NEW; //$NON-NLS-1$
- protected static String BROWSE_STRING = Messages._UI_BUTTON_BROWSE; //$NON-NLS-1$
-
- protected CLabel comboLabel;
- protected CCombo combo;
- protected ComponentReferenceEditManager refManager;
-
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- createControlArea();
- }
-
- public void createControlArea()
- {
- FormData data;
-
- combo = getWidgetFactory().createCCombo(composite);
- combo.setBackground(composite.getBackground());
- combo.addListener(SWT.Modify, this);
- combo.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, ASDEditorCSHelpIds.PROPERTIES_MESSAGE_REF_MESSAGE_COMBO);
-
- comboLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_MESSAGE + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(combo, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(combo, 0, SWT.CENTER);
- comboLabel.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
-// data.right = new FormAttachment(button, 0);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(nameText, +ITabbedPropertyConstants.VSPACE);
- combo.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- super.refresh();
- if (nameText.isFocusControl()) {
- return;
- }
- setListenerEnabled(false);
- String refName = ""; //$NON-NLS-1$
-
- combo.removeAll();
- combo.add(BROWSE_STRING);
- combo.add(NEW_STRING);
-
- MessageReference messageRef = (MessageReference) ((W11MessageReference) getModel()).getTarget();
- if (messageRef != null && messageRef.getEMessage() != null) {
- refName = messageRef.getEMessage().getQName().getLocalPart();
- }
-
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null) {
- ComponentSpecification[] specs = editManager.getQuickPicks();
- for (int index = 0; index < specs.length; index++) {
- combo.add((String) specs[index].getName());
- }
- }
-
- String[] items = combo.getItems();
- int index;
- for (index = 0; index < items.length; index++) {
- if (items[index].equals(refName)) {
- break;
- }
- }
-
- if (index < items.length) {
- // Found a match
- combo.select(index);
- }
- else {
- combo.setText(refName);
- }
-
- setControlForegroundColor(combo);
- setListenerEnabled(true);
-
-
-// MessageReference messageRef = (MessageReference) ((W11MessageReference) getModel()).getTarget();
-// Iterator it = messageRef.getEnclosingDefinition().getEMessages().iterator();
-// while (it.hasNext()) {
-// Message message = (Message) it.next();
-// combo.add(message.getQName().getLocalPart());
-// }
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager() {
- if (refManager != null) {
- return refManager;
- }
-
- refManager = ReferenceEditManagerHelper.getMessageReferenceEditManager((IASDObject) getModel());
-
- return refManager;
- }
-
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void handleEvent(Event event)
- {
- if (event.widget == combo) {
- if (isListenerEnabled() && !isInDoHandle)
- {
- isInDoHandle = true;
- startDelayedEvent(event);
- isInDoHandle = false;
- }
- }
- else {
- super.handleEvent(event);
- }
- }
-
- public void doHandleEvent(Event event)
- {
- super.doHandleEvent(event);
- if (event.widget == combo) {
- String value = ""; //$NON-NLS-1$
- if (combo.getSelectionIndex() != -1) {
- value = combo.getItem(combo.getSelectionIndex());
- }
-
- ComponentSpecification spec = null;
- int continueApply = Window.OK;
- IMessageReference messageRef = (IMessageReference) this.getModel();
-
- if (value.equals(NEW_STRING)) {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- IComponentDialog dialog = editManager.getNewDialog();
- continueApply = dialog.createAndOpen();
- spec = dialog.getSelectedComponent();
- }
- else if (value.equals(BROWSE_STRING)) {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- IComponentDialog dialog = editManager.getBrowseDialog();
- continueApply = dialog.createAndOpen();
- spec = dialog.getSelectedComponent();
- }
- else {
- spec = getComponentSpecificationForValue((String)value);
- }
-
- if (continueApply == Window.OK) {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (spec != null) {
- editManager.modifyComponentReference(messageRef, spec);
- }
- }
-
-
- }
- }
-
- protected ComponentSpecification getComponentSpecificationForValue(String value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSectionFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSectionFilter.java
deleted file mode 100644
index 7ac556c1a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11MessageReferenceSectionFilter.java
+++ /dev/null
@@ -1,28 +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.properties.sections;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-
-public class W11MessageReferenceSectionFilter implements IFilter {
- // rmah: we should consider other ways of 'extending' this capability
- // rather than simply checking a variable....
- public static boolean showW11MessageReferenceSection = true;
-
- public boolean select(Object toTest) {
- if (toTest instanceof IMessageReference && showW11MessageReferenceSection) {
- return true;
- }
-
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSection.java
deleted file mode 100644
index 2b262d490..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSection.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.properties.sections;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.ParameterSection;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-
-public class W11ParameterSection extends ParameterSection {
- protected Button typeRadio;
- protected Button elementRadio;
- protected ComponentReferenceEditManager refManager;
-
- public void createControlArea() {
- super.createControlArea();
- FormData data;
-
- CLabel referenceKindLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_REFERENCE_KIND + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- Composite comp = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginRight = 5;
- comp.setLayout(layout);
-
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(comp, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(comp, 0, SWT.CENTER);
- referenceKindLabel.setLayoutData(data);
-
- typeRadio = getWidgetFactory().createButton(comp, Messages._UI_LABEL_TYPE, SWT.RADIO); //$NON-NLS-1$
- elementRadio = getWidgetFactory().createButton(comp, Messages._UI_LABEL_ELEMENT, SWT.RADIO); //$NON-NLS-1$
- typeRadio.addSelectionListener(this);
- elementRadio.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(typeRadio, ASDEditorCSHelpIds.PROPERTIES_PART_TYPE_RADIO);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(elementRadio, ASDEditorCSHelpIds.PROPERTIES_PART_ELEMENT_RADIO);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.top = new FormAttachment(combo, +ITabbedPropertyConstants.VSPACE);
- comp.setLayoutData(data);
- }
-
- public void doWidgetSelected(SelectionEvent e) {
- W11ParameterForPart parameter = (W11ParameterForPart) this.getModel();
- Part part = (Part) parameter.getTarget();
-
- if (e.widget == typeRadio && typeRadio.getSelection()) {
- comboLabel.setText(Messages._UI_LABEL_TYPE+ ":"); //$NON-NLS-1$ //$NON-NLS-2$
- ComponentReferenceUtil.setComponentReference(part, true, null);
- super.refreshCombo();
- }
- else if (e.widget == elementRadio && elementRadio.getSelection()) {
- comboLabel.setText(Messages._UI_LABEL_ELEMENT + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- ComponentReferenceUtil.setComponentReference(part, false, null);
- refreshElementCombo();
- }
- }
-
- public void doHandleEvent(Event event) {
- if (event.widget == combo) {
- if (elementRadio.getSelection()) {
- // Handle Element selection
- String value = combo.getItem(combo.getSelectionIndex());
-
- W11ParameterForPart parameter = (W11ParameterForPart) this.getModel();
-
- if (value.equals(NEW_STRING)) {
- Command command = parameter.getSetElementCommand(IParameter.SET_NEW_ACTION_ID);
- command.execute();
- }
- else if (value.equals(BROWSE_STRING)) {
- Command command = parameter.getSetElementCommand(IParameter.SELECT_EXISTING_ACTION_ID);
- command.execute();
- }
- else {
- ComponentReferenceEditManager editManager = getElementComponentReferenceEditManager();
- ComponentSpecification spec = getComponentSpecificationForValue((String)value);
- if (spec != null) {
- editManager.modifyComponentReference(parameter, spec);
- }
- }
- }
- }
-
- super.doHandleEvent(event);
- refresh();
- }
-
- protected void refreshElementCombo() {
-
- // Refresh with Elements
- IParameter param = null;
- Object model = getModel();
- setListenerEnabled(false);
-
- if (model instanceof IParameter) {
- param = (IParameter) model;
- }
-
- String name = ""; //$NON-NLS-1$
- String elementName = "ParameterSection.java"; //$NON-NLS-1$
- if (param != null) {
- name = param.getName();
- elementName = param.getComponentName();
- }
-
- if (!nameText.isFocusControl()) {
- nameText.setText(name);
- }
-
- // Populate the Combo
- combo.removeAll();
- combo.add(BROWSE_STRING);
- combo.add(NEW_STRING);
-
- ComponentReferenceEditManager editManager = getElementComponentReferenceEditManager();
- if (editManager != null) {
- ComponentSpecification[] specs = editManager.getQuickPicks();
- for (int index = 0; index < specs.length; index++) {
- combo.add((String) specs[index].getName());
- }
- }
-
- // Display the element in the Combo
- String[] items = combo.getItems();
- int index;
- for (index = 0; index < items.length; index++) {
- if (items[index].equals(elementName)) {
- break;
- }
- }
-
- if (index < items.length) {
- // Found a match
- combo.select(index);
- }
- else {
- combo.setText(elementName);
- }
-
- setListenerEnabled(true);
-
- }
-
- public void refresh() {
- setListenerEnabled(false);
-
- Object model = getModel();
- if (model instanceof W11ParameterForPart) {
- W11ParameterForPart param = (W11ParameterForPart) model;
- Part part = (Part) param.getTarget();
- if (part.getTypeDefinition() != null) {
- typeRadio.setSelection(true);
- elementRadio.setSelection(false);
- comboLabel.setText(Messages._UI_LABEL_TYPE + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- handleTypeScenario = true;
- }
- else if (part.getElementDeclaration() != null) {
- typeRadio.setSelection(false);
- elementRadio.setSelection(true);
- comboLabel.setText(Messages._UI_LABEL_ELEMENT + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- handleTypeScenario = false;
- refreshElementCombo();
- }
- else {
- // Neither a Type or Element
- typeRadio.setSelection(false);
- elementRadio.setSelection(true);
- }
- }
-
- setControlForegroundColor(elementRadio);
- setControlForegroundColor(typeRadio);
-
- super.refresh();
- setListenerEnabled(true);
- }
-
- protected ComponentReferenceEditManager getElementComponentReferenceEditManager() {
- if (refManager != null) {
- return refManager;
- }
-
- refManager = ReferenceEditManagerHelper.getXSDElementReferenceEditManager((IASDObject) getModel());
-
- return refManager;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSectionFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSectionFilter.java
deleted file mode 100644
index 9c5d82bfb..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/properties/sections/W11ParameterSectionFilter.java
+++ /dev/null
@@ -1,46 +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.properties.sections;
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-
-public class W11ParameterSectionFilter implements IFilter
-{
- public boolean select(Object toTest)
- {
- boolean result = false;
- if (toTest instanceof IParameter)
- {
- result = true;
- try
- {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- EditorModeManager manager = (EditorModeManager) editor.getAdapter(EditorModeManager.class);
- if (manager != null)
- {
- EditorModeSectionFilter filter = (EditorModeSectionFilter) manager.getCurrentMode().getAdapter(EditorModeSectionFilter.class);
- if (filter != null)
- {
- result = filter.isApplicable(W11ParameterSection.class, toTest);
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java
deleted file mode 100644
index e0f343bf9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/reconciler/DelegatingSourceValidatorForWSDL.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.reconciler;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.eclipse.wst.validation.Validator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator;
-
-/**
- * This performs the as-you-type validation for WSDL files
- */
-public class DelegatingSourceValidatorForWSDL extends DelegatingSourceValidator
-{
- private final static String Id = "org.eclipse.wst.wsdl.validation.wsdl"; //$NON-NLS-1$
-
- private Validator _validator;
-
- public DelegatingSourceValidatorForWSDL()
- {
- }
-
- private Validator getValidator()
- {
- if (_validator == null)
- _validator = ValidationFramework.getDefault().getValidator(Id);
- return _validator;
- }
-
- protected IValidator getDelegateValidator()
- {
- Validator v = getValidator();
- if (v == null)
- return null;
- return v.asIValidator();
- }
-
- protected boolean isDelegateValidatorEnabled(IFile file)
- {
- Validator v = getValidator();
- if (v == null)
- return false;
- if (!v.shouldValidate(file, false, false))
- return false;
- return v.isBuildValidation() || v.isManualValidation();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlink.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlink.java
deleted file mode 100644
index 51ba272d8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlink.java
+++ /dev/null
@@ -1,117 +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.text;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * WSDLHyperlink knows how to open links from wsdl files.
- *
- * @see WSDLHyperlinkDetector
- */
-public class WSDLHyperlink implements IHyperlink
-{
- private IRegion fRegion;
- private String fResource;
- private String fSpec;
-
- public WSDLHyperlink(IRegion region, String resource, String spec)
- {
- fRegion = region;
- fResource = resource;
- fSpec = spec;
- }
-
- public IRegion getHyperlinkRegion()
- {
- return fRegion;
- }
-
- public String getTypeLabel()
- {
- return null;
- }
-
- public String getHyperlinkText()
- {
- return null;
- }
-
- public void open()
- {
- /*
- * ISSUE: There are cleaner ways to find the right file based on a URI
- * string and cleaner ways to find which editor to open for the file. See
- * other IHyperlink and IHyperlinkDetector implementors for examples.
- */
- String pattern = "platform:/resource"; //$NON-NLS-1$
- if (fResource != null && fResource.startsWith(pattern))
- {
- Path path = new Path(fResource.substring(pattern.length()));
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-
- IWorkbenchPage workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- IEditorPart editorPart = workbenchPage.getActiveEditor();
-
- // When using the cursor or the mouse to move around in the text
- // editor, the location history is not updated, so we make sure we keep
- // a reference to where we are. If we use other navigation means, like the
- // outline view, this call will not add a new location history entry, as
- // it is the same as the last location set through the outline driven
- // navigation.
-
- boolean sameEditor = editorPart.getEditorInput() instanceof IFileEditorInput && ((IFileEditorInput) editorPart.getEditorInput()).getFile().equals(file);
-
- workbenchPage.getNavigationHistory().markLocation(editorPart);
-
- if (!sameEditor)
- {
- try
- {
- // The target is in a different file, so open the target's enclosing
- // resource in it's own editor. Let the workbench decide what editor
- // to open based on the file's content type.
-
- editorPart = IDE.openEditor(workbenchPage, file, true);
- }
- catch (PartInitException e)
- {
-// Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- return;
- }
- }
-
- // Attempt to retrieve the target editor's selection manager and try to
- // change the selection to the thing (schema component, wsdl element, etc)
- // pointed to by fSpec.
-
- ISelectionProvider selectionProvider = (ISelectionProvider) editorPart.getAdapter(ISelectionProvider.class);
-
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(fSpec));
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlinkDetector.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlinkDetector.java
deleted file mode 100644
index 1b60e2c84..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLHyperlinkDetector.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.text;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDHyperlinkDetector;
-/**
- * Detects hyperlinks for WSDL files. Used by the WSDL text editor to provide a
- * "Go to declaration" functionality similar with the one provided by the Java
- * editor.
- */
-public class WSDLHyperlinkDetector extends XSDHyperlinkDetector
-{
- /*
- * (non-Javadoc)
- */
- protected IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region)
- {
- // Here we're trying to find the target component's resource and spec.
-
- Definition definition = getDefinition(document);
- OpenOnSelectionHelper helper = new OpenOnSelectionHelper(definition);
- String[] targetData = helper.computeSpecification(node);
-
- if (targetData != null)
- {
- String resource = targetData[0];
- String spec = targetData[1];
- return new WSDLHyperlink(region, resource, spec);
- }
-
- return null;
- }
-
- /**
- * Gets the definition from document
- *
- * @param document
- * @return Definition
- */
- private Definition getDefinition(IDocument document)
- {
- Definition definition = null;
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null)
- {
- try
- {
- if (model instanceof IDOMModel)
- {
- IDOMDocument domDoc = ((IDOMModel) model).getDocument();
- if (domDoc != null)
- {
- WSDLModelAdapter modelAdapter = (WSDLModelAdapter) domDoc.getAdapterFor(WSDLModelAdapter.class);
- // ISSUE: if adapter does not already exist for domDoc getAdapterFor
- // will create one. So why is this null check/creation needed?
- if (modelAdapter == null)
- {
- modelAdapter = new WSDLModelAdapter();
- domDoc.addAdapter(modelAdapter);
- modelAdapter.createDefinition(domDoc);
- }
- definition = modelAdapter.getDefinition();
- }
- }
- }
- finally
- {
- model.releaseFromRead();
- }
- }
- return definition;
- }
-
- /*
- * (non-Javadoc)
- */
- protected boolean isLinkableAttribute(String name)
- {
- boolean isLinkable = super.isLinkableAttribute(name)||
- name.equals(WSDLConstants.BINDING_ATTRIBUTE) ||
- name.equals(WSDLConstants.ELEMENT_ATTRIBUTE) ||
- name.equals(WSDLConstants.TYPE_ATTRIBUTE) ||
- name.equals(WSDLConstants.MESSAGE_ATTRIBUTE);
- return isLinkable;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelAdapter.java
deleted file mode 100644
index dc3fccb71..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelAdapter.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.text;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
-import org.eclipse.wst.wsdl.ui.internal.extensions.ExtensibleTypeSystemProvider;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaLocationResolverAdapterFactory;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class WSDLModelAdapter implements INodeAdapter
-{
- protected ResourceSet resourceSet;
- protected Definition definition;
- private ModelReconcileAdapter modelReconcileAdapter;
-
- public Definition getDefinition()
- {
- return definition;
- }
-
- public void setDefinition(Definition definition)
- {
- this.definition = definition;
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type == WSDLModelAdapter.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- }
-
- /**
- * @deprecated
- */
- public Definition createDefinition(Element element, Document document)
- {
- return createDefinition(document);
- }
-
- public Definition createDefinition(final Document document)
- {
- try
- {
- IDOMNode domNode = (IDOMNode) document;
- String baseLocation = "blankWSDL.wsdl"; //$NON-NLS-1$
- if (domNode != null)
- {
- baseLocation = domNode.getModel().getBaseLocation();
- }
- else if (document instanceof IDOMNode)
- {
- IDOMModel domModel = ((IDOMNode) document).getModel();
- baseLocation = domModel.getBaseLocation();
- }
- resourceSet = new ResourceSetImpl();
- resourceSet.getAdapterFactories().add(new WSDLModelLocatorAdapterFactory());
- resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
- // TODO.. .revist the best approach to obtain a URI from the SSE model
- //
- URI uri = null;
- if (baseLocation.startsWith("/")) //$NON-NLS-1$
- {
- uri = URI.createPlatformResourceURI(baseLocation);
- }
- else if (baseLocation.startsWith("http")) //$NON-NLS-1$
- {
- uri = URI.createURI(baseLocation);
- }
- else
- {
- uri = URI.createFileURI(baseLocation);
- }
- definition = WSDLFactory.eINSTANCE.createDefinition();
- definition.setDocumentBaseURI(uri.toString());
- definition.setDocument(document);
-
- WSDLResourceFactoryImpl resourceFactory = new WSDLResourceFactoryImpl();
- Resource resource = resourceFactory.createResource(uri);
- resourceSet.getResources().add(resource);
- resource.getContents().add(definition);
- resource.setModified(false);
-
- IRunnableWithProgress setElementOperation = new IRunnableWithProgress()
- {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
- {
- // Use the animated flavour as we don't know beforehand how many ticks we need.
- // The task name will be displayed by the code in WSDLResourceImpl and XSDResourceImpl.
-
- monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
-
- Map loadOptions = resourceSet.getLoadOptions();
-
- loadOptions.put(WSDLResourceImpl.WSDL_PROGRESS_MONITOR, monitor);
- loadOptions.put(XSDResourceImpl.XSD_PROGRESS_MONITOR, monitor);
-
- definition.setElement(document.getDocumentElement());
- ((DefinitionImpl) definition).reconcileReferences(true);
-
- loadOptions.remove(WSDLResourceImpl.WSDL_PROGRESS_MONITOR);
- loadOptions.remove(XSDResourceImpl.XSD_PROGRESS_MONITOR);
- }
- };
-
- IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
- try
- {
- progressService.busyCursorWhile(setElementOperation);
- }
- catch (InvocationTargetException e)
- {
- e.printStackTrace();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
-
- // attach an adapter to keep the WSDL model and DOM in sync
- //
- modelReconcileAdapter = new WSDLModelReconcileAdapter(document, definition);
- domNode.getModel().addModelStateListener(modelReconcileAdapter);
-
- // TODO... CS : revisit this line
- // currently this is used to associate a 'type' system with the definition
- // I suspect that this could be made a whole lot more simple
- //
- WSDLEditorUtil.getInstance().setTypeSystemProvider(definition, new ExtensibleTypeSystemProvider());
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- return definition;
- }
-
- public ModelReconcileAdapter getModelReconcileAdapter()
- {
- return modelReconcileAdapter;
- }
-
- public static WSDLModelAdapter lookupOrCreateModelAdapter(Document document)
- {
- WSDLModelAdapter adapter = null;
- if (document instanceof INodeNotifier)
- {
- INodeNotifier notifier = (INodeNotifier)document;
- adapter = (WSDLModelAdapter)notifier.getAdapterFor(WSDLModelAdapter.class);
- if (adapter == null)
- {
- adapter = new WSDLModelAdapter();
- notifier.addAdapter(adapter);
- }
- }
- return adapter;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelLocatorAdapterFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelLocatorAdapterFactory.java
deleted file mode 100644
index 0de7a94d5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelLocatorAdapterFactory.java
+++ /dev/null
@@ -1,46 +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.text;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.wsdl.internal.util.WSDLModelLocator;
-
-public class WSDLModelLocatorAdapterFactory extends AdapterFactoryImpl
-{
- protected CustomWSDLModelLocator customWSDLModelLocator = new CustomWSDLModelLocator();
-
- class CustomWSDLModelLocator extends AdapterImpl implements WSDLModelLocator
- {
- public String resolveURI(String baseLocation, String namespace, String location)
- {
- return URIResolverPlugin.createResolver().resolve(baseLocation, namespace, location);
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == WSDLModelLocator.class;
- }
- }
-
- public boolean isFactoryForType(Object type)
- {
- return type == WSDLModelLocator.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return customWSDLModelLocator;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelQueryExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelQueryExtension.java
deleted file mode 100644
index 11b31285a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelQueryExtension.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.text;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.filter.ExtensiblityElementFilter;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelQueryExtension;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class WSDLModelQueryExtension extends XSDModelQueryExtension
-{
- public WSDLModelQueryExtension()
- {
- }
-
- protected boolean isParentElementMessageReference(String parentElementName)
- {
- return parentElementName.equals("input") || parentElementName.equals("output") || parentElementName.equals("fault"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- protected boolean isMessageReference(String elementName)
- {
- return elementName.equals("body") || elementName.equals("header") || elementName.equals("fault") || elementName.equals("urlReplacement") || elementName.equals("urlEncoded"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
-
-
- public boolean isApplicableChildElement(Node parentNode, String namespace, String name)
- {
- boolean result = true;
-
- if (parentNode.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element) parentNode;
- String parentElementNamespaceURI = parentNode.getNamespaceURI();
- String parentElementName = parentNode.getLocalName();
- // only filter children for 'non-schema' elements
- //
- if (!WSDLConstants.XSD_NAMESPACE_URI.equals(parentElementNamespaceURI))
- {
- if (parentElementName != null && name != null)
- {
- if (namespace != null)
- {
- // the following namespace are one that always should be filtered out
- // for now this is hardcoded
- //
- if (namespace.equals("http://schemas.xmlsoap.org/soap/encoding/")) //$NON-NLS-1$
- {
- // exclude soap-enc elements
- //
- result = false;
- }
- else if (namespace.equals(WSDLConstants.XSD_NAMESPACE_URI))
- {
- // eclipse all schema elements, except for 'schema' withing wsdl types elements
- result = parentElementName.equals("types") && name.equals("schema"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (namespace.equals(WSDLConstants.WSDL_NAMESPACE_URI))
- {
- // cs : the 'required' attribute is burned into WSDL schema as the 'base' extensibility element
- // the WTP WSDL validator complains when these are present so this line filters them out
- // of the content assist and extension details view. As far as I can tell no one actually uses 'em
- // in practise ... so filtering them out should be ok.
- //
- // TODO (cs) how come the schema says their ok but the validator doesn't like them?
- //
- result = !name.equals("required"); //$NON-NLS-1$
- }
- else
- {
- // TODO.. we should investigate removing the ExtensiblityElementFilter extension point
- // shouldn't this be a ModelQueryExtension defined on the extension languages?
- //
- ExtensiblityElementFilter filter = (ExtensiblityElementFilter) WSDLEditorPlugin.getInstance().getExtensiblityElementFilterRegistry().getProperty(namespace, ""); //$NON-NLS-1$
- if (filter != null)
- {
- result = filter.isValidContext(element, name);
- }
- }
- }
- }
- }
- else
- {
- return super.isApplicableChildElement(parentNode, namespace, name);
- }
- }
- return result;
- }
-
- public String[] getAttributeValues(Element element, String namespace, String name)
- {
- if (WSDLConstants.WSDL_NAMESPACE_URI.equals(namespace))
- {
- List list = new ArrayList();
- ComponentReferenceUtil util = new ComponentReferenceUtil(lookupOrCreateDefinition(element.getOwnerDocument()));
- String currentElementName = element.getLocalName();
- if (checkName(name, "message")) //$NON-NLS-1$
- {
- list.addAll(util.getMessageNames());
- }
- else if (checkName(name, "binding")) //$NON-NLS-1$
- {
- list.addAll(util.getBindingNames());
- }
- else if (checkName(name, "type")) //$NON-NLS-1$
- {
- if (checkName(currentElementName, "binding")) //$NON-NLS-1$
- {
- list.addAll(util.getPortTypeNames());
- }
- else if (checkName(currentElementName, "part")) //$NON-NLS-1$
- {
- list.addAll(util.getComponentNameList(true));
- }
- }
- else if (checkName(name, "element")) //$NON-NLS-1$
- {
- if (checkName(currentElementName, "part")) //$NON-NLS-1$
- {
- list.addAll(util.getComponentNameList(false));
- }
- }
- String[] result = new String[list.size()];
- list.toArray(result);
- return result;
- }
- else
- {
- return super.getAttributeValues(element, namespace, name);
- }
- }
-
- /**
- * @deprecated
- */
- protected XSDSchema lookupOrCreateSchemaForElement(Element element)
- {
- return lookupOrCreateSchema(element);
- }
-
- private XSDSchema lookupOrCreateSchema(Element element)
- {
- XSDSchema schema = null;
- Definition definition = lookupOrCreateDefinition(element.getOwnerDocument());
- Object o = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, element);
- if (o instanceof XSDConcreteComponent)
- {
- schema = ((XSDConcreteComponent) o).getSchema();
- }
- return schema;
- }
-
- protected Definition lookupOrCreateDefinition(Document document)
- {
- Definition definition = null;
- if (document instanceof INodeNotifier)
- {
- INodeNotifier notifier = (INodeNotifier) document;
- WSDLModelAdapter adapter = (WSDLModelAdapter) notifier.getAdapterFor(WSDLModelAdapter.class);
- if (adapter == null)
- {
- adapter = new WSDLModelAdapter();
- notifier.addAdapter(adapter);
- adapter.createDefinition(document);
- }
- definition = adapter.getDefinition();
- }
- return definition;
- }
-
-
- protected TypesHelper getTypesHelper(final Element element)
- {
- XSDSchema schema = lookupOrCreateSchema(element);
- return new TypesHelper(schema)
- {
- // TODO... it seems as though the model is not correctly
- // mainting the list of prefixes for a given namespace
- // must be a bug!
- //
- protected List getPrefixesForNamespace(String namespace)
- {
- List list = super.getPrefixesForNamespace(namespace);
- Definition definition = lookupOrCreateDefinition(element.getOwnerDocument());
- if (definition != null)
- {
- Map map = definition.getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- String ns = (String) map.get(prefix);
- if (ns != null && ns.equals(namespace))
- {
- if (!list.contains(prefix))
- {
- list.add(prefix);
- }
- }
- }
- }
- return list;
- }
- };
- }
-
- /**
- * @deprecated
- */
- protected Definition lookupOrCreateDefinition(Element element)
- {
- return lookupOrCreateDefinition(element.getOwnerDocument());
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelReconcileAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelReconcileAdapter.java
deleted file mode 100644
index 772076818..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/text/WSDLModelReconcileAdapter.java
+++ /dev/null
@@ -1,154 +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.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.impl.XSDSchemaExtensibilityElementImpl;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-class WSDLModelReconcileAdapter extends ModelReconcileAdapter
-{
- protected Definition definition;
-
- public WSDLModelReconcileAdapter(Document document, Definition definition)
- {
- super(document);
- this.definition = definition;
- }
-
- // This method is clever enough to deal with 'bad' documents that happen
- // to have more than one root element. It picks of the first 'matching' element.
- //
- // TODO (cs) why aren't we calling this from the WSDLModelAdapter when the model is initialized?
- //
- private Element getDefinitionElement(Document document)
- {
- Element definitionElement = null;
- for (Node node = document.getFirstChild(); node != null; node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element)node;
- if (WSDLEditorUtil.getInstance().getWSDLType(element) == WSDLConstants.DEFINITION)
- {
- definitionElement = element;
- break;
- }
- }
- }
- return definitionElement;
- }
-
- protected void handleNodeChanged(Node node)
- {
- if (node instanceof Element)
- {
- reconcileModelObjectForElement((Element)node);
- }
- else if (node instanceof Document)
- {
- // The document changed so we may need to fix up the
- // definition's root element
- Document document = (Document)node;
- Element definitionElement = getDefinitionElement(document);
- if (definitionElement != null && definitionElement != definition.getElement())
- {
- // here we handle the case where a new 'definition' element was added
- //(e.g. the file was totally blank and then we type in the root element)
- // See Bug 5366
- //
- if (definitionElement.getLocalName().equals(WSDLConstants.DEFINITION_ELEMENT_TAG))
- {
- //System.out.println("****** Setting new definition");
- definition.setElement(definitionElement);
- }
- }
- else if (definitionElement != null)
- {
- // handle the case where the definition element's content has changed
- //
- ((DefinitionImpl)definition).elementChanged(definitionElement);
- }
- else if (definitionElement == null)
- {
- // if there's no definition element clear out the WSDL
- //
- ((DefinitionImpl)definition).removeAll();
-
- // The removeAll() call does not remove namespaces as well and the model
- // does not reconcile well in this case. Also reset the definition name and target
- // namespace.
-
- definition.getNamespaces().clear();
- definition.setQName(null);
- definition.setTargetNamespace(null);
-
- // Reset the document because removeAll() sets the document to null as well.
- definition.setDocument(document);
- }
- }
- }
-
- private void reconcileModelObjectForElement(Element element)
- {
- Object modelObject = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, element);
- if (modelObject != null)
- {
- if (modelObject instanceof XSDSchemaExtensibilityElementImpl)
- {
- XSDSchemaExtensibilityElementImpl ee = (XSDSchemaExtensibilityElementImpl)modelObject;
- ((XSDSchemaImpl)ee.getSchema()).elementChanged(element);
- ee.elementChanged(element);
- }
- else if (modelObject instanceof WSDLElementImpl)
- {
- ((WSDLElementImpl)modelObject).elementChanged(element);
- }
- else if (modelObject instanceof XSDConcreteComponent)
- {
- ((XSDConcreteComponent)modelObject).elementChanged(element);
- }
- }
- }
-
- /**
- * @deprecated
- */
- protected void reconcileModelObjectForElement(Element element, int eventType, Object feature, Object oldValue, Object newValue, int index)
- {
- reconcileModelObjectForElement(element);
- }
-
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty)
- {
- if (!isDirty)
- {
- // cs : At this time (when a save occurs) it's a good opportunity
- // to update the model to ensure it's in sync with the source.
- // That way if the incremental sync between DOM and model has gotten
- // the model out of whack we'll be able to put things right at this point.
- //
- // TODO (cs) need to do more to ensure model is sync'd up properly
- ((DefinitionImpl)definition).reconcileReferences(true);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ComponentReferenceUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ComponentReferenceUtil.java
deleted file mode 100644
index 10f30ec17..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ComponentReferenceUtil.java
+++ /dev/null
@@ -1,959 +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.util;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.ui.internal.extensions.ITypeSystemProvider;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class ComponentReferenceUtil
-{
- protected Definition rootDefinition;
-
- public ComponentReferenceUtil(Definition rootDefinition)
- {
- this.rootDefinition = rootDefinition;
- }
-
- protected static boolean isEqual(String a, String b)
- {
- boolean result = false;
- if (a != null)
- {
- result = a.equals(b) || (a.length() == 0 && b == null);
- }
- else
- {
- result = (b == null || b.length() == 0);
- }
- return result;
- }
-
- protected static boolean isEqualInputName(Operation operation, BindingOperation bindingOperation)
- {
- boolean result = false;
- Input operationInput = operation.getEInput();
- BindingInput bindingOperationInput = bindingOperation.getEBindingInput();
-
- if (operationInput != null && bindingOperationInput != null)
- {
- result = isEqual(operationInput.getName(), bindingOperationInput.getName());
- }
- else if (operationInput == null && bindingOperationInput == null)
- {
- result = true;
- }
- return result;
- }
-
- protected static boolean isEqualOutputName(Operation operation, BindingOperation bindingOperation)
- {
- boolean result = false;
- Output operationOutput = operation.getEOutput();
- BindingOutput bindingOperationOutput = bindingOperation.getEBindingOutput();
-
- if (operationOutput != null && bindingOperationOutput != null)
- {
- result = isEqual(operationOutput.getName(), bindingOperationOutput.getName());
- }
- else if (operationOutput == null && bindingOperationOutput == null)
- {
- result = true;
- }
- return result;
- }
-
- protected static boolean isMatchingBinding(Operation operation, BindingOperation bindingOperation)
- {
- return isEqual(operation.getName(), bindingOperation.getName()); /* &&
- isEqualInputName(operation, bindingOperation) &&
- isEqualOutputName(operation, bindingOperation);*/
- }
-
- public List getPortsForPortType(PortType portType)
- {
- List list = new ArrayList();
- for (Iterator i = getServices().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- for (Iterator j = service.getEPorts().iterator(); j.hasNext();)
- {
- Port port = (Port) j.next();
- Binding binding = port.getEBinding();
- if (binding != null && binding.getEPortType() == portType)
- {
- list.add(port);
- }
- }
- }
- return list;
- }
-
- public List getPortsForBinding(Binding binding)
- {
- List list = new ArrayList();
- for (Iterator i = getServices().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- for (Iterator j = service.getEPorts().iterator(); j.hasNext();)
- {
- Port port = (Port) j.next();
- if (port.getEBinding() == binding)
- {
- list.add(port);
- }
- }
- }
- return list;
- }
-
- public List getBindingOperations(Operation operation)
- {
- List list = new ArrayList();
- String operationName = operation.getName();
-
- if (operationName != null)
- {
- PortType portType = getEnclosingPortType(operation);
- for (Iterator i = getBindings(portType).iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- BindingOperation bindingOperation = getBindingOperation(operation, binding);
- if (bindingOperation != null)
- {
- list.add(bindingOperation);
- }
- }
- }
- return list;
- }
-
- public BindingOperation getBindingOperation(Operation operation, Binding binding)
- {
- BindingOperation result = null;
- for (Iterator j = binding.getBindingOperations().iterator(); j.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) j.next();
- if (isMatchingBinding(operation, bindingOperation))
- {
- result = bindingOperation;
- break;
- }
- }
- return result;
- }
-
- public BindingInput getBindingInput(Input input, Binding binding)
- {
- BindingOperation bindingOperation = getBindingOperation((Operation) input.eContainer(), binding);
- return bindingOperation != null ? bindingOperation.getEBindingInput() : null;
- }
-
- public BindingOutput getBindingOutput(Output output, Binding binding)
- {
- BindingOperation bindingOperation = getBindingOperation((Operation) output.eContainer(), binding);
- return bindingOperation != null ? bindingOperation.getEBindingOutput() : null;
- }
-
- public BindingFault getBindingFault(Fault fault, Binding binding)
- {
- BindingFault result = null;
- String faultName = fault.getName();
- if (faultName != null)
- {
- BindingOperation bindingOperation = getBindingOperation((Operation) fault.eContainer(), binding);
- if (bindingOperation != null)
- {
- result = (BindingFault) bindingOperation.getBindingFault(faultName);
- }
- }
- return result;
- }
-
- public EObject getBindingObject(EObject interfaceObject, Binding binding)
- {
- EObject result = null;
- if (interfaceObject instanceof Input)
- {
- result = getBindingInput((Input) interfaceObject, binding);
- }
- else if (interfaceObject instanceof Output)
- {
- result = getBindingOutput((Output) interfaceObject, binding);
- }
- else if (interfaceObject instanceof Fault)
- {
- result = getBindingFault((Fault) interfaceObject, binding);
- }
- else if (interfaceObject instanceof Operation)
- {
- result = getBindingOperation((Operation) interfaceObject, binding);
- }
- else if (interfaceObject instanceof PortType)
- {
- result = binding;
- }
- return result;
- }
-
- public List getBindingInputs(Input input)
- {
- List list = new ArrayList();
- List operations = getBindingOperations((Operation) input.eContainer());
- for (Iterator i = operations.iterator(); i.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) i.next();
- if (bindingOperation.getBindingInput() != null)
- {
- list.add(bindingOperation.getBindingInput());
- }
- }
- return list;
- }
-
- public List getBindingOutputs(Output output)
- {
- List list = new ArrayList();
- Operation operation = (Operation) output.eContainer();
- if (operation != null)
- {
- List operations = getBindingOperations(operation);
- for (Iterator i = operations.iterator(); i.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) i.next();
- if (bindingOperation.getBindingOutput() != null)
- {
- list.add(bindingOperation.getBindingOutput());
- }
- }
- }
- return list;
- }
-
- public List getBindingFaults(Fault fault)
- {
- List list = new ArrayList();
- String faultName = fault.getName();
- if (faultName != null)
- {
- Operation operation = (Operation) fault.eContainer();
- if (operation != null)
- {
- List operations = getBindingOperations(operation);
- for (Iterator i = operations.iterator(); i.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) i.next();
- BindingFault bindingFault = (BindingFault) bindingOperation.getBindingFault(faultName);
- if (bindingFault != null)
- {
- list.add(bindingFault);
- }
- }
- }
- }
- return list;
- }
-
- protected PortType getEnclosingPortType(Operation operation)
- {
- return (PortType) operation.eContainer();
- }
-
- public List getBindings(Operation operation)
- {
- return getBindings(getEnclosingPortType(operation));
- }
-
- public List getBindings(PortType portType)
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- for (Iterator j = definition.getBindings().values().iterator(); j.hasNext();)
- {
- Binding binding = (Binding) j.next();
- if (portType == null || binding.getPortType() == portType)
- {
- list.add(binding);
- }
- }
- }
- return list;
- }
-
- public List getBindingsWithoutOperation(PortType portType, String operationName)
- {
- List result = new ArrayList();
- if (operationName != null)
- {
- List bindings = getBindings(portType);
- for (Iterator i = bindings.iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- boolean hasName = false;
- for (Iterator j = binding.getBindingOperations().iterator(); j.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) j.next();
- if (operationName.equals(bindingOperation.getName()))
- {
- hasName = true;
- break;
- }
- }
- if (!hasName)
- {
- result.add(binding);
- }
- }
- }
- return result;
- }
-
- public List getBindings()
- {
- return getBindings((PortType) null);
- }
-
- public List getBindingNames()
- {
- List list = new ArrayList();
- for (Iterator i = getBindings().iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- list.addAll(getPrefixedNames(binding.getQName()));
- }
- return list;
- }
-
- public List getPortTypeNames()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- for (Iterator j = definition.getPortTypes().values().iterator(); j.hasNext();)
- {
- PortType portType = (PortType) j.next();
- list.addAll(getPrefixedNames(portType.getQName()));
- }
- }
- return list;
- }
-
- public List getServices()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- list.addAll(definition.getEServices());
- }
- return list;
- }
-
- public List getPortTypes()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- list.addAll(definition.getEPortTypes());
- }
- return list;
- }
-
- public List getMessages()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- list.addAll(definition.getEMessages());
- }
- return list;
- }
-
- public List getTypes()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- if (definition.getETypes() != null)
- {
- list.add(definition.getETypes());
- }
- }
- return list;
- }
-
- public List getMessageNames()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- for (Iterator j = definition.getMessages().values().iterator(); j.hasNext();)
- {
- Message message = (Message) j.next();
- list.addAll(getPrefixedNames(message.getQName()));
- }
- }
- return list;
- }
-
- public List getDefinitions()
- {
- List list = new ArrayList();
- addDefinition(rootDefinition, list);
- return list;
- }
-
- /**
- * @deprecated -- we should always use getPrefixedNames
- */
- public String getPrefixedName(QName qname)
- {
- String name = null;
- if (qname != null)
- {
- String prefix = rootDefinition.getPrefix(qname.getNamespaceURI());
- if (prefix != null)
- {
- name = prefix + ":" + qname.getLocalPart(); //$NON-NLS-1$
- }
- }
- return name;
- }
-
- public List getPrefixedNames(QName qname)
- {
- List list = new ArrayList();
- if (qname != null)
- {
- Map map = rootDefinition.getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- String namespace = (String) map.get(prefix);
- if (namespace != null && namespace.equals(qname.getNamespaceURI()))
- {
- String name = prefix.length() > 0 ? prefix + ":" + qname.getLocalPart() : //$NON-NLS-1$
- qname.getLocalPart();
- list.add(name);
- }
- }
- }
- return list;
- }
-
- protected void addDefinition(Definition definition, List list)
- {
- if (definition != null)
- {
- list.add(definition);
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- ImportImpl theImport = (ImportImpl) i.next();
- if (theImport.getLocationURI() != null && !theImport.getLocationURI().endsWith("xsd")) //$NON-NLS-1$
- {
- theImport.importDefinitionOrSchema();
- Definition importedDefinition = (Definition) theImport.getEDefinition();
- if (importedDefinition != null && !list.contains(importedDefinition))
- {
- addDefinition(importedDefinition, list);
- }
- }
- }
- }
- }
-
- public static String getPortTypeReference(Binding binding)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- if (element != null)
- {
- result = element.getAttribute("type"); //$NON-NLS-1$
- }
- return result;
- }
-
- public static void setPortTypeReference(Binding binding, String portType)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- if (element != null)
- {
- element.setAttribute("type", portType); //$NON-NLS-1$
- }
- }
-
- public static String getBindingReference(Port port)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(port);
- if (element != null)
- {
- result = element.getAttribute("binding"); //$NON-NLS-1$
- }
- return result;
- }
-
- public static String getName(Binding binding)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- if (element != null)
- {
- result = element.getAttribute("name"); //$NON-NLS-1$
- }
- return result;
- }
-
- public static QName getPortTypeReferenceQName(Binding binding)
- {
- QName result = null;
- Definition definition = binding.getEnclosingDefinition();
- String prefixedName = getPortTypeReference(binding);
- if (prefixedName != null)
- {
- result = WSDLEditorUtil.createQName(definition, prefixedName);
- }
- return result;
- }
-
- public static QName getBindingReferenceQName(Port port)
- {
- QName result = null;
- Definition definition = port.getEnclosingDefinition();
- String prefixedName = getBindingReference(port);
- if (prefixedName != null)
- {
- result = WSDLEditorUtil.createQName(definition, prefixedName);
- }
- return result;
- }
-
- public static String getMessageReference(Input input)
- {
- return getMessageReferenceHelper(input);
- }
-
- public static String getMessageReference(Output output)
- {
- return getMessageReferenceHelper(output);
- }
-
- public static String getMessageReference(Fault fault)
- {
- return getMessageReferenceHelper(fault);
- }
-
- public static QName getMessageReferenceQName(Input input)
- {
- return getMessageReferenceQNameHelper(input);
- }
-
- public static QName getMessageReferenceQName(Output output)
- {
- return getMessageReferenceQNameHelper(output);
- }
-
- public static QName getMessageReferenceQName(Fault fault)
- {
- return getMessageReferenceQNameHelper(fault);
- }
-
- protected static String getMessageReferenceHelper(WSDLElement o)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(o);
- if (element != null)
- {
- result = element.getAttribute("message"); //$NON-NLS-1$
- }
- return result;
- }
-
- public static QName getMessageReferenceQNameHelper(WSDLElement o)
- {
- QName result = null;
- Definition definition = o.getEnclosingDefinition();
- String prefixedName = getMessageReferenceHelper(o);
- if (prefixedName != null)
- {
- result = WSDLEditorUtil.createQName(definition, prefixedName);
- }
- return result;
- }
-
- public static void updatePortTypeReferences(Definition definition)
- {
- for (Iterator i = definition.getBindings().values().iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- QName qname = ComponentReferenceUtil.getPortTypeReferenceQName(binding);
-
- PortType portType = (qname != null) ? (PortType) definition.getPortType(qname) : null;
-
- if (binding.getPortType() != portType)
- {
- binding.setPortType(portType);
- }
- }
- }
-
- public static void updateBindingReferences(Definition definition)
- {
- for (Iterator i = definition.getServices().values().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- for (Iterator j = service.getEPorts().iterator(); j.hasNext();)
- {
- Port port = (Port) j.next();
- QName qname = ComponentReferenceUtil.getBindingReferenceQName(port);
-
- Binding binding = (qname != null) ? (Binding) definition.getBinding(qname) : null;
-
- if (port.getBinding() != binding)
- {
- port.setBinding(binding);
- }
- }
- }
- }
-
- public static void updateMessageReferences(Definition definition)
- {
- // for each port type
- //
- for (Iterator i = definition.getPortTypes().values().iterator(); i.hasNext();)
- {
- PortType portType = (PortType) i.next();
-
- // for each operation
- //
- for (Iterator j = portType.getEOperations().iterator(); j.hasNext();)
- {
- Operation operation = (Operation) j.next();
-
- // handle Input
- //
- Input input = (Input) operation.getInput();
- if (input != null)
- {
- QName qname = ComponentReferenceUtil.getMessageReferenceQName(input);
- Message message = (qname != null) ? (Message) definition.getMessage(qname) : null;
- if (input.getMessage() != message)
- {
- input.setMessage(message);
- }
- }
-
- // handle Output
- //
- Output output = (Output) operation.getOutput();
- if (output != null)
- {
- QName qname = ComponentReferenceUtil.getMessageReferenceQName(output);
- Message message = (qname != null) ? (Message) definition.getMessage(qname) : null;
- if (output.getMessage() != message)
- {
- output.setMessage(message);
- }
- }
-
- // handle Faults
- //
- for (Iterator k = operation.getEFaults().iterator(); k.hasNext();)
- {
- Fault fault = (Fault) k.next();
-
- QName qname = ComponentReferenceUtil.getMessageReferenceQName(fault);
- Message message = (qname != null) ? (Message) definition.getMessage(qname) : null;
- if (fault.getMessage() != message)
- {
- fault.setMessage(message);
- }
- }
- }
- }
- }
-
- public static void updateSchemaReferences(Definition definition)
- {
- for (Iterator i = definition.getEMessages().iterator(); i.hasNext();)
- {
- Message message = (Message) i.next();
- for (Iterator j = message.getEParts().iterator(); j.hasNext();)
- {
- Part part = (Part) j.next();
- Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- if (element != null)
- {
- ((WSDLElementImpl)part).elementChanged(element);
- }
- }
- }
- }
-
- public static Operation getOperation(PortType portType, BindingOperation bindingOperation)
- {
- Operation result = null;
- for (Iterator i = portType.getEOperations().iterator(); i.hasNext();)
- {
- Operation operation = (Operation) i.next();
- if (isMatchingBinding(operation, bindingOperation))
- {
- result = operation;
- break;
- }
- }
- return result;
- }
-
- public static void updateOperationReference(BindingOperation bindingOperation)
- {
- Operation operation = computeOperation(bindingOperation);
- if (operation != bindingOperation.getOperation())
- {
- bindingOperation.setOperation(operation);
- }
- }
-
- public List getComponentNameList(boolean isType)
- {
- List result = Collections.EMPTY_LIST;
- ITypeSystemProvider typeSystemProvider = WSDLEditorUtil.getInstance().getTypeSystemProvider(rootDefinition);
- if (typeSystemProvider != null)
- {
- result = isType ? typeSystemProvider.getAvailableTypeNames(rootDefinition, 0) : typeSystemProvider.getAvailableElementNames(rootDefinition);
- }
- return result;
- }
-
- public static List getComponentNameList(Part part, boolean isType)
- {
- List result = Collections.EMPTY_LIST;
- Definition definition = part.getEnclosingDefinition();
- ITypeSystemProvider typeSystemProvider = WSDLEditorUtil.getInstance().getTypeSystemProvider(definition);
- if (typeSystemProvider != null)
- {
- result = isType ? typeSystemProvider.getAvailableTypeNames(definition, 0) : typeSystemProvider.getAvailableElementNames(definition);
- }
- return result;
- }
-
- public static boolean isType(Part part)
- {
- //Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- Element element = part.getElement();
- return !element.hasAttribute("element"); //$NON-NLS-1$
- }
-
- public static String getPartComponentReference(Part part)
- {
- //Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- Element element = part.getElement();
- String result = null;
- if (element.hasAttribute("type")) //$NON-NLS-1$
- {
- result = element.getAttribute("type"); //$NON-NLS-1$
- }
- else if (element.hasAttribute("element")) //$NON-NLS-1$
- {
- result = element.getAttribute("element"); //$NON-NLS-1$
- }
- return result;
- }
-
- public static void setComponentReference(Part part, boolean isType, String componentName)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- String newAttribute = isType ? "type" : "element"; //$NON-NLS-1$ //$NON-NLS-2$
- String oldAttribute = isType ? "element" : "type"; //$NON-NLS-1$ //$NON-NLS-2$
- element.removeAttribute(oldAttribute);
-
- String value = componentName != null ? componentName : element.getAttribute(newAttribute);
-
- if (value == null)
- {
- if (isType)
- {
- String xsdPrefix = part.getEnclosingDefinition().getPrefix(WSDLConstants.XSD_NAMESPACE_URI);
- value = "string"; //$NON-NLS-1$
- if (xsdPrefix != null && xsdPrefix.length() > 0)
- {
- value = xsdPrefix + ":" + value; //$NON-NLS-1$
- }
- }
- else
- {
- List list = getComponentNameList(part, isType);
- value = list.size() > 0 ? (String) list.get(0) : "some-element-name"; //$NON-NLS-1$
- }
- }
- element.setAttribute(newAttribute, value);
- }
-
- public static Operation computeOperation(BindingOperation bindingOperation)
- {
- Operation result = null;
- Binding binding = (Binding) bindingOperation.eContainer();
- PortType portType = (PortType) binding.getPortType();
- if (portType != null)
- {
- result = getOperation(portType, bindingOperation);
- }
- return result;
- }
-
- public static Input computeInput(BindingInput bindingInput)
- {
- Operation operation = computeOperation((BindingOperation) bindingInput.eContainer());
- return operation != null ? operation.getEInput() : null;
- }
-
- public static Output computeOutput(BindingOutput bindingOutput)
- {
- Operation operation = computeOperation((BindingOperation) bindingOutput.eContainer());
- return operation != null ? operation.getEOutput() : null;
- }
-
- public static Fault computeFault(BindingFault bindingFault)
- {
- Fault result = null;
- Operation operation = computeOperation((BindingOperation) bindingFault.eContainer());
- if (operation != null)
- {
- for (Iterator i = operation.getEFaults().iterator(); i.hasNext();)
- {
- Fault fault = (Fault) i.next();
- String faultName = fault.getName();
- if (faultName != null && faultName.equals(bindingFault.getName()))
- {
- result = fault;
- break;
- }
- }
- }
- return result;
- }
-
- public static String getPartReferenceValue(Part part)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- String value = null;
- if (element != null)
- {
- if (element.hasAttribute("type")) //$NON-NLS-1$
- {
- value = element.getAttribute("type"); //$NON-NLS-1$
- }
- else if (element.hasAttribute("element")) //$NON-NLS-1$
- {
- value = element.getAttribute("element"); //$NON-NLS-1$
- }
- }
- return value != null ? value : ""; //$NON-NLS-1$
- }
-
- public Operation getBindingOperation(Element bindingOperationContent)
- {
- Operation operation = null;
- Node parent = bindingOperationContent.getParentNode();
- if (parent instanceof Element)
- {
- Object object = WSDLEditorUtil.getInstance().findModelObjectForElement(rootDefinition, (Element) parent);
- if (object instanceof BindingOperation)
- {
- operation = ComponentReferenceUtil.computeOperation((BindingOperation) object);
- }
- }
- return operation;
- }
-
- public Message getBindingOperationInputMessage(Element bindingOperationContent)
- {
- Message message = null;
- Operation operation = getBindingOperation(bindingOperationContent);
- if (operation != null)
- {
- Input input = operation.getEInput();
- if (input != null)
- {
- message = input.getEMessage();
- }
- }
- return message;
- }
-
- public Message getBindingOperationOutputMessage(Element bindingOperationContent)
- {
- Message message = null;
- Operation operation = getBindingOperation(bindingOperationContent);
- if (operation != null)
- {
- Output output = operation.getEOutput();
- if (output != null)
- {
- message = output.getEMessage();
- }
- }
- return message;
- }
-
- public static String computeRelativeURI(IFile referencedLocation, IFile baseLocation, boolean enableIEStyleReferences)
- {
- // TODO... we need some extension to allow IE folks to plugin logic to create an 'IE' style path
- // TODO... consider using URI class in EMF
- return URIHelper.getRelativeURI(referencedLocation.getLocation(), baseLocation.getLocation());
- }
-
- public static String computeRelativeURI(String referencedLocation, String baseLocation, boolean enableIEStyleReferences)
- {
- // TODO... we need some extension to allow IE folks to plugin logic to create an 'IE' style path
- // TODO... consider using URI class in EMF
- return URIHelper.getRelativeURI(referencedLocation, baseLocation);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/CreateWSDLElementHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/CreateWSDLElementHelper.java
deleted file mode 100644
index 860864c66..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/CreateWSDLElementHelper.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.util;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.OperationType;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.internal.generator.ContentGenerator;
-import org.eclipse.wst.wsdl.internal.impl.MessageReferenceImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBindingCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddFaultCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddInputCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddInputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOperationCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOutputCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOutputParameterCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPartCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPortCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPortTypeCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddServiceCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDElementDeclarationCommand;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class CreateWSDLElementHelper {
- // Constants used for getting Part information
- public static final String PART_INFO_ELEMENT_DECLARATION = "ELEMENT_DECLARATION"; //$NON-NLS-1$
- public static final String PART_INFO_TYPE_DEFINITION = "TYPE_DEFINITION"; //$NON-NLS-1$
-
- // The following variables should be set if a name other than the computed name is to be used.
- public static String serviceName = null;
- public static String portName = null;
- public static String bindingName = null;
- public static String portTypeName = null;
- public static String operationName = null;
- public static String inputName = null;
- public static String outputName = null;
- public static String faultName = null;
- public static String messageName = null;
- public static String partName = null;
-
- public static String PART_TYPE_OR_DEFINITION = PART_INFO_TYPE_DEFINITION;
- public static boolean CREATE_DOWN_TO_PART = true;
-
- /**
- * Adds additional namespaces required by contentGenerator to definition.
- * Also reloads the content model associated with definition if needed
- * after adding new namespaces.
- *
- * @param contentGenerator
- * @param definition
- */
- public static void addRequiredNamespaces(ContentGenerator contentGenerator, Definition definition) {
- if (contentGenerator != null && definition != null) {
- // flag indicating if content model needs to be reloaded
- boolean reloadContentModel = false;
-
- String[] namespaceNames = contentGenerator.getRequiredNamespaces();
- String[] preferredPrefixes = new String[namespaceNames.length];
- for (int index = 0; index < namespaceNames.length; index++) {
- preferredPrefixes[index] = contentGenerator.getPreferredNamespacePrefix(namespaceNames[index]);
- }
-
- Map map = definition.getNamespaces();
-
- for (int i = 0; i < namespaceNames.length; i++) {
- String namespace = namespaceNames[i];
- if (!map.containsValue(namespace)) {
- String prefix = (i < preferredPrefixes.length) ? preferredPrefixes[i] : "p0"; //$NON-NLS-1$
- if (map.containsKey(prefix)) {
- prefix = computeUniquePrefix("p", map); //$NON-NLS-1$
- }
- definition.addNamespace(prefix, namespace);
-
- // a namespace was added so update reloadContentModel flag
- reloadContentModel = true;
- }
- }
-
- if (reloadContentModel) {
- reloadContentModel(definition);
- }
- }
- }
-
- /**
- * Reloads content model associated with the given definition
- *
- * @param definition
- */
- private static void reloadContentModel(Definition definition) {
- Document document = definition.getDocument();
- if (document != null) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery != null) {
- CMDocumentManager manager = modelQuery.getCMDocumentManager();
- if (manager != null) {
- // check if currently async loading
- boolean oldValue = manager.getPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD);
- // do not async to get immediate document loading
- if (oldValue)
- manager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, false);
-
- // load content model again
- CMDocumentLoader loader = new CMDocumentLoader(document, modelQuery);
- loader.loadCMDocuments();
-
- // reset back to old value just in case
- if (oldValue)
- manager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, oldValue);
- }
- }
- }
- }
-
- /**
- * Computes a unique prefix given the list of existing prefixes in table
- * and starting with a base prefix of base
- *
- * @param base
- * @param table
- * @return
- */
- private static String computeUniquePrefix(String base, Map table) {
- int i = 0;
- String prefix = base;
- while (true) {
- if (!table.containsKey(prefix)) {
- break;
- }
- else {
- prefix = base + i;
- i++;
- }
- }
- return prefix;
- }
-
-/*
- * The following methods creates the 'specified' (by calling a certain method) WSDLElement
- * and it's 'children' all the way to the PortType level.
- */
- public static Service createService(Definition definition) {
- if (serviceName == null || serviceName.trim().equals("")) //$NON-NLS-1$
- serviceName = NameUtil.buildUniqueServiceName(definition);
-
- CreateWSDLElementHelper.portTypeName = serviceName;
-
- AddServiceCommand addService = new AddServiceCommand(definition, serviceName, false);
- addService.run();
- Service service = (Service) addService.getWSDLElement();
- CreateWSDLElementHelper.createPort(service);
-
- return service;
- }
-
- public static Port createPort(Service service) {
- if (portName == null || portName.trim().equals("")) //$NON-NLS-1$
- portName = NameUtil.buildUniquePortName(service, null);
-
- AddPortCommand addPort = new AddPortCommand(service, portName);
- addPort.run();
- Port port = (Port) addPort.getWSDLElement();
- Binding binding = CreateWSDLElementHelper.createBinding(port.getEnclosingDefinition(), port);
-
- port.setBinding(binding);
-
- return port;
- }
-
- public static Binding createBinding(Definition definition, Port port) {
- bindingName = port.getName();
- if (bindingName == null || bindingName.trim().equals("")) //$NON-NLS-1$
- bindingName = NameUtil.buildUniqueBindingName(definition, null);
-
- AddBindingCommand addBinding = new AddBindingCommand(definition, bindingName);
- addBinding.run();
- Binding binding = (Binding) addBinding.getWSDLElement();
- PortType portType = CreateWSDLElementHelper.createPortType(binding.getEnclosingDefinition());
-
- binding.setPortType(portType);
-
- return binding;
- }
-
- public static PortType createPortType(Definition definition) {
- if (portTypeName == null || portTypeName.trim().equals("")) //$NON-NLS-1$
- portTypeName = NameUtil.buildUniquePortTypeName(definition, "PortType"); //$NON-NLS-1$
-
- AddPortTypeCommand addPortTypeCommand = new AddPortTypeCommand(definition, portTypeName);
- addPortTypeCommand.run();
- PortType portType = (PortType) addPortTypeCommand.getWSDLElement();
-
- if (CREATE_DOWN_TO_PART) {
- CreateWSDLElementHelper.createOperation(portType);
- }
-
- return portType;
- }
-
-
-/*
- * The following methods creates the 'specified' (by calling a certain method) WSDLElement
- * and it's 'children' all the way to the Part level.
- */
- public static Operation createOperation(PortType portType) {
- if (operationName == null || operationName.trim().equals("")) //$NON-NLS-1$
- operationName = NameUtil.buildUniqueOperationName(portType);
-
- AddOperationCommand action = new AddOperationCommand(portType, operationName);
- action.run();
- Operation operation = (Operation) action.getWSDLElement();
-
- int style = AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT;
- if (PART_TYPE_OR_DEFINITION == PART_INFO_TYPE_DEFINITION) {
- style = AddBaseParameterCommand.PART_SIMPLETYPE;
- }
- else if (PART_TYPE_OR_DEFINITION == PART_INFO_ELEMENT_DECLARATION) {
- style = AddBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT;
-// style = AddBaseParameterCommand.PART_ELEMENT;
- }
-
- AddInputParameterCommand inputCommand = new AddInputParameterCommand(operation, style);
- inputCommand.run();
- AddOutputParameterCommand outputCommand = new AddOutputParameterCommand(operation, style);
- outputCommand.run();
- operation.setStyle(OperationType.REQUEST_RESPONSE);
-
- return operation;
- }
-
- public static Input createInput(PortType portType, Operation operation, String inputName) {
- if (inputName == null || inputName.trim().equals("")) //$NON-NLS-1$
- inputName = NameUtil.buildUniqueInputName(portType, operation.getName(), ""); //$NON-NLS-1$
-
- AddInputCommand action = new AddInputCommand(operation, inputName);
- action.run();
- Input input = (Input) action.getWSDLElement();
- Message mess = CreateWSDLElementHelper.createMessage(input);
- input.setMessage(mess);
-
- return input;
- }
-
- public static Output createOutput(PortType portType, Operation operation) {
- if (outputName == null || outputName.trim().equals("")) //$NON-NLS-1$
- outputName = NameUtil.buildUniqueOutputName(portType, operation.getName(), ""); //$NON-NLS-1$
-
- AddOutputCommand action = new AddOutputCommand(operation, outputName);
- action.run();
- Output output = (Output) action.getWSDLElement();
- Message mess = CreateWSDLElementHelper.createMessage(output);
- output.setMessage(mess);
-
- return output;
- }
-
- public static Fault createFault(Operation operation) {
- if (faultName == null || faultName.trim().equals("")) //$NON-NLS-1$
- faultName = NameUtil.buildUniqueFaultName(operation);
-
- AddFaultCommand action = new AddFaultCommand(operation, faultName);
- action.run();
- Fault fault = (Fault) action.getWSDLElement();
- Message mess = CreateWSDLElementHelper.createMessage(fault);
- fault.setMessage(mess);
-
- return fault;
- }
-
- public static Message createMessage(MessageReference iof) {
- if (messageName == null || messageName.trim().equals("")) //$NON-NLS-1$
- messageName = NameUtil.buildUniqueMessageName(iof.getEnclosingDefinition(), iof);
-// messageName = NameUtil.buildMessageName(iof.getName());
-
- Definition def = iof.getEnclosingDefinition();
- AddMessageCommand action = new AddMessageCommand(def, messageName);
- action.run();
- Message message = (Message) action.getWSDLElement();
- CreateWSDLElementHelper.createPart(message);
- Element parentNode = message.getElement();
- if (parentNode instanceof IDOMNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((IDOMNode)parentNode);
- }
-
- messageName = null;
- return message;
- }
-
- public static Part createPart(Message message) {
- Definition def = message.getEnclosingDefinition();
- String name = NameUtil.buildUniquePartName(message, message.getQName().getLocalPart());
- AddPartCommand action = null;
-
- if (PART_TYPE_OR_DEFINITION == PART_INFO_TYPE_DEFINITION) {
- action = new AddPartCommand(message, name, WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string", true); //$NON-NLS-1$
- }
- else if (PART_TYPE_OR_DEFINITION == PART_INFO_ELEMENT_DECLARATION) {
- //action = new AddPartCommand(message, name, WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string", true);
- String elementName = getNewNameHelper(name, def, false);
- AddXSDElementDeclarationCommand elementAction = new AddXSDElementDeclarationCommand(def, elementName);
- elementAction.run();
- action = new AddPartCommand(message, name, def.getTargetNamespace(), elementName, false);
- }
-
- action.run();
-
- return (Part) action.getWSDLElement();
- }
-
- /*
- * Used to determine a name for an Element
- */
- private static String getNewNameHelper(String base, Definition def, boolean isType)
- {
- String name = base;
- int count = 0;
-
- // Ugly.... Redo this...
- // Get a list of Elements...
- List elementList = null;
- if (def.getETypes() != null) {
- List xsdsList = def.getETypes().getEExtensibilityElements();
- if (xsdsList != null) {
- Iterator xsdsIterator = xsdsList.iterator();
- XSDSchemaExtensibilityElement xsdElement = (XSDSchemaExtensibilityElement) xsdsIterator.next();
- XSDSchema schema = xsdElement.getSchema();
- if (schema != null) {
- elementList = schema.getElementDeclarations();
- }
- }
- }
-
- if (elementList != null) {
- int index = 0;
- while (index < elementList.size()) {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) elementList.get(index);
-
- if (name.equals(elementDeclaration.getName())) {
- count++;
- name = name + count;
- index = 0;
- }
- else {
- index++;
- }
- }
- }
-
- return name;
- }
-
- /*
- * Return the type of Part this WSDLElement should have (Element vs Type). To determine this, we filter up to the 'parent' PortType
- * and go down to the first Part we encounter and check the type it has. If this fails, default to Type.
- */
- public static String getPartInfo(WSDLElement element) {
- String partInfo = null;
-
- if (element instanceof PortType) {
- partInfo = getPartInfo((PortType) element);
- }
- else if (element instanceof Operation) {
- partInfo = getPartInfo(((WSDLElementImpl) element).getContainer());
- }
- else if (element instanceof MessageReferenceImpl) {
- partInfo = getPartInfo(((WSDLElementImpl) element).getContainer());
- }
-
- if (partInfo == null) {
- partInfo = CreateWSDLElementHelper.PART_INFO_TYPE_DEFINITION;
- }
-
- return partInfo;
- }
-
- private static String getPartInfo(PortType portType) {
- String partInfo = null;
-
- if (portType.getOperations() != null) {
- Iterator operationIt = portType.getOperations().iterator();
- while (operationIt.hasNext()) {
- Operation op = (Operation) operationIt.next();
-
- if (op.getEInput() != null) {
- partInfo = getMessageRefPartInfo((MessageReferenceImpl) op.getEInput());
- }
-
- if (partInfo == null && op.getEOutput() != null) {
- partInfo = getMessageRefPartInfo((MessageReferenceImpl) op.getEOutput());
- }
-
- if (op.getEFaults() != null) {
- Iterator faultIt = op.getEFaults().iterator();
- while (partInfo == null && faultIt.hasNext()) {
- Fault fault = (Fault) faultIt.next();
- partInfo = getMessageRefPartInfo((MessageReferenceImpl) fault);
- }
- }
-
- if (partInfo != null)
- break;
- }
- }
-
- return partInfo;
- }
-
- private static String getMessageRefPartInfo(MessageReferenceImpl iof) {
- String partInfo = null;
-
- if (iof.getEMessage() != null && iof.getEMessage().getEParts() != null) {
- Iterator partIt = iof.getEMessage().getEParts().iterator();
-
- while (partInfo == null && partIt.hasNext()) {
- Part part = (Part) partIt.next();
-
- if (part.getTypeDefinition() != null) {
- partInfo = CreateWSDLElementHelper.PART_INFO_TYPE_DEFINITION;
- }
- else if (part.getElementDeclaration() != null) {
- partInfo = CreateWSDLElementHelper.PART_INFO_ELEMENT_DECLARATION;
- }
- }
- }
-
- return partInfo;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NameUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NameUtil.java
deleted file mode 100644
index eb9920fc5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NameUtil.java
+++ /dev/null
@@ -1,581 +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.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-
-public class NameUtil
-{
- /**
- * Return a name which is not used by any other fault in the operation.
- * @return String
- */
- public static String buildUniqueFaultName(Operation operation)
- {
- return buildUniqueFaultName(operation, "NewFault"); //$NON-NLS-1$
- }
-
- public static String buildUniqueFaultName(Operation operation, String baseName) {
- if (baseName == null)
- baseName = "NewFault"; //$NON-NLS-1$
-
- List names = getUsedFaultNames(operation);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other input in the portType. Returned name will be of the form:
- * <operationName> + <ending> [+ unique Integer]
- * @return String
- */
- public static String buildUniqueInputName(PortType portType, String operationName, String ending)
- {
- String name = null;
- String candidate = operationName + ending;
-
- int i = 0;
-
- // loop until we find a unique name (the name will consist of the operationName + ending + an integer)
- while (name == null)
- {
- boolean unique = true;
-
- // determine if this combination is unique within the current porttype
- for (Iterator it = portType.getEOperations().iterator(); it.hasNext() && unique;)
- {
- Operation current = (Operation) it.next();
- // TODO : port check
- // old if(current.isSetEInput() && current.getEInput().isSetName()) {
- if (current.getEInput() != null && current.getEInput().getName() != null)
- {
- if (current.getEInput().getName().equals(candidate))
- unique = false;
- }
- }
- if (unique)
- name = candidate;
- else
- candidate = operationName + ending + i;
- i++;
- }
- return name;
- }
-
- /**
- * Return a name which is not used by any other message in the definition.
- * @return String
- */
- public static String buildUniqueMessageName(Definition definition, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewMessage"; //$NON-NLS-1$
- }
-
- List names = getUsedMessageNames(definition);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other operation in the port type.
- * @return String
- */
- public static String buildUniqueOperationName(PortType portType)
- {
- return buildUniqueOperationName(portType, "NewOperation"); //$NON-NLS-1$
- }
-
- public static String buildUniqueOperationName(PortType portType, String baseName)
- {
- if (baseName == null) {
- baseName = "NewOperation"; //$NON-NLS-1$
- }
-
- List names = getUsedOperationNames(portType);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other output in the portType. Returned name will be of the form:
- * <operationName> + <ending> [+ unique Integer]
- * @return String
- */
- public static String buildUniqueOutputName(PortType portType, String operationName, String ending)
- {
- String name = null;
- String candidate = operationName + ending;
-
- int i = 0;
-
- // loop until we find a unique name (the name will consist of the operationName + ending + an integer)
- while (name == null)
- {
- boolean unique = true;
-
- // determine if this combination is unique within the current porttype
- for (Iterator it = portType.getEOperations().iterator(); it.hasNext() && unique;)
- {
- Operation current = (Operation) it.next();
- // TODO: port check
- // old if(current.isSetEOutput() && current.getEOutput().isSetName()) {
- if (current.getEOutput() != null && current.getEOutput().getName() != null)
- {
- if (current.getEOutput().getName().equals(candidate))
- unique = false;
- }
- }
- if (unique)
- name = candidate;
- else
- candidate = operationName + ending + i;
- i++;
- }
- return name;
- }
-
- /**
- * Return a name which is not used by any other part in the message.
- * @return String
- */
- public static String buildUniquePartName(Message message)
- {
- List names = getUsedPartNames(message);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper("NewPart", names); //$NON-NLS-1$
- }
-
- public static String buildUniquePartName(Message message, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewPart"; //$NON-NLS-1$
- }
-
- List names = getUsedPartNames(message);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other port type in the definition.
- * @return String
- */
- public static String buildUniquePortTypeName(Definition definition, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewPortType"; //$NON-NLS-1$
- }
-
- List names = getUsedPortTypeNames(definition);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- public static String getUniqueNameHelper(String baseName, List names)
- {
- int i = 0;
-
- String name = baseName;
- while (true)
- {
- if (!names.contains(name))
- {
- break;
- }
- i++;
- name = baseName + i;
- }
-
- return name;
- }
-
- /**
- * Return a name which is not used by any other service in the definition.
- * @return String
- */
- public static String buildUniqueServiceName(Definition definition)
- {
- List names = getUsedServiceNames(definition);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper("NewService", names); //$NON-NLS-1$
- }
-
- /**
- * Return a name which is not used by any other binding in the definition.
- * @return String
- */
- public static String buildUniqueBindingName(Definition definition, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewBinding"; //$NON-NLS-1$
- }
-
- List names = getUsedBindingNames(definition);
-
- return getUniqueNameHelper(baseName, names);
- }
-
- public static String buildUniquePrefix(Definition definition, String basePrefix)
- {
- String prefix = basePrefix;
- for (int i = 1; definition.getNamespace(prefix) != null; i++)
- {
- prefix = basePrefix + i;
- }
- return prefix;
- }
-
- public static String buildUniquePortName(Service service, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewPort"; //$NON-NLS-1$
- }
-
- List names = getUsedPortNames(service);
-
- return getUniqueNameHelper(baseName, names);
- }
-
- public static String buildUniqueMessageName(Definition definition, MessageReference messRef)
- {
- String name = null;
- if (messRef instanceof Input)
- {
- name = createOperationName(messRef, "Request"); //$NON-NLS-1$
- }
- else if (messRef instanceof Output)
- {
- name = createOperationName(messRef, "Response"); //$NON-NLS-1$
- }
- else if (messRef instanceof Fault)
- {
- String faultName = ((Fault) messRef).getName();
- if (faultName == null || faultName.length() == 0)
- {
- faultName = "Fault"; //$NON-NLS-1$
- }
- name = createOperationName(messRef, faultName);
- }
-
- return NameUtil.buildUniqueMessageName(definition, name);
- }
-
-
- public static List getUsedFaultNames(Operation operation) {
- ArrayList names = new ArrayList();
- for (Iterator i = operation.getEFaults().iterator(); i.hasNext();)
- {
- Fault fault = (Fault) i.next();
- names.add(fault.getName());
- }
-
- return names;
- }
-
- public static List getUsedOperationNames(PortType portType) {
- ArrayList names = new ArrayList();
- for (Iterator i = portType.getEOperations().iterator(); i.hasNext();)
- {
- Operation op = (Operation) i.next();
- names.add(op.getName());
- }
-
- return names;
- }
-
- public static List getUsedPartNames(Message message) {
- ArrayList names = new ArrayList();
- for (Iterator i = message.getEParts().iterator(); i.hasNext();)
- {
- Part part = (Part) i.next();
- names.add(part.getName());
- }
- return names;
- }
-
- public static List getUsedPortTypeNames(Definition definition) {
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEPortTypes().iterator(); i.hasNext();)
- {
- PortType portType = (PortType) i.next();
- // TODO: port check
- // if (portType.isSetQName())
- if (portType.getQName() != null)
- {
- names.add(portType.getQName().getLocalPart());
- }
- }
-
- return names;
-
- }
- public static List getUsedServiceNames(Definition definition) {
- // First build a list of names already used
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEServices().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- // TODO: port check
- // if(service.isSetQName())
- if (service.getQName() != null)
- names.add(service.getQName().getLocalPart());
- }
-
- return names;
- }
-
- public static List getUsedMessageNames(Definition definition) {
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEMessages().iterator(); i.hasNext();)
- {
- Message msg = (Message) i.next();
- // TODO: port check
- if (msg.getQName() != null)
- // if(msg.isSetQName())
- names.add(msg.getQName().getLocalPart());
- }
-
- return names;
- }
-
- public static List getUsedBindingNames(Definition definition) {
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEBindings().iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- // TODO: port check
- // if (binding.isSetQName())
- if (binding.getQName() != null)
- {
- names.add(binding.getQName().getLocalPart());
- }
- }
-
- return names;
- }
-
- public static List getUsedPortNames(Service service) {
- // First build a list of names already used
- ArrayList names = new ArrayList();
- for (Iterator i = service.getEPorts().iterator(); i.hasNext();)
- {
- Port port = (Port) i.next();
-
- if (port.getName() != null)
- {
- names.add(port.getName());
- }
- }
-
- return names;
- }
-
- private static String createOperationName(Object object, String suffix)
- {
- String result = null;
- if (object instanceof EObject)
- {
- EObject parent = ((EObject)object).eContainer();
- if (parent instanceof Operation)
- {
- result = ((Operation)parent).getName();
- }
- }
- if (result != null)
- {
- result += suffix;
- }
- return result;
- }
-
-public static String getMessageName(MessageReference messageRef) {
- String messageName = "NewMessage"; //$NON-NLS-1$
- List messageNames = new ArrayList();
- Operation operation = (Operation) messageRef.getContainer();
- Iterator messageIt = operation.getEnclosingDefinition().getEMessages().iterator();
- while (messageIt.hasNext()) {
- messageNames.add(((Message) messageIt.next()).getQName().getLocalPart());
- }
-
-// String requestResponseString = getRequestOrResponse(messageRef) + "Msg"; //$NON-NLS-1$
- String requestResponseString = getRequestOrResponse(messageRef); //$NON-NLS-1$
- messageName = getUniqueNameHelper(operation.getName() + requestResponseString, messageNames);
-
- return messageName;
-}
-
-public static String getPartName(MessageReference messageRef) {
- String partName = "NewPart"; //$NON-NLS-1$
- Message message = messageRef.getEMessage();
-
- Operation operation = (Operation) messageRef.getContainer();
- String operationName = operation.getName();
- String appendString = ""; //$NON-NLS-1$
- if (messageRef instanceof Input) {
-// appendString = "Parameters"; //$NON-NLS-1$
- appendString = "Request"; //$NON-NLS-1$
- }
- else if (messageRef instanceof Output) {
-// appendString = "Result"; //$NON-NLS-1$
- appendString = "Response"; //$NON-NLS-1$
- }
- else if (messageRef instanceof Fault) {
-// appendString = "Fault"; //$NON-NLS-1$
- appendString = "_Fault"; //$NON-NLS-1$
- }
- partName = operationName + appendString;
-
- List usedPartNames = new ArrayList();
- if (message != null) {
- partName = message.getQName().getLocalPart();
- Iterator partIt = message.getEParts().iterator();
- while (partIt.hasNext()) {
- usedPartNames.add(((Part) partIt.next()).getName());
- }
- }
-
- partName = getUniqueNameHelper(partName, usedPartNames);
-
- return partName;
-}
-
-public static String getOperationName(PortType portType) {
- String operationName = "NewOperation"; //$NON-NLS-1$
- Iterator operationIt = portType.getEOperations().iterator();
- List usedNames = new ArrayList();
- while (operationIt.hasNext()) {
- usedNames.add(((Operation) operationIt.next()).getName());
- }
-
- operationName = getUniqueNameHelper("NewOperation", usedNames); //$NON-NLS-1$
-
- return operationName;
-}
-
-public static String getRequestOrResponse(MessageReference messageRef) {
- if (messageRef instanceof Input)
- {
- return "Request"; //$NON-NLS-1$
- }
- else if (messageRef instanceof Output)
- {
- return "Response"; //$NON-NLS-1$
- }
- else if (messageRef instanceof Fault)
- {
- return "_Fault"; //$NON-NLS-1$
- }
-
- return ""; //$NON-NLS-1$
-}
-
-public static String getFaultName(Operation operation) {
- String faultName = "fault"; //$NON-NLS-1$
- List nameList = new ArrayList();
- Iterator faultIt = operation.getEFaults().iterator();
- while (faultIt.hasNext()) {
- nameList.add(((Fault) faultIt.next()).getName());
- }
-
- faultName = getUniqueNameHelper(faultName, nameList);
-
- return faultName;
-}
-
-public static String getXSDElementName(String baseName, Object parent) {
- String elementName = ""; //$NON-NLS-1$
-
- if (parent instanceof XSDSchema) {
- elementName = getUniqueNameHelper(baseName, getUsedElementNames((XSDSchema) parent));
- }
- else if (parent instanceof XSDModelGroup) {
- List existingNames = new ArrayList();
- XSDModelGroup modelGroup = (XSDModelGroup) parent;
- Iterator modelGroupIt = modelGroup.getContents().iterator();
- while (modelGroupIt.hasNext()) {
- Object item = modelGroupIt.next();
- if (item instanceof XSDParticle) {
- XSDParticle existingParticle = (XSDParticle) item;
- if (existingParticle.getContent() instanceof XSDElementDeclaration) {
- existingNames.add(((XSDElementDeclaration) existingParticle.getContent()).getName());
- }
- }
- }
-
- elementName = getUniqueNameHelper(baseName, existingNames);
- }
-
- return elementName;
-}
-
-public static String getXSDComplexTypeName(String baseName, XSDSchema schema) {
- String typeName = ""; //$NON-NLS-1$
- List existingNames = new ArrayList();
-
- Iterator it = schema.getTypeDefinitions().iterator();
- while (it.hasNext()) {
- Object item = it.next();
- if (item instanceof XSDComplexTypeDefinition) {
- existingNames.add(((XSDComplexTypeDefinition) item).getName());
- }
- }
-
- typeName = getUniqueNameHelper(baseName, existingNames);
- return typeName;
-}
-
-private static List getUsedElementNames(XSDSchema xsdSchema) {
- List usedNames = new ArrayList();
- Iterator schemaIt = xsdSchema.getContents().iterator();
- while (schemaIt.hasNext()) {
- Object item = schemaIt.next();
- if (item instanceof XSDElementDeclaration) {
- usedNames.add(((XSDElementDeclaration) item).getName());
- }
- }
-
- return usedNames;
-}
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NodeAssociationManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NodeAssociationManager.java
deleted file mode 100644
index 01c0513a1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/NodeAssociationManager.java
+++ /dev/null
@@ -1,146 +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.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.xsd.XSDNodeAssociationProvider;
-import org.eclipse.wst.wsdl.ui.internal.extensions.INodeAssociationProvider;
-import org.eclipse.wst.wsdl.ui.internal.extensions.WSDLNodeAssociationProvider;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class NodeAssociationManager
-{
- protected INodeAssociationProvider wsdlProvider;
- protected INodeAssociationProvider xsdProvider;
-
- public NodeAssociationManager()
- {
- wsdlProvider = new WSDLNodeAssociationProvider();
- xsdProvider = new XSDNodeAssociationProvider();
- }
-
- protected INodeAssociationProvider getAppicableProvider(Object object)
- {
- if (object instanceof XSDSchemaExtensibilityElement ||
- object instanceof XSDConcreteComponent ||
- object instanceof CategoryAdapter) {// ||
-// object instanceof Category) {
- return xsdProvider;
- }
-
- return wsdlProvider;
- }
-
-
- public Object getModelObjectForNode(Object rootObject, Element targetNode)
- {
- if (targetNode != null && targetNode.getParentNode() == null)
- {
- // The element was already removed from the DOM, common scenario during undo.
- // The parent element's reconciliation will take care of reconciling it.
- return null;
- }
-
- int currentIndex = 0;
-
- Element[] elementChain = getParentElementChain((Element)targetNode);
-
- INodeAssociationProvider p = getAppicableProvider(rootObject);
- if (p != null)
- {
- Node rootObjectNode = p.getNode(rootObject);
-
- while (currentIndex < elementChain.length)
- {
- Element e = elementChain[currentIndex];
- if (e == rootObjectNode)
- {
- currentIndex++;
- break;
- }
- currentIndex++;
- }
- }
-
- Object currentObject = rootObject;
- int end[] = new int[1];
-
- while (currentIndex < elementChain.length)
- {
- p = getAppicableProvider(currentObject);
- if (p != null)
- {
- end[0] = elementChain.length;
- currentObject = p.getModelObject(currentObject, elementChain, currentIndex, end);
-
- if (currentObject == null)
- {
- // failure
- break;
- }
- else
- {
- currentIndex = Math.max(end[0], currentIndex + 1);
- }
- }
- else
- {
- break;
- }
- }
-
- return (currentIndex == elementChain.length) ? currentObject : null;
- }
-
-
- public Node getNode(Object modelObject)
- {
- Node result = null;
- if (modelObject instanceof Node)
- {
- result = (Node)modelObject;
- }
- else
- {
- INodeAssociationProvider p = getAppicableProvider(modelObject);
- if (p != null)
- {
- result = p.getNode(modelObject);
- }
- }
- return result;
- }
-
- protected Element[] getParentElementChain(Element element)
- {
- List list = new ArrayList();
- while (element != null)
- {
- list.add(0, element);
- Node node = element.getParentNode();
- element = (node != null && node.getNodeType() == Node.ELEMENT_NODE) ? (Element)node : null;
- }
-
- int listSize = list.size();
- Element[] result = new Element[listSize];
- for (int i = 0; i < listSize; i++)
- {
- result[i] = (Element)list.get(i);
- }
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/OpenOnSelectionHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/OpenOnSelectionHelper.java
deleted file mode 100644
index 118dd7bdd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/OpenOnSelectionHelper.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTReadOnlyFileEditorInput;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDHyperlinkTargetLocator;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDPackage;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class OpenOnSelectionHelper extends WSDLSwitch
-{
- Definition definition;
- Attr attr = null;
- Element element = null;
-
- public OpenOnSelectionHelper(Definition definition)
- {
- this.definition = definition;
- }
-
- public void openEditor(EObject eObject)
- {
- String[] array = computeSpecification(eObject);
- if (array != null)
- {
- openEditor(array[0], array[1]);
- }
- }
-
- public void openEditor(Node node)
- {
- String[] array = computeSpecification(node);
- if (array != null)
- {
- openEditor(array[0], array[1]);
- }
- }
-
- protected void openEditor(String resource, String spec)
- {
- String pattern = "platform:/resource"; //$NON-NLS-1$
- IWorkbenchPage workbenchPage = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editorPart = workbenchPage.getActiveEditor();
- String currentEditorId = editorPart.getEditorSite().getId();
-
- if (resource != null && resource.startsWith(pattern))
- {
- try
- {
- Path path = new Path(resource.substring(pattern.length()));
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-
-
- if (editorPart.getEditorInput() instanceof IFileEditorInput &&
- ((IFileEditorInput)editorPart.getEditorInput()).getFile().equals(file))
- {
- workbenchPage.getNavigationHistory().markLocation(editorPart);
- }
- else
- {
- try
- {
- // TODO: Use content type as below
- if (resource.endsWith("xsd")) //$NON-NLS-1$
- {
- editorPart = workbenchPage.openEditor(new FileEditorInput(file), WSDLEditorPlugin.XSD_EDITOR_ID);
- }
- else
- {
- // Since we are already in the wsdleditor
- editorPart = workbenchPage.openEditor(new FileEditorInput(file), editorPart.getEditorSite().getId());
- }
- }
- catch (PartInitException initEx)
- {
- }
- }
-
- Class theClass = editorPart.getClass();
- Class[] methodArgs = { String.class };
- Method method = theClass.getMethod("openOnSelection", methodArgs); //$NON-NLS-1$
- Object args[] = { spec };
- method.invoke(editorPart, args);
- workbenchPage.getNavigationHistory().markLocation(editorPart);
- }
- catch (Exception e)
- {
- }
- }
- else if (resource != null && resource.startsWith("http"))
- {
- IEditorPart newEditorPart = null;
- boolean doOpenWsdlEditor = true;
- if (resource.endsWith("xsd")) //$NON-NLS-1$
- {
- doOpenWsdlEditor = false;
- }
- try
- {
- IEditorReference[] refs = workbenchPage.getEditorReferences();
- int length = refs.length;
- // Need to find if an editor on that schema has already been opened
- for (int i = 0; i < length; i++)
- {
- IEditorInput input = refs[i].getEditorInput();
- if (input instanceof ADTReadOnlyFileEditorInput)
- {
- ADTReadOnlyFileEditorInput readOnlyEditorInput = (ADTReadOnlyFileEditorInput) input;
- if (readOnlyEditorInput.getUrlString().equals(resource) &&
- (!doOpenWsdlEditor && readOnlyEditorInput.getEditorID().equals(WSDLEditorPlugin.XSD_EDITOR_ID)
- || (doOpenWsdlEditor && readOnlyEditorInput.getEditorID().equals(WSDLEditorPlugin.WSDL_EDITOR_ID))))
- {
- newEditorPart = refs[i].getEditor(true);
- workbenchPage.activate(refs[i].getPart(true));
- break;
- }
- }
- }
- if (newEditorPart == null)
- {
- ADTReadOnlyFileEditorInput readOnlyStorageEditorInput = new ADTReadOnlyFileEditorInput(resource);
- IContentType contentType = null;
- InputStream iStream = null;
- try
- {
- iStream = readOnlyStorageEditorInput.getStorage().getContents();
- contentType = Platform.getContentTypeManager().findContentTypeFor(iStream, resource);
- }
- catch (CoreException coreException)
- {
-
- }
- finally
- {
- }
- // content type more reliable check
- if (contentType != null && contentType.equals(XSDEditorPlugin.XSD_CONTENT_TYPE_ID) || resource.endsWith("xsd")) //$NON-NLS-1$
- {
- readOnlyStorageEditorInput.setEditorID(WSDLEditorPlugin.XSD_EDITOR_ID);
- workbenchPage.openEditor(readOnlyStorageEditorInput, WSDLEditorPlugin.XSD_EDITOR_ID, true, 0); //$NON-NLS-1$
- }
- else
- {
- readOnlyStorageEditorInput.setEditorID(currentEditorId);
- workbenchPage.openEditor(readOnlyStorageEditorInput, currentEditorId, true, 0); //$NON-NLS-1$
- }
- }
- }
- catch (PartInitException pie)
- {
- }
- catch (IOException ioe)
- {
- }
- }
- }
-
- public String[] computeSpecification(EObject eObject)
- {
- String[] result = null;
- Object referencedObject = doSwitch(eObject);
- if (referencedObject instanceof EObject)
- {
- EObject referencedEObject = (EObject)referencedObject;
- if (referencedEObject != eObject ||
- referencedEObject.eResource() != definition.eResource())
- {
-
- Resource resource = referencedEObject.eResource();
- if (resource != null)
- {
- result = new String[2];
- result[0] = resource.getURI().toString();
- result[1] = resource.getURIFragment(referencedEObject);
- }
- }
- }
- return result;
- }
-
- public String[] computeSpecification(Node node)
- {
- String[] result = null;
- switch (node.getNodeType())
- {
- case Node.ELEMENT_NODE :
- {
- element = (Element)node;
- break;
- }
- case Node.ATTRIBUTE_NODE :
- {
- attr = (Attr)node;
- element = attr.getOwnerElement();
- break;
- }
- case Node.TEXT_NODE :
- {
- Node parent = node.getParentNode();
- element = (parent instanceof Element) ? (Element)parent : null;
- break;
- }
- }
- if (element != null)
- {
- Object object = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, element);
- if (object instanceof EObject)
- {
- result = computeSpecification((EObject)object);
- }
- }
- return result;
- }
-
- public Object caseBinding(Binding binding)
- {
- Object result = binding;
- if (isMatchingAttribute(WSDLConstants.TYPE_ATTRIBUTE))
- {
- result = binding.getEPortType();
- }
- return result;
- }
-
- public Object caseDefinition(Definition definition)
- {
- return definition;
- }
-
- public Object casePart(Part part)
- {
- Object result = part;
- if (attr != null)
- {
- if (isMatchingAttribute(WSDLConstants.TYPE_ATTRIBUTE))
- {
- result = part.getTypeDefinition();
- }
- else if (isMatchingAttribute(WSDLConstants.ELEMENT_ATTRIBUTE))
- {
- result = part.getElementDeclaration();
- }
- }
- else if (part.getEnclosingDefinition() == definition)
- {
- result = part.getTypeDefinition() != null ? (Object)part.getTypeDefinition() : (Object)part.getElementDeclaration();
- }
- return result;
- }
-
- public Object casePort(Port port)
- {
- Object result = port;
- if (isMatchingAttribute(WSDLConstants.BINDING_ATTRIBUTE))
- {
- result = port.getEBinding();
-
- }
- return result;
- }
-
- public Object caseFault(Fault fault)
- {
- Object result = fault;
- if (isMatchingAttribute(WSDLConstants.MESSAGE_ATTRIBUTE))
- {
- result = fault.getMessage();
- }
- return result;
- }
-
- public Object caseInput(Input input)
- {
- Object result = input;
- if (isMatchingAttribute(WSDLConstants.MESSAGE_ATTRIBUTE))
- {
- result = input.getMessage();
- }
- return result;
- }
-
- public Object caseOutput(Output output)
- {
- Object result = output;
-
- if (isMatchingAttribute(WSDLConstants.MESSAGE_ATTRIBUTE))
- {
- result = output.getMessage();
- }
- return result;
- }
-
- public Object caseImport(Import theImport)
- {
- Object result = null;
-
- // For now, look at the file extension. When bugzilla 118293 is fixed, look at
- // the Import's eDefinition and eSchema instead.
- Path importPath = new Path(theImport.getLocationURI());
- String extension = importPath.getFileExtension();
- if (extension.equalsIgnoreCase("xsd")) { //$NON-NLS-1$
- if (theImport.getESchema() == null) {
- ((ImportImpl)theImport).importDefinitionOrSchema();
- }
-
- result = theImport.getESchema();
- }
- else if (extension.equalsIgnoreCase("wsdl") || extension.endsWith("wsdl")) { //$NON-NLS-1$
- if (theImport.getEDefinition() == null) {
- ((ImportImpl)theImport).importDefinitionOrSchema();
- }
-
- result = theImport.getEDefinition();
- }
-
-
-// if (theImport.getESchema() != null) {
-// result = theImport.getESchema();
-// }
-// else if (theImport.getEDefinition() != null) {
-// result = theImport.getEDefinition();
-// }
-// else {
-// // Need to resolve imports because the model doesn't automatically
-// // do it for us
-// ((ImportImpl)theImport).importDefinitionOrSchema();
-// result = theImport.getESchema();
-// }
-
- return result;
- }
-
- public Object caseWSDLElement(WSDLElement wsdlElement)
- {
- return wsdlElement;
- }
-
- private boolean isMatchingAttribute(String value)
- {
- return attr != null && value.equals(attr.getName());
- }
-
- public Object defaultCase(EObject object)
- {
- EClass theEClass = object.eClass();
-
- if (theEClass.eContainer() == XSDPackage.eINSTANCE)
- {
- // Handle navigation between inline schema components.
-
- XSDHyperlinkTargetLocator xsdHyperlinkTargetLocator = new XSDHyperlinkTargetLocator();
- String attributeName = attr != null ? attr.getName(): null;
- return xsdHyperlinkTargetLocator.locate((XSDConcreteComponent) object, attributeName);
- }
-
- return super.defaultCase(object);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ReferenceEditManagerHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ReferenceEditManagerHelper.java
deleted file mode 100644
index 63120cfcc..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ReferenceEditManagerHelper.java
+++ /dev/null
@@ -1,123 +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.util;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-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.adapters.basic.W11EndPoint;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11MessageReference;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.edit.W11BindingReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.W11InterfaceReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.W11MessageReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLXSDElementReferenceEditManager;
-import org.eclipse.wst.wsdl.ui.internal.edit.WSDLXSDTypeReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDElementReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-
-public class ReferenceEditManagerHelper {
-
-
- public static ComponentReferenceEditManager getBindingReferenceEditManager(IASDObject asdObject) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor().getAdapter(W11InterfaceReferenceEditManager.class) != null) {
- return (ComponentReferenceEditManager) page.getActiveEditor().getAdapter(W11BindingReferenceEditManager.class);
- }
- else {
- IEditorInput input = page.getActiveEditor().getEditorInput();
- if (input instanceof IFileEditorInput && asdObject instanceof W11EndPoint) {
- WSDLElement element = (WSDLElement) ((W11EndPoint) asdObject).getTarget();
- IDescription description = (IDescription) WSDLAdapterFactoryHelper.getInstance().adapt(element.getEnclosingDefinition());
- return new W11BindingReferenceEditManager((W11Description) description, ((IFileEditorInput) input).getFile());
- }
- }
-
- return null;
- }
-
- public static ComponentReferenceEditManager getInterfaceReferenceEditManager(IASDObject asdObject) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor().getAdapter(W11InterfaceReferenceEditManager.class) != null) {
- return (ComponentReferenceEditManager) page.getActiveEditor().getAdapter(W11InterfaceReferenceEditManager.class);
- }
- else {
- IEditorInput input = page.getActiveEditor().getEditorInput();
- if (input instanceof IFileEditorInput && asdObject instanceof W11Binding) {
- WSDLElement element = (WSDLElement) ((W11Binding) asdObject ).getTarget();
- IDescription description = (IDescription) WSDLAdapterFactoryHelper.getInstance().adapt(element.getEnclosingDefinition());
- return new W11InterfaceReferenceEditManager((W11Description) description, ((IFileEditorInput) input).getFile());
- }
- }
-
- return null;
- }
-
- public static ComponentReferenceEditManager getMessageReferenceEditManager(IASDObject asdObject) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor().getAdapter(W11MessageReferenceEditManager.class) != null) {
- return (ComponentReferenceEditManager) page.getActiveEditor().getAdapter(W11MessageReferenceEditManager.class);
- }
- else {
- IEditorInput input = page.getActiveEditor().getEditorInput();
- if (input instanceof IFileEditorInput && asdObject instanceof W11MessageReference) {
- WSDLElement element = (WSDLElement) ((W11MessageReference) asdObject).getTarget();
- IDescription description = (IDescription) WSDLAdapterFactoryHelper.getInstance().adapt(element.getEnclosingDefinition());
- return new W11MessageReferenceEditManager((W11Description) description, ((IFileEditorInput) input).getFile());
- }
- }
-
- return null;
- }
-
- public static ComponentReferenceEditManager getXSDElementReferenceEditManager(IASDObject asdObject) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor().getAdapter(XSDElementReferenceEditManager.class) != null) {
- return (ComponentReferenceEditManager) page.getActiveEditor().getAdapter(XSDElementReferenceEditManager.class);
- }
- else {
- IEditorInput input = page.getActiveEditor().getEditorInput();
- if (input instanceof IFileEditorInput && asdObject instanceof W11ParameterForPart) {
- WSDLElement element = (WSDLElement) ((W11ParameterForPart) asdObject).getTarget();
- IDescription description = (IDescription) WSDLAdapterFactoryHelper.getInstance().adapt(element.getEnclosingDefinition());
- return new WSDLXSDElementReferenceEditManager(((IFileEditorInput) input).getFile(), null, description);
- }
- }
-
- return null;
- }
-
- public static ComponentReferenceEditManager getXSDTypeReferenceEditManager(IASDObject asdObject) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor().getAdapter(XSDTypeReferenceEditManager.class) != null) {
- return (ComponentReferenceEditManager) page.getActiveEditor().getAdapter(XSDTypeReferenceEditManager.class);
- }
- else {
- IEditorInput input = page.getActiveEditor().getEditorInput();
- if (input instanceof IFileEditorInput && asdObject instanceof IParameter && asdObject instanceof WSDLBaseAdapter) {
- WSDLElement element = (WSDLElement) ((WSDLBaseAdapter) asdObject).getTarget();
- IDescription description = (IDescription) WSDLAdapterFactoryHelper.getInstance().adapt(element.getEnclosingDefinition());
- return new WSDLXSDTypeReferenceEditManager(((IFileEditorInput) input).getFile(), null, description);
- }
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ServicePolicyHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ServicePolicyHelper.java
deleted file mode 100644
index c5614ef80..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ServicePolicyHelper.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.wst.ws.internal.preferences.WSIServicePoliciesConstants;
-import org.eclipse.wst.ws.service.policy.IPolicyState;
-import org.eclipse.wst.ws.service.policy.IPolicyStateEnum;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.ws.service.policy.ServicePolicyPlatform;
-
-/**
- * Contains helper methods dealing with service policies
- */
-public class ServicePolicyHelper
-{
- /**
- * Returns an active policy with an associated default protocol
- *
- * @param project
- * @return IServicePolicy if there is one, otherwise null
- */
- public static IServicePolicy getActivePolicyWithProtocol(IProject project)
- {
- IServicePolicy thePolicy = null;
-
- IServicePolicy[] policies = getActiveServicePolicies(project);
- for (int i = 0; i < policies.length; ++i)
- {
- IServicePolicy policy = policies[i];
- // get the default protocol from the policy
- IPolicyState policyState = policy.getPolicyState(project);
- if (policyState != null)
- {
- String defaultBinding = policyState.getValue(WSIServicePoliciesConstants.stateKeyDefaultProtocol);
- if ((defaultBinding != null) && (defaultBinding.length() > 0))
- {
- // policy will be last one active
- thePolicy = policy;
- IPolicyStateEnum policyStateEnum = policy.getPolicyStateEnum(project);
- String enumId = policyStateEnum.getCurrentItem().getId();
- // if found a required policy, stop and return it
- if (WSIServicePoliciesConstants.stateEnumRequire.equals(enumId))
- break;
- }
- }
- }
- return thePolicy;
- }
-
- /**
- * Get the default binding based on the project
- *
- * @param project
- * @return String binding id (namespace)
- */
- public static String getDefaultBinding(IProject project)
- {
- String defaultBinding = null;
- IServicePolicy policy = getActivePolicyWithProtocol(project);
- if (policy != null)
- {
- defaultBinding = policy.getPolicyState(project).getValue(WSIServicePoliciesConstants.stateKeyDefaultProtocol);
- }
-
- // still unable to get default binding so just hardcode a value
- if (defaultBinding == null)
- defaultBinding = getDefaultDefaultBinding();
-
- return defaultBinding;
- }
-
- /**
- * Get the default binding based on project and service policy
- *
- * @param project
- * @param policy
- * @return String binding id (namespace)
- */
- public static String getDefaultBinding(IProject project, IServicePolicy policy)
- {
- String defaultBinding = null;
- if (policy != null)
- {
- defaultBinding = policy.getPolicyState(project).getValue(WSIServicePoliciesConstants.stateKeyDefaultProtocol);
- }
-
- // still unable to get default binding so just hardcode a value
- if (defaultBinding == null)
- defaultBinding = getDefaultDefaultBinding();
-
- return defaultBinding;
- }
-
- /**
- * Get the severity to be used when there are problems with the current policy
- *
- * @param project
- * @param policy
- * @return int (IMessageProvider.NONE, IMessageProvider.ERROR,
- * IMessageProvider.WARNING)
- */
- public static int getMessageSeverity(IProject project, IServicePolicy policy)
- {
- int messageSeverity = IMessageProvider.NONE;
-
- if (policy != null)
- {
- IPolicyStateEnum policyStateEnum = policy.getPolicyStateEnum(project);
- String enumId = policyStateEnum.getCurrentItem().getId();
-
- if (WSIServicePoliciesConstants.stateEnumRequire.equals(enumId))
- messageSeverity = IMessageProvider.ERROR;
- else if (WSIServicePoliciesConstants.stateEnumSuggest.equals(enumId))
- messageSeverity = IMessageProvider.WARNING;
- }
-
- return messageSeverity;
- }
-
- /**
- * Get the default binding
- *
- * @return String binding id (namespace)
- */
- private static String getDefaultDefaultBinding()
- {
- return WSIServicePoliciesConstants.stateKeyDefaultProtocol_VALUE_SOAP;
- }
-
- /**
- * Get active service policies based on project
- *
- * @param project
- * @return IServicePolicy[]
- */
- private static IServicePolicy[] getActiveServicePolicies(IProject project)
- {
- List servicePolicies = new ArrayList();
- // Determine default binding to use based on project's wsi compliance
- // preference
- IServicePolicy rootPolicy = ServicePolicyPlatform.getInstance().getServicePolicy(WSIServicePoliciesConstants.ServicePolicyID_WSIProfileRoot);
- if (rootPolicy != null)
- {
- List wsiPolicies = rootPolicy.getChildren();
- // iterate through wsi policies and determine which ones are applicable
- for (int i = 0; i < wsiPolicies.size(); ++i)
- {
- IServicePolicy policy = (IServicePolicy) wsiPolicies.get(i);
- IPolicyStateEnum policyStateEnum = policy.getPolicyStateEnum(project);
- String enumId = policyStateEnum.getCurrentItem().getId();
- // found an enabled policy
- if (WSIServicePoliciesConstants.stateEnumRequire.equals(enumId) || WSIServicePoliciesConstants.stateEnumSuggest.equals(enumId))
- {
- // special check for AP 1.0 policy (it doesnt really count, so dont
- // add it)
- if (!WSIServicePoliciesConstants.ServicePolicyID_AP10.equals(policy.getId()))
- {
- servicePolicies.add(policy);
- }
- }
- }
- }
- return (IServicePolicy[]) servicePolicies.toArray(new IServicePolicy[servicePolicies.size()]);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ValidateHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ValidateHelper.java
deleted file mode 100644
index e582599b5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/ValidateHelper.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.util;
-
-import org.eclipse.wst.common.ui.internal.UIPlugin;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-
-public class ValidateHelper
-{
- // XML Lang can have many different valid formats
- // 1) xx ie. en, fr, de
- // 2) xx-xx ie. en-US, en-FR
- // 3) I-xx ie. I-en
- // 4) X-xx ie. X-en
- public static String checkXMLLang(String lang)
- {
- if (lang.length() == 0)
- return null;
-
- if (lang.length() == 1)
- {
- char ch0 = lang.charAt(0);
- if ((ch0 >= 'a' && ch0 <= 'z') || (ch0 >= 'A' && ch0 <= 'Z'))
- return UIPlugin.getResourceString("_WARN_LANG_TOO_SHORT"); //$NON-NLS-1$
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch0 + //$NON-NLS-1$
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END"); //$NON-NLS-1$
- }
-
- int offset;
-
- char ch0 = lang.charAt(0);
- if (lang.charAt(1) == '-')
- {
- if (ch0 == 'i' || ch0 == 'I' || ch0 == 'x' || ch0 == 'X')
- offset = 1;
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch0 + //$NON-NLS-1$
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END"); //$NON-NLS-1$
- }
- else
- {
- char ch1 = lang.charAt(1);
- if ((ch0 >= 'a' && ch0 <= 'z') || (ch0 >= 'A' && ch0 <= 'Z'))
- if ((ch1 >= 'a' && ch1 <= 'z') || (ch1 >= 'A' && ch1 <= 'Z'))
- offset = 2;
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch1 + //$NON-NLS-1$
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END"); //$NON-NLS-1$
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch0 + //$NON-NLS-1$
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END"); //$NON-NLS-1$
- }
-
- if (lang.length() > offset)
- {
- char ch = lang.charAt(offset++);
- if (ch != '-')
- return UIPlugin.getResourceString("_WARN_HYPHEN_NEEDED") + Integer.toString(offset-1); //$NON-NLS-1$
- else
- {
- while (true)
- {
- if (ch == '-')
- {
- if (lang.length() == offset)
- return UIPlugin.getResourceString("_WARN_HYPHEN_ENDING"); //$NON-NLS-1$
-
- ch = lang.charAt(offset++);
- if ((ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z'))
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch + //$NON-NLS-1$
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END"); //$NON-NLS-1$
-
- if (lang.length() == offset)
- return null;
- }
- else if ((ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z'))
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch + //$NON-NLS-1$
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END"); //$NON-NLS-1$
- else if (lang.length() == offset)
- return null;
- ch = lang.charAt(offset++);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Check to see if the min value is correct.
- * A minimum value must be non-negative and < maxValue
- */
- public static String isValidMinValue(String minValue, String maxValue)
- {
- int min;
-
- if (minValue == null || minValue.equals("")) //$NON-NLS-1$
- {
- // Nothing to check
- return null;
- }
-
- try
- {
- min = Integer.parseInt(minValue);
- }
- catch (NumberFormatException ex)
- {
- return UIPlugin.getResourceString("_ERROR_MIN_NOT_POSITIVE"); //$NON-NLS-1$
- }
-
- if (min < 0)
- {
- return UIPlugin.getResourceString("_ERROR_MIN_NOT_POSITIVE"); //$NON-NLS-1$
- }
-
- try
- {
- int max = Integer.parseInt(maxValue);
- if (min > max)
- {
- return UIPlugin.getResourceString("_ERROR_MIN_VALUE"); //$NON-NLS-1$
- }
- }
- catch (NumberFormatException ex)
- {
- // Max is not accurate. Don't compare it.
- }
- return null;
- }
-
- /**
- * Check to see if the max value is correct.
- * A maximum value must be non-negative and > minValue
- *
- * It can also be set the string "unbounded"
- */
- public static String isValidMaxValue(String maxValue, String minValue)
- {
- int max;
-
- if (maxValue == null || maxValue.equals("")) //$NON-NLS-1$
- {
- // Nothing to check
- return null;
- }
-
- if (maxValue.equals("unbounded")) //$NON-NLS-1$
- {
- return null;
- }
-
- try
- {
- max = Integer.parseInt(maxValue);
- }
- catch (NumberFormatException ex)
- {
- return UIPlugin.getResourceString("_ERROR_MAX_NOT_POSITIVE"); //$NON-NLS-1$
- }
-
- if (max < 0)
- {
- return UIPlugin.getResourceString("_ERROR_MAX_NOT_POSITIVE"); //$NON-NLS-1$
- }
-
- try
- {
- int min = Integer.parseInt(minValue);
- if (max < min)
- {
- return UIPlugin.getResourceString("_ERROR_MAX_VALUE"); //$NON-NLS-1$
- }
- }
- catch (NumberFormatException ex)
- {
- // Min is not accurate. Don't compare it.
- }
- return null;
- }
-
- /**
- * Validate the name conforms to the XML spec
- */
- public static String checkXMLName(String name, boolean allowEntityRef)
- {
- int length = name.length();
- char character;
-
- if (length == 0)
- {
- return Messages._WARN_NAME_MUST_CONTAIN_AT_LEAST_ONE_CHAR;
- }
-
- if (name.indexOf(" ") >= 0) //$NON-NLS-1$
- {
- return Messages._WARN_NAME_HAS_SPACE;
- }
-
- int index = 0;
- if (length > 0 &&
- name.charAt(0) == '%')
- {
- if (allowEntityRef)
- {
- // skip over the first character
- index++;
- } // end of if ()
- else
- {
- return Messages._WARN_NAME_INVALID_FIRST;
- } // end of else
- }
-
- for(; index < length; index++)
- {
- character = name.charAt(index);
-
- if(index == 0)
- {
- if( !isXMLNameStart(character) )
- {
- return Messages._WARN_NAME_INVALID_FIRST;
- }
- }
- else
- {
- if(!isXMLNameChar(character))
- {
- if ((index == length - 1) && //check if the last character is a ';'
- allowEntityRef &&
- character == ';')
- {
- // we're still ok then
- continue;
- } // end of if ()
- else
- {
- return Messages._WARN_NAME_INVALID_CHAR + character +
- Messages._UI_NAME_INVALID_CHAR_END;
- } // end of else
- }
- }
- }
- return null;
- }
-
- /**
- * Validate the name conforms to the XML spec
- */
- public static String checkXMLName(String name)
- {
- return checkXMLName(name, false);
- }
-
- /**
- * isXMLNameStart
- **/
- private static boolean isXMLNameStart(char ch)
- {
- return (ch == '_' || ch == ':' || Character.isLetter(ch) );
- }
-
- /**
- * isXMLNameChar
- **/
- private static boolean isXMLNameChar(char ch)
- {
- return (Character.isLetterOrDigit(ch) || ch == '.' || ch == '-' || ch == '_' || ch == ':');
- }
-
- /**
- * isXMLPrefixStart
- **/
-// private static boolean isXMLPrefixStart(char ch)
-// {
-// return (ch == '_' || Character.isLetter(ch) );
-// }
-
- /**
- * isXMLPrefixChar
- **/
- private static boolean isXMLPrefixChar(char ch)
- {
- return (Character.isLetterOrDigit(ch) || ch == '.' || ch == '-' || ch == '_');
- }
-
- /**
- * parseElementText
- */
- public static String parseElementText(String text)
- {
- if (text.indexOf('<') != -1 || text.indexOf('>') != -1)
- {
- return UIPlugin.getResourceString("_WARN_ELEMENT_INVALID_CHAR"); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * parseAttributeValue
- */
- public static String parseAttributeValue(String value)
- {
- if (value.indexOf('"') != -1 || value.indexOf('<') != -1 || value.indexOf('>') != -1)
- {
- return UIPlugin.getResourceString("_WARN_ATTRIBUTE_INVALID_CHAR"); //$NON-NLS-1$
-
- }
- return null;
- }
-
- /**
- * parseADATASection
- */
- public static String parseCDATASection(String section)
- {
- if (section.indexOf("]]>") != -1) //$NON-NLS-1$
- {
- return UIPlugin.getResourceString("_WARN_CDATA_INVALID_STRING"); //$NON-NLS-1$
-
- }
- return null;
- }
-
- /**
- * parseProcessiingInstruction
- */
- public static String parseProcessingInstructionData(String data)
- {
- if (data.indexOf("?>") != -1) //$NON-NLS-1$
- {
- return UIPlugin.getResourceString("_WARN_PROCESSING_INVALID_STRING"); //$NON-NLS-1$
-
- }
- return null;
- }
-
- /**
- * parseProcessingInstructionTarget
- */
- public static String parseProcessingInstructionTarget(String target)
- {
- if (target.length() == 3 && (target.indexOf("XML") != -1 || target.indexOf("XMl") != -1 || target.indexOf("XmL") != -1 || //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- target.indexOf("xML") != -1 || target.indexOf("Xml") != -1 || target.indexOf("xMl") != -1 || //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- target.indexOf("xmL") != -1 || target.indexOf("xml") != -1)) //$NON-NLS-1$ //$NON-NLS-2$
- {
- return UIPlugin.getResourceString("_WARN_PROCESSING_TARGET_INVALID_STRING"); //$NON-NLS-1$
-
- }
- return checkXMLName(target);
- }
-
- /**
- * parsComment
- */
- public static String parseComment(String comment)
- {
- if (comment.indexOf("--") != -1) //$NON-NLS-1$
- {
- return UIPlugin.getResourceString("_WARN_COMMENT_INVALID_STRING"); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Validate the prefix conforms to the XML spec
- */
- public static String checkXMLPrefix(String prefix)
- {
- int length = prefix.length();
- if (length == 0)
- {
- return null;
- }
- char character;
-
- if (prefix.indexOf(" ") >= 0) //$NON-NLS-1$
- {
- return(UIPlugin.getResourceString("_WARN_PREFIX_HAS_SPACE")); //$NON-NLS-1$
- }
-
- for(int index = 0; index < length; index++)
- {
- character = prefix.charAt(index);
-
- if(!isXMLPrefixChar(character))
- {
- return UIPlugin.getString("_WARN_PREFIX_INVALID_CHAR", String.valueOf(character)); //$NON-NLS-1$
- }
- }
- return null;
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/W11OpenExternalEditorHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/W11OpenExternalEditorHelper.java
deleted file mode 100644
index a546a754e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/W11OpenExternalEditorHelper.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.util;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.util.IOpenExternalEditorHelper;
-import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
-import org.eclipse.wst.xsd.ui.internal.dialogs.IOpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.dialogs.XSDGraphViewerDialog;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class W11OpenExternalEditorHelper implements IOpenExternalEditorHelper, IOpenInNewEditor {
- private Object object;
- private IEditorInput editorInput;
-
- public W11OpenExternalEditorHelper(IEditorInput editorInput)
- {
- this.editorInput = editorInput;
- }
-
- public void setModel(Object object) {
- this.object = object;
- }
-
- public void openExternalEditor() {
- if (object instanceof WSDLBaseAdapter) {
- Object notifier = ((WSDLBaseAdapter) object).getTarget();
- Object openOnModel = getModelToOpenOn(notifier);
-
- if (openOnModel instanceof XSDConcreteComponent) {
- XSDConcreteComponent xsdComponent = (XSDConcreteComponent) openOnModel;
- XSDSchema schema = getSchema(xsdComponent);
- if (schema == null) return;
- if (schema.eResource() instanceof WSDLResourceImpl)
- {
- String fileName = schema.eResource().getURI().lastSegment();
- if (fileName == null) fileName = "WSDL"; //$NON-NLS-1$
- String editorName = Messages._UI_LABEL_INLINE_SCHEMA_OF + fileName;
- XSDGraphViewerDialog.openInlineSchema(editorInput, xsdComponent, schema, editorName);
- }
- else
- {
- XSDGraphViewerDialog.openXSDEditor(editorInput, xsdComponent.getSchema(), xsdComponent);
- }
- }
- }
- }
-
- public void openXSDEditor()
- {
- openExternalEditor();
- }
-
- protected XSDSchema getSchema(XSDConcreteComponent xsdComponent) {
- XSDSchema schema = xsdComponent.getSchema();
- if (schema == null) {
- Object notifier = ((WSDLBaseAdapter) object).getTarget();
- if (notifier instanceof XSDConcreteComponent) {
- schema = ((XSDConcreteComponent) notifier).getSchema();
- }
- }
-
- return schema;
- }
-
- public boolean linkApplicable() {
- boolean applicable = true;
-
- if (object instanceof IParameter) {
- IParameter param = (IParameter) object;
- String prefix = param.getComponentNameQualifier();
- if (prefix != null && prefix.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) {
- applicable = false;
- }
- }
-
- return applicable;
- }
-
- protected Object getModelToOpenOn(Object object) {
- if (object instanceof XSDElementDeclaration) {
- XSDElementDeclaration xsdElement = ((XSDElementDeclaration) object).getResolvedElementDeclaration();
- return xsdElement.getTypeDefinition();
- }
- else if (object instanceof Part) {
- Object elementOrType = ((Part) object).getElementDeclaration();
- if (elementOrType == null) {
- elementOrType = ((Part) object).getTypeDefinition();
- }
-
- return elementOrType;
- }
-
- return object;
- }
-
- /**
- * @param file
- * @return
- */
- protected boolean isInlineSchema(IFile file) {
- // Should there be a better test for this? The IFiles are different so we can't use file == wsdlFile.
- // return file.getFullPath().equals(wsdlFile.getFullPath());
- if (editorInput instanceof FileStoreEditorInput) {
- FileStoreEditorInput fileStoreEditorInput = (FileStoreEditorInput)editorInput;
- file.getFullPath().equals(fileStoreEditorInput.getURI().getPath());
- return true;
- }
- else if (editorInput instanceof IStorageEditorInput) {
- IStorageEditorInput storage = (IStorageEditorInput) editorInput;
- try {
- IPath path = storage.getStorage().getFullPath();
- if (path != null && path.equals(file.getFullPath())) {
- return true;
- }
- }
- catch (CoreException e) {
- }
- }
- else if (editorInput instanceof IFileEditorInput) {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- return file.getFullPath().equals(fileEditorInput.getFile().getFullPath());
- }
- return false;
- }
-
- public boolean isValid() {
- if (object instanceof WSDLBaseAdapter) {
- Object notifier = ((WSDLBaseAdapter) object).getTarget();
- Object openOnModel = getModelToOpenOn(notifier);
-
- // We check to ensure it's element != null. If it does, then it's a sign of a
- // bad reference (is invalid).
- if (openOnModel instanceof XSDConcreteComponent && ((XSDConcreteComponent) openOnModel).getElement() != null) {
- XSDConcreteComponent xsdComponent = (XSDConcreteComponent) openOnModel;
-
- XSDSchema schema = getSchema(xsdComponent);
- if (schema != null) {
- String schemaLocation = URIHelper.removePlatformResourceProtocol(schema.getSchemaLocation());
- IPath schemaPath = new Path(schemaLocation);
- if (schemaLocation.startsWith("http")) {
- return true;
- }
- if (editorInput instanceof FileEditorInput) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
- if (file != null && file.exists()) {
- return true;
- }
- }
- else if (editorInput instanceof FileStoreEditorInput) {
- return true;
-// Revisit
-// schemaLocation = schema.getSchemaLocation();
-// schemaPath = new Path(URIHelper.removeProtocol(schemaLocation));
-// IFileStore fileStore = EFS.getLocalFileSystem().getStore(schemaPath);
-// if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists())
-// {
-// return true;
-// }
- }
- else if (editorInput instanceof IStorageEditorInput) {
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
- public void showPreview() {
- Object xsdModel = null;
- String title = "";
- String info = "";
-
- Object notifier = ((WSDLBaseAdapter) object).getTarget();
- xsdModel = getModelToOpenOn(notifier);
- if (xsdModel instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent) xsdModel;
- title = namedComponent.getName();
- info = namedComponent.getTargetNamespace();
- }
-
- if (isValid() && xsdModel != null)
- {
- XSDGraphViewerDialog dialog = new XSDGraphViewerDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, info, xsdModel, "org.eclipse.wst.wsdl.ui.preview");
- dialog.setOpenExternalEditor(this);
- dialog.open();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLAdapterFactoryHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLAdapterFactoryHelper.java
deleted file mode 100644
index 7874c27aa..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLAdapterFactoryHelper.java
+++ /dev/null
@@ -1,46 +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.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLAdapterFactory;
-
-public class WSDLAdapterFactoryHelper {
- private static WSDLAdapterFactoryHelper instance;
-
- private AdapterFactory adapterFactory;
-
- public static WSDLAdapterFactoryHelper getInstance() {
- if (instance == null) {
- instance = new WSDLAdapterFactoryHelper();
- }
-
- return instance;
- }
-
- public Adapter adapt(Notifier target) {
- AdapterFactory factory = getWSDLAdapterFactory();
- return factory.adapt(target, factory);
- }
-
- public AdapterFactory getWSDLAdapterFactory() {
- if (adapterFactory == null) {
- adapterFactory = new WSDLAdapterFactory();
- }
- return adapterFactory;
- }
-
- public void setWSDLAdapterFactory(AdapterFactory factory) {
- adapterFactory = factory;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLEditorUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLEditorUtil.java
deleted file mode 100644
index 89fa8c9dc..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLEditorUtil.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.ui.internal.extensions.ExtensibleTypeSystemProvider;
-import org.eclipse.wst.wsdl.ui.internal.extensions.ITypeSystemProvider;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class WSDLEditorUtil extends WSDLConstants {
- protected static WSDLEditorUtil instance;
- protected NodeAssociationManager nodeAssociationManager = new NodeAssociationManager();
-
- protected HashMap elementNameToTypeMap = new HashMap();
-
- public static final int ELEMENT = 14;
- public static final int TYPE = 15;
-
- public static WSDLEditorUtil getInstance() {
- if (instance == null) {
- instance = new WSDLEditorUtil();
- }
- return instance;
- }
-
- public WSDLEditorUtil() {
- elementNameToTypeMap.put(BINDING_ELEMENT_TAG, new Integer(BINDING));
- elementNameToTypeMap.put(DEFINITION_ELEMENT_TAG, new Integer(DEFINITION));
- elementNameToTypeMap.put(DOCUMENTATION_ELEMENT_TAG, new Integer(DOCUMENTATION));
- elementNameToTypeMap.put(FAULT_ELEMENT_TAG, new Integer(FAULT));
- elementNameToTypeMap.put(IMPORT_ELEMENT_TAG, new Integer(IMPORT));
- elementNameToTypeMap.put(INPUT_ELEMENT_TAG, new Integer(INPUT));
- elementNameToTypeMap.put(MESSAGE_ELEMENT_TAG, new Integer(MESSAGE));
- elementNameToTypeMap.put(OPERATION_ELEMENT_TAG, new Integer(OPERATION));
- elementNameToTypeMap.put(OUTPUT_ELEMENT_TAG, new Integer(OUTPUT));
- elementNameToTypeMap.put(PART_ELEMENT_TAG, new Integer(PART));
- elementNameToTypeMap.put(PORT_ELEMENT_TAG, new Integer(PORT));
- elementNameToTypeMap.put(PORT_TYPE_ELEMENT_TAG, new Integer(PORT_TYPE));
- elementNameToTypeMap.put(SERVICE_ELEMENT_TAG, new Integer(SERVICE));
- elementNameToTypeMap.put(TYPES_ELEMENT_TAG, new Integer(TYPES));
- }
-
- public int getWSDLType(Element element) {
- int result = -1;
-
- Integer integer = (Integer) elementNameToTypeMap.get(element.getLocalName());
- if (integer != null) {
- result = integer.intValue();
- }
- return result;
- }
-
- protected List getParentElementChain(Element element) {
- List list = new ArrayList();
- while (element != null) {
- list.add(0, element);
- Node node = element.getParentNode();
- element = (node != null && node.getNodeType() == Node.ELEMENT_NODE) ? (Element) node : null;
- }
- return list;
- }
-
- public Object findModelObjectForElement(Definition definition, Element targetElement) {
- Object o = nodeAssociationManager.getModelObjectForNode(definition, targetElement);
- return o;
- }
-
- public Element getElementForObject(Object o) {
- return ((org.eclipse.wst.wsdl.WSDLElement) o).getElement();
- }
-
- public Node getNodeForObject(Object o) {
- return nodeAssociationManager.getNode(o);
- }
-
- // Provide a mapping between Definitions and ITypeSystemProviders
-// private Hashtable typeSystemProviders = new Hashtable();
- private ITypeSystemProvider typeSystemProvider;
-
- public ITypeSystemProvider getTypeSystemProvider(Definition definition) {
- if (typeSystemProvider == null) {
- typeSystemProvider = new ExtensibleTypeSystemProvider();
- }
- return typeSystemProvider;
- }
-
- public void setTypeSystemProvider(Definition definition, ITypeSystemProvider typeSystemProvider) {
- // typeSystemProviders.put(definition,typeSystemProvider);
- }
-
- public static QName createQName(Definition definition, String prefixedName) {
- QName qname = null;
- if (prefixedName != null) {
- int index = prefixedName.indexOf(":"); //$NON-NLS-1$
-// String prefix = (index == -1) ? null : prefixedName.substring(0, index);
- String prefix = (index == -1) ? "" : prefixedName.substring(0, index);
- if (prefix != null) {
- String namespace = definition.getNamespace(prefix);
- if (namespace != null) {
- String localPart = prefixedName.substring(index + 1);
- qname = new QName(namespace, localPart);
- }
- }
- }
- return qname;
- }
-
- public List getExtensibilityElementNodes(ExtensibleElement extensibleElement) {
- // For Types, I need to get all the schemas
- if (extensibleElement instanceof Types) {
- Types xsdEE = (Types) extensibleElement;
- return xsdEE.getSchemas();
- }
- /*
- * List childList = new ArrayList();
- *
- * Element parentElement = getElementForObject(extensibleElement); if
- * (parentElement != null) {
- *
- * NodeList nodeList = parentElement.getChildNodes(); int
- * nodeListLength = nodeList.getLength(); for (int i = 0; i <
- * nodeListLength; i++) { childList.add(nodeList.item(i)); } HashMap
- * extensibleElementTable = new HashMap(); for (Iterator i =
- * extensibleElement.getEExtensibilityElements().iterator();
- * i.hasNext();) { ExtensibilityElement extensibilityElement =
- * (ExtensibilityElement)i.next(); if (extensibilityElement != null) {
- * Element element = getElementForObject(extensibilityElement); if
- * (element != null) { extensibleElementTable.put(element, element); } } }
- *
- * for (Iterator i = childList.iterator(); i.hasNext();) { Object o =
- * i.next(); if (extensibleElementTable.get(o) == null) { i.remove(); } } }
- * return childList;
- */
- return extensibleElement.getEExtensibilityElements();
- }
-
- /*
- * Returns a list of 'children' of the given object model (WSDLElement).
- */
- public static List getModelGraphViewChildren(Object object) {
- List childList = new ArrayList();
-
- if (object instanceof PortType) {
- PortType portType = (PortType) object;
- childList.addAll(portType.getOperations());
- }
- else if (object instanceof Operation) {
- Operation operation = (Operation) object;
-
- if (operation.getEInput() != null) {
- childList.add(operation.getEInput());
- }
- if (operation.getEOutput() != null) {
- childList.add(operation.getEOutput());
- }
- childList.addAll(operation.getFaults().values());
- }
- else if (object instanceof MessageReference) {
- MessageReference messageReference = (MessageReference) object;
- childList.add(messageReference.getEMessage());
- }
-
- return childList;
- }
-
- public static String getTargetNamespaceURIForSchema(String uri) {
- String result = null;
- try {
- URL url = new URL(uri);
- InputStream inputStream = url.openStream();
- result = WSDLEditorUtil.getTargetNamespaceURIForSchema(inputStream);
- }
- catch (Exception e) {
- }
- return result;
- }
-
- public static String getTargetNamespaceURIForSchema(InputStream input) {
- TargetNamespaceURIContentHandler handler = new TargetNamespaceURIContentHandler();
- ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(WSDLEditorUtil.class.getClassLoader());
- try {
- XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
- reader.setContentHandler(handler);
- reader.parse(new InputSource(input));
- }
- catch (StopParseException e) {
- // this is a normal exception to stop parsing early,
- // when info is found, so we can safely ignore
- }
- catch (SAXException e) {
- // TODO: these should be logged, but the obvious choice,
- // WSDLEditorPlugin.logMessage(message) is an empy implementation,
- // so, for now, we'll at least print out.
- e.printStackTrace();
- }
- catch (IOException e) {
- // TODO: this should be logged, but the obvious choice,
- // WSDLEditorPlugin.logMessage(message) is an empy implementation,
- // so, for now, we'll at least print out.
- e.printStackTrace();
- }
- finally {
- Thread.currentThread().setContextClassLoader(prevClassLoader);
- }
- return handler.targetNamespaceURI;
- }
-
- /**
- * This is a special exception that is used to stop parsing when required
- * information is found.
- */
- static class StopParseException extends org.xml.sax.SAXException {
- static final long serialVersionUID = 1L;
-
- /**
- * Constructor StopParseException.
- */
- StopParseException() {
- super("targetnamespace found, no need to continue the parse");
- }
- }
-
- protected static class TargetNamespaceURIContentHandler extends DefaultHandler {
-
-
- public String targetNamespaceURI;
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- if (localName.equals("schema") || localName.equals("definitions")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- int nAttributes = attributes.getLength();
- for (int i = 0; i < nAttributes; i++) {
- if (attributes.getLocalName(i).equals("targetNamespace")) //$NON-NLS-1$
- {
- targetNamespaceURI = attributes.getValue(i);
- break;
- }
- }
- }
- throw new StopParseException();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLResourceUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLResourceUtil.java
deleted file mode 100644
index 108c16337..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLResourceUtil.java
+++ /dev/null
@@ -1,145 +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.util;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLModelLocator;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.w3c.dom.Element;
-
-
-public class WSDLResourceUtil
-{
- public static void reloadDirectives(Definition definition)
- {
- Resource rootResource = definition.eResource();
- ResourceSet resourceSet = rootResource.getResourceSet();
-
- for (Iterator i = resourceSet.getResources().iterator(); i.hasNext();)
- {
- Resource resource = (Resource) i.next();
- if (resource != rootResource)
- {
- // TODO... consider unloading the resources
- // resource.unload();
- i.remove();
- }
- }
- ReloadDirectiveVisitor visitor = new ReloadDirectiveVisitor();
- visitor.visitDefinition(definition);
- }
-
- static class ReloadDirectiveVisitor
- {
-
- public void visitImport(Import theImport)
- {
- // force the import to reload
- Element element = WSDLEditorUtil.getInstance().getElementForObject(theImport);
- if (element != null)
- {
- ((WSDLElementImpl)theImport).elementChanged(element);
- }
- }
-
- public void visitXSDSchemaDirective(XSDSchemaDirective directive)
- {
- // force the schema directive to reload
- Element element = directive.getElement();
- if (element != null)
- {
- directive.elementAttributesChanged(element);
- }
- }
-
- public void visitDefinition(Definition definition)
- {
- if (definition != null)
- {
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- visitImport((Import) i.next());
- }
- Types types = definition.getETypes();
- if (types != null)
- {
-
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement e = (XSDSchemaExtensibilityElement) o;
- if (e.getSchema() != null)
- {
- visitSchema(e.getSchema());
- }
- }
- }
- }
- }
- }
-
- public void visitSchema(XSDSchema schema)
- {
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- visitXSDSchemaDirective((XSDSchemaDirective) o);
- }
- }
- }
- }
-
-
- public static class InternalURIResolver implements WSDLModelLocator
- {
- //IdResolver idResolver = new IdResolverImpl(null, true);
- org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver resolver = URIResolverPlugin.createResolver();
-
- InternalURIResolver()
- {
- }
-
- public String resolveURI(String baseLocation, String namespace, String location)
- {
- String resolvedLocation = resolver.resolve(baseLocation, namespace, location);
-
- // here's an ugly hack... Platform.resolve() returns Windows files with the pattern "file:D:/hello.xsd"
- // but EMF's URI class expects a pattern like this "file:///D:/hello.xsd"
- //
- if (resolvedLocation != null)
- {
- String fileProtocol = "file:"; //$NON-NLS-1$
- if (resolvedLocation.startsWith(fileProtocol) && !resolvedLocation.startsWith(fileProtocol + "/")) //$NON-NLS-1$
- {
- resolvedLocation = resolvedLocation.substring(fileProtocol.length());
- }
- resolvedLocation = URIHelper.addImpliedFileProtocol(resolvedLocation);
- }
- // end ugly hack
- return resolvedLocation;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLSetComponentHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLSetComponentHelper.java
deleted file mode 100644
index 07b472361..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/WSDLSetComponentHelper.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.util;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementDeclarationAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddImportAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddWSISchemaImportAction;
-import org.eclipse.wst.wsdl.util.WSDLConstants;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-
-public class WSDLSetComponentHelper {
- private Definition definition;
- private IFile currentIFile;
-
- public WSDLSetComponentHelper(IFile iFile, Definition definition) {
- currentIFile = iFile;
- this.definition = definition;
- }
-
- public void setWSDLComponent(WSDLElement inputElement, String property, ComponentSpecification spec) {
- addImportIfNecessary(spec);
- String componentObject = getPrefixedComponentName(spec);
-
- org.w3c.dom.Element wsdlElement = inputElement.getElement();
-
- wsdlElement.setAttribute(property, componentObject); //$NON-NLS-1$
- }
-
- public void setXSDTypeComponent(Part part, ComponentSpecification spec) {
- if (spec.getName() != null && spec.getQualifier() != null) {
- addImportIfNecessary(spec);
- }
- String componentObject = getPrefixedComponentName(spec);
-
- ComponentReferenceUtil.setComponentReference((Part) part, true, componentObject);
- }
-
- public void setXSDElementComponent(Part part, ComponentSpecification spec) {
- addImportIfNecessary(spec);
- String componentObject = getPrefixedComponentName(spec);
-
- ComponentReferenceUtil.setComponentReference((Part) part, false, componentObject);
- }
-
- /*
- * Return the prefixed component name described by the given
- * ComponentSpecification object.
- */
- public String getPrefixedComponentName(ComponentSpecification spec) {
- String name = (String) spec.getName();
- List prefixes = getPrefixes(definition, spec.getQualifier());
- if (prefixes.size() > 0) {
- name = prefixes.get(0) + ":" + name; //$NON-NLS-1$
- }
-
- return name;
- }
-
- private List getPrefixes(Definition definition, String namespace) {
- List list = new ArrayList();
- Map map = definition.getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();) {
- String prefix = (String) i.next();
- String theNamespace = (String) map.get(prefix);
- if (theNamespace != null && theNamespace.equals(namespace)) {
- list.add(prefix);
- }
- }
- return list;
- }
-
-
- private void addImportIfNecessary(ComponentSpecification spec) {
- boolean foundMatch = false;
-
- // Check itself
- Path currentFileLocation = new Path(currentIFile.getLocation().toString());
- if (spec.getFile() == null || currentFileLocation.equals(spec.getFile().getLocation())) {
- // if the ComponentSpecification's getFile() returns null, forget about adding necessary imports
- foundMatch = true;
- }
-
- // Check regular Imports
- if (!foundMatch) {
- Iterator importsIt = definition.getEImports().iterator();
-
- while (importsIt.hasNext()) {
- String importLocation = ""; //$NON-NLS-1$
- ImportImpl importItem = (ImportImpl) importsIt.next();
- importItem.importDefinitionOrSchema();
-
- if (importItem.getESchema() != null) {
- XSDSchema schema = importItem.getESchema();
- importLocation = getNormalizedLocation(schema.getSchemaLocation());
- }
- else {
- Definition importDefinition = importItem.getEDefinition();
- importLocation = getNormalizedLocation(importDefinition.getLocation());
- }
-
- if (spec.getFile().getLocation().equals(new Path(importLocation))) {
- foundMatch = true;
- break;
- }
- }
- }
-
- // Check inline Schemas
- if (!foundMatch) {
- List imports = new ArrayList();
-
- if (definition.getETypes() != null) {
- Iterator it = definition.getETypes().getEExtensibilityElements().iterator();
- while (it.hasNext()) {
- XSDSchemaExtensibilityElement eeElement = (XSDSchemaExtensibilityElement) it.next();
- XSDSchema schema = eeElement.getSchema();
- if (schema.getTargetNamespace() == null || schema.getTargetNamespace().equals("")) { //$NON-NLS-1$
- Iterator contents = schema.getContents().iterator();
- while (contents.hasNext()) {
- XSDSchemaContent content = (XSDSchemaContent) contents.next();
- if (content instanceof XSDImport) {
- imports.add(content);
- }
- }
- }
- }
- }
-
- Iterator importIt = imports.iterator();
- while (importIt.hasNext()) {
- XSDImport importItem = (XSDImport) importIt.next();
- XSDSchema resolvedSchema = importItem.getResolvedSchema();
- String resolvedString = resolvedSchema.getSchemaLocation();
- String importLocation = getNormalizedLocation(resolvedString);
-
- if (spec.getFile().getLocation().equals(new Path(importLocation))) {
- foundMatch = true;
- break;
- }
- }
- }
-
- if (!foundMatch) {
- boolean wsiStyleImport = isXSDSchemaFile(spec);
- if (wsiStyleImport) {
- AddElementDeclarationAction action = new AddElementDeclarationAction(definition, spec.getQualifier(), "xsd"); //$NON-NLS-1$
- action.run();
-
- String location = URIHelper.getRelativeURI(spec.getFile().getLocation(), currentIFile.getLocation());
- AddWSISchemaImportAction addImport = new AddWSISchemaImportAction(definition, spec.getQualifier(), location);
- addImport.run();
- }
- else {
- String newSelectedFileLoc = spec.getFile().getLocation().toOSString();
- String currentFileLoc = getNormalizedLocation(definition.getLocation());
- String relativeLoc = ComponentReferenceUtil.computeRelativeURI(newSelectedFileLoc, currentFileLoc, true);
-
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
- String namespace = spec.getQualifier();
-
- AddImportAction addImportAction = new AddImportAction(null, definition, definitionElement, prefix, namespace, relativeLoc);
- addImportAction.run();
-
- String uniquePrefix = getUniquePrefix(definition, prefix);
- definitionElement.setAttribute("xmlns:" + uniquePrefix, namespace); //$NON-NLS-1$
- }
- }
- }
- /*
- * Try to determine if the passed in ComponentSpecification refers to
- * an XSD or WSDL file. If it's an XSD, return true.
- */
- private boolean isXSDSchemaFile(ComponentSpecification spec) {
- String fileLocation = spec.getFile().getLocation().toOSString();
- int periodIndex = fileLocation.lastIndexOf("."); //$NON-NLS-1$
-
- if (periodIndex > 0) {
- String extension = fileLocation.substring(periodIndex + 1);
- if (extension.equalsIgnoreCase("xsd")) { //$NON-NLS-1$
- return true;
- }
- }
-
- return false;
- }
-
- private String getUniquePrefix(Definition definition, String initPrefix) {
- String uniquePrefix;
- Map map = definition.getNamespaces();
-
- if (definition.getNamespace(initPrefix) == null) {
- uniquePrefix = initPrefix;
- }
- else {// if used, then try to create a unique one
- String tempPrefix = initPrefix;
- int i = 1;
- while(map.containsKey(tempPrefix + i)) {
- i++;
- }
- uniquePrefix = tempPrefix + i;
- }
- return uniquePrefix;
- }
-
- private String getNormalizedLocation(String location) {
- try {
- URL url = new URL(location);
- URL resolvedURL = FileLocator.resolve(url);
- location = resolvedURL.getPath();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- return location;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDComponentHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDComponentHelper.java
deleted file mode 100644
index 7873f8fe4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDComponentHelper.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.util;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDElementDeclarationCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDSchemaCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-/**
- * Input createInput(Operation operation, String style) --- create default message/part/etc.
- * Object createInputParameter(Operation operation, Input input, Style style) --
- *
- * Command getCreateInputParameterCommand(Operation operation, Input input, Style style)
- *
- * Message/part/Element
- * Message/part/Element/sequence/Element
- * (x) Message/part
- */
-public class XSDComponentHelper {
- /*
- * Create an XSDElement with type anonymous. Set the given part to reference the newly created
- * XSDElement.
- */
- public static XSDElementDeclaration createAnonymousXSDElementDefinition(String baseName, Part part) {
- XSDElementDeclaration anonElement = createXSDElementDeclarationCommand(part.getEnclosingDefinition(), baseName, part);
- XSDComplexTypeDefinition newAnon = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- XSDParticle newXSDParticle = XSDFactory.eINSTANCE.createXSDParticle();
- XSDModelGroup newXSDModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
- newXSDModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
-
- anonElement.setAnonymousTypeDefinition(newAnon);
- newXSDParticle.setContent(newXSDModelGroup);
- newAnon.setContent(newXSDParticle);
-
- return anonElement;
- }
-
- public static XSDElementDeclaration createXSDElementDeclarationCommand(Definition definition, String baseName, Object context) {
- XSDElementDeclaration xsdElement = null;
-
- if (context instanceof Part) {
- AddXSDElementDeclarationCommand command = new AddXSDElementDeclarationCommand(definition, ""); //$NON-NLS-1$
-
- // Find a unique name
- XSDSchema xsdSchema = command.getSchema();
- String name = NameUtil.getXSDElementName(baseName, xsdSchema);
- command.run(name);
- // The 'workaround' below is causing me to hang..... The latest WTP is needed.
-// xsdElement = xsdSchema.resolveElementDeclaration(name);
- xsdElement = command.getXSDElement();
- }
- else if (context instanceof XSDModelGroup) {
- XSDModelGroup modelGroup = (XSDModelGroup) context;
- XSDParticle newParticle = XSDFactory.eINSTANCE.createXSDParticle();
- String name = NameUtil.getXSDElementName(baseName, modelGroup);
-
- AddXSDElementCommand command = new AddXSDElementCommand(Messages._UI_ACTION_ADD_XML_SCHEMA_ELEMENT, modelGroup);
- command.execute();
- xsdElement = (XSDElementDeclaration) command.getAddedComponent();
- xsdElement.setName(name);
- xsdElement.setTypeDefinition(getXSDStringType(modelGroup));
-
- newParticle.setContent(xsdElement);
- modelGroup.getContents().add(newParticle);
- }
- else {
- AddXSDElementCommand command = new AddXSDElementCommand();
- command.execute();
- xsdElement = (XSDElementDeclaration) command.getAddedComponent();
- xsdElement.setName(baseName);
- }
-
- return xsdElement;
- }
-
- public static void addXSDElementToModelGroup(XSDElementDeclaration parent, XSDElementDeclaration child) {
- if (parent.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition) {
- XSDComplexTypeDefinition anonType = (XSDComplexTypeDefinition) parent.getAnonymousTypeDefinition();
- if (anonType.getContent() instanceof XSDParticle) {
- XSDParticle particle = (XSDParticle) anonType.getContent();
- if (particle.getContent() instanceof XSDModelGroup) {
- // Create XSDParticle
- XSDModelGroup modelGroup = (XSDModelGroup) particle.getContent();
- addXSDElementToModelGroup(modelGroup, child);
- }
- else {
- // Create XSDModelGroup -- XSDParticle
- addXSDElementToModelGroup(particle, child);
- }
- }
- else {
- // Create XSDParticle --> XSDModelGroup --> XSDParticle
- XSDParticle newParticle = XSDFactory.eINSTANCE.createXSDParticle();
- anonType.setContent(newParticle);
- addXSDElementToModelGroup(newParticle, child);
- }
- }
- else {
- // Create Anonymous Type --> XSDParticle --> XSDModelGroup --> XSDParticle
- XSDComplexTypeDefinition newAnonType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- parent.setAnonymousTypeDefinition(newAnonType);
-
- XSDParticle newParticle = XSDFactory.eINSTANCE.createXSDParticle();
- newAnonType.setContent(newParticle);
- addXSDElementToModelGroup(newParticle, child);
- }
- }
-
- public static void addXSDElementToModelGroup(XSDParticle particle, XSDElementDeclaration child) {
- XSDModelGroup newXSDModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
- newXSDModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
- particle.setContent(newXSDModelGroup);
- addXSDElementToModelGroup(newXSDModelGroup, child);
- }
-
- public static void addXSDElementToModelGroup(XSDModelGroup modelGroup, XSDElementDeclaration child) {
- // Create XSDParticle
- XSDParticle newParticle = XSDFactory.eINSTANCE.createXSDParticle();
- newParticle.setContent(child);
- modelGroup.getContents().add(newParticle);
- }
-
- /*
- * Return it's XSDModelGroup. If one does not exist, create one
- */
- public static XSDModelGroup getXSDModelGroup(XSDElementDeclaration xsdElement, Definition definition) {
- XSDModelGroup modelGroup = null;
- XSDComplexTypeDefinition anonType = null;
-
- if (xsdElement.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition) {
- anonType = (XSDComplexTypeDefinition) xsdElement.getAnonymousTypeDefinition();
- }
- else {
- // Create Anonymous Type
- anonType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- anonType.setName("NewComplexTypeName"); //$NON-NLS-1$
- getXSDSchema(definition).getContents().add(anonType);
- xsdElement.setAnonymousTypeDefinition(anonType);
- }
-
- if (anonType != null) {
- modelGroup = getXSDModelGroup(anonType);
- }
-
- return modelGroup;
- }
-
- /*
- * Return it's XSDModelGroup. If one does not exist, create one
- */
- public static XSDModelGroup getXSDModelGroup(XSDComplexTypeDefinition xsdComplexType) {
- XSDModelGroup modelGroup = null;
- XSDParticle particle = null;
- // Check for XSDParticle
- if (xsdComplexType.getContent() instanceof XSDParticle) {
- particle = (XSDParticle) xsdComplexType.getContent();
- }
- else {
- particle = XSDFactory.eINSTANCE.createXSDParticle();
- modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
- modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
- particle.setContent(modelGroup);
- xsdComplexType.setContent(particle);
- }
-
- // Check for XSDModelGroup
- if (particle.getContent() instanceof XSDModelGroup) {
- modelGroup = (XSDModelGroup) particle.getContent();
- }
- else {
- modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
- modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
- particle.setContent(modelGroup);
- }
-
- return modelGroup;
- }
-
- /*
- *
- */
- public static XSDComplexTypeDefinition createXSDComplexTypeDefiniion(String complexTypeName, Part part) {
- XSDComplexTypeDefinition newComplexType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- XSDParticle newXSDParticle = XSDFactory.eINSTANCE.createXSDParticle();
- XSDModelGroup newXSDModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
- newXSDModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
-
- newComplexType.setName(complexTypeName);
- newComplexType.setContent(newXSDParticle);
- newXSDParticle.setContent(newXSDModelGroup);
- getXSDSchema(part.getEnclosingDefinition()).getContents().add(newComplexType);
-
- return newComplexType;
- }
-
- public static void addXSDElementToModelGroup(XSDComplexTypeDefinition parent, XSDElementDeclaration child) {
- if (parent.getContent() instanceof XSDParticle) {
- XSDParticle particle = (XSDParticle) parent.getContent();
- if (particle.getContent() instanceof XSDModelGroup) {
- // Create XSDParticle
- XSDModelGroup modelGroup = (XSDModelGroup) particle.getContent();
- addXSDElementToModelGroup(modelGroup, child);
- }
- else {
- // Create XSDModelGroup -- XSDParticle
- addXSDElementToModelGroup(particle, child);
- }
- }
- else {
- // Create XSDParticle --> XSDModelGroup --> XSDParticle
- XSDParticle newParticle = XSDFactory.eINSTANCE.createXSDParticle();
- parent.setContent(newParticle);
- addXSDElementToModelGroup(newParticle, child);
- }
- }
-
- /*
- * Return the inline XSDSchema associated with this WSDL.
- * Look for the inline XSDSchema with the same namespace as the WSDL.
- * If this inline XSDSchema does not exists, create it.
- */
- public static XSDSchema getXSDSchema(Definition definition) {
- XSDSchema schema = null;
- String wsdlTargetNamespace = definition.getTargetNamespace();
-
- Types types = (Types) definition.getTypes();
- if (types != null) {
-
- Iterator eeIt = types.getExtensibilityElements().iterator();
- while (eeIt.hasNext()) {
- Object eeElement = eeIt.next();
- if (eeElement instanceof XSDSchemaExtensibilityElement) {
- XSDSchemaExtensibilityElement ee = (XSDSchemaExtensibilityElement) eeElement;
- if (ee.getSchema().getTargetNamespace() != null &&
- ee.getSchema().getTargetNamespace().equals(wsdlTargetNamespace)) {
- schema = ee.getSchema();
- break;
- }
- }
- }
- }
-
- if (schema == null) {
- // We need to create the schema
- AddXSDSchemaCommand command = new AddXSDSchemaCommand(definition);
- command.run();
- XSDSchemaExtensibilityElement eeElement = (XSDSchemaExtensibilityElement) command.getWSDLElement();
- schema = eeElement.getSchema();
- }
-
- return schema;
- }
-
- private static XSDSimpleTypeDefinition getXSDStringType(XSDComponent component) {
- XSDSchema schema = component.getSchema();
- return schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDTypeSystemProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDTypeSystemProvider.java
deleted file mode 100644
index bf913c9cd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/util/XSDTypeSystemProvider.java
+++ /dev/null
@@ -1,212 +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.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.extensions.ITypeSystemProvider;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-
-public class XSDTypeSystemProvider implements ITypeSystemProvider
-{
- public List getPrefixes(Definition definition, String namespace)
- {
- List list = new ArrayList();
- Map map = definition.getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- String theNamespace = (String) map.get(prefix);
- if (theNamespace != null && theNamespace.equals(namespace))
- {
- list.add(prefix);
- }
- }
- return list;
- }
-
- public List getPrefixedNames(Definition definition, String namespace, String localName)
- {
- List list = new ArrayList();
- for (Iterator i = getPrefixes(definition, namespace).iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- String name = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; //$NON-NLS-1$
- list.add(name);
- }
- return list;
- }
-
- protected void addNamedComponents(Definition definition, List list, List namedComponents)
- {
- for (Iterator i = namedComponents.iterator(); i.hasNext();)
- {
- XSDNamedComponent component = (XSDNamedComponent) i.next();
- list.addAll(getPrefixedNames(definition, component.getTargetNamespace(), component.getName()));
- }
- }
-
- public void initWSIStyleImports(XSDSchema xsdSchema)
- {
- if (xsdSchema.getTargetNamespace() == null)
- {
- for (Iterator i = xsdSchema.getContents().iterator(); i.hasNext();)
- {
- XSDSchemaContent content = (XSDSchemaContent) i.next();
- if (content instanceof XSDImportImpl)
- {
- XSDImportImpl xsdImport = (XSDImportImpl) content;
- XSDSchema schema = (XSDSchema)xsdImport.getResolvedSchema();
- if (schema == null)
- {
- schema = xsdImport.importSchema();
- }
- }
- }
- }
- }
-
- public List getAvailableTypeNames(Definition definition, int typeNameCategory)
- {
- List list = new ArrayList();
-
- if (typeNameCategory == ITypeSystemProvider.BUILT_IN_TYPE) {
- list = getBuiltInTypeNamesList(definition);
- }
- else {
- Types types = definition.getETypes();
- if (types != null)
- {
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchema schema = ((XSDSchemaExtensibilityElement) o).getSchema();
- if (schema != null)
- {
- initWSIStyleImports(schema);
- addNamedComponents(definition, list, schema.getTypeDefinitions());
- }
- }
- }
- }
-
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- Import theImport = (Import) i.next();
- XSDSchema schema = theImport.getESchema();
- if (schema != null)
- {
- addNamedComponents(definition, list, schema.getTypeDefinitions());
- }
- }
- list.addAll(getBuiltInTypeNamesList(definition));
- }
-
- return list;
- }
-
- public List getAvailableTypes(Definition definition, XSDSchema schema, int typeNameCategory)
- {
- List keepTypes = new ArrayList();
- Iterator typeIterator = schema.getTypeDefinitions().iterator();
- // Filter out unwanted Types
- if (typeNameCategory == ITypeSystemProvider.USER_DEFINED_COMPLEX_TYPE) {
- while (typeIterator.hasNext()) {
- Object type = typeIterator.next();
- if (type instanceof XSDComplexTypeDefinition) {
- keepTypes.add(type);
- }
- }
- }
- else if (typeNameCategory == ITypeSystemProvider.USER_DEFINED_SIMPLE_TYPE) {
- while (typeIterator.hasNext()) {
- Object type = typeIterator.next();
- if (type instanceof XSDSimpleTypeDefinition) {
- keepTypes.add(type);
- }
- }
- }
-
- //addNamedComponents(definition, list, keepTypes);
- //return list;
- return keepTypes;
- }
-
- public java.util.List getBuiltInTypeNamesList(Definition definition)
- {
- List items = new ArrayList();
-// if (definition != null)
-// {
-// List prefixes = getPrefixes(definition, WSDLConstants.XSD_NAMESPACE_URI);
-// for (Iterator i = prefixes.iterator(); i.hasNext();)
-// {
-// String prefix = (String) i.next();
-// for (int j = 0; j < XSDDOMHelper.dataType.length; j++)
-// {
-// String localName = XSDDOMHelper.dataType[j][0];
-// String name = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName;
-// items.add(name);
-// }
-// }
-// }
- return items;
- }
- public List getAvailableElementNames(Definition definition)
- {
- List list = new ArrayList();
- Types types = definition.getETypes();
- if (types != null)
- {
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchema schema = ((XSDSchemaExtensibilityElement) o).getSchema();
- if (schema != null)
- {
- initWSIStyleImports(schema);
- addNamedComponents(definition, list, schema.getElementDeclarations());
- }
- }
- }
- }
-
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- Import theImport = (Import) i.next();
- XSDSchema schema = theImport.getESchema();
- if (schema != null)
- {
- addNamedComponents(definition, list, schema.getElementDeclarations());
- }
- }
- return list;
- }
- public int getCategoryForTypeName(Definition definition, String typeName)
- {
- return 0;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BaseRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BaseRenamer.java
deleted file mode 100644
index a99eb5fb0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BaseRenamer.java
+++ /dev/null
@@ -1,44 +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.visitor;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-
-public abstract class BaseRenamer extends WSDLVisitor
-{
- protected String newName;
- protected WSDLElement globalComponent;
-
- public BaseRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent.getEnclosingDefinition());
- this.globalComponent = globalComponent;
- this.newName = newName;
- }
-
- public String getNewQName()
- {
- String qName = null;
- if (newName != null)
- {
- Definition definition = globalComponent.getEnclosingDefinition();
- qName = definition.getPrefix(definition.getTargetNamespace());
- qName += ":" + newName; //$NON-NLS-1$
- }
- else
- {
- qName = newName;
- }
-
- return qName;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BindingRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BindingRenamer.java
deleted file mode 100644
index 3d1485a15..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/BindingRenamer.java
+++ /dev/null
@@ -1,42 +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.visitor;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class BindingRenamer extends BaseRenamer
-{
- /**
- * Constructor for BindingRenamer.
- * @param globalComponent
- * @param newName
- */
- public BindingRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent, newName);
- }
-
- public void visitPort(Port port)
- {
- super.visitPort(port);
- Binding binding = port.getEBinding();
- if (globalComponent.equals(binding))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(port);
- element.setAttribute("binding", getNewQName()); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/MessageRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/MessageRenamer.java
deleted file mode 100644
index a85b95fe9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/MessageRenamer.java
+++ /dev/null
@@ -1,63 +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.visitor;
-
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class MessageRenamer extends BaseRenamer
-{
- /**
- * Constructor for MessageRenamer.
- * @param globalComponent
- * @param newName
- */
- public MessageRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent, newName);
- }
-
- public void visitInput(Input input)
- {
- super.visitInput(input);
- Message message = input.getEMessage();
- if (globalComponent.equals(message))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(input);
- element.setAttribute("message", getNewQName()); //$NON-NLS-1$
- }
- }
-
- public void visitOutput(Output output)
- {
- super.visitOutput(output);
- if (globalComponent.equals(output))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(output);
- element.setAttribute("message", getNewQName()); //$NON-NLS-1$
- }
- }
-
- public void visitFault(Fault fault)
- {
- super.visitFault(fault);
- if (globalComponent.equals(fault))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(fault);
- element.setAttribute("message", getNewQName()); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/PortTypeRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/PortTypeRenamer.java
deleted file mode 100644
index 8959c831e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/PortTypeRenamer.java
+++ /dev/null
@@ -1,42 +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.visitor;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class PortTypeRenamer extends BaseRenamer
-{
- /**
- * Constructor for PortTypeRenamer.
- * @param globalComponent
- * @param newName
- */
- public PortTypeRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent, newName);
- }
-
- public void visitBinding(Binding binding)
- {
- super.visitBinding(binding);
- PortType portType = binding.getEPortType();
-
- if (globalComponent.equals(portType))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- element.setAttribute("type", getNewQName()); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitor.java
deleted file mode 100644
index f86827490..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitor.java
+++ /dev/null
@@ -1,197 +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.visitor;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-
-public class WSDLVisitor
-{
- protected Definition definition;
-
-
- public WSDLVisitor(Definition definition)
- {
- this.definition = definition;
- }
-
-
- public void visitDefinition()
- {
- visitBindings();
- visitMessages();
- visitPortTypes();
- visitServices();
- }
-
- public void visitBindings()
- {
- for (Iterator iterator = definition.getEBindings().iterator(); iterator.hasNext(); )
- {
- Binding binding = (Binding)iterator.next();
- visitBinding(binding);
- }
- }
-
- public void visitMessages()
- {
- for (Iterator iterator = definition.getEMessages().iterator(); iterator.hasNext(); )
- {
- Message message = (Message)iterator.next();
- visitMessage(message);
- }
- }
-
- public void visitPortTypes()
- {
- for (Iterator iterator = definition.getEPortTypes().iterator(); iterator.hasNext(); )
- {
- PortType portType = (PortType)iterator.next();
- visitPortType(portType);
- }
- }
-
- public void visitServices()
- {
- for (Iterator iterator = definition.getEServices().iterator(); iterator.hasNext(); )
- {
- Service service = (Service)iterator.next();
- visitService(service);
- }
- }
-
- public void visitBinding(Binding binding)
- {
- PortType portType = binding.getEPortType();
- if (portType != null)
- {
- visitPortType(portType);
- }
-
- for (Iterator iterator = binding.getEBindingOperations().iterator(); iterator.hasNext(); )
- {
- BindingOperation bindingOperation = (BindingOperation)iterator.next();
- visitBindingOperation(bindingOperation);
- }
- }
-
- public void visitPortType(PortType portType)
- {
- for (Iterator iterator = portType.getEOperations().iterator(); iterator.hasNext(); )
- {
- Operation operation = (Operation)iterator.next();
- visitOperation(operation);
- }
- }
-
- public void visitBindingOperation(BindingOperation bindingOperation)
- {
-// BindingInput bindingInput = bindingOperation.getEBindingInput();
-// BindingOutput bindingOutput = bindingOperation.getEBindingOutput();
- }
-
- public void visitOperation(Operation operation)
- {
- Input input = operation.getEInput();
- Output output = operation.getEOutput();
-
- if (input != null)
- {
- visitInput(input);
- }
- if (output != null)
- {
- visitOutput(output);
- }
-
- for (Iterator iterator = operation.getEFaults().iterator(); iterator.hasNext(); )
- {
- Fault fault = (Fault)iterator.next();
- if (fault != null)
- {
- visitFault(fault);
- }
- }
-
- }
-
- public void visitPart(Part part)
- {
-// XSDTypeDefinition type = part.getTypeDefinition();
- }
-
- public void visitMessage(Message message)
- {
- for (Iterator iterator = message.getEParts().iterator(); iterator.hasNext(); )
- {
- Part part = (Part)iterator.next();
- visitPart(part);
- }
- }
-
- public void visitInput(Input input)
- {
- Message message = input.getEMessage();
- if (message != null)
- {
- visitMessage(message);
- }
- }
-
- public void visitOutput(Output output)
- {
- Message message = output.getEMessage();
- if (message != null)
- {
- visitMessage(message);
- }
- }
-
- public void visitFault(Fault fault)
- {
- Message message = fault.getEMessage();
- if (message != null)
- {
- visitMessage(message);
- }
- }
-
- public void visitPort(Port port)
- {
- Binding binding = port.getEBinding();
- if (binding != null)
- {
- visitBinding(binding);
- }
- }
-
- public void visitService(Service service)
- {
- for (Iterator iterator = service.getEPorts().iterator(); iterator.hasNext(); )
- {
- Port port = (Port)iterator.next();
- visitPort(port);
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitorForParameters.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitorForParameters.java
deleted file mode 100644
index 0d99ec597..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitorForParameters.java
+++ /dev/null
@@ -1,97 +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.visitor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.adapters.visitor.W11XSDVisitorForFields;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class WSDLVisitorForParameters
-{
- public List concreteComponents = new ArrayList();
- public List thingsToListenTo = new ArrayList();
-
- public void visitMessageReference(MessageReference messageReference)
- {
- if (messageReference.getEMessage() != null)
- {
- visitMessage(messageReference.getEMessage());
- }
- }
-
- public void visitMessage(Message message)
- {
- // for now we assume that the first part is the only one that
- // should be used to deduce the parameters
- // TODO (cs) we need to revist this, multiple parts need to be considered
- //
- if (message != null) {
- thingsToListenTo.add(message);
- for (Iterator i = message.getEParts().iterator(); i.hasNext(); )
- {
- visitPart((Part)i.next());
- }
- }
- }
-
- void visitPart(Part part)
- {
- thingsToListenTo.add(part);
- if (part.getElementDeclaration() != null)
- {
- visitXSDElementDeclaration(part.getElementDeclaration());
- }
- else
- // if (part.getTypeDefinition() instanceof XSDSimpleTypeDefinition)
- {
- concreteComponents.add(part);
- }
- }
-
- void visitXSDElementDeclaration(XSDElementDeclaration ed)
- {
- XSDTypeDefinition td = ed.getTypeDefinition();
- if (td != null)
- {
- if (td.getName() != null)
- {
- concreteComponents.add(ed);
- }
- else if (td instanceof XSDComplexTypeDefinition)
- {
- // we're dealing with an anonymous locally defined type
- // se we need to visit it's children
- thingsToListenTo.add(ed);
- visitXSDComplextTypeDefinition((XSDComplexTypeDefinition) td);
- }
- }
- }
-
- void visitXSDComplextTypeDefinition(XSDComplexTypeDefinition td)
- {
- // TODO (cs) revisit to see if it makes sense for the WSDL editor to redisplay
- // the 'Fields' (in XSD editor lingo) as paramters
- // perhaps the WSDL Editor should simply reuse the XSD Editor's
- // ComplexType edit part when displaying these sections?
- W11XSDVisitorForFields fieldVisitor = new W11XSDVisitorForFields();
- fieldVisitor.visitComplexTypeDefinition(td);
- concreteComponents.addAll(fieldVisitor.getConcreteComponentList());
- thingsToListenTo.addAll(fieldVisitor.getThingsWeNeedToListenTo());
- }
- } \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/BindingWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/BindingWizard.java
deleted file mode 100644
index 8e4094eaa..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/BindingWizard.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.wizards;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.internal.generator.BindingGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.ProtocolComponentControl;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class BindingWizard extends Wizard
-{
- protected BindingGenerator bindingGenerator;
- protected BindingWizardOptionsPage specifyBindingPage;
-
- protected Document document;
- protected int kind;
-
- public static final int KIND_NEW_BINDING = 1;
- public static final int KIND_REGENERATE_BINDING = 2;
-
- protected Definition definition;
-
- /*
- * Constructor used when are creating a brand new Binding
- */
- public BindingWizard(Definition definition)
- {
- this(definition, null, KIND_NEW_BINDING);
- }
-
- /*
- * Constructor used when are creating a brand new Binding
- */
- public BindingWizard(Definition definition, Document document)
- {
- this(definition, null, KIND_NEW_BINDING);
- this.document = document;
- }
-
- /*
- * Constructor used when there is an existing Binding we wish to modify/regenerate
- */
- public BindingWizard(Definition definition, Binding binding, int kind)
- {
- super();
- this.definition = definition;
- this.kind = kind;
- bindingGenerator = new BindingGenerator(definition, binding);
-
- setWindowTitle(Messages._UI_BINDING_WIZARD); //$NON-NLS-1$
- //setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditorPlugin.class, "icons/NewXML.gif"));
- }
-
- public void setBindingName(String bindingName)
- {
-// QName qname = new QName(definition.getTargetNamespace(), bindingName);
- bindingGenerator.setName(bindingName);
-/*
- // Binding binding = (Binding) definition.getBinding(qname);
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String namespace = element.getNamespaceURI();
- if (namespace != null)
- {
- ContentGeneratorExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorExtensionRegistry().getExtensionForNamespace(namespace);
-
- if (extension != null)
- {
- bindingGenerator.setProtocol(extension.getName());
- }
- }
- }
- }
- */
- }
-
- public void setPortTypeName(String portTypeName)
- {
- bindingGenerator.setRefName(portTypeName);
- }
-
- public BindingGenerator getBindingGenerator()
- {
- return bindingGenerator;
- }
-
- /**
- * Return true if wizard setup is successful, false otherwise
- */
- public boolean setup()
- {
- return true;
- }
-
- public void addPages()
- {
- specifyBindingPage = new BindingWizardOptionsPage();
- addPage(specifyBindingPage);
- }
-
- public boolean performFinish()
- {
- boolean recordingStarted = false;
- if (definition.getElement() == null || (document != null && document.getChildNodes().getLength() == 0)) {
- recordingStarted = true;
- beginRecording();
-
- // Create the Definitions element with proper namespace
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals("")) //$NON-NLS-1$
- {
- charSet = "UTF-8"; //$NON-NLS-1$
- }
- document.appendChild(document.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + charSet + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Element root = document.createElement("wsdl:definitions"); //$NON-NLS-1$
- document.appendChild(root);
-
- // Add various namespace attributes here.
- root.setAttribute("xmlns:soap", "http://schemas.xmlsoap.org/wsdl/soap/"); //$NON-NLS-1$ //$NON-NLS-2$
- root.setAttribute("xmlns:tns", getDefaultNamespace(definition)); //$NON-NLS-1$
- root.setAttribute("xmlns:wsdl", "http://schemas.xmlsoap.org/wsdl/"); //$NON-NLS-1$ //$NON-NLS-2$
- root.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$ //$NON-NLS-2$
- root.setAttribute("name", getFileName(definition)); //$NON-NLS-1$
- root.setAttribute("targetNamespace", getDefaultNamespace(definition)); //$NON-NLS-1$
-
- definition.setElement(root);
- }
-
- // Generate/re-generate the Binding
- try
- {
-
- // go ahead and add required namespaces first before generating binding content
- CreateWSDLElementHelper.addRequiredNamespaces(bindingGenerator.getContentGenerator(), definition);
- Binding binding = bindingGenerator.generateBinding();
-
- if (binding != null)
- {
- IEditorPart editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ISelectionProvider selectionProvider = (ISelectionProvider) editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(binding));
- }
- }
- }
- catch (Exception e)
- {
- }
- finally {
- if (recordingStarted)
- endRecording();
- }
-
- return true;
- }
-
- private String getDefaultNamespace(Definition definition)
- {
- String namespace = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(Messages._UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE); //$NON-NLS-1$
- if (!namespace.endsWith("/")) { //$NON-NLS-1$
- namespace = namespace.concat("/"); //$NON-NLS-1$
- }
-
- namespace += getFileName(definition) + "/"; //$NON-NLS-1$
-
- return namespace;
- }
-
- private String getFileName(Definition definition) {
- String fileLocation = definition.getLocation();
- IPath filePath = new Path(fileLocation);
- return filePath.removeFileExtension().lastSegment().toString();
- }
-
- private void beginRecording() {
- Node node = document;
- if (node instanceof IDOMNode)
- {
- ((IDOMNode)node).getModel().beginRecording(this, Messages._UI_ACTION_ADD_BINDING); //$NON-NLS-1$
- }
- }
-
- private void endRecording() {
- Node node = document;
- if (node instanceof IDOMNode)
- {
- ((IDOMNode)node).getModel().endRecording(this);
- }
- }
-
- class BindingWizardOptionsPage extends WizardPage
- {
- protected ProtocolComponentControl protocolComponentControl;
-
- public BindingWizardOptionsPage()
- {
- super("SpecifyBindingPage"); //$NON-NLS-1$
- setTitle(Messages._UI_TITLE_SPECIFY_BINDING_DETAILS); //$NON-NLS-1$
- setDescription(Messages._UI_SPECIFY_BINDING_DETAILS_LABEL); //$NON-NLS-1$
- }
-
- protected BindingGenerator getBindingGenerator()
- {
- return ((BindingWizard) getWizard()).getBindingGenerator();
- }
-
- public void createControl(Composite parent)
- {
- ProtocolComponentControl protocolComponentControl = new BindingProtocolComponentControl(parent, bindingGenerator, true);
- protocolComponentControl.initFields();
- setControl(protocolComponentControl);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(protocolComponentControl, ASDEditorCSHelpIds.BINDING_WIZARD);
- }
- }
-
- public static class BindingProtocolComponentControl extends ProtocolComponentControl
- {
- public BindingProtocolComponentControl(Composite parent, BindingGenerator generator)
- {
- this(parent, generator, true);
- }
-
- public BindingProtocolComponentControl(Composite parent, BindingGenerator generator, boolean showOverwriteButton)
- {
- super(parent, generator, showOverwriteButton);
-
- if (generator.getName() != null)
- {
- componentNameField.setEditable(false);
- }
- }
-
- public String getRefNameLabelText()
- {
- return Messages._UI_PORT_TYPE; //$NON-NLS-1$
- }
-
- public List getRefNames()
- {
- return new ComponentReferenceUtil(generator.getDefinition()).getPortTypeNames();
- }
-
- public String getDefaultName()
- {
- String bindingName = generator.getName();
- return bindingName != null ? bindingName : NameUtil.buildUniqueBindingName(generator.getDefinition(), null);
- }
-
- public ContentGeneratorOptionsPage createContentGeneratorOptionsPage(String protocol)
- {
- ContentGeneratorUIExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry().getExtensionForLabel(protocol);
- if (extension != null) {
- return extension.getBindingContentGeneratorOptionsPage();
- }
-
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/ContentGeneratorOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/ContentGeneratorOptionsPage.java
deleted file mode 100644
index 9a16e1a23..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/ContentGeneratorOptionsPage.java
+++ /dev/null
@@ -1,26 +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.wizards;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.wsdl.internal.generator.BaseGenerator;
-
-public interface ContentGeneratorOptionsPage
-{
- public void init(BaseGenerator baseGenerator);
- public Composite createControl(Composite parent);
- public Composite getControl();
-
- // TODO can this go into init?
- //
- public void setOptionsOnGenerator();
- public boolean isOverwriteApplicable();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/HttpBindingOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/HttpBindingOptionsPage.java
deleted file mode 100644
index 19586756f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/HttpBindingOptionsPage.java
+++ /dev/null
@@ -1,143 +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.wizards;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.binding.http.internal.generator.HTTPContentGenerator;
-import org.eclipse.wst.wsdl.internal.generator.BaseGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-
-public class HttpBindingOptionsPage implements ContentGeneratorOptionsPage, SelectionListener
-{
- protected Button getButton;
- protected Button postButton;
- protected Composite control;
- protected BaseGenerator generator;
- protected HTTPContentGenerator httpGenerator;
-
- public HttpBindingOptionsPage()
- {
- }
-
- public void init(BaseGenerator generator)
- {
- this.generator = generator;
- if (generator.getContentGenerator() instanceof HTTPContentGenerator) {
- httpGenerator = (HTTPContentGenerator) generator.getContentGenerator();
- }
- }
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
-
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(Messages._UI_LABEL_HTTP_BINDING_OPTIONS); //$NON-NLS-1$
-
- getButton = new Button(control, SWT.RADIO);
- getButton.setText("HTTP GET"); //$NON-NLS-1$
- getButton.setSelection(true);
-
- postButton = new Button(control, SWT.RADIO);
- postButton.setText("HTTP POST"); //$NON-NLS-1$
-
- if (generator.getName() != null)
- {
- Definition definition = generator.getDefinition();
- QName qname = new QName(definition.getTargetNamespace(), generator.getName());
- Binding binding = (Binding) definition.getBinding(qname);
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String verb = element.getAttribute("verb"); //$NON-NLS-1$
- if ("POST".equals(verb)) //$NON-NLS-1$
- {
- getButton.setSelection(false);
- postButton.setSelection(true);
- }
- }
- }
- }
-
- postButton.addSelectionListener(this);
- getButton.addSelectionListener(this);
- computeOptions();
-
- return control;
- }
-
- public Composite getControl() {
- return control;
- }
-
- public boolean isOverwriteApplicable()
- {
- return true;
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- computeOptions();
- }
-
- protected void computeOptions()
- {
- if (generator.getContentGenerator() instanceof HTTPContentGenerator) {
- HTTPContentGenerator httpGenerator = (HTTPContentGenerator) generator.getContentGenerator();
-
- if (postButton.getSelection()) {
- httpGenerator.setVerb(HTTPContentGenerator.VERB_POST);
- }
- else if (getButton.getSelection()) {
- httpGenerator.setVerb(HTTPContentGenerator.VERB_GET);
- }
- }
- }
-
- public void setOptionsOnGenerator() {
- computeOptions();
- }
-
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NamespaceTable.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NamespaceTable.java
deleted file mode 100644
index a8438c34a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NamespaceTable.java
+++ /dev/null
@@ -1,702 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.wizards;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditNamespaceInfoDialog;
-import org.eclipse.wst.xml.ui.internal.dialogs.UpdateListener;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonResources;
-
-public class NamespaceTable extends Composite
-{
- protected static final String NAMESPACE_URI = XMLCommonResources.getInstance().getString("_UI_LABEL_NAMESPACE_NAME"); //$NON-NLS-1$
- protected static final String PREFIX = XMLCommonResources.getInstance().getString("_UI_LABEL_PREFIX"); //$NON-NLS-1$
- protected static final String INCLUDE = Messages._UI_TITLE_SELECT; //$NON-NLS-1$
-
- protected List namespaceInfoList = new Vector();
- protected List checkedList = new Vector();
- protected NamespaceNavigableTableViewer tableViewer;
- protected Button addButton;
-
- protected NamespaceInfoTableLabelProvider provider;
- protected UpdateListener updateListener;
- protected IPath resourceLocation;
- protected int visibleRows = -1;
- protected boolean dummyRowsRemoved = false;
- Table table;
-
- public NamespaceTable(Composite parent)
- {
- this(parent, -1, -1, -1);
- }
-
- public NamespaceTable(Composite parent, int visibleRows)
- {
- this(parent, -1, -1, visibleRows);
- }
-
- public NamespaceTable(Composite parent, int widthHint, int heightHint)
- {
- this(parent, widthHint, heightHint, -1);
- }
-
- public NamespaceTable(Composite parent, int widthHint, int heightHint, int visibleRows)
- {
- super(parent, SWT.NONE);
- setLayout(createGridLayout());
- GridData fillGD= new GridData();
- fillGD.horizontalAlignment= GridData.FILL;
- fillGD.grabExcessHorizontalSpace= true;
- fillGD.verticalAlignment= GridData.FILL;
- fillGD.grabExcessVerticalSpace= true;
-
- setLayoutData(fillGD);
-
- Group namespaceInfoGroup = new Group(this, SWT.NONE);
- namespaceInfoGroup.setText(Messages._UI_LABEL_NAMESPACE_URIS_TO_BE_INCLUDED); //$NON-NLS-1$
- namespaceInfoGroup.setLayout(new GridLayout());
- GridData gd = fillGD;
- if (widthHint != -1)
- {
- gd.widthHint = widthHint;
- }
- if (heightHint != -1)
- {
- gd.heightHint = heightHint;
- }
- namespaceInfoGroup.setLayoutData(gd);
- //WorkbenchHelp.setHelp(namespaceInfoGroup, new ControlContextComputer(namespaceInfoGroup, XMLBuilderContextIds.XMLC_NAMESPACE_GROUP));
-
- String[] titleArray = {INCLUDE, PREFIX, NAMESPACE_URI};
-
- table = new Table(namespaceInfoGroup, SWT.FULL_SELECTION);
- table.setHeaderVisible(true);
-
- table.setLayoutData(fillGD);
- table.setLinesVisible(true);
- table.addMouseListener(new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- TableItem item = table.getItem(new Point(e.x, e.y));
- if (item != null)
- {
- Object obj = item.getData();
- if (obj != null)
- {
- TableElement holder = (TableElement)obj;
- TableColumn col = table.getColumn(0);
- if (e.x < col.getWidth()) // if the point falls within the Select column then perform check/uncheck
- {
- String currentState = holder.getChecked();
- if (currentState.equals("true")) //$NON-NLS-1$
- {
- holder.setChecked("false"); //$NON-NLS-1$
- checkedList.set(holder.getIndex(), "false"); //$NON-NLS-1$
- }
- else if (currentState.equals("false")) //$NON-NLS-1$
- {
- holder.setChecked("true"); //$NON-NLS-1$
- checkedList.set(holder.getIndex(), "true"); //$NON-NLS-1$
- }
- tableViewer.refresh();
- if (updateListener != null)
- {
- updateListener.updateOccured(this, namespaceInfoList);
- }
- }
- }
- }
- }
- });
-
- tableViewer = new NamespaceNavigableTableViewer(table);
- provider = new NamespaceInfoTableLabelProvider();
- tableViewer.setContentProvider(provider);
- tableViewer.setLabelProvider(provider);
- tableViewer.setColumnProperties(titleArray);
- tableViewer.setCellModifier(new NamespaceInfoCellModifier());
-
-
- int[] widthArray = {10, 20, 50};
- TableLayout layout = new TableLayout();
-
- for (int i = 0; i < titleArray.length; i++)
- {
- TableColumn column = new TableColumn(table, i);
- column.setText(titleArray[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(widthArray[i], true));
- }
- this.visibleRows = visibleRows;
- for (int i = 0; i < visibleRows; i++)
- {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText("#######"); //$NON-NLS-1$
- }
- table.setLayout(layout);
-
- CellEditor[] cellEditors = new CellEditor[titleArray.length];
- cellEditors[0] = new NamespaceInfoCheckboxCellEditor(table);
- cellEditors[1] = new TextCellEditor(table);
- tableViewer.setCellEditors(cellEditors);
-
-// createButtons(namespaceInfoGroup);
-
- initialize();
- }
-
- public void setUpdateListener(UpdateListener updateListener)
- {
- this.updateListener = updateListener;
- }
-
- public void setNamespaceInfoList(List namespaceInfoList)
- {
- this.namespaceInfoList = namespaceInfoList;
- update();
- }
-
- public List getNamespaceInfoList()
- {
- return namespaceInfoList;
- }
-
- public List getNamespaceCheckedList()
- {
- return checkedList;
- }
-
- public String getWSDLPrefix()
- {
- return ((NamespaceInfo)(namespaceInfoList.get(0))).prefix;
- }
-
- public void setResourceLocation(IPath resourceLocation)
- {
- this.resourceLocation = resourceLocation;
- }
-
- public GridLayout createGridLayout()
- {
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginWidth = 0;
- gridLayout.horizontalSpacing = 0;
- return gridLayout;
- }
-
- protected void initialize()
- {
- // better way to do this....
- NamespaceInfo info1 = new NamespaceInfo();
- info1.prefix = "wsdl"; //$NON-NLS-1$
- info1.uri = "http://schemas.xmlsoap.org/wsdl/"; //$NON-NLS-1$
- namespaceInfoList.add(info1);
- checkedList.add("true"); //$NON-NLS-1$
- NamespaceInfo info2 = new NamespaceInfo();
- info2.prefix = "soap"; //$NON-NLS-1$
- info2.uri = "http://schemas.xmlsoap.org/wsdl/soap/"; //$NON-NLS-1$
- namespaceInfoList.add(info2);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info3 = new NamespaceInfo();
- info3.prefix = "http"; //$NON-NLS-1$
- info3.uri = "http://schemas.xmlsoap.org/wsdl/http/"; //$NON-NLS-1$
- namespaceInfoList.add(info3);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info4 = new NamespaceInfo();
- info4.prefix = "mime"; //$NON-NLS-1$
- info4.uri = "http://schemas.xmlsoap.org/wsdl/mime/"; //$NON-NLS-1$
- namespaceInfoList.add(info4);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info5 = new NamespaceInfo();
- info5.prefix = "soapenc"; //$NON-NLS-1$
- info5.uri = "http://schemas.xmlsoap.org/soap/encoding/"; //$NON-NLS-1$
- namespaceInfoList.add(info5);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info6 = new NamespaceInfo();
- info6.prefix = "soapenv"; //$NON-NLS-1$
- info6.uri = "http://schemas.xmlsoap.org/soap/envelope/"; //$NON-NLS-1$
- namespaceInfoList.add(info6);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info7 = new NamespaceInfo();
- info7.prefix = "xsi"; //$NON-NLS-1$
- info7.uri = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
- namespaceInfoList.add(info7);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info8 = new NamespaceInfo();
- info8.prefix = "xsd"; //$NON-NLS-1$
- info8.uri = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
- namespaceInfoList.add(info8);
- checkedList.add("true"); //$NON-NLS-1$
- update();
- }
-
- protected void createButtons(Composite parent)
- {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData hFillGD = new GridData();
- hFillGD.horizontalAlignment= GridData.FILL;
- hFillGD.grabExcessHorizontalSpace= true;
-
- composite.setLayoutData(hFillGD);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- composite.setLayout(gridLayout);
-
- GridData gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
-
- Button hiddenButton = new Button(composite, SWT.NONE);
- hiddenButton.setLayoutData(gd);
- hiddenButton.setVisible(false);
- hiddenButton.setEnabled(false);
-
- SelectionListener selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == addButton)
- {
- performNew();
- }
- }
- };
-
- // create a composite to hold the three buttons
- Composite buttonComposite = new Composite(composite, SWT.NONE);
-
- buttonComposite.setLayoutData(hFillGD);
- GridLayout buttonGridLayout = new GridLayout();
- buttonGridLayout.numColumns = 1;
- buttonGridLayout.makeColumnsEqualWidth = true;
- buttonComposite.setLayout(buttonGridLayout);
-
- // add the New button
- //
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
-
- addButton = new Button(buttonComposite, SWT.NONE);
- addButton.setText(Messages._UI_ACTION_ADD); //$NON-NLS-1$
- addButton.setLayoutData(gd);//ViewUtility.createHorizontalFill());
- addButton.addSelectionListener(selectionListener);
- }
-
- public void performNew()
- {
- NamespaceInfo info = new NamespaceInfo();
- EditNamespaceInfoDialog dialog = invokeDialog(XMLCommonResources.getInstance().getString("_UI_LABEL_NEW_NAMESPACE_INFORMATION"), info); //$NON-NLS-1$
- if (dialog.getReturnCode() == Dialog.OK)
- {
- namespaceInfoList.add(info);
- checkedList.add("true"); //$NON-NLS-1$
- performDelayedUpdate();
- }
- }
-
- protected EditNamespaceInfoDialog invokeDialog(String title, NamespaceInfo info)
- {
- Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(shell, info);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.setResourceLocation(resourceLocation);
- dialog.open();
- return dialog;
- }
-
- protected void performDelayedUpdate()
- {
- Runnable delayedUpdate = new Runnable()
- {
- public void run()
- {
- update();
- }
- };
- Display.getCurrent().asyncExec(delayedUpdate);
-
- if (updateListener != null)
- {
- updateListener.updateOccured(this, namespaceInfoList);
- }
- }
-
- protected NamespaceInfo getTargetNamespaceInfo()
- {
- return (namespaceInfoList != null && namespaceInfoList.size() > 0) ?
- (NamespaceInfo)namespaceInfoList.get(0) :
- null;
- }
-
-
- public void update()
- {
- updateHelper(namespaceInfoList);
- }
-
- public void updateHelper(List namespaceInfoList)
- {
- if (visibleRows != -1 && !dummyRowsRemoved)
- {
-// dummyRowsRemoved = true;
-// tableViewer.getTable().removeAll();
- }
- ISelection selection = tableViewer.getSelection();
- tableViewer.setInput(namespaceInfoList);
- if (selection.isEmpty())
- {
- if (namespaceInfoList.size() > 0)
- {
- tableViewer.setSelection(new StructuredSelection(namespaceInfoList.get(0)));
- }
- }
- else
- {
- tableViewer.setSelection(selection);
- }
- }
-
- protected class NamespaceInfoCheckboxCellEditor extends CheckboxCellEditor implements MouseListener
- {
- public NamespaceInfoCheckboxCellEditor(Composite parent)
- {
- super(parent);
- }
-
- protected void doSetValue(Object value)
- {
- }
-
- public void activate()
- {
- super.activate();
- deactivate();
- Display.getCurrent().getFocusControl().redraw();
- }
-
- public void mouseDown(MouseEvent e)
- {
- if (tableViewer.getTable().getItem(new Point(e.x, e.y)) != null)
- {
- }
- }
- public void mouseDoubleClick(MouseEvent e) {}
- public void mouseUp(MouseEvent e) {}
-
-
- }
-
-
- protected class NamespaceInfoCellModifier implements ICellModifier
- {
- public NamespaceInfoCellModifier()
- {
-
- }
-
- public boolean canModify(Object element, String property)
- {
- if (property.equals(INCLUDE))
- {
- return true;
- }
- else if (property.equals(PREFIX))
- {
- return true;
- }
- return false;
- }
-
- public Object getValue(Object element, String property)
- {
- int column = 0;
- if (property.equals(INCLUDE))
- {
- column = 0;
- }
- else if (property.equals(PREFIX))
- {
- column = 1;
- }
- else if (property.equals(NAMESPACE_URI))
- {
- column = 2;
- }
-
- if (element instanceof TableElement)
- {
- return provider.getColumnText(element, column);
- }
- else
- {
- return null;
- }
- }
-
- public void modify(Object element, String property, Object value)
- {
- TableItem item = (TableItem)element;
- if (item != null)
- {
- Object obj = item.getData();
- if (obj != null)
- {
- TableElement holder = (TableElement)obj;
- NamespaceInfo info = holder.getNamespaceInfo();
- if (property.equals(INCLUDE))
- {
- if (value instanceof Boolean)
- {
- if (((Boolean)value).booleanValue())
- {
- holder.setChecked("true"); //$NON-NLS-1$
- checkedList.set(holder.getIndex(), "true"); //$NON-NLS-1$
- }
- else
- {
- holder.setChecked("false"); //$NON-NLS-1$
- checkedList.set(holder.getIndex(), "false"); //$NON-NLS-1$
- }
- }
- }
- else if (property.equals(PREFIX))
- {
- info.prefix = ((String)value).trim();
- }
-
- Runnable delayedUpdate = new Runnable()
- {
- public void run()
- {
- tableViewer.refresh();
- }
- };
- Display.getCurrent().asyncExec(delayedUpdate);
- if (updateListener != null)
- {
- updateListener.updateOccured(this, namespaceInfoList);
- }
-
-// performDelayedUpdate();
- }
- }
- }
- }
-
- protected class TableElement
- {
- NamespaceInfo info;
- int index;
- String checked = "true"; //$NON-NLS-1$
-
- TableElement(NamespaceInfo info, int index)
- {
- this.info = info;
- this.index = index;
- }
-
- public NamespaceInfo getNamespaceInfo()
- {
- return info;
- }
-
- public int getIndex()
- {
- return index;
- }
-
- public String getChecked()
- {
- return checked;
- }
-
- public void setChecked(String checked)
- {
- this.checked = checked;
- }
- }
-
- /**
- * NamespaceInfoTableLabelProvider
- */
- protected class NamespaceInfoTableLabelProvider implements ITableLabelProvider, IStructuredContentProvider
- {
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- public boolean isDeleted(Object element)
- {
- return false;
- }
-
- public Object[] getElements(Object inputElement)
- {
- Vector v = new Vector();
- for (int i = 0; i < namespaceInfoList.size(); i++)
- {
- NamespaceInfo info = (NamespaceInfo)namespaceInfoList.get(i);
- TableElement holder = new TableElement(info, i);
- holder.setChecked((String)checkedList.get(i));
- v.add(holder);
- }
- return v.toArray();
- }
-
- public String getColumnText(Object object, int column)
- {
- TableElement holder = (TableElement)object;
- NamespaceInfo info = holder.getNamespaceInfo();
- String result = null;
- switch (column)
- {
- case 1: { result = info.prefix; break; }
- case 2: { result = info.uri; break; }
- }
- result = result != null ? result.trim() : ""; //$NON-NLS-1$
- if (result.equals("")) //$NON-NLS-1$
- {
- switch (column)
- {
- case 2:
- {
- result = XMLCommonResources.getInstance().getString("_UI_NO_NAMESPACE_NAME"); //$NON-NLS-1$
- break;
- }
- }
- }
- return result;
- }
-
-// private String getDefaultPrefix()
-// {
-// String defaultPrefix = "p";
-// if (namespaceInfoList == null)
-// return defaultPrefix;
-//
-// Vector v = new Vector();
-// for (int i=0; i<namespaceInfoList.size(); i++)
-// {
-// NamespaceInfo nsinfo = (NamespaceInfo)namespaceInfoList.get(i);
-// if (nsinfo.prefix != null)
-// v.addElement(nsinfo.prefix);
-// }
-//
-// if (v.contains(defaultPrefix))
-// {
-// String s = defaultPrefix;
-// for (int j=0; v.contains(s); j++)
-// {
-// s = defaultPrefix + Integer.toString(j);
-// }
-// return s;
-// }
-// else
-// return defaultPrefix;
-// }
-
- public Image getColumnImage(Object object, int columnIndex)
- {
- if (columnIndex == 0) // Output Column
- {
- if (object instanceof TableElement)
- {
- TableElement holder = (TableElement) object;
- String result = holder.getChecked();
- if (result.equals("true")) //$NON-NLS-1$
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/output_yes.gif"); //$NON-NLS-1$
- }
- else
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/output_no.gif"); //$NON-NLS-1$
- }
- }
- }
- return null;
- }
-
- public boolean isLabelProperty(Object object, Object property)
- {
- return false;
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- public void dispose()
- {
- }
- }
-
- class NamespaceNavigableTableViewer extends NavigableTableViewer
- {
- public NamespaceNavigableTableViewer(Table parent)
- {
- super(parent);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java
deleted file mode 100644
index 0e5cfd819..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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
- * -------- -------- -----------------------------------------------------------
- * 20071108 196997 ericdp@ca.ibm.com - Eric Peters
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.ui.internal.UIPlugin;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.ws.internal.plugin.WSPlugin;
-import org.eclipse.wst.ws.internal.preferences.PersistentWSIContext;
-import org.eclipse.wst.ws.internal.service.policy.ui.properties.ServicePoliciesPropertyPage;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.internal.generator.BindingGenerator;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLFactoryImpl;
-import org.eclipse.wst.wsdl.ui.internal.InternalWSDLMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.DOMValidator;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.w3c.dom.Element;
-
-public class NewWSDLWizard extends Wizard implements INewWizard {
- private WSDLNewFilePage newFilePage;
- private WSDLNewFileOptionsPage optionsPage;
- private IStructuredSelection selection;
- private BindingGenerator generator;
- private boolean fOpenEditorWhenFinished;
- private IFile fNewFile = null;
-
- /**
- * Constructor for NewWSDLWizard.
- */
- public NewWSDLWizard() {
- super();
- generator = new BindingGenerator(null, null);
- fOpenEditorWhenFinished = true;
- }
-
- public NewWSDLWizard(boolean openEditorWhenFinished) {
- this();
- fOpenEditorWhenFinished = openEditorWhenFinished;
- }
-
- /**
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- fNewFile = newFilePage.createNewFile();
-
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
- charSet = "UTF-8"; //$NON-NLS-1$
- }
-
- String wsdlPrefix = "wsdl"; //$NON-NLS-1$
- Vector namespaces = optionsPage.getNamespaceInfo();
-
- String prefix = optionsPage.getPrefix();
- String definitionName = optionsPage.getDefinitionName();
-
- URI uri2 = URI.createPlatformResourceURI(fNewFile.getFullPath().toOSString(), false);
- ResourceSet resourceSet = new ResourceSetImpl();
- WSDLResourceImpl resource = (WSDLResourceImpl) resourceSet.createResource(URI.createURI("*.wsdl")); //$NON-NLS-1$
- resource.setURI(uri2);
-
- WSDLFactoryImpl factory = new WSDLFactoryImpl();
- DefinitionImpl definition = (DefinitionImpl) factory.createDefinition();
- resource.getContents().add(definition);
-
- definition.setTargetNamespace(optionsPage.getTargetNamespace());
- definition.setLocation(fNewFile.getLocation().toString());
- definition.setEncoding(charSet);
- definition.setQName(new QName(wsdlPrefix, definitionName));
- definition.addNamespace(prefix, optionsPage.getTargetNamespace());
-
- for (int i = 0; i < namespaces.size(); i++) {
- NamespaceInfo info = (NamespaceInfo) namespaces.get(i);
-
- if (info.prefix.length() > 0) {
- definition.addNamespace(info.prefix, info.uri);
- }
- else {
- definition.addNamespace(null, info.uri);
- }
- }
- // TODO : cs... why do we need this? these calls are evil!
- definition.updateElement(true);
- try {
- if (optionsPage.getCreateSkeletonBoolean()) {
- if (optionsPage.isSoapDocLiteralProtocol()) {
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.PART_INFO_ELEMENT_DECLARATION;
- }
- else {
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.PART_INFO_TYPE_DEFINITION;
- }
-
- CreateWSDLElementHelper.serviceName = definitionName;
- CreateWSDLElementHelper.portName = definitionName + optionsPage.getProtocol();
- Service service = CreateWSDLElementHelper.createService(definition);
-
- // Generate Binding
- Iterator bindingIt = definition.getEBindings().iterator();
- Binding binding = null;
- if (bindingIt.hasNext()) {
- binding = (Binding) bindingIt.next();
- }
-
- generator.setDefinition(definition);
- generator.setBinding(binding);
- Port port = (Port) service.getEPorts().iterator().next();
- generator.setName(ComponentReferenceUtil.getName(port.getEBinding()));
- generator.setRefName(ComponentReferenceUtil.getPortTypeReference(port.getEBinding()));
- generator.setOverwrite(true);
- generator.generateBinding();
- generator.generatePortContent();
- }
- resource.save(null);
- }
- catch (Exception e) {
- System.out.println("\nCould not write new WSDL file in WSDL Wizard: " + e); //$NON-NLS-1$
- }
-
- /*
- * if (file != null) { final ISelection selection = new
- * StructuredSelection(file); if (selection != null) { IWorkbench
- * workbench = UIPlugin.getDefault().getWorkbench(); final
- * IWorkbenchWindow workbenchWindow =
- * workbench.getActiveWorkbenchWindow(); final IWorkbenchPart
- * focusPart = workbenchWindow.getActivePage().getActivePart(); if
- * (focusPart instanceof ISetSelectionTarget) {
- * Display.getCurrent().asyncExec (new Runnable() { public void run() {
- * ((ISetSelectionTarget)focusPart).selectReveal(selection); } }); } } }
- */
- if (fOpenEditorWhenFinished) {
- openEditor(fNewFile);
- }
-
- return true;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWizard#init(IWorkbench,
- * IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
-
- // Need new icon
- this.setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(InternalWSDLMultiPageEditor.class, "icons/new_wsdl_wiz.png")); //$NON-NLS-1$
- this.setWindowTitle(Messages._UI_TITLE_NEW_WSDL_FILE); //$NON-NLS-1$
- }
-
- public void addPages() {
- newFilePage = new WSDLNewFilePage(selection);
- optionsPage = new WSDLNewFileOptionsPage(Messages._UI_TITLE_OPTIONS, Messages._UI_TITLE_OPTIONS, null, newFilePage); //$NON-NLS-1$ //$NON-NLS-2$
- optionsPage.setBindingGenerator(generator);
- addPage(newFilePage);
- addPage(optionsPage);
- }
-
- public IPath getNewFilePath() {
- String fileName = newFilePage.getFileName();
- return fileName != null ? new Path(fileName) : null;
- }
-
- public IFile getNewFile() {
- return fNewFile;
- }
-
- public boolean canFinish() {
- if (newFilePage.isPageComplete() && optionsPage.isPageComplete()) {
- return true;
- }
- return false;
- }
-
- static public void openEditor(final IFile iFile) {
- if (iFile != null) {
- IWorkbench workbench = UIPlugin.getDefault().getWorkbench();
- final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- String editorId = null;
- IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(iFile.getLocation().toOSString(), iFile.getContentDescription().getContentType());
- if (editor != null) {
- editorId = editor.getId();
- }
- workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), editorId);
- }
- catch (PartInitException ex) {
- // B2BGUIPlugin.getPlugin().getMsgLogger().write("Exception
- // encountered when attempting to open file: " + iFile
- // + "\n\n" + ex);
- }
- catch (CoreException ex) {
- }
- }
- });
- }
- }
-
- public class AvailableContentCMVisitor extends CMVisitor {
- public static final int INCLUDE_ATTRIBUTES = ModelQuery.INCLUDE_ATTRIBUTES;
- public static final int INCLUDE_CHILD_NODES = ModelQuery.INCLUDE_CHILD_NODES;
- public static final int INCLUDE_SEQUENCE_GROUPS = ModelQuery.INCLUDE_SEQUENCE_GROUPS;
-
- public Hashtable childNodeTable = new Hashtable();
- public Hashtable attributeTable = new Hashtable();
- public Element rootElement;
- public CMElementDeclaration rootElementDeclaration;
- public boolean isRootVisited;
- protected boolean includeSequenceGroups;
- public DOMValidator validator;
-
- public AvailableContentCMVisitor(Element rootElement, CMElementDeclaration rootElementDeclaration) {
- this.rootElement = rootElement;
- this.rootElementDeclaration = rootElementDeclaration;
- validator = new DOMValidator();
- }
-
- protected String getKey(CMNode cmNode) {
- String key = cmNode.getNodeName();
- CMDocument cmDocument = (CMDocument) cmNode.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null) {
- String namespaceURI = (String) cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- if (namespaceURI != null) {
- key = "[" + namespaceURI + "]" + key; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return key;
- }
-
- public List computeAvailableContent(int includeOptions) {
- Vector v = new Vector();
-
- int contentType = rootElementDeclaration.getContentType();
- includeSequenceGroups = ((includeOptions & INCLUDE_SEQUENCE_GROUPS) != 0);
- visitCMNode(rootElementDeclaration);
-
- if ((includeOptions & INCLUDE_ATTRIBUTES) != 0) {
- v.addAll(attributeTable.values());
- CMAttributeDeclaration nillableAttribute = (CMAttributeDeclaration) rootElementDeclaration.getProperty("http://org.eclipse.wst/cm/properties/nillable"); //$NON-NLS-1$
- if (nillableAttribute != null) {
- v.add(nillableAttribute);
- }
- }
-
- if ((includeOptions & INCLUDE_CHILD_NODES) != 0) {
- if (contentType == CMElementDeclaration.MIXED || contentType == CMElementDeclaration.ELEMENT) {
- v.addAll(childNodeTable.values());
- }
- else if (contentType == CMElementDeclaration.ANY) {
- CMDocument cmDocument = (CMDocument) rootElementDeclaration.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null) {
- CMNamedNodeMap elements = cmDocument.getElements();
- for (Iterator i = elements.iterator(); i.hasNext();) {
- v.add((CMElementDeclaration) i.next());
- }
- }
- }
-
- if (contentType == CMElementDeclaration.MIXED || contentType == CMElementDeclaration.PCDATA || contentType == CMElementDeclaration.ANY) {
- CMDataType dataType = rootElementDeclaration.getDataType();
- if (dataType != null) {
- v.add(dataType);
- }
- }
- }
- return v;
- }
-
- /*
- * public void visitCMAnyElement(CMAnyElement anyElement) { String uri =
- * anyElement.getNamespaceURI(); List list =
- * getCMDocumentList(rootElement, rootElementDeclaration, uri); for
- * (Iterator iterator = list.iterator(); iterator.hasNext(); ) {
- * CMDocument cmdocument = (CMDocument)iterator.next(); if (cmdocument !=
- * null) { CMNamedNodeMap map = cmdocument.getElements(); int size =
- * map.getLength(); for (int i = 0; i < size; i++) { CMNode ed =
- * map.item(i);
- *
- * childNodeTable.put(getKey(ed), ed); } } } }
- */
- public void visitCMAttributeDeclaration(CMAttributeDeclaration ad) {
- super.visitCMAttributeDeclaration(ad);
- attributeTable.put(ad.getNodeName(), ad);
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed) {
- if (ed == rootElementDeclaration && !isRootVisited) {
- isRootVisited = true;
- super.visitCMElementDeclaration(ed);
- }
- else {
- if (!Boolean.TRUE.equals(ed.getProperty("Abstract"))) { //$NON-NLS-1$
- childNodeTable.put(getKey(ed), ed);
- }
-
- CMNodeList substitutionGroup = (CMNodeList) ed.getProperty("SubstitutionGroup"); //$NON-NLS-1$
- if (substitutionGroup != null) {
- handleSubstitutionGroup(substitutionGroup);
- }
- }
- }
-
- protected void handleSubstitutionGroup(CMNodeList substitutionGroup) {
- int substitutionGroupLength = substitutionGroup.getLength();
- if (substitutionGroupLength > 1) {
- for (int i = 0; i < substitutionGroupLength; i++) {
- CMNode ed = substitutionGroup.item(i);
- if (!Boolean.TRUE.equals(ed.getProperty("Abstract"))) { //$NON-NLS-1$
- childNodeTable.put(getKey(ed), ed);
- }
- }
- }
- }
-
- public void visitCMGroup(CMGroup group) {
- if (includeSequenceGroups) {
- if (group.getOperator() == CMGroup.SEQUENCE && group.getChildNodes().getLength() > 1 && includesRequiredContent(group)) {
- childNodeTable.put(group, group);
- }
- }
- super.visitCMGroup(group);
- }
-
- public boolean includesRequiredContent(CMGroup group) {
- List list = getValidator().createContentSpecificationList(group);
- return list.size() > 1;
- }
-
- public DOMValidator getValidator() {
- return validator;
- }
- } // ///////////////////////// here
-
-
- public void openProjectWSIProperties() {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getFile(newFilePage.getContainerFullPath().append(newFilePage.getFileName())).getProject();
- //PreferencesUtil.createPropertyDialogOn(shell,targetProject,null,null,null).open();
-
- PreferencesUtil.createPropertyDialogOn(shell,targetProject,ServicePoliciesPropertyPage.PAGE_ID ,new String[] {ServicePoliciesPropertyPage.PAGE_ID},null).open();
- }
-
- public String getWSIPreferences() {
- IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getFile(newFilePage.getContainerFullPath().append(newFilePage.getFileName())).getProject();
- PersistentWSIContext WSISSBcontext = WSPlugin.getInstance().getWSISSBPContext();
-
- if (WSISSBcontext.projectStopNonWSICompliances(targetProject))
- {
- return (PersistentWSIContext.STOP_NON_WSI);
- }
- else if (WSISSBcontext.projectWarnNonWSICompliances(targetProject))
- {
- return (PersistentWSIContext.WARN_NON_WSI);
- }
- else
- {
- return (PersistentWSIContext.IGNORE_NON_WSI);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/PortWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/PortWizard.java
deleted file mode 100644
index 575277873..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/PortWizard.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.wizards;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.internal.generator.PortGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.ProtocolComponentControl;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class PortWizard extends Wizard
-{
- protected final static int STYLE_NEW_BINDING = 1;
- protected final static int STYLE_EXISTING_BINDING = 1 << 1;
- protected final static int STYLE_DEFAULT = STYLE_NEW_BINDING | STYLE_EXISTING_BINDING;
-
- protected PortGenerator portGenerator;
- protected PortWizardOptionsPage specifyBindingPage;
- protected int style;
-
- /**
- * Constructor for PortWizard.
- */
- public PortWizard(Service service)
- {
- this(service, 0);
- }
-
- public PortWizard(Service service, int style)
- {
- super();
- portGenerator = new PortGenerator(service);
- setWindowTitle(Messages._UI_PORT_WIZARD); //$NON-NLS-1$
- //setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditorPlugin.class, "icons/NewXML.gif"));
- }
-
- /**
- * Return true if wizard setup is successful, false otherwise
- */
- public boolean setup()
- {
- return true;
- }
-
- public void addPages()
- {
- specifyBindingPage = new PortWizardOptionsPage(style);
- addPage(specifyBindingPage);
- }
-
- public boolean performFinish()
- {
- // go ahead and add required namespaces first before generating port
- CreateWSDLElementHelper.addRequiredNamespaces(portGenerator.getContentGenerator(), portGenerator.getDefinition());
- Object object = portGenerator.generatePort();
-
- try
- {
- if (object != null)
- {
- IEditorPart editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ISelectionProvider selectionProvider = (ISelectionProvider) editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- catch (Exception e)
- {
- }
- return true;
- }
-
- class PortWizardOptionsPage extends WizardPage
- {
-
- protected ProtocolComponentControl protocolComponentControl;
-
- public PortWizardOptionsPage(int style)
- {
- super("SpecifyPortPage"); //$NON-NLS-1$
- setTitle(Messages._UI_SPECIFY_PORT_DETAILS); //$NON-NLS-1$
- setDescription(Messages._UI_SPECIFY_PORT_DETAILS_TO_BE_CREATED); //$NON-NLS-1$
- }
-
- public PortGenerator getGenerator()
- {
- return portGenerator;
- }
-
- public void createControl(Composite parent)
- {
- ProtocolComponentControl protocolComponentControl = new PortProtocolComponentControl(parent, portGenerator);
- protocolComponentControl.initFields();
- setControl(protocolComponentControl);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(protocolComponentControl, ASDEditorCSHelpIds.PORT_WIZARD);
- }
- }
-
- class PortProtocolComponentControl extends ProtocolComponentControl
- {
-
- public PortProtocolComponentControl(Composite parent, PortGenerator generator)
- {
- super(parent, generator, false);
- }
-
- public String getRefNameLabelText()
- {
- return Messages._UI_BINDING; //$NON-NLS-1$
- }
-
- public List getRefNames()
- {
- return new ComponentReferenceUtil(portGenerator.getDefinition()).getBindingNames();
- }
-
- public String getDefaultName()
- {
- Service service = portGenerator.getService();
- return NameUtil.buildUniquePortName(service, null);
- }
-
- public ContentGeneratorOptionsPage createContentGeneratorOptionsPage(String protocol)
- {
- ContentGeneratorUIExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry().getExtensionForLabel(protocol);
- if (extension != null) {
- return extension.getPortContentGeneratorOptionsPage();
- }
-
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/SoapBindingOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/SoapBindingOptionsPage.java
deleted file mode 100644
index d38309d1b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/SoapBindingOptionsPage.java
+++ /dev/null
@@ -1,189 +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.wizards;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.binding.soap.internal.generator.SOAPContentGenerator;
-import org.eclipse.wst.wsdl.internal.generator.BaseGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-
-public class SoapBindingOptionsPage implements ContentGeneratorOptionsPage, SelectionListener
-{
- protected Button docLiteral;
- protected Button rpcLiteral;
- protected Button rpcEncoded;
- protected Composite control;
- protected BaseGenerator generator;
-
- public SoapBindingOptionsPage()
- {
- }
-
- public void init(BaseGenerator generator)
- {
- this.generator = generator;
- }
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(Messages._UI_LABEL_SOAP_BINDING_OPTIONS); //$NON-NLS-1$
-
- docLiteral = new Button(control, SWT.RADIO);
- docLiteral.setText(Messages._UI_RADIO_DOCUMENT_LITERAL); //$NON-NLS-1$
- docLiteral.setSelection(true);
-
- rpcLiteral = new Button(control, SWT.RADIO);
- rpcLiteral.setText(Messages._UI_RADIO_RPC_LITERAL); //$NON-NLS-1$
-
- rpcEncoded = new Button(control, SWT.RADIO);
- rpcEncoded.setText(Messages._UI_RADIO_RPC_ENCODED); //$NON-NLS-1$
-
- if (generator.getName() != null)
- {
- Definition definition = generator.getDefinition();
- QName qname = new QName(definition.getTargetNamespace(), generator.getName());
- Binding binding = (Binding) definition.getBinding(qname);
-
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
-
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String style = element.getAttribute("style"); //$NON-NLS-1$
-
- if ("rpc".equals(style)) //$NON-NLS-1$
- {
- // Try to determine if it's RPC Literal or RPC Encoded
- String use = "encoded"; //$NON-NLS-1$
- List operations = binding.getEBindingOperations();
- if (operations.size() > 0) {
- element = null;
- BindingOperation operation = (BindingOperation) operations.get(0);
- if (operation.getEBindingInput() != null && operation.getEBindingInput().getEExtensibilityElements().size() > 0) {
- Object object = operation.getEBindingInput().getEExtensibilityElements().get(0);
- element = WSDLEditorUtil.getInstance().getElementForObject(object);
- }
- else if (operation.getEBindingOutput() != null && operation.getEBindingOutput().getEExtensibilityElements().size() > 0) {
- Object object = operation.getEBindingOutput().getEExtensibilityElements().get(0);
- element = WSDLEditorUtil.getInstance().getElementForObject(object);
- }
- else if (operation.getEBindingFaults().size() > 0) {
- BindingFault fault = (BindingFault) operation.getEBindingFaults().get(0);
- List faultEE = fault.getExtensibilityElements();
-
- if (faultEE.size() > 0) {
- element = WSDLEditorUtil.getInstance().getElementForObject(faultEE.get(0));
- }
- }
-
- if (element != null) {
- use = element.getAttribute("use"); //$NON-NLS-1$
- }
- }
-
- if (use != null && "literal".equals(use)) { //$NON-NLS-1$
- docLiteral.setSelection(false);
- rpcLiteral.setSelection(true);
- rpcEncoded.setSelection(false);
- }
- else {
- docLiteral.setSelection(false);
- rpcLiteral.setSelection(false);
- rpcEncoded.setSelection(true);
- }
- }
- }
- }
- }
-
- docLiteral.addSelectionListener(this);
- rpcLiteral.addSelectionListener(this);
- rpcEncoded.addSelectionListener(this);
- computeOptions();
-
- return control;
- }
-
- public Composite getControl() {
- return control;
- }
-
- public boolean isOverwriteApplicable()
- {
- return true;
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- computeOptions();
- }
-
- protected void computeOptions()
- {
- if (generator.getContentGenerator() instanceof SOAPContentGenerator) {
- SOAPContentGenerator soapGenerator = (SOAPContentGenerator) generator.getContentGenerator();
- if (docLiteral.getSelection()) {
- soapGenerator.setStyle(SOAPContentGenerator.STYLE_DOCUMENT);
- soapGenerator.setUse(SOAPContentGenerator.USE_LITERAL);
- }
- else if (rpcLiteral.getSelection()) {
- soapGenerator.setStyle(SOAPContentGenerator.STYLE_RPC);
- soapGenerator.setUse(SOAPContentGenerator.USE_LITERAL);
- }
- else if (rpcEncoded.getSelection()) {
- soapGenerator.setStyle(SOAPContentGenerator.STYLE_RPC);
- soapGenerator.setUse(SOAPContentGenerator.USE_ENCODED);
- }
- }
- }
-
- public void setOptionsOnGenerator() {
- computeOptions();
- }
-
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFileOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFileOptionsPage.java
deleted file mode 100644
index 9407038b2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFileOptionsPage.java
+++ /dev/null
@@ -1,776 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.wizards;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.ws.service.policy.IServicePolicy;
-import org.eclipse.wst.wsdl.internal.generator.BindingGenerator;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.BaseContentGeneratorOptionsPage;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.ISoapStyleInfo;
-import org.eclipse.wst.wsdl.ui.internal.util.ServicePolicyHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.ValidateHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.dialogs.UpdateListener;
-
-public class WSDLNewFileOptionsPage extends WizardPage implements ModifyListener, UpdateListener, SelectionListener
-{
- protected WizardNewFileCreationPage newFileCreationPage;
- protected Text targetNamespaceText;
- protected Text prefixText;
- protected boolean updatePortOpFieldBoolean = true;
-
- protected PageBook protocolPageBook;
- protected Combo protocolCombo;
- protected Link WSIPreferenceLink;
-
- private BindingGenerator generator;
- private Map pageMap = new HashMap();
- private IServicePolicy activeServicePolicy;
-
- /**
- * Constructor for WSDLNewFileOptionsPage.
- * @param pageName
- */
- public WSDLNewFileOptionsPage(String pageName)
- {
- super(pageName);
- }
-
- public void setBindingGenerator(BindingGenerator generator) {
- this.generator = generator;
- }
-
- /**
- * Constructor for WSDLNewFileOptionsPage.
- * @param pageName
- * @param title
- * @param titleImage
- */
- public WSDLNewFileOptionsPage(String pageName, String title, ImageDescriptor titleImage)
- {
- super(pageName, title, titleImage);
- setDescription(Messages._UI_DESCRIPTION_NEW_WSDL_FILE);
- }
-
- public WSDLNewFileOptionsPage(String pageName, String title, ImageDescriptor titleImage, WizardNewFileCreationPage newFilePage)
- {
- super(pageName, title, titleImage);
- setDescription(Messages._UI_DESCRIPTION_NEW_WSDL_FILE);
- newFileCreationPage = newFilePage;
- }
-
- /**
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
- */
- public void createControl(Composite parent)
- {
- Composite base = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(base, Messages._UI_HELP); //$NON-NLS-1$
- base.setLayout(new GridLayout());
-
- // Group wsdlGroup = ViewUtility.createGroup(base, 2, "WSDL", false);
- Composite wsdlGroup = new Composite(base, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- wsdlGroup.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- wsdlGroup.setLayoutData(data);
-
- GridData gd = (GridData)wsdlGroup.getLayoutData();
- gd.grabExcessHorizontalSpace = true;
-
- Label targetNamespace = new Label(wsdlGroup, SWT.LEFT);
- targetNamespace.setText(Messages._UI_LABEL_TARGET_NAMESPACE);
- GridData nsData = new GridData();
- nsData.horizontalAlignment = GridData.FILL;
- targetNamespace.setLayoutData(nsData);
-
- targetNamespaceText = new Text(wsdlGroup, SWT.SINGLE | SWT.BORDER);
- GridData textData = new GridData();
- textData.horizontalAlignment = GridData.FILL;
- textData.grabExcessHorizontalSpace = true;
- textData.widthHint = 10;
- targetNamespaceText.setLayoutData(textData);
-
- targetNamespaceText.addModifyListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(targetNamespaceText, ASDEditorCSHelpIds.WSDL_WIZARD_OPTIONS_PAGE_TNS_TEXT);
-
- Label prefix = new Label(wsdlGroup, SWT.LEFT);
- prefix.setText(Messages._UI_LABEL_PREFIX_WITH_COLON);
-
- GridData prefixData = new GridData();
- prefixData.horizontalAlignment = GridData.FILL;
- prefix.setLayoutData(prefixData);
-
- prefixText = new Text(wsdlGroup, SWT.SINGLE | SWT.BORDER);
- GridData prefixTextData = new GridData();
- prefixTextData.horizontalAlignment = GridData.FILL;
- prefixTextData.grabExcessHorizontalSpace = true;
- prefixTextData.widthHint = 10;
- prefixText.setLayoutData(prefixTextData);
-
- prefixText.addModifyListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(prefixText, ASDEditorCSHelpIds.WSDL_WIZARD_OPTIONS_PAGE_PREFIX_TEXT);
-
- // XMLCatalog xmlCatalog = XMLCatalogRegistry.getInstance().lookupOrCreateXMLCatalog("default");
- // SelectXMLCatalogIdPanel catalog = new SelectXMLCatalogIdPanel(base, xmlCatalog);
-
-// Determine if the user wishes to create a skeleton WSDL. If yes, present the user with input fields.
- createSkeletonCheckBox = new Button(base, SWT.CHECK);
- createSkeletonCheckBox.setText(Messages._UI_LABEL_CREATE_WSDL_SKELETON);
- createSkeletonCheckBox.setSelection(true);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(createSkeletonCheckBox, ASDEditorCSHelpIds.WSDL_WIZARD_OPTIONS_PAGE_CREATE_SKELETON_CHECKBOX);
-
- wsdlSkeletonGroup = new Composite(base, SWT.NONE);
- GridLayout layout2 = new GridLayout();
- layout2.numColumns = 2;
- wsdlSkeletonGroup.setLayout(layout2);
-
- GridData data2 = new GridData();
- data2.verticalAlignment = GridData.FILL;
- data2.horizontalAlignment = GridData.FILL;
- wsdlSkeletonGroup.setLayoutData(data2);
-
- createLabel(wsdlSkeletonGroup, Messages._UI_LABEL_BINDING_PROTOCOL);
- protocolCombo = new Combo(wsdlSkeletonGroup, SWT.READ_ONLY);
- GridData dataC = new GridData();
- dataC.horizontalAlignment = GridData.FILL;
- dataC.grabExcessHorizontalSpace = true;
- protocolCombo.setLayoutData(dataC);
-
- IProject project = getProject();
- activeServicePolicy = ServicePolicyHelper.getActivePolicyWithProtocol(project);
- String defaultProtocolNS = ServicePolicyHelper.getDefaultBinding(project, activeServicePolicy);
- String defaultProtocolLabel = null;
- ContentGeneratorUIExtensionRegistry registry = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry();
- ContentGeneratorUIExtension extension = registry.getExtensionForNamespace(defaultProtocolNS);
- if (extension != null)
- defaultProtocolLabel = extension.getLabel();
-
- Iterator it = registry.getBindingExtensionNames().iterator();
- int defaultIndex = 0;
- boolean defaultFound = false;
- while (it.hasNext()) {
- String protocolName = (String) it.next();
- String protocolLabel = null;
- ContentGeneratorUIExtension ext = registry.getExtensionForName(protocolName);
- if (ext != null) {
- String label = ext.getLabel();
- if (label != null) {
- protocolLabel = label;
- protocolCombo.add(protocolLabel);
- }
- }
-
- if (!defaultFound && protocolLabel != null)
- {
- defaultFound = protocolLabel.equals(defaultProtocolLabel);
- if (!defaultFound) {
- ++defaultIndex;
- }
- }
- }
- if (!defaultFound) {
- defaultIndex = 0;
- }
-
- protocolCombo.addModifyListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(protocolCombo, ASDEditorCSHelpIds.WSDL_WIZARD_OPTIONS_PAGE_PROTOCOL_COMBO);
-
- // Create PageBook and pages/controls for the PageBook
- protocolPageBook = new PageBook(base, SWT.NONE);
- GridData gdFill = new GridData();
- gdFill.horizontalAlignment = GridData.FILL;
- gdFill.grabExcessHorizontalSpace = true;
- gdFill.verticalAlignment = GridData.FILL;
- gdFill.grabExcessVerticalSpace = true;
- protocolPageBook.setLayoutData(gdFill);
-
- if (protocolCombo.getItemCount() > 0) {
- String protocol = protocolCombo.getItem(defaultIndex);
- ContentGeneratorUIExtension ext = registry.getExtensionForLabel(protocol);
- ContentGeneratorOptionsPage page = ext.getBindingContentGeneratorOptionsPage();
- page.init(generator);
-
- protocolPageBook.showPage(page.getControl());
- protocolPageBook.setVisible(true);
- protocolCombo.select(defaultIndex);
- updatePageBook(protocol);
- }
-
- wsdlSkeletonGroup.setVisible(true);
-
- WSIPreferenceLink = new Link(base, SWT.NONE);
- WSIPreferenceLink.setText("<A>" + Messages._WSI_COMPLIANCE_LINK_TEXT + "</A>"); //$NON-NLS-1$ //$NON-NLS-2$
- WSIPreferenceLink.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- getNewWSDLWizard().openProjectWSIProperties();
- IProject project = getProject();
- activeServicePolicy = ServicePolicyHelper.getActivePolicyWithProtocol(project);
- setPageComplete(validatePage());
- }
- });
-
- WSIPreferenceLink.setLayoutData(new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_END));
-
- createSkeletonCheckBox.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(base, ASDEditorCSHelpIds.WSDL_WIZARD_OPTIONS_PAGE);
-
- setControl(base);
-
- }
-
- private NewWSDLWizard getNewWSDLWizard()
- {
- return (NewWSDLWizard)getWizard();
- }
-
- private String computeDefaultDefinitionName()
- {
- String name = "DefaultName"; //$NON-NLS-1$
- IPath path = getNewWSDLWizard().getNewFilePath();
- if (path != null)
- {
- name = path.removeFileExtension().lastSegment().toString();
- }
- return name;
- }
-
- private String computeDefaultNamespaceName()
- {
- String namespace = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(Messages._UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE);
- if (!namespace.endsWith("/")) { //$NON-NLS-1$
- namespace = namespace.concat("/"); //$NON-NLS-1$
- }
-
- IPath path = getNewWSDLWizard().getNewFilePath();
- if (path != null)
- {
- namespace += path.removeFileExtension().toString() + "/"; //$NON-NLS-1$
- }
- return namespace;
- }
-
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
-
- if (visible)
- {
- // prime the fields
- targetNamespaceText.setText(computeDefaultNamespaceName());
- prefixText.setText("tns"); //$NON-NLS-1$
- }
- }
-
- public String getTargetNamespace()
- {
- return targetNamespaceText.getText();
- }
-
- public String getPrefix()
- {
- return prefixText.getText().trim();
- }
-
- public String getDefinitionName()
- {
- return computeDefaultDefinitionName();
- }
-
- public void modifyText(ModifyEvent e)
- {
- if (e.widget == targetNamespaceText)
- {
- startDelayedEvent(e);
- }
- else if (e.widget == prefixText)
- {
- setPageComplete(validatePage());
- }
- else if (e.widget == protocolCombo)
- {
- String protocol = protocolCombo.getText();
-
- ContentGeneratorUIExtension ext = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry().getExtensionForLabel(protocol);
- generator.setContentGenerator(BindingGenerator.getContentGenerator(ext.getNamespace()));
- updatePageBook(protocol);
- setPageComplete(validatePage());
- }
- }
-
- protected void updatePageBook(String protocol)
- {
- if (protocol != null)
- {
- ContentGeneratorOptionsPage page = (ContentGeneratorOptionsPage) pageMap.get(protocol);
- if (page == null)
- {
- page = createContentGeneratorOptionsPage(protocol);
-
- if (page != null)
- {
- page.init(generator);
- page.createControl(protocolPageBook);
- pageMap.put(protocol, page);
-
- if (page instanceof BaseContentGeneratorOptionsPage) {
- // We should put the setWizardPage() method into the ContentGeneratorOptionsPage Interface
- ((BaseContentGeneratorOptionsPage) page).setWizardPage(this);
- }
-
- }
- }
-
- if (page != null)
- {
- protocolPageBook.showPage(page.getControl());
- protocolPageBook.layout();
- protocolPageBook.getParent().layout();
-
- page.setOptionsOnGenerator();
- }
- }
- }
-
- public ContentGeneratorOptionsPage createContentGeneratorOptionsPage(String protocol)
- {
- ContentGeneratorOptionsPage optionsPage = null;
- ContentGeneratorUIExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry().getExtensionForLabel(protocol);
- if (extension != null) {
- optionsPage = extension.getBindingContentGeneratorOptionsPage();
- }
- return optionsPage;
- }
-
- public void updateOccured(Object arg1, Object arg2)
- {
- setPageComplete(validatePage());
- }
-
- public boolean validatePage()
- {
- boolean ready = true;
-
- setErrorMessage(null);
- setMessage(null);
-
- // this.setMessage(Messages.getString("_UI_DESCRIPTION_NEW_WSDL_FILE"),this.NONE);
- // //$NON-NLS-1$
-
- // so that the page doesn't immediately show up with an error
- if (targetNamespaceText.getText().trim().equals("")) //$NON-NLS-1$
- {
- if (ready)
- {
- setErrorMessage(null);
- }
- return false;
- }
-
- if (!validateTargetNamespace(targetNamespaceText.getText()))
- {
- ready = false;
- }
-
- if (createSkeletonCheckBox.getSelection())
- {
- if (!displayDialogMessages())
- {
- ready = false;
- }
- }
- else
- {
- this.setMessage(Messages._UI_DESCRIPTION_NEW_WSDL_FILE, NONE);
- }
-
- return ready;
- }
-
- protected boolean displayDialogMessages()
- {
- String protocol = getProtocol();
- if (!(pageMap.get(protocol) instanceof ContentGeneratorOptionsPage))
- {
- return false;
- }
-
- if (!validateProtocol(protocol))
- {
- if (getMessageType() == IMessageProvider.ERROR)
- return false;
- else
- return true;
- }
-
- ContentGeneratorOptionsPage optionsPage = (ContentGeneratorOptionsPage) pageMap.get(protocol);
- IFile targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile(newFileCreationPage.getContainerFullPath().append(newFileCreationPage.getFileName()));
-
- if (optionsPage instanceof BaseContentGeneratorOptionsPage)
- {
- ((BaseContentGeneratorOptionsPage) optionsPage).setTargetIFile(targetFile);
-
- String message = ((IMessageProvider) optionsPage).getMessage();
- int messageType = ((IMessageProvider) optionsPage).getMessageType();
-
- if (messageType == IMessageProvider.NONE)
- {
- setMessage(Messages._UI_DESCRIPTION_NEW_WSDL_FILE, NONE);
- }
- else
- {
- setMessage(message, messageType);
- }
-
- if (messageType == IMessageProvider.ERROR)
- {
- return false;
- }
- }
-
- return true;
- }
-
- protected boolean validatePrefix(String prefix)
- {
- String errorMessage = ValidateHelper.checkXMLPrefix(prefix);
-
- if (errorMessage == null || errorMessage.length() == 0)
- {
- return true;
- }
- return false;
- }
-
- /**
- * Validates protocol by checking if there is an active wsi policy requires or
- * suggests a default protocol and that protocol is not the same as the
- * currently selected protocol
- *
- * @param protocol
- * @return
- */
- private boolean validateProtocol(String protocol)
- {
- ContentGeneratorUIExtensionRegistry registry = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry();
- ContentGeneratorUIExtension extension = registry.getExtensionForLabel(protocol);
- if (extension != null)
- {
- String namespace = extension.getNamespace();
- if (namespace != null)
- {
- IProject project = getProject();
- if (activeServicePolicy != null)
- {
- // get default binding and compare if same or not
- String defaultBinding = ServicePolicyHelper.getDefaultBinding(project, activeServicePolicy);
- if (!defaultBinding.equals(namespace))
- {
- int messageType = ServicePolicyHelper.getMessageSeverity(project, activeServicePolicy);
- if (messageType == IMessageProvider.ERROR)
- {
- // if not same, set error message
- // put up an error message
- ContentGeneratorUIExtension ext = registry.getExtensionForNamespace(defaultBinding);
- if (ext != null)
- {
- String n = ext.getLabel();
- setMessage(NLS.bind(Messages._ERROR_WSI_COMPLIANCE_PROTOCOL, new String[] { n }), IMessageProvider.ERROR);
- }
- return false;
- }
- else if (messageType == IMessageProvider.WARNING)
- {
- // put up a warning message
- ContentGeneratorUIExtension ext = registry.getExtensionForNamespace(defaultBinding);
- if (ext != null)
- {
- String n = ext.getLabel();
- setMessage(NLS.bind(Messages._WARN_WSI_COMPLIANCE_PROTOCOL, new String[] { n }), IMessageProvider.WARNING);
- }
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
- protected boolean validateXMLName(String xmlName)
- {
- String errorMessage = ValidateHelper.checkXMLName(xmlName);
-
- if (errorMessage == null || errorMessage.length() == 0)
- {
- return true;
- }
- setErrorMessage(errorMessage);
- return false;
- }
-
- protected boolean validateTargetNamespace(String ns)
- {
- boolean test = true;
- try
- {
- new URI(ns);
-// URI testURI = new URI(ns);
- // if (!testURI.isGenericURI())
- // {
- // setErrorMessage(WSDLEditorPlugin.getInstance().getWSDLString("_UI_ERROR_NAMESPACE_INVALID")); //$NON-NLS-1$
- // test = false;
- // }
- }
- catch (URISyntaxException e)
- {
- // String errorMessage = ValidateHelper.checkXMLName(ns);
- // if (errorMessage == null || errorMessage.length() == 0)
- // {
- // test = true;
- // }
- // else
- // {
- setErrorMessage(Messages._UI_ERROR_NAMESPACE_INVALID); //$NON-NLS-1$
- test = false;
- // }
- }
-
- return test;
- }
-
- /*
- * private boolean arePrefixesUniqueAndValid() { java.util.List infoList =
- * namespaceInfo.getNamespaceInfoList(); java.util.List checkedList =
- * namespaceInfo.getNamespaceCheckedList();
- *
- * Vector prefixList = new Vector(); boolean test = true; boolean isOneBlank =
- * false;
- *
- * String currentPrefix = prefixText.getText().trim(); if
- * (currentPrefix.length() == 0) { isOneBlank = true; } else { if
- * (validatePrefix(currentPrefix)) { prefixList.add(currentPrefix); } else {
- * setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_PREFIX_IS_INVALID",
- * currentPrefix)); //$NON-NLS-1$ return false; } }
- *
- * for (int i = 0; i < infoList.size(); i++) { NamespaceInfo info =
- * (NamespaceInfo)infoList.get(i); if
- * (((String)checkedList.get(i)).equals("true")) //$NON-NLS-1$ { String
- * aPrefix = info.prefix.trim(); if (aPrefix.length() > 0) { if
- * (!prefixList.contains(aPrefix)) { if (validatePrefix(aPrefix)) {
- * prefixList.add(aPrefix); } else {
- * setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_PREFIX_IS_INVALID",
- * info.prefix)); //$NON-NLS-1$ test = false; break; } } else {
- * setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_PREFIX_IS_A_DUPLICATE",
- * info.prefix)); //$NON-NLS-1$ test = false; break; } } else { if
- * (!isOneBlank) { isOneBlank = true; } else {
- * setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_MORE_THAN_ONE_PREFIX_IS_BLANK"));
- * //$NON-NLS-1$ test = false; break; } } } } return test; }
- */
-
- protected DelayedEvent delayedTask;
-
- protected void startDelayedEvent(ModifyEvent e)
- {
- if (delayedTask == null || delayedTask.getEvent() == null)
- {
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- else
- {
- ModifyEvent delayedEvent = delayedTask.getEvent();
-
- if (e.widget == delayedEvent.widget)
- {
- // same event, just different data, delay new event
- delayedTask.setEvent(null);
- }
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- }
-
- class DelayedEvent implements Runnable
- {
- protected ModifyEvent event;
-
- /*
- * @see Runnable#run()
- */
- public void run()
- {
- if (event != null)
- {
- setPageComplete(validatePage());
- event = null;
- }
- }
-
- public ModifyEvent getEvent()
- {
- return event;
- }
-
- public void setEvent(ModifyEvent event)
- {
- this.event = event;
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == createSkeletonCheckBox) {
- if (createSkeletonCheckBox.getSelection()) {
- wsdlSkeletonGroup.setVisible(true);
- protocolPageBook.setVisible(true);
- }
- else {
- wsdlSkeletonGroup.setVisible(false);
- protocolPageBook.setVisible(false);
- }
- setPageComplete(validatePage());
- }
- }
-
- Composite wsdlSkeletonGroup;
-
- Button createSkeletonCheckBox;
-
- private Label createLabel(Composite comp, String labelString) {
- Label label = new Label(comp, SWT.LEFT);
- label.setText(labelString);
- GridData nsData = new GridData();
- nsData.horizontalAlignment = GridData.FILL;
- label.setLayoutData(nsData);
-
- return label;
- }
-
- public Vector getNamespaceInfo() {
- Vector namespaces = new Vector();
-
- // Add Default Namespaces
- NamespaceInfo info1 = new NamespaceInfo();
- info1.prefix = "wsdl"; //$NON-NLS-1$
- info1.uri = "http://schemas.xmlsoap.org/wsdl/"; //$NON-NLS-1$
- namespaces.addElement(info1);
-
- NamespaceInfo info8 = new NamespaceInfo();
- info8.prefix = "xsd"; //$NON-NLS-1$
- info8.uri = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
- namespaces.addElement(info8);
-
- return namespaces;
- }
-
- public boolean getCreateSkeletonBoolean() {
- return createSkeletonCheckBox.getSelection();
- }
-
- public String getProtocol() {
- return protocolCombo.getText();
- }
-
- public boolean isSoapDocLiteralProtocol() {
- // We need to revisit this.... Can we make this code more generic...
- // Wee need this method because the NewWSDLWizard needs to know if it should create the new
- // WSDL with a doc-literal pattern (A WSDL Part referencing an XSD Element)
- ContentGeneratorOptionsPage optionsPage = (ContentGeneratorOptionsPage) pageMap.get(getProtocol());
- if (optionsPage instanceof ISoapStyleInfo) {
- return ((ISoapStyleInfo) optionsPage).isDocumentLiteralPattern();
- }
-
- return false;
- }
-
- /**
- * Returns the project the current containing project
- *
- * @return IProject object. If path is <code>null</code> the return value is
- * also <code>null</code>.
- */
- public IProject getProject()
- {
- IPath path = newFileCreationPage.getContainerFullPath();
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject project = null;
-
- if (path != null)
- {
- if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK())
- {
- project = workspace.getRoot().getProject(path.toString());
- }
- else
- {
- project = workspace.getRoot().getFile(path).getProject();
- }
- }
-
- return project;
- }
-
- public IServicePolicy getServicePolicy()
- {
- return activeServicePolicy;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFilePage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFilePage.java
deleted file mode 100644
index 0b5fb0d43..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFilePage.java
+++ /dev/null
@@ -1,133 +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.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-
-public class WSDLNewFilePage extends WizardNewFileCreationPage
-{
- public WSDLNewFilePage(IStructuredSelection selection)
- {
- super(Messages._UI_TITLE_NEW_WSDL_FILE, selection); //$NON-NLS-1$
- setTitle(Messages._UI_TITLE_NEW_WSDL_FILE); //$NON-NLS-1$
- setDescription(Messages._UI_LABEL_CREATE_NEW_WSDL_FILE); //$NON-NLS-1$
- }
-
- public void createControl(Composite parent)
- {
- // inherit default container and name specification widgets
- super.createControl(parent);
- this.setFileName(computeDefaultFileName());
-
- setPageComplete(validatePage());
- }
-
- protected boolean validatePage()
- {
- Path newName = new Path(getFileName());
- String fullFileName = getFileName();
- String extension = newName.getFileExtension();
- if (extension == null || !extension.equalsIgnoreCase("wsdl")) //$NON-NLS-1$
- {
- setErrorMessage(Messages._UI_ERROR_FILE_MUST_END_WITH_WSDL); //$NON-NLS-1$
- return false;
- }
- else
- {
- setErrorMessage(null);
- }
-
- // check for file should be case insensitive
- String sameName = existsFileAnyCase(fullFileName);
- if (sameName != null)
- {
-// String qualifiedFileName = getContainerFullPath().toString() + '/' + fullFileName;
- setErrorMessage(NLS.bind(Messages._UI_ERROR_FILE_ALREADY_EXISTS, sameName)); //$NON-NLS-1$
- return false;
- }
-
-
- return super.validatePage();
- }
-
- public String defaultName = "NewWSDLFile"; //$NON-NLS-1$
- public String defaultFileExtension = ".wsdl"; //$NON-NLS-1$
- public String[] filterExtensions = { "*.wsdl"}; //$NON-NLS-1$
-
-
- protected String computeDefaultFileName()
- {
- int count = 0;
- String fileName = defaultName + defaultFileExtension;
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null)
- {
- while (true)
- {
- IPath path = containerFullPath.append(fileName);
- // if (WorkbenchUtility.getWorkspace().getRoot().exists(path))
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
- {
- count++;
- fileName = defaultName + count + defaultFileExtension;
- }
- else
- {
- break;
- }
- }
- }
- return fileName;
- }
-
- // returns true if file of specified name exists in any case for selected container
- protected String existsFileAnyCase(String fileName)
- {
- if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
- && (fileName.compareTo("") != 0)) //$NON-NLS-1$
- {
- //look through all resources at the specified container - compare in upper case
- IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
- if (parent instanceof IContainer)
- {
- IContainer container = (IContainer) parent;
- try
- {
- IResource[] members = container.members();
- String enteredFileUpper = fileName.toUpperCase();
- for (int i=0; i<members.length; i++)
- {
- String resourceUpperName = members[i].getName().toUpperCase();
- if (resourceUpperName.equals(enteredFileUpper))
- {
- return members[i].getName();
- }
- }
- }
- catch (CoreException e)
- {
- }
- }
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeAssociationProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeAssociationProvider.java
deleted file mode 100644
index bcb0590aa..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeAssociationProvider.java
+++ /dev/null
@@ -1,77 +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.xsd;
-
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.extensions.INodeAssociationProvider;
-
-
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDNodeAssociationProvider implements INodeAssociationProvider
-{
- public Object getModelObject(Object parentModelObject, Element[] elementChain, int start, int[] end)
- {
- Object result = null;
- if (parentModelObject instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement extensibilityElement = (XSDSchemaExtensibilityElement)parentModelObject;
- XSDSchema schema = extensibilityElement.getSchema();
- if (schema != null)
- {
- Element targetElement = elementChain[elementChain.length - 1];
- result = schema.getCorrespondingComponent(targetElement);
- }
- }
- else if (parentModelObject instanceof CategoryAdapter)
- {
- result = ((CategoryAdapter)parentModelObject).getXSDSchema();
- }
-// else if (parentModelObject instanceof Category)
-// {
-// result = ((Category)parentModelObject).getXSDSchema();
-// }
-
- return result;
- }
-
- public Node getNode(Object modelObject)
- {
- Node node = null;
- if (modelObject instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement extensibilityElement = (XSDSchemaExtensibilityElement)modelObject;
- XSDSchema schema = extensibilityElement.getSchema();
- if (schema != null)
- {
- node = schema.getElement();
- }
- }
- else if (modelObject instanceof XSDConcreteComponent)
- {
- node = ((XSDConcreteComponent)modelObject).getElement();
- }
- else if (modelObject instanceof CategoryAdapter)
- {
- node = ((CategoryAdapter)modelObject).getXSDSchema().getElement();
- }
-// else if (modelObject instanceof Category)
-// {
-// node = ((Category)modelObject).getXSDSchema().getElement();
-// }
-
- return node;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorCSHelpIds.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorCSHelpIds.java
deleted file mode 100644
index 49330e3b5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorCSHelpIds.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd;
-
-public class ASDEditorCSHelpIds {
- private static String pluginId = "org.eclipse.wst.wsdl.ui."; //$NON-NLS-1$
-
- /*-------------------------------------------------------------------------------
- New WSDL Wizard - Options page:
- -------------------------------------------------------------------------------*/
- public static String WSDL_WIZARD_OPTIONS_PAGE_TNS_TEXT = pluginId + "wsdlu0000"; //$NON-NLS-1$
- public static String WSDL_WIZARD_OPTIONS_PAGE_PREFIX_TEXT = pluginId + "wsdlu0001"; //$NON-NLS-1$
- public static String WSDL_WIZARD_OPTIONS_PAGE_CREATE_SKELETON_CHECKBOX = pluginId + "wsdlu0002"; //$NON-NLS-1$
- public static String WSDL_WIZARD_OPTIONS_PAGE_PROTOCOL_COMBO = pluginId + "wsdlu0003"; //$NON-NLS-1$
-
-// Soap Binding Options
- public static String DOC_LIT_RADIO = pluginId + "wsdlu0010"; //$NON-NLS-1$
- public static String RPC_LIT_RADIO = pluginId + "wsdlu0011"; //$NON-NLS-1$
- public static String RPC_ENCODED_RADIO = pluginId + "wsdlu0012"; //$NON-NLS-1$
-
-// HTTP Binding Options
- public static String HTTP_GET_RADIO = pluginId + "wsdlu0013"; //$NON-NLS-1$
- public static String HTTP_POST_RADIO = pluginId + "wsdlu0014"; //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Design View
- -------------------------------------------------------------------------------*/
- public static String WSDL_DESIGN_VIEW_SERVICE_OBJECT = pluginId + "wsdlu0020"; // Service Object --> wsdlu0020 //$NON-NLS-1$
- public static String WSDL_DESIGN_VIEW_BINDING_OBJECT = pluginId + "wsdlu0021"; // Binding Object --> wsdlu0021 //$NON-NLS-1$
- public static String WSDL_DESIGN_VIEW_PORTTYPE_OBJECT = pluginId + "wsdlu0022"; // PortType Object --> wsdlu0022 //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Outline View
- -------------------------------------------------------------------------------*/
- public static String WSDL_OUTLINE_VIEW_GROUP = pluginId + "wsdlu0023"; // Imports, Types, Services, Bindings, Port Types, Messages (grouped together) --> wsdlu0023 //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Port Wizard
- -------------------------------------------------------------------------------*/
- public static String PORT_WIZARD = pluginId + "wsdlu0030"; //$NON-NLS-1$
- public static String PORT_WIZARD_NAME_TEXT = pluginId + "wsdlu0031"; // not used - dup below //$NON-NLS-1$
- public static String PORT_WIZARD_BINDING_COMBO = pluginId + "wsdlu0032"; // not used - dup below //$NON-NLS-1$
- public static String PORT_WIZARD_PROTOCOL_COMBO = pluginId + "wsdlu0033"; // not used - dup below //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Generate Binding Wizard
- -------------------------------------------------------------------------------*/
- public static String BINDING_WIZARD = pluginId + "wsdlu0040"; //$NON-NLS-1$
- public static String PROTOCOL_COMPONENT_NAME_TEXT = pluginId + "wsdlu0041"; //$NON-NLS-1$
- public static String PROTOCOL_COMPONENT_REF_COMBO = pluginId + "wsdlu0042"; //$NON-NLS-1$
- public static String PROTOCOL_COMPONENT_PROTOCOL_COMBO = pluginId + "wsdlu0043"; //$NON-NLS-1$
- public static String pROTOCOL_COMPONENT_OVERWRITE_CHECKBOX = pluginId + "wsdlu0044"; //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Edit Namespaces Dialog --- common.ui
- -------------------------------------------------------------------------------*/
- public static String EDIT_NS_DIALOG = pluginId + "wsdlu0050"; // Edit Namespaces Dialog "dialog" --> wsdlu0050 //$NON-NLS-1$
- public static String EDIT_NS_DIALOG_TNS_TEXT = pluginId + "wsdlu0051"; // Target Namespace "text" --> wsdlu0051 //$NON-NLS-1$
- public static String EDIT_NS_DIALOG_DECLARATIONS_TABLE = pluginId + "wsdlu0052"; // Namespace Declarations "table" --> wsdlu0052 //$NON-NLS-1$
-
- public static String EDIT_NS_DIALOG_ADD_BUTTON = pluginId + "wsdlu0053"; // Add... "push button" --> wsdlu0053 //$NON-NLS-1$
- public static String EDIT_NS_DIALOG_EDIT_BUTTON = pluginId + "wsdlu0054"; // Edit... "push button" --> wsdlu0054 //$NON-NLS-1$
- public static String EDIT_NS_DIALOG_DELETE_BUTTON = pluginId + "wsdlu0055"; // Delete "push button" --> wsdlu0055 //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Add Namespace Declarations Dialog --- common.ui
- -------------------------------------------------------------------------------*/
- public static String ADD_NS_DECL = pluginId + "wsdlu0060"; // Add Namespace Declarations Dialog "dialog" --> wsdlu0060 //$NON-NLS-1$
- public static String ADD_NS_DECL_SELECT_REG_NS_RADIO = pluginId + "wsdlu0061"; // Select From Registered Namespaces "radio" --> wsdlu0061 //$NON-NLS-1$
- public static String ADD_NS_DECL_SPECIFY_NEW_NS_RADIO = pluginId + "wsdlu0062"; // Specify New Namespace "radio" --> wsdlu0062 //$NON-NLS-1$
-
- // Registered Namespaces:
- public static String ADD_NS_DECL_SELECT_NS_TO_ADD_TABLE = pluginId + "wsdlu0063"; // Select the namespace declarations to add "table" --> wsdlu0063 //$NON-NLS-1$
-
- // New Namespace:
- public static String ADD_NS_DECL_PREFIX_TEXT = pluginId + ""; // Prefix: "text" -->(COMMON) wsdlu0064 //$NON-NLS-1$
- public static String ADD_NS_DECL_NAMESPACE_NAME_TEXT = pluginId + ""; // Namespace Name: "text" -->(COMMON) wsdlu0065 //$NON-NLS-1$
- public static String ADD_NS_DECL_LOCATION_HINT_TEXT = pluginId + ""; // Location Hint: "text" -->(COMMON) wsdlu0066 //$NON-NLS-1$
- public static String ADD_NS_DECL_BROWSE_BUTTON = pluginId + ""; // Browse... "push button" -->(COMMON) wsdlu0067 //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - New Namespace Information Dialog --- common.ui
- -------------------------------------------------------------------------------*/
- public static String NEW_NAMESPACE_INFO_DIALOG = pluginId + "wsdlu0068"; //$NON-NLS-1$
-
- public static String NAMESPACE_NAME = pluginId + "wsdlu0065"; //$NON-NLS-1$
- public static String PREFIX = pluginId + "wsdlu0064"; //$NON-NLS-1$
- public static String LOCATION_HINT = pluginId + "wsdlu0066"; //$NON-NLS-1$
- public static String BROWSE = pluginId + "wsdlu0067"; //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - New Message Dialog
- -------------------------------------------------------------------------------*/
- public static String NEW_MESSAGE_DIALOG = pluginId + "wsdlu0080"; //$NON-NLS-1$
- public static String NEW_MESSAGE_DIALOG_NAME_TEXT = pluginId + "wsdlu0081"; // not used -- text will use "dialog" context Id //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Specify Message Dialog --- common.ui
- -------------------------------------------------------------------------------*/
- public static String SPECIFY_MESSAGE_DIALOG = pluginId + "wsdlu0082"; // "dialog" --> wsdlu0082 //$NON-NLS-1$
-
- public static String SPECIFY_DIALOG_NAME_TEXT = pluginId + "wsdlu0070"; // Name (? = character, * = any string): "text" -->(COMMON) wsdlu0070 //$NON-NLS-1$
- public static String SPECIFY_DIALOG_COMPONENTS_LIST = pluginId + "wsdlu0071"; // Components "list" -->(COMMON) wsdlu0071 //$NON-NLS-1$
-
- public static String SPECIFY_DIALOG_SEARCH_SCOPE = pluginId + "wsdlu0072"; // Search Scope: //$NON-NLS-1$
- //Workspace, Enclosing Project, Current Resource, Working Sets (Grouped) "radio" -->(COMMON) wsdlu0072
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - New Binding Dialog
- -------------------------------------------------------------------------------*/
- public static String NEW_BINDING_DIALOG = pluginId + "wsdlu0083"; //$NON-NLS-1$
- public static String NEW_BINDING_DIALOG_NAME_TEXT = pluginId + "wsdlu0084"; // not used -- text will use "dialog" context Id //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Specify Binding Dialog --- common.ui
- -------------------------------------------------------------------------------*/
- public static String SPECIFY_BINDING_DIALOG = pluginId + "wsdlu0085"; // Specify Binding Dialog "dialog" --> wsdlu0085 //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - New PortType Dialog
- -------------------------------------------------------------------------------*/
- public static String NEW_PORTTYPE_DIALOG = pluginId + "wsdlu0086"; //$NON-NLS-1$
- public static String NEW_PORTTYPE_DIALOG_NAME_TEXT = pluginId + "wsdlu0087"; // not used -- text will use "dialog" context Id //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Specify Port Type Dialog --- common.ui
- -------------------------------------------------------------------------------*/
- public static String SPECIFY_PORTTYPE_DIALOG = pluginId + "wsdlu0088"; // Specify Port Type Dialog "dialog" --> wsdlu0088 //$NON-NLS-1$
-
-
- /*-------------------------------------------------------------------------------
- WSDL Editor - Properties
- -------------------------------------------------------------------------------*/
- //Definition:
- public static String PROPERTIES_NAME_TEXT = pluginId + "wsdlu0100"; //$NON-NLS-1$
- public static String PROPERTIES_DEF_PREFIX_TEXT = pluginId + "wsdlu0101"; //$NON-NLS-1$
- public static String PROPERTIES_DEF_TNS_TEXT = pluginId + "wsdlu0102"; //$NON-NLS-1$
-
- //Port:
- public static String PROPERTIES_PORT_BINDING_COMBO = pluginId + "wsdlu0103"; //$NON-NLS-1$
- public static String PROPERTIES_PORT_ADDRESS_TEXT = pluginId + "wsdlu0104"; //$NON-NLS-1$
- public static String PROPERTIES_PORT_PROTOCOL_TEXT = pluginId + "wsdlu0105"; //$NON-NLS-1$
-
- //Binding:
- public static String PROPERTIES_BINDING_PORTTYPE_COMBO = pluginId + "wsdlu0106"; //$NON-NLS-1$
- public static String PROPERTIES_BINDING_PROTOCOL_TEXT = pluginId + "wsdlu0107"; //$NON-NLS-1$
- public static String PROPERTIES_BINDING_GEN_BINDING_BUTTON = pluginId + "wsdlu0108"; //$NON-NLS-1$
-
- //Input/Output/Fault:
- public static String PROPERTIES_MESSAGE_REF_MESSAGE_COMBO = pluginId + "wsdlu0109"; //$NON-NLS-1$
-
- //Part:
- public static String PROPERTIES_PART_ELEMENT_COMBO = pluginId + "wsdlu0110"; //$NON-NLS-1$
- public static String PROPERTIES_PART_TYPE_COMBO = pluginId + "wsdlu0111"; //$NON-NLS-1$
- public static String PROPERTIES_PART_TYPE_RADIO = pluginId + "wsdlu0112"; //$NON-NLS-1$
- public static String PROPERTIES_PART_ELEMENT_RADIO = pluginId + "wsdlu0113"; //$NON-NLS-1$
-
-
- public static String PROPERTIES_DOCUMENTATION_TAB = pluginId + "wsdlu0114"; //$NON-NLS-1$
-
- public static String WSDL_WIZARD_OPTIONS_PAGE = pluginId + "wsdlu0120"; // New WSDL Wizard - options page --> wsdlu0120 //$NON-NLS-1$
- public static String WSDL_DESIGN_VIEW = pluginId + "wsdlu0121"; // Design View --> wsdlu0121 //$NON-NLS-1$
- public static String WSDL_OUTLINE_VIEW = pluginId + "wsdlu0122"; // Outline View --> wsdlu0122 //$NON-NLS-1$
- public static String WSDL_PROPERTIES_VIEW = pluginId + "wsdlu0123"; // Properties View --> wsdlu0123 //$NON-NLS-1$
-
-// WSDL Preference Page:
- public static String WSDL_PREF_DEFAULT_TNS = pluginId + "wsdlu0200"; //$NON-NLS-1$
- public static String WSDL_PREF_REGEN_ON_SAVE = pluginId + "wsdlu0201"; //$NON-NLS-1$
- public static String WSDL_PREF_PROMPT_REGEN_ON_SAVE = pluginId + "wsdlu0202"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorPlugin.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorPlugin.java
deleted file mode 100644
index c7ac0befd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDEditorPlugin.java
+++ /dev/null
@@ -1,68 +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.asd;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class ASDEditorPlugin extends AbstractUIPlugin {
- public static int DEPENDECIES_CHANGED_POLICY_RELOAD = 2;
-
- protected static ASDEditorPlugin instance;
-
- public ASDEditorPlugin() {
- }
-
-// /**
-// * Get the singleton instance.
-// */
-// public static ASDEditorPlugin getInstance()
-// {
-// if (instance == null) {
-// instance = new ASDEditorPlugin();
-// }
-// return instance;
-// }
-//
-// public Image getImage(String iconName)
-// {
-// ImageRegistry imageRegistry = getImageRegistry();
-//
-// if (imageRegistry.get(iconName) != null)
-// {
-// return imageRegistry.get(iconName);
-// }
-// else
-// {
-// imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
-// return imageRegistry.get(iconName);
-// }
-// }
-
- public static ImageDescriptor getImageDescriptor(String path) {
- // We should not know about WSDLEditorPlugin.java. Eventually, we should move these
- // 'generic', 'top-level' icons to the ASD level.....
- return WSDLEditorPlugin.getImageDescriptor(path);
- }
-
- public static ImageDescriptor getImageDescriptorFromPlugin(String path) {
- // We should not know about WSDLEditorPlugin.java. Eventually, we should move these
- // 'generic', 'top-level' icons to the ASD level.....
- return WSDLEditorPlugin.getImageDescriptorFromPlugin(path);
- }
-
- public static IEditorPart getActiveEditor() {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDLabelProvider.java
deleted file mode 100644
index 228ca216d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDLabelProvider.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-
-public class ASDLabelProvider extends LabelProvider {
- /**
- *
- */
- public ASDLabelProvider() {
- super();
- }
-
- private ILabelProvider getDelegate()
- {
- ILabelProvider labelProvider = null;
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- EditorModeManager manager = (EditorModeManager) editor.getAdapter(EditorModeManager.class);
- if (manager != null)
- {
- labelProvider = (ILabelProvider) manager.getCurrentMode().getAdapter(ILabelProvider.class);
- }
- return labelProvider;
- }
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object object) {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return null;
- }
- Image result = null;
- if (object instanceof StructuredSelection) {
- Object selected = ((StructuredSelection)object).getFirstElement();
- ILabelProvider delegate = getDelegate();
- if (delegate != null) {
- result = delegate.getImage(selected);
- }
- else if (selected instanceof ITreeElement) {
- result = ((ITreeElement) selected).getImage();
- }
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object object) {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return "No items selected";//$NON-NLS-1$
- }
- String result = null;
- Object selected = null;
- if (object instanceof StructuredSelection) {
- selected = ((StructuredSelection) object).getFirstElement();
-
- ILabelProvider delegate = getDelegate();
- if (delegate != null) {
- result = delegate.getText(selected);
- }
- else if (selected instanceof ITreeElement) {
- result = ((ITreeElement) selected).getText();
- }
-
- boolean isFileReadOnly = false;
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null) {
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- IEditorInput editorInput = editor.getEditorInput();
- if (!(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput)) {
- isFileReadOnly = true;
- }
- }
- }
- }
- }
-
- if (selected instanceof IASDObject && ((IASDObject) selected).isReadOnly() || isFileReadOnly) {
- result = result + " (" + Messages._UI_LABEL_READ_ONLY + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDMultiPageEditor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDMultiPageEditor.java
deleted file mode 100644
index 73103ad0d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDMultiPageEditor.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddEndPointAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddFaultAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddImportAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddInputAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddOperationAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddOutputAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddParameterAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddSchemaAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddServiceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDeleteAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDGenerateBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDOpenSchemaAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetExistingBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetExistingInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetNewBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetNewInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewContextMenuProvider;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.DirectEditSelectionTool;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ASDEditPartFactory;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ASDContentOutlinePage;
-import org.eclipse.wst.wsdl.ui.internal.asd.properties.sections.ASDTabbedPropertySheetPage;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonMultiPageEditor;
-
-public abstract class ASDMultiPageEditor extends CommonMultiPageEditor
-{
- // TODO: move to design viewer
- protected DesignViewContextMenuProvider menuProvider;
- protected IDescription model;
- private int currentPage = -1;
-
- /**
- * Creates a multi-page editor example.
- */
- public ASDMultiPageEditor()
- {
- super();
-
- getEditDomain().setActiveTool(new DirectEditSelectionTool());
- getEditDomain().setDefaultTool(new DirectEditSelectionTool());
- }
-
- public String getContributorId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.WSDLEditor"; //$NON-NLS-1$
- }
-
- private class InternalLayout extends StackLayout
- {
- public InternalLayout() {
- super();
- }
-
- protected void layout(Composite composite, boolean flushCache) {
- Control children[] = composite.getChildren();
- Rectangle rect = composite.getClientArea();
- rect.x += marginWidth;
- rect.y += marginHeight;
- rect.width -= 2 * marginWidth;
- rect.height -= 2 * marginHeight;
-
- for (int i = 0; i < children.length; i++) {
- if (i == 0 && modeCombo != null) { // For the drop down toolbar
- children[i].setBounds(rect.x + rect.width - 90 - maxLength, rect.y + 10, maxLength + 60, 26);
- }
- else {// For the main graph viewer
- children[i].setBounds(rect);
- }
- }
- }
- }
-
- protected Composite createGraphPageComposite() {
- Composite parent = new Composite(getContainer(), SWT.FLAT);
- parent.setLayout(new InternalLayout());
- createViewModeToolbar(parent);
- return parent;
- }
-
-
- public IContentOutlinePage getContentOutlinePage() {
- if ((fOutlinePage == null) || fOutlinePage.getControl() == null || (fOutlinePage.getControl().isDisposed())) {
- IContentProvider provider = getEditorModeManager().getCurrentMode().getOutlineProvider();
-
- ASDContentOutlinePage outlinePage = new ASDContentOutlinePage(this, menuProvider);
- outlinePage.setContentProvider((ITreeContentProvider)provider);
- outlinePage.setLabelProvider((ILabelProvider)provider);
- outlinePage.setModel(getModel());
- outlinePage.addSelectionChangedListener(getSelectionManager());
- getSelectionManager().addSelectionChangedListener(outlinePage);
-
- fOutlinePage = outlinePage;
- }
- return fOutlinePage;
- }
-
- /**
- * Creates the pages of the multi-page editor.
- */
- protected void createPages()
- {
- selectionProvider = getSelectionManager();
- getEditorSite().setSelectionProvider(selectionProvider);
-
- createGraphPage();
- createSourcePage();
-
- buildAndSetModel();
- initializeGraphicalViewer();
- setActivePage(getDefaultPageTypeIndex());
-
- getSelectionManager().setSelection(new StructuredSelection(getModel()));
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(graphicalViewer.getControl(), ASDEditorCSHelpIds.WSDL_DESIGN_VIEW);
- }
-
- protected int getDefaultPageTypeIndex() {
- int pageIndex = SOURCE_PAGE_INDEX;
- if (WSDLEditorPlugin.getInstance().getDefaultPage().equals(WSDLEditorPlugin.DESIGN_PAGE)) {
- pageIndex = DESIGN_PAGE_INDEX;
- }
-
- return pageIndex;
- }
-
- protected ScrollingGraphicalViewer getGraphicalViewer()
- {
- return new DesignViewGraphicalViewer(this, getSelectionManager());
- }
-
- public void buildAndSetModel() {
- model = buildModel(getEditorInput());
- }
-
- abstract public IDescription buildModel(IEditorInput editorInput);
-
- public boolean isFileReadOnly() {
- IEditorInput editorInput = getEditorInput();
- return !(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput);
- }
-
- protected void createActions()
- {
- ActionRegistry registry = getActionRegistry();
- BaseSelectionAction action;
- if (!isFileReadOnly())
- {
- action = new ASDAddServiceAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddBindingAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddInterfaceAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddEndPointAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddOperationAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddInputAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddOutputAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddFaultAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDDeleteAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDSetNewBindingAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDSetExistingBindingAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDSetNewInterfaceAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDSetExistingInterfaceAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDGenerateBindingAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddImportAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddParameterAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ASDAddSchemaAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
- }
-
- action = new ASDOpenSchemaAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ShowPropertiesViewAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
- }
-
- public IDescription getModel()
- {
- return model;
- }
-
- public Object getAdapter(Class type)
- {
- if (type == ZoomManager.class)
- return graphicalViewer.getProperty(ZoomManager.class.toString());
-
- if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class)
- {
- ASDTabbedPropertySheetPage page = new ASDTabbedPropertySheetPage(this);
- return page;
- }
- if (type == GraphicalViewer.class)
- return graphicalViewer;
- if (type == EditPart.class && graphicalViewer != null)
- return graphicalViewer.getRootEditPart();
- if (type == IFigure.class && graphicalViewer != null)
- return ((GraphicalEditPart) graphicalViewer.getRootEditPart()).getFigure();
-
- if (IContentOutlinePage.class.equals(type))
- {
- return getContentOutlinePage();
- }
-
- if (type == ISelectionProvider.class)
- {
- return getSelectionManager();
- }
-
- return super.getAdapter(type);
- }
-
- protected EditPartFactory getEditPartFactory() {
- return new ASDEditPartFactory();
- }
-
- protected void setEditPartFactory(EditPartFactory factory) {
- graphicalViewer.setEditPartFactory(factory);
- }
-
- protected void initializeGraphicalViewer()
- {
- graphicalViewer.setContents(model);
- menuProvider = new DesignViewContextMenuProvider(graphicalViewer, getSelectionManager());
- }
-
- protected void pageChange(int newPageIndex) {
- currentPage = newPageIndex;
- super.pageChange(newPageIndex);
- }
-
- public void dispose() {
- if (currentPage == SOURCE_PAGE_INDEX) {
- WSDLEditorPlugin.getInstance().setDefaultPage(WSDLEditorPlugin.SOURCE_PAGE);
- }
- else {
- WSDLEditorPlugin.getInstance().setDefaultPage(WSDLEditorPlugin.DESIGN_PAGE);
- }
-
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDSelectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDSelectionManager.java
deleted file mode 100644
index 3c7ac861d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/ASDSelectionManager.java
+++ /dev/null
@@ -1,100 +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.asd;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-
-public class ASDSelectionManager extends MultiPageSelectionProvider implements ISelectionProvider, ISelectionChangedListener
-{
- protected List listenerList = new ArrayList();
- protected ISelection currentSelection;
- protected boolean enableNotify = true;
-
- public ASDSelectionManager(MultiPageEditorPart multiPageEditor)
- {
- super(multiPageEditor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection()
- {
- return currentSelection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection)
- {
- setSelection(selection, this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (enableNotify)
- {
- setSelection(event.getSelection(), event.getSelectionProvider());
- }
- }
-
- public void setSelection(ISelection selection, ISelectionProvider source)
- {
- if (enableNotify)
- {
- currentSelection = selection;
- enableNotify = false;
- try
- {
- SelectionChangedEvent event = new SelectionChangedEvent(source, selection);
- List copyOfListenerList = new ArrayList(listenerList);
- for (Iterator i = copyOfListenerList.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(event);
- }
- }
- finally
- {
- enableNotify = true;
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/Messages.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/Messages.java
deleted file mode 100644
index 8203720df..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/Messages.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.asd;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.wsdl.ui.internal.asd.messages"; //$NON-NLS-1$
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class); //$NON-NLS-1$
- }
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- // TODO Auto-generated method stub
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
- public static String _UI_TAB_GRAPH;
- public static String _UI_TAB_SOURCE;
- public static String _UI_BUTTON_NEW;
- public static String _UI_LABEL_READ_ONLY;
- public static String _UI_LABEL_NAMESPACE;
- public static String _UI_LABEL_PORTTYPE;
- public static String _UI_LABEL_LOCATION;
- public static String _UI_LABEL_ADDRESS;
- public static String _UI_LABEL_BINDING;
- public static String _UI_LABEL_PREFIX;
- public static String _UI_LABEL_NAME;
- public static String _UI_LABEL_TYPE;
- public static String _UI_ACTION_ADD_SERVICE;
- public static String _UI_ACTION_ADD_MESSAGE;
- public static String _UI_ACTION_ADD_OPERATION;
- public static String _UI_ACTION_ADD_IMPORT;
- public static String _UI_ACTION_ADD_OUTPUT;
- public static String _UI_ACTION_ADD_FAULT;
- public static String _UI_ACTION_ADD_PORT;
- public static String _UI_ACTION_ADD_PORTTYPE;
- public static String _UI_ACTION_DELETE;
- public static String _UI_BUTTON_BROWSE;
- public static String _UI_ACTION_NEW_PORTTYPE;
- public static String _UI_ACTION_NEW_BINDING;
- public static String _UI_ACTION_EXISTING_PORTTYPE;
- public static String _UI_GENERATE_BINDING_CONTENT;
- public static String _UI_ACTION_EXISTING_BINDING;
- public static String _UI_LABEL_BINDING_PROTOCOL;
- public static String _UI_LABEL_TARGET_NAMESPACE;
- public static String _UI_ACTION_ADD_BINDING;
- public static String _UI_ACTION_ADD_SCHEMA;
- public static String _UI_ACTION_ADD_INPUT;
- public static String _UI_SECTION_ADVANCED_ATTRIBUTES;
-
- public static String _UI_ACTION_EDIT_NAMESPACES;
- public static String _UI_ACTION_OPEN_SCHEMA;
- public static String _UI_TOOLTIP_RENAME_REFACTOR;
-
- public static String _UI_LABEL_RIGHT_CLICK_TO_INSERT_CONTENT;
- public static String _UI_ACTION_SHOW_PROPERTIES;
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddBindingAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddBindingAction.java
deleted file mode 100644
index 1ea54453c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddBindingAction.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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-
-public class ASDAddBindingAction extends BaseSelectionAction {
- public static String ID = "ASDAddBindingAction"; //$NON-NLS-1$
-
- public ASDAddBindingAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_BINDING); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/binding_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof ICategoryAdapter) {
- o = ((ICategoryAdapter) o).getOwnerDescription();
- }
-
- if (o instanceof IDescription) {
- Command command = ((IDescription) o).getAddBindingCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- performSelection(object);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddEndPointAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddEndPointAction.java
deleted file mode 100644
index d6a7e31de..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddEndPointAction.java
+++ /dev/null
@@ -1,55 +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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IService;
-
-public class ASDAddEndPointAction extends BaseSelectionAction {
- public static String ID = "ASDAddEndPointAction"; //$NON-NLS-1$
-
- public ASDAddEndPointAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_PORT); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/port_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- IService service = null;
-
- if (o instanceof IService) {
- service = (IService) o;
- }
- else if (o instanceof IEndPoint) {
- service = ((IEndPoint) o).getOwnerService();
- }
-
- if (service != null) {
- Command command = service.getAddEndPointCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object element = ((IASDAddCommand) command).getNewlyAddedComponent();
- selectAndDirectEdit(element);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddFaultAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddFaultAction.java
deleted file mode 100644
index 1c188367e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddFaultAction.java
+++ /dev/null
@@ -1,63 +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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11MessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-
-public class ASDAddFaultAction extends BaseSelectionAction {
- public static String ID = "ASDAddFaultActionn"; //$NON-NLS-1$
-
- public ASDAddFaultAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_FAULT); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/fault_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- IOperation iOperation = null;
- Object possibleFault = null;
-
- if (o instanceof IOperation) {
- iOperation = (IOperation) o;
- }
- else if (o instanceof IMessageReference) {
- iOperation = ((IMessageReference) o).getOwnerOperation();
- possibleFault = ((W11MessageReference) o).getTarget();
- }
- else if (o instanceof IParameter) {
- iOperation = ((IMessageReference) ((IParameter) o).getOwner()).getOwnerOperation();
- possibleFault = ((W11MessageReference) ((IParameter) o).getOwner()).getTarget();
- }
-
- if (iOperation != null) {
- Command command = iOperation.getAddFaultCommand(possibleFault);
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- performSelection(object);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddImportAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddImportAction.java
deleted file mode 100644
index a8ce0bed7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddImportAction.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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-
-public class ASDAddImportAction extends BaseSelectionAction {
- public static String ID = "ASDAddImportAction"; //$NON-NLS-1$
-
- public ASDAddImportAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_IMPORT); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/import_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof ICategoryAdapter) {
- o = ((ICategoryAdapter) o).getOwnerDescription();
- }
-
- if (o instanceof IDescription) {
- Command command = ((IDescription) o).getAddImportCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- performSelection(object);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInputAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInputAction.java
deleted file mode 100644
index ff5f9aa5f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInputAction.java
+++ /dev/null
@@ -1,59 +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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-
-public class ASDAddInputAction extends BaseSelectionAction {
- public static String ID = "ASDAddInputActionn"; //$NON-NLS-1$
-
- public ASDAddInputAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_INPUT); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/input_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- IOperation iOperation = null;
-
- if (o instanceof IOperation) {
- iOperation = (IOperation) o;
- }
- else if (o instanceof IMessageReference) {
- iOperation = ((IMessageReference) o).getOwnerOperation();
- }
- else if (o instanceof IParameter) {
- iOperation = ((IMessageReference) ((IParameter) o).getOwner()).getOwnerOperation();
- }
-
- if (iOperation != null) {
- Command command = iOperation.getAddInputCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- performSelection(object);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInterfaceAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInterfaceAction.java
deleted file mode 100644
index ddf12f83f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddInterfaceAction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-
-public class ASDAddInterfaceAction extends BaseSelectionAction {
- public static String ID = "ASDAddInterfaceAction"; //$NON-NLS-1$
-
- public ASDAddInterfaceAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_PORTTYPE); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/porttype_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof ICategoryAdapter) {
- o = ((ICategoryAdapter) o).getOwnerDescription();
- }
-
- if (o instanceof IDescription) {
- Command command = ((IDescription) o).getAddInterfaceCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object element = ((IASDAddCommand) command).getNewlyAddedComponent();
- selectAndDirectEdit(element);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddMessageAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddMessageAction.java
deleted file mode 100644
index acd07a84c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddMessageAction.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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-
-public class ASDAddMessageAction extends BaseSelectionAction {
- public static String ID = "ASDAddMessageAction"; //$NON-NLS-1$
-
- public ASDAddMessageAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_MESSAGE); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/message_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof ICategoryAdapter) {
- o = ((ICategoryAdapter) o).getOwnerDescription();
- }
-
- if (o instanceof IDescription) {
- Command command = ((IDescription) o).getAddMessageCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- performSelection(object);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOperationAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOperationAction.java
deleted file mode 100644
index 3e1939aa5..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOperationAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-
-public class ASDAddOperationAction extends BaseSelectionAction {
- public static String ID = "ASDAddOperationAction"; //$NON-NLS-1$
-
- public ASDAddOperationAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_OPERATION); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/operation_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- IInterface theInterface = null;
-
- if (o instanceof IInterface) {
- theInterface = (IInterface) o;
- }
- else if (o instanceof IOperation) {
- theInterface = ((IOperation) o).getOwnerInterface();
- }
- else if (o instanceof IMessageReference) {
- theInterface = ((IMessageReference) o).getOwnerOperation().getOwnerInterface();
- }
- else if (o instanceof IParameter) {
- theInterface = ((IMessageReference) ((IParameter) o).getOwner()).getOwnerOperation().getOwnerInterface();
- }
-
- if (theInterface != null) {
- Command command = theInterface.getAddOperationCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object element = ((IASDAddCommand) command).getNewlyAddedComponent();
- selectAndDirectEdit(element);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOutputAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOutputAction.java
deleted file mode 100644
index ca36abfb4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddOutputAction.java
+++ /dev/null
@@ -1,59 +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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-
-public class ASDAddOutputAction extends BaseSelectionAction {
- public static String ID = "ASDAddOutputActionn"; //$NON-NLS-1$
-
- public ASDAddOutputAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_OUTPUT); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/output_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- IOperation iOperation = null;
-
- if (o instanceof IOperation) {
- iOperation = (IOperation) o;
- }
- else if (o instanceof IMessageReference) {
- iOperation = ((IMessageReference) o).getOwnerOperation();
- }
- else if (o instanceof IParameter) {
- iOperation = ((IMessageReference) ((IParameter) o).getOwner()).getOwnerOperation();
- }
-
- if (iOperation != null) {
- Command command = iOperation.getAddOutputCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- performSelection(object);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddParameterAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddParameterAction.java
deleted file mode 100644
index 61970a854..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddParameterAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11MessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-
-public class ASDAddParameterAction extends BaseSelectionAction {
- public static String ID = "ASDAddParameterAction"; //$NON-NLS-1$
-
- public ASDAddParameterAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText("Add Parameter"); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/input_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- IMessageReference messageReference = null;
-
- if (o instanceof IMessageReference)
- {
- messageReference = (IMessageReference)o;
- }
- else if (o instanceof IParameter) {
- messageReference = ((IMessageReference) ((IParameter) o).getOwner());
- }
-
- if (messageReference instanceof W11MessageReference) {
- W11MessageReference w11MessageReference = (W11MessageReference)messageReference;
- Command command = w11MessageReference.getAddParamterCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- selectAndDirectEdit(object);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddSchemaAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddSchemaAction.java
deleted file mode 100644
index 1904b2d05..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddSchemaAction.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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-
-public class ASDAddSchemaAction extends BaseSelectionAction {
- public static String ID = "ASDAddSchemaAction"; //$NON-NLS-1$
-
- public ASDAddSchemaAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_SCHEMA); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/xsd_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof ICategoryAdapter) {
- o = ((ICategoryAdapter) o).getOwnerDescription();
- }
-
- if (o instanceof IDescription) {
- Command command = ((IDescription) o).getAddSchemaCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object object = ((IASDAddCommand) command).getNewlyAddedComponent();
- performSelection(object);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddServiceAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddServiceAction.java
deleted file mode 100644
index ec6368f61..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDAddServiceAction.java
+++ /dev/null
@@ -1,59 +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.asd.actions;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ServiceEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-
-public class ASDAddServiceAction extends BaseSelectionAction {
- public static String ID = "ASDAddServiceAction"; //$NON-NLS-1$
-
- public ASDAddServiceAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_SERVICE); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/service_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof ICategoryAdapter) {
- o = ((ICategoryAdapter) o).getOwnerDescription();
- }
-
- if (o instanceof IDescription) {
- Command command = ((IDescription) o).getAddServiceCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (command instanceof IASDAddCommand) {
- Object element = ((IASDAddCommand) command).getNewlyAddedComponent();
- selectAndDirectEdit(element);
- }
- }
- }
- }
-
- protected void doDirectEdit(EditPart ep) {
- if (ep instanceof ServiceEditPart) {
- ((ServiceEditPart) ep).performDirectEdit(null);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDCaptureScreenAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDCaptureScreenAction.java
deleted file mode 100644
index 0589425fd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDCaptureScreenAction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.asd.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.CaptureScreenAction;
-
-
-/**
- * Our sample action implements workbench action delegate.
- * The action proxy will be created by the workbench and
- * shown in the UI. When the user tries to use the action,
- * this delegate will be created and execution will be
- * delegated to it.
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate
- */
-public class ASDCaptureScreenAction extends ActionDelegate implements IEditorActionDelegate {
-
- /**
- * The constructor.
- */
- public ASDCaptureScreenAction() {
- }
-
- /**
- * The action has been activated. The argument of the
- * method represents the 'real' action sitting
- * in the workbench UI.
- * @see IWorkbenchWindowActionDelegate#run
- */
- public void run(IAction action) {
- CaptureScreenAction captureScreenAction = new CaptureScreenAction();
- captureScreenAction.run();
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDeleteAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDeleteAction.java
deleted file mode 100644
index 59df16335..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDeleteAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-
-public class ASDDeleteAction extends BaseSelectionAction {
- public static String ID = "ASDDeleteAction"; //$NON-NLS-1$
-
- public ASDDeleteAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_DELETE); //$NON-NLS-1$
- setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/delete_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- Iterator it = getSelectedObjects().iterator();
- while (it.hasNext()) {
- Object object = it.next();
- Command command = null;
-
- if (object instanceof IASDObject) {
- command = ((IASDObject) object).getDeleteCommand();
- }
-
- if (command != null) {
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
-
- if (object instanceof WSDLBaseAdapter) {
- Object target = ((WSDLBaseAdapter) object).getTarget();
- if (target instanceof WSDLElement) {
- performSelection(((WSDLElement) target).getEnclosingDefinition());
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDirectEditAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDirectEditAction.java
deleted file mode 100644
index 26d5bd69c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDirectEditAction.java
+++ /dev/null
@@ -1,84 +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.asd.actions;
-
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.ui.actions.DirectEditAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-
-public class ASDDirectEditAction extends DirectEditAction {
- protected ISelectionProvider provider;
-
- /**
- * Same as {@link #DirectEditAction(IWorkbenchPart)}.
- * @param editor the editor
- */
- public ASDDirectEditAction(IEditorPart editor) {
- super((IWorkbenchPart)editor);
- }
-
- /**
- * Constructs a DirectEditAction using the specified part.
- * @param part the workbench part
- */
- public ASDDirectEditAction(IWorkbenchPart part) {
- super(part);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#getSelection()
- */
- protected ISelection getSelection()
- {
- // If we're in this action, we assume the action was initiated via the graphical viewer.
- // We use the graphical view to obtain the selected edit part because for us, one model
- // may drive more than one edit part. So we need to find the exact edit part we wish to
- // direct edit. The preferred method of determining the edit part would have been to go
- // through the selection manager, then through the edit part registry. However, the selection
- // manager only returns the model object (not the edit part).... and since the model object
- // may drive more than one edit part, the edit part registry may return the "wrong" edit
- // part for direct editing. Thus we look call GraphicalViewer.getFocusEditPart().
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object object = editor.getAdapter(GraphicalViewer.class);
- if (object instanceof GraphicalViewer) {
- Object selection = ((GraphicalViewer) object).getFocusEditPart();
- return new StructuredSelection(selection);
- }
-
- return super.getSelection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
- */
- public void setSelectionProvider(ISelectionProvider provider)
- {
- super.setSelectionProvider(provider);
- this.provider = provider;
- }
-
- protected boolean calculateEnabled() {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof IASDObject) {
- return !((IASDObject) selection).isReadOnly();
- }
-
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragAction.java
deleted file mode 100644
index 193c83aae..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragAction.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.actions;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.ui.IWorkbenchPart;
-
-public abstract class ASDDragAction extends BaseSelectionAction {
- protected GraphicalEditPart movingChildEditPart;
- protected Point pointerLocation;
-
- public ASDDragAction(IWorkbenchPart part) {
- super(part);
- }
-
- /*
- * Sub-classes should override this method.
- */
- public boolean canExecute() {
- return false;
- }
-
- public void execute() {
- run();
- }
-
- /*
- * Sub-classes should override this method.
- */
- public String getUndoDescription() {
- return ""; //$NON-NLS-1$
- }
-
- /*
- * Sub-classes should override this method.
- */
- public IFigure getFeedbackFigure() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragReorderAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragReorderAction.java
deleted file mode 100644
index 8c5a3e91c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDragReorderAction.java
+++ /dev/null
@@ -1,284 +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.asd.actions;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-
-public class ASDDragReorderAction extends ASDDragAction {
- protected IASDObject movingChild;
- protected IASDObject newParent;
- protected GraphicalEditPart leftSiblingEditPart;
- protected GraphicalEditPart rightSiblingEditPart;
- protected IASDObject leftSibElement;
- protected IASDObject rightSibElement;
- protected boolean canNeverExecute = false;
-
- public ASDDragReorderAction(GraphicalEditPart movingChildEditPart, EditPart pointerEditPart, Point pointerLocation) {
- super(null);
- this.movingChildEditPart = movingChildEditPart;
- this.pointerLocation = pointerLocation;
-
- EditPart possibleParent = getParentEditPart(pointerEditPart);
-
- if (!(possibleParent instanceof GraphicalEditPart)) {
- canNeverExecute = true;
- return;
- }
-
- GraphicalEditPart targetParentEditPart = (GraphicalEditPart) possibleParent;
-
- if (pointerEditPart.getParent() != null) {
- // Sort the siblings (and itself)
- List targetEditPartSiblings = pointerEditPart.getParent().getChildren();
- Collections.sort(targetEditPartSiblings, new VerticalEditPartComparator());
-
- // Get 'left' and 'right' siblings
- leftSiblingEditPart = getVerticalLeftSibling(targetEditPartSiblings, movingChildEditPart, pointerLocation);
- rightSiblingEditPart = getVerticalRightSibling(targetEditPartSiblings, movingChildEditPart, pointerLocation);
-
- if (movingChildEditPart != null)
- movingChild = (IASDObject) movingChildEditPart.getModel();
- if (leftSiblingEditPart != null)
- leftSibElement = (IASDObject) leftSiblingEditPart.getModel();
- if (rightSiblingEditPart != null)
- rightSibElement = (IASDObject) rightSiblingEditPart.getModel();
-
- newParent = (IASDObject) targetParentEditPart.getModel();
- }
- else {
- newParent = (IASDObject) targetParentEditPart.getModel();
- leftSibElement = null;
- rightSibElement= null;
- }
- }
-
- public boolean canExecute()
- {
- boolean result = false;
-
- if (canNeverExecute || newParent == null || movingChild == null) {
- return false;
- }
-
- if (movingChild instanceof IMessageReference) {
- IMessageReference messageRef = (IMessageReference) movingChild;
- if (messageRef.getKind() == IMessageReference.KIND_INPUT || messageRef.getKind() == IMessageReference.KIND_OUTPUT) {
- IMessageReference leftSibMessageRef = (IMessageReference) leftSibElement;
-
- result = true;
- if (leftSibMessageRef != null) {
- if (leftSibMessageRef.getKind() == IMessageReference.KIND_FAULT) {
- result = false;
- }
- }
- if (!(result && newParent.equals(messageRef.getOwnerOperation()))) {
- result = false;
- }
- }
- }
- else if (movingChild instanceof IParameter) {
- if (newParent instanceof IMessageReference && newParent.equals(((IParameter) movingChild).getOwner())) {
- result = true;
- }
- }
-
- return result;
- }
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
-// beginRecording();
- if (canExecute()) {
- if (movingChild instanceof IMessageReference) {
- Object messageRefOwner = ((IMessageReference) movingChild).getOwnerOperation();
- if (messageRefOwner instanceof IOperation) {
- IMessageReference leftSib = (IMessageReference) leftSibElement;
- IMessageReference rightSib = (IMessageReference) rightSibElement;
- IMessageReference movingSib = (IMessageReference) movingChild;
- Command command = ((IOperation) messageRefOwner).getReorderMessageReferencesCommand(leftSib, rightSib, movingSib);
- command.execute();
- }
- }
- else if (movingChild instanceof IParameter) {
- Object paramOwner = ((IParameter) movingChild).getOwner();
- if (paramOwner instanceof IMessageReference) {
- IParameter leftSib = (IParameter) leftSibElement;
- IParameter rightSib = (IParameter) rightSibElement;
- IParameter movingSib = (IParameter) movingChild;
- Command command = ((IMessageReference) paramOwner).getReorderParametersCommand(leftSib, rightSib, movingSib);
- command.execute();
- }
- }
-// wsdlEditor.getSelectionManager().setSelection(new StructuredSelection(movingChild));
- }
-// endRecording();
- }
-
- public IFigure getFeedbackFigure() {
- IFigure feedbackFigure = null;
- if (feedbackFigure == null && movingChildEditPart instanceof GraphicalEditPart)
- {
- feedbackFigure = new Polyline();
- ((Polyline)feedbackFigure).setLineWidth(2);
- drawLines((Polyline) feedbackFigure);
- }
-
- return feedbackFigure;
- }
-
- /* Return a PointList which will be used to add a feedback figure. The feedback figure will be a
- * Polyline composed of the Points in the PointList
- */
- private PointList drawLines(Polyline polyLine) {
- PointList pointList = new PointList();
-
- if (leftSiblingEditPart != null) {
- Rectangle leftRectangle = leftSiblingEditPart.getFigure().getBounds();
- int xCoord = leftRectangle.x;
- int yCoord = leftRectangle.y;
- int height = leftRectangle.height;
- int width = leftRectangle.width;
-
- // Draw left end line
- addLineToPolyline(polyLine, xCoord, yCoord + height + 3, xCoord, yCoord + height - 3);
- addLineToPolyline(polyLine, xCoord, yCoord + height - 3, xCoord, yCoord + height);
-
- // Draw horizontal line
- addLineToPolyline(polyLine, xCoord, yCoord + height, xCoord + width, yCoord + height);
-
- // Draw right end line
- addLineToPolyline(polyLine, xCoord + width, yCoord + height, xCoord + width, yCoord + height - 3);
- addLineToPolyline(polyLine, xCoord + width, yCoord + height, xCoord + width, yCoord + height + 3);
- }
- else if (rightSiblingEditPart != null) {
- Rectangle rightRectangle = rightSiblingEditPart.getFigure().getBounds();
- int xCoord = rightRectangle.x;
- int yCoord = rightRectangle.y;
- int width = rightRectangle.width;
-
- // Draw left end line
- addLineToPolyline(polyLine, xCoord, yCoord + 3, xCoord, yCoord - 3);
- addLineToPolyline(polyLine, xCoord, yCoord - 3, xCoord, yCoord);
-
- // Draw horizontal line
- addLineToPolyline(polyLine, xCoord, yCoord, xCoord + width, yCoord);
-
- // Draw right end line
- addLineToPolyline(polyLine, xCoord + width, yCoord, xCoord + width, yCoord - 3);
- addLineToPolyline(polyLine, xCoord + width, yCoord, xCoord + width, yCoord + 3);
- }
-
- return pointList;
- }
-
- protected Polyline addLineToPolyline(Polyline polyline, int x1, int y1, int x2, int y2) {
- polyline.addPoint(new Point(x1, y1));
- polyline.addPoint(new Point(x2, y2));
-
- return polyline;
- }
-
- /*
- * Pre-condition: The List siblings should be sorted by it's y-coordinate
- */
- private GraphicalEditPart getVerticalRightSibling(List siblings, GraphicalEditPart movingEditPart, Point pointerLocation) {
- GraphicalEditPart rightSibling = null;
- int pointerYLocation = pointerLocation.y;
-
- for (int index = 0; index < siblings.size(); index++) {
- GraphicalEditPart sibling = (GraphicalEditPart) siblings.get(index);
- int siblingYLocation = sibling.getFigure().getBounds().getCenter().y;
-
- if (siblingYLocation > pointerYLocation) {
- rightSibling = sibling;
- break;
- }
- }
-
- return rightSibling;
- }
-
- /*
- * Pre-condition: The List siblings should be sorted by it's y-coordinate
- */
- private GraphicalEditPart getVerticalLeftSibling(List siblings, GraphicalEditPart movingEditPart, Point pointerLocation) {
- GraphicalEditPart leftSibling = null;
- int pointerYLocation = pointerLocation.y;
-
- int index;
- for (index = 0; index < siblings.size(); index++) {
- GraphicalEditPart sibling = (GraphicalEditPart) siblings.get(index);
- int siblingYLocation = sibling.getFigure().getBounds().getCenter().y;
-
- if (siblingYLocation > pointerYLocation) {
- if (index > 0) {
- leftSibling = (GraphicalEditPart) siblings.get(index - 1);
- }
-
- break;
- }
- }
-
- if (index == siblings.size()) {
- leftSibling = (GraphicalEditPart) siblings.get(index - 1);
- }
-
- return leftSibling;
- }
-
- protected EditPart getParentEditPart(EditPart target)
- {
- return target.getParent();
- }
-
- private class VerticalEditPartComparator implements Comparator {
-
- public VerticalEditPartComparator() {
- }
-
- public int compare(Object part1, Object part2) {
- int compareValue = 0;
-
- if (part1 instanceof GraphicalEditPart && part2 instanceof GraphicalEditPart) {
- GraphicalEditPart editPart1 = (GraphicalEditPart) part1;
- GraphicalEditPart editPart2 = (GraphicalEditPart) part2;
-
- int editPart1Y = editPart1.getFigure().getBounds().getCenter().y;
- int editPart2Y = editPart2.getFigure().getBounds().getCenter().y;
-
- Integer integerPart1 = new Integer(editPart1Y);
- Integer integerPart2 = new Integer(editPart2Y);
-
- compareValue = integerPart1.compareTo(integerPart2);
- }
-
- return compareValue;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDEditNamespacesAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDEditNamespacesAction.java
deleted file mode 100644
index f5b727e3e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDEditNamespacesAction.java
+++ /dev/null
@@ -1,74 +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.asd.actions;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11EditNamespacesCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.EditNamespacesDialog;
-
-public class ASDEditNamespacesAction extends BaseSelectionAction {
- public static String ID = "ASDEditNamespacesAction"; //$NON-NLS-1$
-
- private IDescription description;
-
- public ASDEditNamespacesAction(IWorkbenchPart part, IDescription description) {
- super(part);
- setId(ID);
- String text = Messages._UI_EDIT_NAMESPACES; //$NON-NLS-1$
- setText(text);
-
- this.description = description;
- }
-
- public void run() {
- Object o = description;
- if (getSelectedObjects().size() > 0) {
- if (o instanceof ICategoryAdapter) {
- o = ((ICategoryAdapter) o).getOwnerDescription();
- }
- }
-
- if (o instanceof IDescription) {
- // TODO: The code below is not generic. We need to revisit this to ensure it is
- // generic. IDescription needs a getNamespacesInfo() and getEditNamespacesCommand()...
- IDescription description = (IDescription) o;
- W11Description w11Description = (W11Description) o;
- Definition definition = (Definition) w11Description.getTarget();
-
- IPath path = new Path(definition.getDocumentBaseURI());
- List namespaceInfoList = w11Description.getNamespacesInfo();
- String tns = description.getTargetNamespace();
- EditNamespacesDialog dialog = new EditNamespacesDialog(WSDLEditorPlugin.getShell(), path, Messages._UI_EDIT_NAMESPACES_DIALOG_TITLE, tns, namespaceInfoList); //$NON-NLS-1$
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID) {
- List newInfoList = dialog.getNamespaceInfoList();
- W11EditNamespacesCommand command = (W11EditNamespacesCommand) w11Description.getEditNamespacesCommand();
- command.setNamespacesInfo(newInfoList);
- command.setTargetNamespace(dialog.getTargetNamespace());
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDGenerateBindingAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDGenerateBindingAction.java
deleted file mode 100644
index 21a359070..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDGenerateBindingAction.java
+++ /dev/null
@@ -1,43 +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.asd.actions;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-
-public class ASDGenerateBindingAction extends BaseSelectionAction {
- public static String ID = "ASDGenerateBindingActionn"; //$NON-NLS-1$
-
- public ASDGenerateBindingAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_GENERATE_BINDING_CONTENT); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/input_obj.gif"));
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof IBinding) {
- Command command = ((IBinding) o).getGenerateBindingCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
- }
-
- performSelection(o);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDOpenSchemaAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDOpenSchemaAction.java
deleted file mode 100644
index 4951e1b1f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDOpenSchemaAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.actions;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IType;
-import org.eclipse.wst.wsdl.ui.internal.asd.util.IOpenExternalEditorHelper;
-
-public class ASDOpenSchemaAction extends BaseSelectionAction {
- public static String ID = "ASDOpenSchemaAction"; //$NON-NLS-1$
-
- public ASDOpenSchemaAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_OPEN_SCHEMA); //$NON-NLS-1$
-// setImageDescriptor(ASDEditorPlugin.getImageDescriptor("icons/binding_obj.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
-
- if (o instanceof IType) {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object helper = editor.getAdapter(IOpenExternalEditorHelper.class);
- if (helper instanceof IOpenExternalEditorHelper) {
- ((IOpenExternalEditorHelper) helper).setModel(o);
- ((IOpenExternalEditorHelper) helper).openExternalEditor();
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingBindingAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingBindingAction.java
deleted file mode 100644
index 357852275..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingBindingAction.java
+++ /dev/null
@@ -1,58 +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.asd.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class ASDSetExistingBindingAction extends BaseSelectionAction {
- public static String ID = "ASDSetExistingBindingAction"; //$NON-NLS-1$
- protected IEndPoint endPoint;
-
- public ASDSetExistingBindingAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_EXISTING_BINDING); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/service_obj.gif"));
- }
-
- public void setIEndPoint(IEndPoint endPoint) {
- this.endPoint = endPoint;
- }
-
- public void run() {
- if (endPoint == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IEndPoint) {
- endPoint = (IEndPoint) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getBindingReferenceEditManager(endPoint);
- if (endPoint != null && refManager != null) {
- IComponentDialog dialog = refManager.getBrowseDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(endPoint, spec);
- }
- }
-
- endPoint = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingInterfaceAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingInterfaceAction.java
deleted file mode 100644
index 4605ca855..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetExistingInterfaceAction.java
+++ /dev/null
@@ -1,58 +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.asd.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class ASDSetExistingInterfaceAction extends BaseSelectionAction {
- public static String ID = "ASDSetExistingInterfaceAction"; //$NON-NLS-1$
- protected IBinding binding;
-
- public ASDSetExistingInterfaceAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_EXISTING_PORTTYPE); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/service_obj.gif"));
- }
-
- public void setIBinding(IBinding binding) {
- this.binding = binding;
- }
-
- public void run() {
- if (binding == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IBinding) {
- binding = (IBinding) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getInterfaceReferenceEditManager(binding);
- if (binding != null && refManager != null) {
- IComponentDialog dialog = refManager.getBrowseDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(binding, spec);
- }
- }
-
- binding = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewBindingAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewBindingAction.java
deleted file mode 100644
index a6da98c2b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewBindingAction.java
+++ /dev/null
@@ -1,58 +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.asd.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class ASDSetNewBindingAction extends BaseSelectionAction {
- public static String ID = "ASDSetNewBindingAction"; //$NON-NLS-1$
- protected IEndPoint endPoint;
-
- public ASDSetNewBindingAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_NEW_BINDING); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/service_obj.gif"));
- }
-
- public void setIEndPoint(IEndPoint endPoint) {
- this.endPoint = endPoint;
- }
-
- public void run() {
- if (endPoint == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IEndPoint) {
- endPoint = (IEndPoint) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getBindingReferenceEditManager(endPoint);
- if (endPoint != null && refManager != null) {
- IComponentDialog dialog = refManager.getNewDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(endPoint, spec);
- }
- }
-
- endPoint = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewInterfaceAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewInterfaceAction.java
deleted file mode 100644
index 02aec427c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDSetNewInterfaceAction.java
+++ /dev/null
@@ -1,58 +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.asd.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-public class ASDSetNewInterfaceAction extends BaseSelectionAction {
- public static String ID = "ASDSetNewInterfaceAction"; //$NON-NLS-1$
- protected IBinding binding;
-
- public ASDSetNewInterfaceAction(IWorkbenchPart part) {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_NEW_PORTTYPE); //$NON-NLS-1$
-// setImageDescriptor(WSDLEditorPlugin.getImageDescriptor("icons/service_obj.gif"));
- }
-
- public void setIBinding(IBinding binding) {
- this.binding = binding;
- }
-
- public void run() {
- if (binding == null) {
- if (getSelectedObjects().size() > 0) {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IBinding) {
- binding = (IBinding) o;
- }
- }
- }
-
- ComponentReferenceEditManager refManager = ReferenceEditManagerHelper.getInterfaceReferenceEditManager(binding);
- if (binding != null && refManager != null) {
- IComponentDialog dialog = refManager.getNewDialog();
- if (dialog.createAndOpen() == Window.OK) {
- ComponentSpecification spec = dialog.getSelectedComponent();
- refManager.modifyComponentReference(binding, spec);
- }
- }
-
- binding = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/BaseSelectionAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/BaseSelectionAction.java
deleted file mode 100644
index f5bc1a248..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/BaseSelectionAction.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
-
-public abstract class BaseSelectionAction extends SelectionAction
-{
- public static final String SUBMENU_START_ID = "SUBMENU_START_ID: "; //$NON-NLS-1$
- public static final String SUBMENU_END_ID = "SUBMENU_END_ID: "; //$NON-NLS-1$
-
- protected ISelectionProvider provider;
-
- public BaseSelectionAction(IWorkbenchPart part)
- {
- super(part);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#getSelection()
- */
- protected ISelection getSelection()
- {
- // always get selection from selection provider first
- if (provider!=null)
- return provider.getSelection();
-
- return super.getSelection();
- }
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
- */
- public void setSelectionProvider(ISelectionProvider provider)
- {
- super.setSelectionProvider(provider);
- this.provider = provider;
- }
-
- public List getSelectedObjects()
- {
- List processedObjects = new ArrayList();
- List objects = super.getSelectedObjects();
- Iterator it = objects.iterator();
- while (it.hasNext()) {
- Object item = it.next();
- if (item instanceof AbstractModelCollection) {
- processedObjects.add(((AbstractModelCollection) item).getModel());
- }
- else {
- processedObjects.add(item);
- }
- }
-
- return processedObjects;
- }
-
- protected boolean calculateEnabled() {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof IASDObject) {
- return !((IASDObject) selection).isReadOnly();
- }
-
- return true;
- }
-
- protected void selectAndDirectEdit(final Object o) {
- Runnable runnable = new Runnable() {
- public void run() {
- if (o instanceof Notifier) {
- performSelection(o);
- activateDirectEdit();
- }
- }};
- Display.getCurrent().asyncExec(runnable);
- }
-
- protected void activateDirectEdit() {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- if (!(part instanceof ContentOutline)) {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object graphicalViewer = editor.getAdapter(GraphicalViewer.class);
- if (graphicalViewer instanceof AbstractEditPartViewer) {
- AbstractEditPartViewer viewer = (AbstractEditPartViewer) graphicalViewer;
- Object obj = viewer.getSelectedEditParts().get(0);
- // todo: rmah: we need to completely remove all implementations of doDirectEdit().
- // Use performRequest() instead.
-// doDirectEdit((EditPart) obj);
- Request request = new Request();
- request.setType(RequestConstants.REQ_DIRECT_EDIT);
- ((EditPart) obj).performRequest(request);
- }
- }
- }
-
- protected void doDirectEdit(EditPart ep) {
- Request request = new Request();
- request.setType(RequestConstants.REQ_DIRECT_EDIT);
- ep.performRequest(request);
- }
-
- protected void performSelection(Object object) {
- Object adapted = null;
-
- if (object instanceof Notifier) {
- Notifier element = (Notifier) object;
- // TODO: We shouldn't know about WSDLAdapterFactoryHelper here....
- adapted = WSDLAdapterFactoryHelper.getInstance().adapt(element);
- }
- else if (object instanceof IASDObject) {
- adapted = object;
- }
-
- if (adapted != null) {
- try {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (editor != null && editor.getAdapter(ISelectionProvider.class) != null) {
- ISelectionProvider provider = (ISelectionProvider) editor.getAdapter(ISelectionProvider.class);
- if (provider != null) {
- provider.setSelection(new StructuredSelection(adapted));
- }
- }
- }
- catch (Exception e) {}
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/IASDAddCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/IASDAddCommand.java
deleted file mode 100644
index 552ee0bb9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/IASDAddCommand.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.asd.actions;
-
-public interface IASDAddCommand {
- public Object getNewlyAddedComponent();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ShowPropertiesViewAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ShowPropertiesViewAction.java
deleted file mode 100644
index 8f447ace9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ShowPropertiesViewAction.java
+++ /dev/null
@@ -1,56 +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.asd.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-
-
-/**
- * Show the properties view in the current perspective.
- */
-public class ShowPropertiesViewAction extends BaseSelectionAction
-{
- public static final String ID = "org.eclipse.wst.wsdl.ui.internal.asd.actions.ShowPropertiesViewAction"; //$NON-NLS-1$
- public static final String PROPERTIES_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
-
- protected static ImageDescriptor enabledImage, disabledImage;
-
- public ShowPropertiesViewAction(IWorkbenchPart part)
- {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_SHOW_PROPERTIES);
- setToolTipText(getText());
- setImageDescriptor(ASDEditorPlugin.getImageDescriptorFromPlugin("icons/elcl16/showproperties_obj.gif") ); //$NON-NLS-1$
- setDisabledImageDescriptor(ASDEditorPlugin.getImageDescriptorFromPlugin("icons/dlcl16/showproperties_obj.gif") ); //$NON-NLS-1$
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- try
- {
- getWorkbenchPart().getSite().getPage().showView(PROPERTIES_VIEW_ID);
- }
- catch (PartInitException pie)
- {
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtension.java
deleted file mode 100644
index 147090576..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtension.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.asd.adapterfactory.extension;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-
-public class AdapterFactoryExtension {
- private String namespace;
- private String adapterFactoryClassName;
- private ClassLoader classLoader;
-
- public AdapterFactoryExtension(String namespace) {
- this.namespace = namespace;
- }
-
- public void setAdapterFactoryClassName(String factoryClassName) {
- adapterFactoryClassName = factoryClassName;
- }
-
- public void setClassLoader(ClassLoader classLoader){
- this.classLoader = classLoader;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public AdapterFactory getAdapterFactory() {
- AdapterFactory factory = null;
- if (adapterFactoryClassName != null) {
- try {
- Class theClass = classLoader != null ? classLoader.loadClass(adapterFactoryClassName) : Class.forName(adapterFactoryClassName);
- factory = (AdapterFactory) theClass.newInstance();
- }
- catch (Exception e) {
- }
- }
-
- return factory;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtensionRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtensionRegistry.java
deleted file mode 100644
index 34b99bc23..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/adapterfactory/extension/AdapterFactoryExtensionRegistry.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.asd.adapterfactory.extension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
-public class AdapterFactoryExtensionRegistry {
- protected List registeredAdapterFactories = new ArrayList();
-
- public void add(AdapterFactoryExtension factory) {
- registeredAdapterFactories.add(factory);
- }
-
- public List getAdapterFactoryNamespaces() {
- List list = new ArrayList();
- for (Iterator i = registeredAdapterFactories.iterator(); i.hasNext();) {
- AdapterFactoryExtension extension = (AdapterFactoryExtension) i.next();
- list.add(extension.getNamespace());
- }
- return list;
- }
-
- public AdapterFactoryExtension getExtensionForNamespace(String namespace) {
- AdapterFactoryExtension result = null;
- if (namespace != null) {
- for (Iterator i = registeredAdapterFactories.iterator(); i.hasNext();) {
- AdapterFactoryExtension extension = (AdapterFactoryExtension) i.next();
- if (namespace.equals(extension.getNamespace())) {
- result = extension;
- break;
- }
- }
- }
-
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtension.java
deleted file mode 100644
index 325804987..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtension.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.asd.contentgenerator.ui.extension;
-
-import org.eclipse.wst.wsdl.ui.internal.wizards.ContentGeneratorOptionsPage;
-
-public class ContentGeneratorUIExtension {
- private String name;
- private String namespace;
- private String label;
- private String bindingOptionsPageClassName;
- private String portOptionsPageClassName;
-
- private ClassLoader classLoader;
-
- public ContentGeneratorUIExtension(String name, String namespace) {
- this.name = name;
- this.namespace = namespace;
- }
-
- public void setBindingOptionsPageClassName(String bindingClassName) {
- bindingOptionsPageClassName = bindingClassName;
- }
-
- public void setPortOptionsPageClassName(String portClassName) {
- portOptionsPageClassName = portClassName;
- }
-
- public void setClassLoader(ClassLoader classLoader){
- this.classLoader = classLoader;
- }
-
- public String getName() {
- return name;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public ContentGeneratorOptionsPage getBindingContentGeneratorOptionsPage() {
- ContentGeneratorOptionsPage result = null;
- if (bindingOptionsPageClassName != null) {
- try {
- Class theClass = classLoader != null ? classLoader.loadClass(bindingOptionsPageClassName) : Class.forName(bindingOptionsPageClassName);
- result = (ContentGeneratorOptionsPage) theClass.newInstance();
- }
- catch (Exception e) {
- }
- }
-
- return result;
- }
-
- public ContentGeneratorOptionsPage getPortContentGeneratorOptionsPage() {
- ContentGeneratorOptionsPage result = null;
- if (portOptionsPageClassName != null) {
- try {
- Class theClass = classLoader != null ? classLoader.loadClass(portOptionsPageClassName) : Class.forName(portOptionsPageClassName);
- result = (ContentGeneratorOptionsPage) theClass.newInstance();
- }
- catch (Exception e) {
- }
- }
-
- return result;
- }
-
- public String getLabel() {
- return label;
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtensionRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtensionRegistry.java
deleted file mode 100644
index 2b853f834..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/contentgenerator/ui/extension/ContentGeneratorUIExtensionRegistry.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.asd.contentgenerator.ui.extension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class ContentGeneratorUIExtensionRegistry {
- protected List registeredContentGeneratorUIList = new ArrayList();
-
- public void add(ContentGeneratorUIExtension extension) {
- registeredContentGeneratorUIList.add(extension);
- }
-
- public List getBindingExtensionNames() {
- List list = new ArrayList();
- for (Iterator i = registeredContentGeneratorUIList.iterator(); i.hasNext();) {
- ContentGeneratorUIExtension extension = (ContentGeneratorUIExtension) i.next();
- list.add(extension.getName());
- }
- return list;
- }
-
- public ContentGeneratorUIExtension getExtensionForNamespace(String namespace) {
- ContentGeneratorUIExtension result = null;
- if (namespace != null) {
- for (Iterator i = registeredContentGeneratorUIList.iterator(); i.hasNext();) {
- ContentGeneratorUIExtension extension = (ContentGeneratorUIExtension) i.next();
- if (namespace.equals(extension.getNamespace())) {
- result = extension;
- break;
- }
- }
- }
-
- return result;
- }
-
- public ContentGeneratorUIExtension getExtensionForName(String name) {
- ContentGeneratorUIExtension result = null;
- if (name != null) {
- for (Iterator i = registeredContentGeneratorUIList.iterator(); i.hasNext();) {
- ContentGeneratorUIExtension extension = (ContentGeneratorUIExtension) i.next();
- if (name.equals(extension.getName())) {
- result = extension;
- break;
- }
- }
- }
-
- return result;
- }
-
- public ContentGeneratorUIExtension getExtensionForLabel(String label)
- {
- ContentGeneratorUIExtension result = null;
- if (label != null)
- {
- for (Iterator i = registeredContentGeneratorUIList.iterator(); i.hasNext();)
- {
- ContentGeneratorUIExtension extension = (ContentGeneratorUIExtension) i.next();
- if (label.equals(extension.getLabel()))
- {
- result = extension;
- break;
- }
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewContextMenuProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewContextMenuProvider.java
deleted file mode 100644
index 6e0d22e27..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewContextMenuProvider.java
+++ /dev/null
@@ -1,170 +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.asd.design;
-
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ColumnEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ContextMenuParticipant;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-
-
-public class DesignViewContextMenuProvider extends ContextMenuProvider
-{
- ISelectionProvider selectionProvider;
-
- /**
- * Constructor for GraphContextMenuProvider.
- *
- * @param selectionProvider
- * @param editor
- */
- public DesignViewContextMenuProvider(EditPartViewer viewer, ISelectionProvider selectionProvider)
- {
- super(viewer);
- this.selectionProvider = selectionProvider;
- }
-
- protected Object getAppropriateSelection(Object selection) {
- if (selection instanceof ColumnEditPart) {
- return ((EditPart) selection).getParent();
- }
-
- return selection;
- }
-
- /**
- * @see org.eclipse.gef.ui.parts.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.eclipse.gef.EditPartViewer)
- */
- public void buildContextMenu(IMenuManager menu)
- {
- IMenuManager currentMenu = menu;
-
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- EditorModeManager manager = (EditorModeManager)editor.getAdapter(EditorModeManager.class);
- ContextMenuParticipant contextMenuParticipant = manager != null ? manager.getCurrentMode().getContextMenuParticipant() : null;
-
-
- currentMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- ActionRegistry registry = getEditorActionRegistry();
- ISelection selection = selectionProvider.getSelection();
-
- Object activePart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
-
- if (selection != null)
- {
- Object selectedObject = ((StructuredSelection) selection).getFirstElement();
- selectedObject = getAppropriateSelection(selectedObject);
-
- if (contextMenuParticipant != null)
- {
- // Convert editparts to model objects as selections
- Object o = selectedObject;
- if (o instanceof EditPart)
- {
- o = ((EditPart)selectedObject).getModel();
- }
- contextMenuParticipant.contributeActions(o, menu);
- }
-
- if (selectedObject instanceof IActionProvider)
- {
- IActionProvider actionProvider = (IActionProvider) selectedObject;
- String[] actions = actionProvider.getActions(activePart);
- for (int i = 0; i < actions.length; i++)
- {
- String id = actions[i];
- if (contextMenuParticipant == null || contextMenuParticipant.isApplicable(selectedObject, id))
- {
- if (id.startsWith(BaseSelectionAction.SUBMENU_START_ID)) {
- String text = id.substring(BaseSelectionAction.SUBMENU_START_ID.length());
- IMenuManager subMenu = new MenuManager(text);
- currentMenu.add(subMenu);
- currentMenu = subMenu;
- }
- else if (id.startsWith(BaseSelectionAction.SUBMENU_END_ID)) {
- currentMenu = getParentMenu(menu, currentMenu);
- }
- else
- {
- IAction action = registry.getAction(id);
- if (action != null) {
- action.isEnabled();
- currentMenu.add(action);
- }
- }
- }
- }
-
- menu.add(registry.getAction(ShowPropertiesViewAction.ID));
- menu.add(new Separator());
- menu.add(new Separator("refactoring-slot-temp")); //$NON-NLS-1$
- menu.add(new Separator());
- menu.add(new Separator("search_slot_temp")); //$NON-NLS-1$
- menu.add(new Separator());
- }
- }
- menu.add(new Separator());
- }
-
- protected IMenuManager getParentMenu(IMenuManager root, IMenuManager child) {
- IMenuManager parent = null;
-
- IContributionItem[] kids = root.getItems();
- int index = 0;
- while (index < kids.length && parent == null) {
- IContributionItem item = kids[index];
- if (item.equals(child)) {
- parent = root;
- }
- else {
- if (item instanceof IMenuManager) {
- parent = getParentMenu((IMenuManager) item, child);
- }
- }
- index++;
- }
-
- return parent;
- }
-
- protected ActionRegistry getEditorActionRegistry()
- {
- return (ActionRegistry) ASDEditorPlugin.getActiveEditor().getAdapter(ActionRegistry.class);
- }
- protected CommandStack commandStack;
-
- protected CommandStack getCommandStack()
- {
- if (commandStack == null)
- commandStack = getViewer().getEditDomain().getCommandStack();
- return commandStack;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicalViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicalViewer.java
deleted file mode 100644
index d6e2da975..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicalViewer.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.SelectionManager;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.BaseGraphicalViewerKeyHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonSelectionManager;
-
-public class DesignViewGraphicalViewer extends ScrollingGraphicalViewer implements ISelectionChangedListener
-{
- protected ASDSelectionChangedListener internalSelectionProvider = new ASDSelectionChangedListener();
-//TODO Make this generic
- public DesignViewGraphicalViewer(IEditorPart editor, CommonSelectionManager manager)
- {
- super();
-
- setContextMenu(new DesignViewContextMenuProvider(this, this));
-
-// MenuManager manager = new MenuManager("#popup");
-// manager.addMenuListener(menuProvider);
-// manager.setRemoveAllWhenShown(true);
-// Menu menu = manager.createContextMenu(getControl());
-// getControl().setMenu(menu);
-
- editor.getEditorSite().registerContextMenu("org.eclipse.wst.wsdl.ui.popup.graph", getContextMenu(), internalSelectionProvider, false); //$NON-NLS-1$
-
- // make the internalSelectionProvider listen to graph view selection changes
- addSelectionChangedListener(internalSelectionProvider);
- internalSelectionProvider.addSelectionChangedListener(manager);
- manager.addSelectionChangedListener(this);
-
- // Workaround bug 227687 An edit part's focus state is not updated properly
- // Once this is bug is fixed, we can remove custom selection manager
- setSelectionManager(new CustomSelectionManager());
-
- setKeyHandler(new BaseGraphicalViewerKeyHandler(this));
- }
-
- // Workaround bug 227687 An edit part's focus state is not updated properly
- // Once this is bug is fixed, we can remove this class
- private class CustomSelectionManager extends SelectionManager
- {
- public void appendSelection(EditPart editpart)
- {
- if (editpart != getFocus())
- getViewer().setFocus(editpart);
- super.appendSelection(editpart);
- }
- }
-
- // this method is called when something changes in the selection manager
- // (e.g. a selection occured from another view)
- public void selectionChanged(SelectionChangedEvent event)
- {
- Object selectedObject = ((StructuredSelection) event.getSelection()).getFirstElement();
- if (event.getSource() != internalSelectionProvider)
- {
- EditPart editPart = getEditPart(getRootEditPart(), selectedObject);
- if (editPart != null)
- {
- setSelection(new StructuredSelection(editPart));
- }
- }
- }
-
- protected EditPart getEditPart(EditPart editPart, Object model)
- {
- EditPart result = null;
- if (editPart.getModel() == model)
- {
- result = editPart;
- }
- else
- {
- for (Iterator i = editPart.getChildren().iterator(); i.hasNext(); )
- {
- result = getEditPart((EditPart)i.next(), model);
- if (result != null)
- {
- break;
- }
- }
- }
- return result;
- }
-
-
- /*
- * We need to convert from edit part selections to model object selections
- */
- class ASDSelectionChangedListener implements ISelectionProvider, ISelectionChangedListener
- {
- protected List listenerList = new ArrayList();
- protected ISelection selection = new StructuredSelection();
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- public ISelection getSelection()
- {
- return selection;
- }
-
- protected void notifyListeners(SelectionChangedEvent event)
- {
- for (Iterator i = listenerList.iterator(); i.hasNext();)
- {
- ISelectionChangedListener listener = (ISelectionChangedListener) i.next();
- listener.selectionChanged(event);
- }
- }
-
- public StructuredSelection convertSelectionFromEditPartToModel(ISelection editPartSelection)
- {
- List selectedModelObjectList = new ArrayList();
- if (editPartSelection instanceof IStructuredSelection)
- {
- for (Iterator i = ((IStructuredSelection) editPartSelection).iterator(); i.hasNext();)
- {
- Object obj = i.next();
- Object model = null;
- if (obj instanceof EditPart)
- {
- EditPart editPart = (EditPart) obj;
- model = editPart.getModel();
- }
- if (model != null)
- {
- selectedModelObjectList.add(model);
- }
- }
- }
- return new StructuredSelection(selectedModelObjectList);
- }
-
- public void setSelection(ISelection selection)
- {
- this.selection = selection;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection newSelection = convertSelectionFromEditPartToModel(event.getSelection());
- this.selection = newSelection;
- SelectionChangedEvent newEvent = new SelectionChangedEvent(this, newSelection);
- notifyListeners(newEvent);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicsConstants.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicsConstants.java
deleted file mode 100644
index c4eff0c4c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/DesignViewGraphicsConstants.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A collection of color and font related constants.
- */
-public interface DesignViewGraphicsConstants
-{
- public final static Display display = Display.getDefault();
- public final static boolean isHighContrast = Display.getDefault().getHighContrast();
-
- public final static Color groupBorderColor = new Color(null, 118, 134, 164);
- public final static Color groupHeaderColor = new Color(null, 232, 240, 248);
-
- public final static Color elementBorderColor = new Color(null, 120, 152, 184);
- public final static Color elementBackgroundColor = new Color(null, 232, 240, 248);
- public final static Color elementLabelColor = new Color(null, 80, 102, 144);
- public final static Color readOnlyBorderColor = new Color(null, 164, 164, 164);
- public final static Color red = new Color(null, 255, 0, 0);
-
- public final static Color tableOperationHeadingColor = new Color(null, 224, 233, 246);
- public final static Color tableMessageHeadingColor = new Color(null, 230, 240, 245);
- public final static Color normalTableCellSelectionColor = new Color(null, 238, 232, 170); //new Color(null, 240, 230, 140); //1, 15, 42);
- public final static Color tableCellSelectionColor = isHighContrast ? Display.getDefault().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT): normalTableCellSelectionColor;
-
- public final static Color readOnlyTableOperationHeadingColor = new Color(null, 239, 243, 255);
- public final static Color readOnlyMessageRefHeadingColor = new Color(null, 245, 245, 245);
-
- public final static Color readOnlyBackgroundColor = ColorConstants.white;
- public final static Color readOnlyLabelColor = ColorConstants.gray;
- public final static Color labelColor = ColorConstants.black;
-
- public final static Color defaultForegroundColor = isHighContrast ? Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND) : ColorConstants.black;
- public final static Color defaultBackgroundColor = isHighContrast ? Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND) : ColorConstants.white;
-
- public final static Font smallBoldFont = new Font(Display.getCurrent(), "Tahoma", 8, SWT.BOLD); //$NON-NLS-1$
- public final static Font mediumFont = new Font(Display.getCurrent(), "Tahoma", 10, SWT.NONE); //$NON-NLS-1$
- public final static Font mediumBoldFont = new Font(Display.getCurrent(), "Tahoma", 10, SWT.BOLD); //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/KeyboardDragImpl.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/KeyboardDragImpl.java
deleted file mode 100644
index a84adf13f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/KeyboardDragImpl.java
+++ /dev/null
@@ -1,78 +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.asd.design;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IKeyboardDrag;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-
-public class KeyboardDragImpl extends BaseSelectionAction implements IKeyboardDrag {
-
- public KeyboardDragImpl() {
- super(null);
- }
-
- public void performKeyboardDrag(GraphicalEditPart movingElement, int direction) {
-
- KeyBoardAccessibilityEditPolicy policy = (KeyBoardAccessibilityEditPolicy)movingElement.getEditPolicy(KeyBoardAccessibilityEditPolicy.KEY);
-
- EditPart rightElement = policy.getRelativeEditPart(movingElement, direction);
- policy = (KeyBoardAccessibilityEditPolicy)rightElement.getEditPolicy(KeyBoardAccessibilityEditPolicy.KEY);
- EditPart leftElement = (policy != null)? policy.getRelativeEditPart(rightElement, direction): null;
-
- Object leftSibElement = (leftElement != null)? leftElement.getModel() : null;
- Object rightSibElement = (rightElement != null)? rightElement.getModel() : null;
- if (direction == PositionConstants.SOUTH) {
- leftSibElement = rightSibElement;
- rightSibElement = leftSibElement;
- } else if (direction != PositionConstants.NORTH) return;
-
- Object source = movingElement.getModel();
-
- if (source instanceof IMessageReference) {
-
- if(!(leftSibElement instanceof IMessageReference)) leftSibElement = null;
- if(!(rightSibElement instanceof IMessageReference)) rightSibElement = null;
-
- Object messageRefOwner = ((IMessageReference) source).getOwnerOperation();
- if (messageRefOwner instanceof IOperation) {
- IMessageReference leftSib = (IMessageReference) leftSibElement;
- IMessageReference rightSib = (IMessageReference) rightSibElement;
- IMessageReference movingSib = (IMessageReference) source;
- Command command = ((IOperation) messageRefOwner).getReorderMessageReferencesCommand(leftSib, rightSib, movingSib);
- command.execute();
- performSelection(source);
- }
- }
- else if (source instanceof IParameter) {
-
- if(!(leftSibElement instanceof IParameter)) leftSibElement = null;
- if(!(rightSibElement instanceof IParameter)) rightSibElement = null;
-
- Object paramOwner = ((IParameter) source).getOwner();
- if (paramOwner instanceof IMessageReference) {
- IParameter leftSib = (IParameter) leftSibElement;
- IParameter rightSib = (IParameter) rightSibElement;
- IParameter movingSib = (IParameter) source;
- Command command = ((IMessageReference) paramOwner).getReorderParametersCommand(leftSib, rightSib, movingSib);
- command.execute();
- performSelection(source);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/CenteredConnectionAnchor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/CenteredConnectionAnchor.java
deleted file mode 100644
index e5c9c29ee..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/CenteredConnectionAnchor.java
+++ /dev/null
@@ -1,88 +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.asd.design.connections;
-
-import org.eclipse.draw2d.AbstractConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class CenteredConnectionAnchor extends AbstractConnectionAnchor
-{
- public static final int TOP = 0;
- public static final int BOTTOM = 1;
- public static final int LEFT = 2;
- public static final int RIGHT = 3;
-
- // These two are custom for rectangles with header blocks
- public static final int HEADER_LEFT = 4;
- public static final int HEADER_RIGHT = 5;
-
- private int location;
- private int inset;
- private int offset = 0;
-
- public CenteredConnectionAnchor(IFigure owner, int location, int inset) {
- super(owner);
- this.location = location;
- this.inset = inset;
- }
-
- public CenteredConnectionAnchor(IFigure owner, int location, int inset, int offset) {
- this(owner, location, inset);
- this.offset = offset;
- }
-
- public Point getLocation(Point reference) {
- Rectangle r = getOwner().getBounds();
- int x, y;
- switch (location) {
- case TOP:
- x = r.right() - r.width / 2 + offset;
- y = r.y + inset;
- break;
- case BOTTOM:
- x = r.right() - r.width / 2 + offset;
- y = r.bottom() - inset;
- break;
- case LEFT:
- x = r.x + inset;
- y = r.bottom() - r.height / 2 + offset;
- break;
- case RIGHT:
- x = r.right() - inset;
- y = r.bottom() - r.height / 2 + offset;
- break;
- case HEADER_LEFT:
- x = r.x + inset;
- y = r.y + offset;
- break;
- case HEADER_RIGHT:
- x = r.right() - inset;
- y = r.y + offset;
- break;
-
- default:
- // Something went wrong. Attach the anchor to the middle
- x = r.right() - r.width / 2;
- y = r.bottom() - r.height / 2;
- }
- Point p = new Point(x,y);
-
- getOwner().translateToAbsolute(p);
- return p;
- }
-
- public Point getReferencePoint() {
- return getLocation(null);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/TopLeftConnectionAnchor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/TopLeftConnectionAnchor.java
deleted file mode 100644
index 840bda89c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/connections/TopLeftConnectionAnchor.java
+++ /dev/null
@@ -1,35 +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.asd.design.connections;
-
-import org.eclipse.draw2d.AbstractConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-
-public class TopLeftConnectionAnchor extends AbstractConnectionAnchor
-{
- IFigure label;
- public TopLeftConnectionAnchor(IFigure owner, IFigure label) {
- super(owner);
- this.label = label;
- }
- public Point getLocation(Point reference) {
- int x = getOwner().getBounds().x;
- int y = label.getBounds().y + label.getBounds().height / 2;
- Point p = new Point(x,y);
- getOwner().translateToAbsolute(p);
- return p;
- }
-
- public Point getReferencePoint() {
- return getLocation(null);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDCCombo.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDCCombo.java
deleted file mode 100644
index 6c9b35739..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDCCombo.java
+++ /dev/null
@@ -1,1511 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 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.asd.design.directedit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.accessibility.AccessibleTextAdapter;
-import org.eclipse.swt.accessibility.AccessibleTextEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TypedListener;
-
-/*
- * rmah:
- * This class is a copy of CCombo. We copy it because we wish to align
- * the Text of the Combo in our own special way. However there is no
- * way to access the Text object within CCombo.....
- * Bug for this issue to be opened
- */
-
-/**
- * The CCombo class represents a selectable user interface object
- * that combines a text field and a list and issues notification
- * when an item is selected from the list.
- * <p>
- * Note that although this class is a subclass of <code>Composite</code>,
- * it does not make sense to add children to it, or set a layout on it.
- * </p>
- * <dl>
- * <dt><b>Styles:</b>
- * <dd>BORDER, READ_ONLY, FLAT</dd>
- * <dt><b>Events:</b>
- * <dd>Selection</dd>
- * </dl>
- */
-public final class ASDCCombo extends Composite {
-
- Text text;
- List list;
- int visibleItemCount = 5;
- Shell popup;
- Button arrow;
- boolean hasFocus;
- Listener listener, filter;
- Color foreground, background;
- Font font;
- private int textIndent = 5;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#BORDER
- * @see SWT#READ_ONLY
- * @see SWT#FLAT
- * @see org.eclipse.swt.widgets.Widget#getStyle()
- */
-public ASDCCombo (Composite parent, int style) {
- super (parent, style = checkStyle (style));
-
- int textStyle = SWT.SINGLE;
- if ((style & SWT.READ_ONLY) != 0) textStyle |= SWT.READ_ONLY;
- if ((style & SWT.FLAT) != 0) textStyle |= SWT.FLAT;
- text = new Text (this, textStyle);
- int arrowStyle = SWT.ARROW | SWT.DOWN;
- if ((style & SWT.FLAT) != 0) arrowStyle |= SWT.FLAT;
- arrow = new Button (this, arrowStyle);
-
- listener = new Listener () {
- public void handleEvent (Event event) {
- if (popup == event.widget) {
- popupEvent (event);
- return;
- }
- if (text == event.widget) {
- textEvent (event);
- return;
- }
- if (list == event.widget) {
- listEvent (event);
- return;
- }
- if (arrow == event.widget) {
- arrowEvent (event);
- return;
- }
- if (ASDCCombo.this == event.widget) {
- comboEvent (event);
- return;
- }
- if (getShell () == event.widget) {
- handleFocus (SWT.FocusOut);
- }
- }
- };
- filter = new Listener() {
- public void handleEvent(Event event) {
- Shell shell = ((Control)event.widget).getShell ();
- if (shell == ASDCCombo.this.getShell ()) {
- handleFocus (SWT.FocusOut);
- }
- }
- };
-
- int [] comboEvents = {SWT.Dispose, SWT.Move, SWT.Resize};
- for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
-
- int [] textEvents = {SWT.KeyDown, SWT.KeyUp, SWT.MenuDetect, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn};
- for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
-
- int [] arrowEvents = {SWT.Selection, SWT.FocusIn};
- for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
-
- createPopup(null, -1);
- initAccessible();
-}
-static int checkStyle (int style) {
- int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- return style & mask;
-}
-/**
- * Adds the argument to the end of the receiver's list.
- *
- * @param string the new item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #add(String,int)
- */
-public void add (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string);
-}
-/**
- * Adds the argument to the receiver's list at the given
- * zero-relative index.
- * <p>
- * Note: To add an item at the end of the list, use the
- * result of calling <code>getItemCount()</code> as the
- * index or use <code>add(String)</code>.
- * </p>
- *
- * @param string the new item
- * @param index the index for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #add(String)
- */
-public void add (String string, int index) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string, index);
-}
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's text is modified, by sending
- * it one of the messages defined in the <code>ModifyListener</code>
- * interface.
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see ModifyListener
- * @see #removeModifyListener
- */
-public void addModifyListener (ModifyListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Modify, typedListener);
-}
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's selection changes, by sending
- * it one of the messages defined in the <code>SelectionListener</code>
- * interface.
- * <p>
- * <code>widgetSelected</code> is called when the combo's list selection changes.
- * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #removeSelectionListener
- * @see org.eclipse.swt.events.SelectionEvent
- */
-public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Selection,typedListener);
- addListener (SWT.DefaultSelection,typedListener);
-}
-void arrowEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.Selection: {
- dropDown (!isDropped ());
- break;
- }
- }
-}
-/**
- * Sets the selection in the receiver's text field to an empty
- * selection starting just before the first character. If the
- * text field is editable, this has the effect of placing the
- * i-beam at the start of the text.
- * <p>
- * Note: To clear the selected items in the receiver's list,
- * use <code>deselectAll()</code>.
- * </p>
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #deselectAll
- */
-public void clearSelection () {
- checkWidget ();
- text.clearSelection ();
- list.deselectAll ();
-}
-void comboEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- if (popup != null && !popup.isDisposed ()) {
- list.removeListener (SWT.Dispose, listener);
- popup.dispose ();
- }
- Shell shell = getShell ();
- shell.removeListener (SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- popup = null;
- text = null;
- list = null;
- arrow = null;
- break;
- case SWT.Move:
- dropDown (false);
- break;
- case SWT.Resize:
- internalLayout (false);
- break;
- }
-}
-
-public Point computeSize (int wHint, int hHint, boolean changed) {
- checkWidget ();
- int width = 0, height = 0;
- String[] items = list.getItems ();
- int textWidth = 0;
- GC gc = new GC (text);
- int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
- for (int i = 0; i < items.length; i++) {
- textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
- }
- gc.dispose();
- Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- Point listSize = list.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- int borderWidth = getBorderWidth ();
-
- height = Math.max (textSize.y, arrowSize.y);
- width = Math.max (textWidth + 2*spacer + arrowSize.x + 2*borderWidth, listSize.x);
- if (wHint != SWT.DEFAULT) width = wHint;
- if (hHint != SWT.DEFAULT) height = hHint;
- return new Point (width + 2*borderWidth, height + 2*borderWidth);
-}
-void createPopup(String[] items, int selectionIndex) {
- // create shell and list
- popup = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP);
- int style = getStyle ();
- int listStyle = SWT.SINGLE | SWT.V_SCROLL;
- if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
- if ((style & SWT.RIGHT_TO_LEFT) != 0) listStyle |= SWT.RIGHT_TO_LEFT;
- if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT;
- list = new List (popup, listStyle);
- if (font != null) list.setFont (font);
- if (foreground != null) list.setForeground (foreground);
- if (background != null) list.setBackground (background);
-
- int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
- for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
- int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.Dispose};
- for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
-
- if (items != null) list.setItems (items);
- if (selectionIndex != -1) list.setSelection (selectionIndex);
-}
-/**
- * Deselects the item at the given zero-relative index in the receiver's
- * list. If the item at the index was already deselected, it remains
- * deselected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to deselect
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void deselect (int index) {
- checkWidget ();
- list.deselect (index);
-}
-/**
- * Deselects all selected items in the receiver's list.
- * <p>
- * Note: To clear the selection in the receiver's text field,
- * use <code>clearSelection()</code>.
- * </p>
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #clearSelection
- */
-public void deselectAll () {
- checkWidget ();
- list.deselectAll ();
-}
-void dropDown (boolean drop) {
- if (drop == isDropped ()) return;
- if (!drop) {
- popup.setVisible (false);
- text.selectAll();
- if (!isDisposed ()&& arrow.isFocusControl()) {
- text.setFocus();
- }
- return;
- }
-
- if (getShell() != popup.getParent ()) {
- String[] items = list.getItems ();
- int selectionIndex = list.getSelectionIndex ();
- list.removeListener (SWT.Dispose, listener);
- popup.dispose();
- popup = null;
- list = null;
- createPopup (items, selectionIndex);
- }
-
- Point size = getSize ();
- int itemCount = list.getItemCount ();
- itemCount = (itemCount == 0) ? visibleItemCount : Math.min(visibleItemCount, itemCount);
- int itemHeight = list.getItemHeight () * itemCount;
- Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
- list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
-
- int index = list.getSelectionIndex ();
- if (index != -1) list.setTopIndex (index);
- Display display = getDisplay ();
- Rectangle listRect = list.getBounds ();
- Rectangle parentRect = display.map (getParent (), null, getBounds ());
- Point comboSize = getSize ();
- Rectangle displayRect = getMonitor ().getClientArea ();
- int width = Math.max (comboSize.x, listRect.width + 2);
- int height = listRect.height + 2;
- int x = parentRect.x;
- int y = parentRect.y + comboSize.y;
- if (y + height > displayRect.y + displayRect.height) y = parentRect.y - height;
- if (x + width > displayRect.x + displayRect.width) x = displayRect.x + displayRect.width - listRect.width;
- popup.setBounds (x, y, width, height);
- popup.setVisible (true);
- list.setFocus ();
-}
-/*
- * Return the lowercase of the first non-'&' character following
- * an '&' character in the given string. If there are no '&'
- * characters in the given string, return '\0'.
- */
-char _findMnemonic (String string) {
- if (string == null) return '\0';
- int index = 0;
- int length = string.length ();
- do {
- while (index < length && string.charAt (index) != '&') index++;
- if (++index >= length) return '\0';
- if (string.charAt (index) != '&') return Character.toLowerCase (string.charAt (index));
- index++;
- } while (index < length);
- return '\0';
-}
-/*
- * Return the Label immediately preceding the receiver in the z-order,
- * or null if none.
- */
-Label getAssociatedLabel () {
- Control[] siblings = getParent ().getChildren ();
- for (int i = 0; i < siblings.length; i++) {
- if (siblings [i] == this) {
- if (i > 0 && siblings [i-1] instanceof Label) {
- return (Label) siblings [i-1];
- }
- }
- }
- return null;
-}
-public Control [] getChildren () {
- checkWidget();
- return new Control [0];
-}
-/**
- * Gets the editable state.
- *
- * @return whether or not the receiver is editable
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public boolean getEditable () {
- checkWidget ();
- return text.getEditable();
-}
-/**
- * Returns the item at the given, zero-relative index in the
- * receiver's list. Throws an exception if the index is out
- * of range.
- *
- * @param index the index of the item to return
- * @return the item at the given index
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String getItem (int index) {
- checkWidget();
- return list.getItem (index);
-}
-/**
- * Returns the number of items contained in the receiver's list.
- *
- * @return the number of items
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getItemCount () {
- checkWidget ();
- return list.getItemCount ();
-}
-/**
- * Returns the height of the area which would be used to
- * display <em>one</em> of the items in the receiver's list.
- *
- * @return the height of one item
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getItemHeight () {
- checkWidget ();
- return list.getItemHeight ();
-}
-/**
- * Returns an array of <code>String</code>s which are the items
- * in the receiver's list.
- * <p>
- * Note: This is not the actual structure used by the receiver
- * to maintain its list of items, so modifying the array will
- * not affect the receiver.
- * </p>
- *
- * @return the items in the receiver's list
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String [] getItems () {
- checkWidget ();
- return list.getItems ();
-}
-public Menu getMenu() {
- return text.getMenu();
-}
-/**
- * Returns a <code>Point</code> whose x coordinate is the start
- * of the selection in the receiver's text field, and whose y
- * coordinate is the end of the selection. The returned values
- * are zero-relative. An "empty" selection as indicated by
- * the the x and y coordinates having the same value.
- *
- * @return a point representing the selection start and end
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public Point getSelection () {
- checkWidget ();
- return text.getSelection ();
-}
-/**
- * Returns the zero-relative index of the item which is currently
- * selected in the receiver's list, or -1 if no item is selected.
- *
- * @return the index of the selected item
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getSelectionIndex () {
- checkWidget ();
- return list.getSelectionIndex ();
-}
-public int getStyle () {
- int style = super.getStyle ();
- style &= ~SWT.READ_ONLY;
- if (!text.getEditable()) style |= SWT.READ_ONLY;
- return style;
-}
-/**
- * Returns a string containing a copy of the contents of the
- * receiver's text field.
- *
- * @return the receiver's text
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String getText () {
- checkWidget ();
- return text.getText ();
-}
-/**
- * Returns the height of the receivers's text field.
- *
- * @return the text height
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getTextHeight () {
- checkWidget ();
- return text.getLineHeight ();
-}
-/**
- * Returns the maximum number of characters that the receiver's
- * text field is capable of holding. If this has not been changed
- * by <code>setTextLimit()</code>, it will be the constant
- * <code>Combo.LIMIT</code>.
- *
- * @return the text limit
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getTextLimit () {
- checkWidget ();
- return text.getTextLimit ();
-}
-/**
- * Gets the number of items that are visible in the drop
- * down portion of the receiver's list.
- *
- * @return the number of items that are visible
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public int getVisibleItemCount () {
- checkWidget ();
- return visibleItemCount;
-}
-void handleFocus (int type) {
- if (isDisposed ()) return;
- switch (type) {
- case SWT.FocusIn: {
- if (hasFocus) return;
-// if (getEditable ()) text.selectAll ();
- hasFocus = true;
- Shell shell = getShell ();
- shell.removeListener (SWT.Deactivate, listener);
- shell.addListener (SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- display.addFilter (SWT.FocusIn, filter);
- Event e = new Event ();
- notifyListeners (SWT.FocusIn, e);
- break;
- }
- case SWT.FocusOut: {
- if (!hasFocus) return;
- Control focusControl = getDisplay ().getFocusControl ();
- if (focusControl == arrow || focusControl == list || focusControl == text) return;
- hasFocus = false;
- Shell shell = getShell ();
- shell.removeListener(SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- Event e = new Event ();
- notifyListeners (SWT.FocusOut, e);
- break;
- }
- }
-}
-/**
- * Searches the receiver's list starting at the first item
- * (index 0) until an item is found that is equal to the
- * argument, and returns the index of that item. If no item
- * is found, returns -1.
- *
- * @param string the search item
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int indexOf (String string) {
- checkWidget ();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string);
-}
-/**
- * Searches the receiver's list starting at the given,
- * zero-relative index until an item is found that is equal
- * to the argument, and returns the index of that item. If
- * no item is found or the starting index is out of range,
- * returns -1.
- *
- * @param string the search item
- * @param start the zero-relative index at which to begin the search
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int indexOf (String string, int start) {
- checkWidget ();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string, start);
-}
-
-void initAccessible() {
- AccessibleAdapter accessibleAdapter = new AccessibleAdapter () {
- public void getName (AccessibleEvent e) {
- String name = null;
- Label label = getAssociatedLabel ();
- if (label != null) {
- name = stripMnemonic (label.getText());
- }
- e.result = name;
- }
- public void getKeyboardShortcut(AccessibleEvent e) {
- String shortcut = null;
- Label label = getAssociatedLabel ();
- if (label != null) {
- String text = label.getText ();
- if (text != null) {
- char mnemonic = _findMnemonic (text);
- if (mnemonic != '\0') {
- shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
- }
- }
- }
- e.result = shortcut;
- }
- public void getHelp (AccessibleEvent e) {
- e.result = getToolTipText ();
- }
- };
- getAccessible ().addAccessibleListener (accessibleAdapter);
- text.getAccessible ().addAccessibleListener (accessibleAdapter);
- list.getAccessible ().addAccessibleListener (accessibleAdapter);
-
- arrow.getAccessible ().addAccessibleListener (new AccessibleAdapter() {
- public void getName (AccessibleEvent e) {
- e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void getKeyboardShortcut (AccessibleEvent e) {
- e.result = "Alt+Down Arrow"; //$NON-NLS-1$
- }
- public void getHelp (AccessibleEvent e) {
- e.result = getToolTipText ();
- }
- });
-
- getAccessible().addAccessibleTextListener (new AccessibleTextAdapter() {
- public void getCaretOffset (AccessibleTextEvent e) {
- e.offset = text.getCaretPosition ();
- }
- public void getSelectionRange(AccessibleTextEvent e) {
- Point sel = text.getSelection();
- e.offset = sel.x;
- e.length = sel.y - sel.x;
- }
- });
-
- getAccessible().addAccessibleControlListener (new AccessibleControlAdapter() {
- public void getChildAtPoint (AccessibleControlEvent e) {
- Point testPoint = toControl (e.x, e.y);
- if (getBounds ().contains (testPoint)) {
- e.childID = ACC.CHILDID_SELF;
- }
- }
-
- public void getLocation (AccessibleControlEvent e) {
- Rectangle location = getBounds ();
- Point pt = toDisplay (location.x, location.y);
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
-
- public void getChildCount (AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- public void getRole (AccessibleControlEvent e) {
- e.detail = ACC.ROLE_COMBOBOX;
- }
-
- public void getState (AccessibleControlEvent e) {
- e.detail = ACC.STATE_NORMAL;
- }
-
- public void getValue (AccessibleControlEvent e) {
- e.result = getText ();
- }
- });
-
- text.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter () {
- public void getRole (AccessibleControlEvent e) {
- e.detail = text.getEditable () ? ACC.ROLE_TEXT : ACC.ROLE_LABEL;
- }
- });
-
- arrow.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter() {
- public void getDefaultAction (AccessibleControlEvent e) {
- e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
-}
-boolean isDropped () {
- return popup.getVisible ();
-}
-public boolean isFocusControl () {
- checkWidget();
- if (text.isFocusControl () || arrow.isFocusControl () || list.isFocusControl () || popup.isFocusControl ()) {
- return true;
- }
- return super.isFocusControl ();
-}
-
-public void setTextIndent(int indent) {
- textIndent = indent;
-}
-
-void internalLayout (boolean changed) {
- if (isDropped ()) dropDown (false);
- Rectangle rect = getClientArea ();
- int width = rect.width;
- int height = rect.height;
- Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
-
- text.pack();
- int textHeight = text.getBounds().height;
- int textX = textIndent;
- int textY = (height - textHeight) / 2;
- text.setLocation(textX, textY);
-
- arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
-}
-void listEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- if (getShell () != popup.getParent ()) {
- String[] items = list.getItems ();
- int selectionIndex = list.getSelectionIndex ();
- popup = null;
- list = null;
- createPopup (items, selectionIndex);
- }
- break;
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- dropDown (false);
- break;
- }
- case SWT.Selection: {
- int index = list.getSelectionIndex ();
- if (index == -1) return;
- text.setText (list.getItem (index));
-// text.selectAll ();
- list.setSelection (index);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- e.doit = event.doit;
- if (!isDropped()) {
- notifyListeners (SWT.Selection, e);
- }
- event.doit = e.doit;
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ESCAPE:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- event.doit = false;
- break;
- }
- Event e = new Event ();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.character = event.character;
- e.keyCode = event.keyCode;
- notifyListeners (SWT.Traverse, e);
- event.doit = e.doit;
- event.detail = e.detail;
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
-
- notifyListeners (SWT.KeyUp, e);
-
-
- break;
- }
- case SWT.KeyDown: {
- if (event.character == SWT.ESC) {
- // Escape key cancels popup list
- dropDown (false);
- }
- if ((event.stateMask & SWT.ALT) != 0 && (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN)) {
- dropDown (false);
- }
-
- if (event.character == SWT.CR) {
- // Enter causes default selection
- dropDown (false);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.DefaultSelection, e);
- }
- // At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
- Event e = new Event();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.KeyDown, e);
- break;
-
- }
- }
-}
-
-void popupEvent(Event event) {
- switch (event.type) {
- case SWT.Paint:
- // draw black rectangle around list
- Rectangle listRect = list.getBounds();
- Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
- event.gc.setForeground(black);
- event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
- break;
- case SWT.Close:
- event.doit = false;
- dropDown (false);
- break;
- case SWT.Deactivate:
- dropDown (false);
- break;
- }
-}
-public void redraw () {
- super.redraw();
- text.redraw();
- arrow.redraw();
- if (popup.isVisible()) list.redraw();
-}
-public void redraw (int x, int y, int width, int height, boolean all) {
- super.redraw(x, y, width, height, true);
-}
-
-/**
- * Removes the item from the receiver's list at the given
- * zero-relative index.
- *
- * @param index the index for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (int index) {
- checkWidget();
- list.remove (index);
-}
-/**
- * Removes the items from the receiver's list which are
- * between the given zero-relative start and end
- * indices (inclusive).
- *
- * @param start the start of the range
- * @param end the end of the range
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (int start, int end) {
- checkWidget();
- list.remove (start, end);
-}
-/**
- * Searches the receiver's list starting at the first item
- * until an item is found that is equal to the argument,
- * and removes that item from the list.
- *
- * @param string the item to remove
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.remove (string);
-}
-/**
- * Removes all of the items from the receiver's list and clear the
- * contents of receiver's text field.
- * <p>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void removeAll () {
- checkWidget();
- text.setText (""); //$NON-NLS-1$
- list.removeAll ();
-}
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's text is modified.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see ModifyListener
- * @see #addModifyListener
- */
-public void removeModifyListener (ModifyListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Modify, listener);
-}
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's selection changes.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #addSelectionListener
- */
-public void removeSelectionListener (SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Selection, listener);
- removeListener(SWT.DefaultSelection,listener);
-}
-/**
- * Selects the item at the given zero-relative index in the receiver's
- * list. If the item at the index was already selected, it remains
- * selected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to select
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void select (int index) {
- checkWidget();
- if (index == -1) {
- list.deselectAll ();
- text.setText (""); //$NON-NLS-1$
- return;
- }
- if (0 <= index && index < list.getItemCount()) {
- if (index != getSelectionIndex()) {
- text.setText (list.getItem (index));
-// text.selectAll ();
- list.select (index);
- list.showSelection ();
- }
- }
-}
-public void setBackground (Color color) {
- super.setBackground(color);
- background = color;
- if (text != null) text.setBackground(color);
- if (list != null) list.setBackground(color);
- if (arrow != null) arrow.setBackground(color);
-}
-/**
- * Sets the editable state.
- *
- * @param editable the new editable state
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public void setEditable (boolean editable) {
- checkWidget ();
- text.setEditable(editable);
-}
-public void setEnabled (boolean enabled) {
- super.setEnabled(enabled);
- if (popup != null) popup.setVisible (false);
- if (text != null) text.setEnabled(enabled);
- if (arrow != null) arrow.setEnabled(enabled);
-}
-public boolean setFocus () {
- checkWidget();
- return text.setFocus ();
-}
-public void setFont (Font font) {
- super.setFont (font);
- this.font = font;
- text.setFont (font);
- list.setFont (font);
- internalLayout (true);
-}
-public void setForeground (Color color) {
- super.setForeground(color);
- foreground = color;
- if (text != null) text.setForeground(color);
- if (list != null) list.setForeground(color);
- if (arrow != null) arrow.setForeground(color);
-}
-/**
- * Sets the text of the item in the receiver's list at the given
- * zero-relative index to the string argument. This is equivalent
- * to <code>remove</code>'ing the old item at the index, and then
- * <code>add</code>'ing the new item at that index.
- *
- * @param index the index for the item
- * @param string the new text for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setItem (int index, String string) {
- checkWidget();
- list.setItem (index, string);
-}
-/**
- * Sets the receiver's list to be the given array of items.
- *
- * @param items the array of items
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the items array is null</li>
- * <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setItems (String [] items) {
- checkWidget ();
- list.setItems (items);
- if (!text.getEditable ()) text.setText (""); //$NON-NLS-1$
-}
-/**
- * Sets the layout which is associated with the receiver to be
- * the argument which may be null.
- * <p>
- * Note: No Layout can be set on this Control because it already
- * manages the size and position of its children.
- * </p>
- *
- * @param layout the receiver's new layout or null
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setLayout (Layout layout) {
- checkWidget ();
- return;
-}
-public void setMenu(Menu menu) {
- text.setMenu(menu);
-}
-/**
- * Sets the selection in the receiver's text field to the
- * range specified by the argument whose x coordinate is the
- * start of the selection and whose y coordinate is the end
- * of the selection.
- *
- * @param selection a point representing the new selection start and end
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setSelection (Point selection) {
- checkWidget();
- if (selection == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- text.setSelection (selection.x, selection.y);
-}
-
-/**
- * Sets the contents of the receiver's text field to the
- * given string.
- * <p>
- * Note: The text field in a <code>Combo</code> is typically
- * only capable of displaying a single line of text. Thus,
- * setting the text to a string containing line breaks or
- * other special characters will probably cause it to
- * display incorrectly.
- * </p>
- *
- * @param string the new text
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setText (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- int index = list.indexOf (string);
- if (index == -1) {
- list.deselectAll ();
- text.setText (string);
- return;
- }
- text.setText (string);
-// text.selectAll ();
- list.setSelection (index);
- list.showSelection ();
-}
-/**
- * Sets the maximum number of characters that the receiver's
- * text field is capable of holding to be the argument.
- *
- * @param limit new text limit
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setTextLimit (int limit) {
- checkWidget();
- text.setTextLimit (limit);
-}
-
-public void setToolTipText (String string) {
- checkWidget();
- super.setToolTipText(string);
- arrow.setToolTipText (string);
- text.setToolTipText (string);
-}
-
-public void setVisible (boolean visible) {
- super.setVisible(visible);
- if (!visible) popup.setVisible(false);
-}
-/**
- * Sets the number of items that are visible in the drop
- * down portion of the receiver's list.
- *
- * @param count the new number of items to be visible
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public void setVisibleItemCount (int count) {
- checkWidget ();
- if (count < 0) return;
- visibleItemCount = count;
-}
-String stripMnemonic (String string) {
- int index = 0;
- int length = string.length ();
- do {
- while ((index < length) && (string.charAt (index) != '&')) index++;
- if (++index >= length) return string;
- if (string.charAt (index) != '&') {
- return string.substring(0, index-1) + string.substring(index, length);
- }
- index++;
- } while (index < length);
- return string;
-}
-void textEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.KeyDown: {
- if (event.character == SWT.CR) {
- dropDown (false);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.DefaultSelection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
-
- if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
- event.doit = false;
- if ((event.stateMask & SWT.ALT) != 0) {
- boolean dropped = isDropped ();
-// text.selectAll ();
- if (!dropped) setFocus ();
- dropDown (!dropped);
- break;
- }
-
- int oldIndex = getSelectionIndex ();
- if (event.keyCode == SWT.ARROW_UP) {
- select (Math.max (oldIndex - 1, 0));
- } else {
- select (Math.min (oldIndex + 1, getItemCount () - 1));
- }
- if (oldIndex != getSelectionIndex ()) {
- Event e = new Event();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.Selection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
- }
-
- // Further work : Need to add support for incremental search in
- // pop up list as characters typed in text widget
-
-
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- //notifyListeners (SWT.KeyDown, e);
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.KeyUp, e);
- break;
- }
- case SWT.MenuDetect: {
- Event e = new Event ();
- e.time = event.time;
- notifyListeners (SWT.MenuDetect, e);
- break;
- }
- case SWT.Modify: {
- list.deselectAll ();
- Event e = new Event ();
- e.time = event.time;
- notifyListeners (SWT.Modify, e);
- break;
- }
- case SWT.MouseDown: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
- boolean dropped = isDropped ();
-// text.selectAll ();
- if (!dropped) setFocus ();
- dropDown (!dropped);
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
-// text.selectAll ();
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- // The enter causes default selection and
- // the arrow keys are used to manipulate the list contents so
- // do not use them for traversal.
- event.doit = false;
- break;
- }
-
- Event e = new Event ();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.character = event.character;
- e.keyCode = event.keyCode;
- notifyListeners (SWT.Traverse, e);
- event.doit = e.doit;
- event.detail = e.detail;
- break;
- }
- }
-}
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDComboBoxCellEditor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDComboBoxCellEditor.java
deleted file mode 100644
index 6ecf5ada7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ASDComboBoxCellEditor.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.directedit;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-
-/*
- * This is a copy of ComboBoxCellEditor.
- * We need to apply and deactivate the combo on a single click (not on a double click like
- * the ComboBoxCellEditor).
- */
-public class ASDComboBoxCellEditor extends CellEditor {
-
- /**
- * The list of items to present in the combo box.
- */
- private String[] items;
-
- /**
- * The zero-based index of the selected item.
- */
- int selection;
-
- /**
- * The custom combo box control.
- */
- ASDCCombo comboBox;
- private Object selectedValue;
- private ComponentReferenceEditManager componentReferenceEditManager;
- private int textIndent = 5;
-
- /**
- * Default ComboBoxCellEditor style
- */
- private static final int defaultStyle = SWT.NONE;
-
- /**
- * Creates a new cell editor with a combo containing the given
- * list of choices and parented under the given control. The cell
- * editor value is the zero-based index of the selected item.
- * Initially, the cell editor has no cell validator and
- * the first item in the list is selected.
- *
- * @param parent the parent control
- * @param items the list of strings for the combo box
- */
- public ASDComboBoxCellEditor(Composite parent, String[] items, ComponentReferenceEditManager editManager) {
- super(parent, defaultStyle);
- setItems(items);
- componentReferenceEditManager = editManager;
- }
-
- /**
- * Returns the list of choices for the combo box
- *
- * @return the list of choices for the combo box
- */
- public String[] getItems() {
- return this.items;
- }
-
- /**
- * Sets the list of choices for the combo box
- *
- * @param items the list of choices for the combo box
- */
- public void setItems(String[] items) {
- Assert.isNotNull(items);
- this.items = items;
- populateComboBoxItems();
- }
-
- public void setTextIndent(int indent) {
- textIndent = indent;
- comboBox.setTextIndent(indent);
- }
-
- /* (non-Javadoc)
- * Method declared on CellEditor.
- */
- protected Control createControl(Composite parent) {
- comboBox = new ASDCCombo(parent, getStyle());
- comboBox.setFont(parent.getFont());
- comboBox.setTextIndent(textIndent);
-
- comboBox.addKeyListener(new KeyAdapter() {
- // hook key pressed - see PR 14201
- public void keyPressed(KeyEvent e) {
- keyReleaseOccured(e);
- }
- });
-
- comboBox.addSelectionListener(new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent event) {
- selectionMade();
- }
-
- public void widgetSelected(SelectionEvent event) {
- selectionMade();
- }
- });
-
- comboBox.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_ESCAPE
- || e.detail == SWT.TRAVERSE_RETURN) {
- e.doit = false;
- }
- }
- });
-
- comboBox.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- ASDComboBoxCellEditor.this.focusLost();
- }
- });
- return comboBox;
- }
-
- private Object invokeDialog(IComponentDialog dialog) {
- Object newValue = null;
-
- if (dialog == null) {
- return null;
- }
-
- if (dialog.createAndOpen() == Window.OK) {
- newValue = dialog.getSelectedComponent();
- }
-
- return newValue;
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of
- * this <code>CellEditor</code> framework method returns
- * the zero-based index of the current selection.
- *
- * @return the zero-based index of the current selection wrapped
- * as an <code>Integer</code>
- */
- protected Object doGetValue() {
- return new Integer(selection);
- }
-
- /* (non-Javadoc)
- * Method declared on CellEditor.
- */
- protected void doSetFocus() {
- comboBox.setFocus();
- comboBox.dropDown(true);
-// String comboText = comboBox.getText();
-// comboBox.setText(" " + comboText);
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of
- * this <code>CellEditor</code> framework method sets the
- * minimum width of the cell. The minimum width is 10 characters
- * if <code>comboBox</code> is not <code>null</code> or <code>disposed</code>
- * eles it is 60 pixels to make sure the arrow button and some text is visible.
- * The list of CCombo will be wide enough to show its longest item.
- */
- public LayoutData getLayoutData() {
- LayoutData layoutData = super.getLayoutData();
- if ((comboBox == null) || comboBox.isDisposed())
- layoutData.minimumWidth = 60;
- else {
- // make the comboBox 10 characters wide
- GC gc = new GC(comboBox);
- layoutData.minimumWidth = (gc.getFontMetrics()
- .getAverageCharWidth() * 10) + 10;
- gc.dispose();
- }
- return layoutData;
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of
- * this <code>CellEditor</code> framework method
- * accepts a zero-based index of a selection.
- *
- * @param value the zero-based index of the selection wrapped
- * as an <code>Integer</code>
- */
- protected void doSetValue(Object value) {
- Assert.isTrue(comboBox != null && (value instanceof Integer));
- selection = ((Integer) value).intValue();
- comboBox.select(selection);
- }
-
- /**
- * Updates the list of choices for the combo box for the current control.
- */
- private void populateComboBoxItems() {
- if (comboBox != null && items != null) {
- comboBox.removeAll();
- for (int i = 0; i < items.length; i++)
- comboBox.add(items[i], i);
-
- setValueValid(true);
- selection = 0;
- }
- }
-
- /**
- * Applies the currently selected value and deactiavates the cell editor
- */
- void applyEditorValueAndDeactivate() {
- // must set the selection before getting value
- selection = comboBox.getSelectionIndex();
- Object newValue = doGetValue();
- markDirty();
- boolean isValid = isCorrect(newValue);
- setValueValid(isValid);
- if (!isValid) {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(),
- new Object[] { items[selection] }));
- }
- fireApplyEditorValue();
- deactivate();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.CellEditor#focusLost()
- */
- protected void focusLost() {
- if (isActivated()) {
- applyEditorValueAndDeactivate();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.CellEditor#keyReleaseOccured(org.eclipse.swt.events.KeyEvent)
- */
- protected void keyReleaseOccured(KeyEvent keyEvent) {
- if (keyEvent.character == '\u001b') { // Escape character
- fireCancelEditor();
- } else if (keyEvent.character == '\t') { // tab key
- applyEditorValueAndDeactivate();
- }
- }
-
- public Object getSelectedValue() {
- return selectedValue;
- }
-
-
- public void selectionMade() {
- Object newValue = null;
- selection = comboBox.getSelectionIndex();
- String stringSelection = items[selection];
-
- if (stringSelection.equals(Messages._UI_BUTTON_BROWSE)) { //$NON-NLS-1$
- newValue = invokeDialog(componentReferenceEditManager.getBrowseDialog());
- }
- else if (stringSelection.equals(Messages._UI_BUTTON_NEW)) { //$NON-NLS-1$
- newValue = invokeDialog(componentReferenceEditManager.getNewDialog());
- }
-
- if (newValue == null) {
- int index = comboBox.getSelectionIndex();
- if (index != -1) {
- selectedValue = comboBox.getItem(index);
- }
- }
- else {
- selectedValue = newValue;
- }
- applyEditorValueAndDeactivate();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ComboBoxCellEditorManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ComboBoxCellEditorManager.java
deleted file mode 100644
index 849ac6bc9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/ComboBoxCellEditorManager.java
+++ /dev/null
@@ -1,204 +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.asd.design.directedit;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public abstract class ComboBoxCellEditorManager extends DirectEditManager
-{
- protected Label label;
-
- public ComboBoxCellEditorManager(GraphicalEditPart source, Label label)
- {
- super(source, ComboBoxCellEditor.class, new InternalCellEditorLocator(label));
- this.label = label;
- }
-
- protected void initCellEditor()
- {
- String initialLabelText = label.getText();
-
- ASDCCombo combo = (ASDCCombo)getCellEditor().getControl();
- combo.setFont(label.getFont());
- combo.setForeground(label.getForegroundColor());
- combo.setBackground(label.getBackgroundColor());
- combo.setVisibleItemCount(20);
- combo.setEditable(false);
-
- ICellEditorListener cellEditorListener = new ICellEditorListener()
- {
- public void cancelEditor()
- {
- }
- public void applyEditorValue()
- {
- }
- public void editorValueChanged(boolean old, boolean newState)
- {
- }
- };
- getCellEditor().addListener(cellEditorListener);
-
- String[] item = combo.getItems();
- for (int i = 0; i < item.length; i++)
- {
- if (item[i].equals(initialLabelText))
- {
- getCellEditor().setValue(new Integer(i));
- break;
- }
- }
- }
-
- // hack... for some reason the ComboBoxCellEditor does't fire an editorValueChanged to set the dirty flag
- // unless we overide this method to return true, the manager is not notified of changes made in the cell editor
- protected boolean isDirty()
- {
- return true;
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- boolean isLabelTextInList = false;
- List list = computeComboContent();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- String string = (String)i.next();
- if (string.equals(label.getText()))
- {
- isLabelTextInList = true;
- break;
- }
- }
-
- if (!isLabelTextInList)
- {
- list.add(label.getText());
- }
-
- List sortedList = computeSortedList(list);
- String[] stringArray = new String[sortedList.size()];
- for (int i = 0; i < stringArray.length; i++)
- {
- stringArray[i] = (String)sortedList.get(i);
- }
- return createCellEditor(composite, stringArray);
- }
-
- protected CellEditor createCellEditor(Composite composite, String[] stringArray)
- {
- return new ComboBoxCellEditor(composite, stringArray);
- }
-
- protected List computeSortedList(List list)
- {
- return list;
- }
-
- protected abstract List computeComboContent();
-
- protected abstract void performModify(Object value);
-
- public static class InternalCellEditorLocator implements CellEditorLocator
- {
- protected Label label;
-
- public InternalCellEditorLocator(Label label)
- {
- this.label = label;
- }
-
- public void relocate(CellEditor celleditor)
- {
- ASDCCombo combo = (ASDCCombo)celleditor.getControl();
- Rectangle labelParentBounds = label.getParent().getBounds().getCopy();
- label.translateToAbsolute(labelParentBounds);
-
- int x = labelParentBounds.x;
- int y = labelParentBounds.y;
- int widthK = labelParentBounds.width;
- int height = labelParentBounds.height;
- combo.setBounds(x, y + 1, widthK, height - 2);
- }
- }
-
- public void performEdit(CellEditor cellEditor)
- {
- ASDComboBoxCellEditor comboCellEditor = (ASDComboBoxCellEditor) cellEditor;
- ASDCCombo combo = (ASDCCombo)getCellEditor().getControl();
- int index = combo.getSelectionIndex();
- if (index != -1)
- {
- Object value = combo.getItem(index);
- if (comboCellEditor.getSelectedValue() != null) {
- value = comboCellEditor.getSelectedValue();
- }
-
- performModify(value);
- }
- else
- {
- String typedValue = combo.getText();
- if (combo.indexOf(typedValue) != -1)
- {
- performModify(typedValue);
- }
- else
- {
- String closeMatch = getCloseMatch(typedValue, combo.getItems());
- if (closeMatch != null)
- {
- performModify(closeMatch);
- }
- else
- {
- Display.getCurrent().beep();
- }
- }
- }
- }
-
- protected String getCloseMatch(String value, String[] items)
- {
- int matchIndex = -1;
-
- for (int i = 0; i < items.length; i++)
- {
- String item = items[i];
- String a = getLocalName(value);
- String b = getLocalName(item);
- if (a.equalsIgnoreCase(b))
- {
- matchIndex = i;
- break;
- }
- }
- return matchIndex != -1 ? items[matchIndex] : null;
- }
-
- protected String getLocalName(String string)
- {
- int index = string.indexOf(":"); //$NON-NLS-1$
- return (index != -1) ? string.substring(index + 1) : string;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java
deleted file mode 100644
index 7eb49a6d1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java
+++ /dev/null
@@ -1,60 +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.asd.design.directedit;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.tools.SelectionTool;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.INamedEditPart;
-
-/**
- * Extends the default GEF selection tools to send the
- * mouse events
- */
-public class DirectEditSelectionTool extends SelectionTool {
-
- protected INamedEditPart getSelectedPart() {
- if(getCurrentViewer() == null)
- return null;
- EditPart ep = getCurrentViewer().getFocusEditPart();
- if(ep instanceof INamedEditPart && ep.isActive())
- return (INamedEditPart)ep;
- return null;
- }
-
- protected boolean handleButtonDown(int button) {
- super.handleButtonDown(button);
- INamedEditPart selectedPart = getSelectedPart();
-
- if(selectedPart != null && button == 1) {
- Input i = getCurrentInput();
- Point l = translateLocation(i.getMouseLocation());
-
- IFigure f = ((AbstractGraphicalEditPart) selectedPart).getFigure();
- Rectangle bounds = f.getBounds();
- if(bounds.contains(l.x,l.y)) {
- selectedPart.performDirectEdit(translateLocation(new Point(l.x, l.y)));
- return true;
- }
- }
- return true;
- }
-
- protected Point translateLocation(Point mouseLocation) {
- FigureCanvas canvas = (FigureCanvas)getCurrentViewer().getControl();
- Point viewLocation = canvas.getViewport().getViewLocation();
- return new Point(mouseLocation.x + viewLocation.x,mouseLocation.y + viewLocation.y);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelCellEditorLocator.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelCellEditorLocator.java
deleted file mode 100644
index cc9164d38..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelCellEditorLocator.java
+++ /dev/null
@@ -1,70 +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.asd.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.INamedEditPart;
-
-public class LabelCellEditorLocator implements CellEditorLocator {
- private INamedEditPart namedEditPart;
- private Point cursorLocation;
-
- public LabelCellEditorLocator(INamedEditPart namedEditPart, Point cursorLocation) {
- this.namedEditPart = namedEditPart;
- this.cursorLocation = cursorLocation;
- }
-
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- if (text.getBounds().x <= 0 && namedEditPart.getLabelFigure() != null) {
- Label label = namedEditPart.getLabelFigure();
- Rectangle boundingRect = label.getTextBounds();
-
- // Reduce the width by the amount we shifted along the x-axis
- int delta = Math.abs(boundingRect.x - label.getParent().getBounds().x);
-// boundingRect.width = tableCellFigure.getPreferredSize().width - delta;
-
- label.getParent().translateToAbsolute(boundingRect);
- org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
- boundingRect.translate(trim.x, trim.y);
-// boundingRect.width = boundingRect.width - trim.x;
- boundingRect.height = boundingRect.height - trim.y;
-
- boundingRect.width = label.getParent().getBounds().width - delta;
- text.setBounds(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);
-
- if (cursorLocation != null) {
- // Translate point
- Point translatedPoint = new Point(cursorLocation.x - boundingRect.x,cursorLocation.y - boundingRect.y);
-
- // Calculate text offset corresponding to the translated point
- text.setSelection(0, 0);
- int xCaret = text.getCaretLocation().x;
- int offset = text.getCaretPosition();
- while (xCaret < translatedPoint.x) {
- text.setSelection(offset + 1, offset + 1);
- xCaret = text.getCaretLocation().x;
- int newOffset = text.getCaretPosition();
- if (newOffset == offset) {
- break;
- }
- offset++;
- }
- text.setSelection(offset, offset);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelEditManager.java
deleted file mode 100644
index 912774435..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/LabelEditManager.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.INamedEditPart;
-
-public class LabelEditManager extends DirectEditManager {
-
- private IActionBars actionBars;
- private CellEditorActionHandler actionHandler;
- private IAction copy, cut, paste, undo, redo, find, selectAll, delete;
- private Font scaledFont;
-
- public LabelEditManager(GraphicalEditPart source, CellEditorLocator locator) {
- super(source, null, locator);
- }
-
- /**
- * @see org.eclipse.gef.tools.DirectEditManager#bringDown()
- */
- protected void bringDown() {
- if (actionHandler != null) {
- actionHandler.dispose();
- actionHandler = null;
- }
- if (actionBars != null) {
- restoreSavedActions(actionBars);
- actionBars.updateActionBars();
- actionBars = null;
- }
-
- Font disposeFont = scaledFont;
- scaledFont = null;
- super.bringDown();
- if (disposeFont != null)
- disposeFont.dispose();
- }
-
- public void showFeedback() {
- getEditPart().showSourceFeedback(getDirectEditRequest());
- }
-
- protected CellEditor createCellEditorOn(Composite composite) {
- return new TextCellEditor(composite, SWT.SINGLE | SWT.WRAP);
- }
-
- protected void initCellEditor() {
- Text text = (Text)getCellEditor().getControl();
- Label label = ((INamedEditPart) getEditPart()).getLabelFigure();
-
- if (label != null) {
- scaledFont = label.getFont();
-
- // TODO: rmah: hack here to set the background color of the
- // direct edit Text. Solution is to make the Text transparent...
- Color color = label.getBackgroundColor();
- if (color.equals(DesignViewGraphicsConstants.tableCellSelectionColor)) {
- text.setBackground(color);
- }
- else {
-// text.setBackground(ColorConstants.lightBlue);
- text.setBackground(DesignViewGraphicsConstants.defaultBackgroundColor);
- }
-
- String initialLabelText = label.getText();
- getCellEditor().setValue(initialLabelText);
- }
- else {
- scaledFont = label.getParent().getFont();
- text.setBackground(label.getParent().getBackgroundColor());
- }
-
- FontData data = scaledFont.getFontData()[0];
- Dimension fontSize = new Dimension(0, data.getHeight());
- label.getParent().translateToAbsolute(fontSize);
- data.setHeight(fontSize.height);
- scaledFont = new Font(null, data);
-
- text.setFont(scaledFont);
-// text.selectAll();
-
- // Hook the cell editor's copy/paste actions to the actionBars so that they can
- // be invoked via keyboard shortcuts.
- actionBars = ASDEditorPlugin.getActiveEditor().getEditorSite().getActionBars();
- saveCurrentActions(actionBars);
- actionHandler = new CellEditorActionHandler(actionBars);
- actionHandler.addCellEditor(getCellEditor());
- actionBars.updateActionBars();
- }
-
- private void restoreSavedActions(IActionBars actionBars){
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
- actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
- }
-
- private void saveCurrentActions(IActionBars actionBars) {
- copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
- paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
- delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
- selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
- cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
- find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
- undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
- redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/TypeReferenceDirectEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/TypeReferenceDirectEditManager.java
deleted file mode 100644
index fdfa992d4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/TypeReferenceDirectEditManager.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.asd.design.directedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11ParameterForPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ParameterTypeEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-
-public class TypeReferenceDirectEditManager extends ComboBoxCellEditorManager
-{
- protected AbstractGraphicalEditPart editPart;
- protected IParameter setObject;
-
- public TypeReferenceDirectEditManager(IParameter parameter, AbstractGraphicalEditPart source, Label label)
- {
- super(source, label);
- editPart = source;
- setObject = parameter;
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- return super.createCellEditorOn(composite);
- }
-
- protected List computeComboContent()
- {
- List list = new ArrayList();
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- list.add(Messages._UI_BUTTON_BROWSE); //$NON-NLS-1$
- list.add(Messages._UI_BUTTON_NEW); //$NON-NLS-1$
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- list.add(componentSpecification.getName());
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- list.add(componentSpecification.getName());
- }
- }
- }
- return list;
- }
-
- public void performModify(Object value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager == null)
- {
- return;
- }
-
- // our crude combo box can only work with 'String' objects
- // if we get a String back we need to do some clever mapping to get the ComponentSpecification
- //
- if (value instanceof String)
- {
- value = getComponentSpecificationForValue((String)value);
- }
- // we assume the selected value is always of the form of a ComponentSpecification
- //
- if (value instanceof ComponentSpecification)
- {
- editManager.modifyComponentReference(getEditPart().getModel(), (ComponentSpecification) value);
- }
- }
-
- protected List computeSortedList(List list)
- {
-// return TypesHelper.sortList(list);
- return list;
- }
-
- private int getTextIndent() {
- if (editPart instanceof ParameterTypeEditPart) {
- Rectangle bounds = ((ParameterTypeEditPart) editPart).getFigure().getBounds();
- int textX = ((ParameterTypeEditPart) editPart).getLabelFigure().getTextBounds().x;
- return textX - bounds.x;
- }
-
- return 5;
- }
-
- protected CellEditor createCellEditor(Composite composite, String[] stringArray)
- {
- ASDComboBoxCellEditor cellEditor = new ASDComboBoxCellEditor(composite, stringArray, getComponentReferenceEditManager());
- cellEditor.setTextIndent(getTextIndent());
- //((ADTComboBoxCellEditor) cellEditor).setObjectToModify(setObject);
-
- return cellEditor;
- }
-
- public ComponentReferenceEditManager getComponentReferenceEditManager() {
- ComponentReferenceEditManager editManager = null;
- boolean isType = true;
-
- // TODO: We're specifically looking for and using WSDL11 Impl classes.... We should
- // investigate further to see if we can avoid knowing about WSDL11 Impl classes.
- if (setObject instanceof W11ParameterForPart) {
- isType = ((W11ParameterForPart) setObject).isType();
- }
-
- if (isType) {
- editManager = (ComponentReferenceEditManager) ReferenceEditManagerHelper.getXSDTypeReferenceEditManager(setObject);
- }
- else {
- editManager = (ComponentReferenceEditManager) ReferenceEditManagerHelper.getXSDElementReferenceEditManager(setObject);
- }
-
- return editManager;
- }
-
- // TODO: rmah: This code should live in a common place..... This code is also used in other UI scenarios when
- // a similar combo box is used. For example in the properties...(ParameterSection) Also used in the XSDEditor...
- protected ComponentSpecification getComponentSpecificationForValue(String value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDEditPartFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDEditPartFactory.java
deleted file mode 100644
index ef66b900d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDEditPartFactory.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.editparts;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.BindingColumn;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.BindingContentPlaceHolder;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IService;
-
-public class ASDEditPartFactory implements EditPartFactory
-{
- public EditPart createEditPart(EditPart context, Object model)
- {
- EditPart child = null;
- if (model instanceof IDescription)
- {
- child = new DefinitionsEditPart();
- }
- else if (model instanceof AbstractModelCollection)
- {
- AbstractModelCollection collection = (AbstractModelCollection)model;
- if (collection instanceof BindingColumn)
- {
- child = new BindingColumnEditPart();
- }
- else
- {
- child = new ColumnEditPart();
- }
- }
- else if (model instanceof IEndPoint)
- {
- child = new EndPointEditPart();
- }
- else if (model instanceof IService)
- {
- child = new ServiceEditPart();
- }
- else if (model instanceof IBinding)
- {
- child = new BindingEditPart();
- }
- else if (model instanceof IBindingOperation ||
- model instanceof IBindingMessageReference ||
- model instanceof BindingContentPlaceHolder)
- {
- child = new BindingContentEditPart();
- }
- else if (model instanceof IInterface)
- {
- child = new InterfaceEditPart();
- }
- else if (model instanceof IMessageReference)
- {
- child = new MessageReferenceEditPart();
- }
- else if (model instanceof IOperation)
- {
- child = new OperationEditPart();
- }
- else if (model instanceof IParameter && context instanceof ParameterEditPart) {
- child = new ParameterTypeEditPart();
- }
- else if (model instanceof IParameter && context instanceof MessageReferenceEditPart)
- {
- child = new ParameterEditPart();
- }
- if (child == null)
- {
- System.out.println("\nCould not create editpart for model: " + model); //$NON-NLS-1$
- Thread.dumpStack();
- }
- Assert.isNotNull(child);
- child.setModel(model);
- return child;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDRootEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDRootEditPart.java
deleted file mode 100644
index 7b943a13c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ASDRootEditPart.java
+++ /dev/null
@@ -1,32 +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.asd.design.editparts;
-
-import org.eclipse.draw2d.BendpointConnectionRouter;
-import org.eclipse.draw2d.ConnectionLayer;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-
-public class ASDRootEditPart extends ScalableRootEditPart implements org.eclipse.gef.RootEditPart
-{
- public void activate()
- {
- super.activate();
- // Set up Connection layer with a router, if it doesn't already have one
- ConnectionLayer connectionLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
- if (connectionLayer != null)
- {
-// connectionLayer.setConnectionRouter(new ManhattanConnectionRouter());
- connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
- }
- refresh();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java
deleted file mode 100644
index 3f45b1755..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDLabelDirectEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.BoxComponentFigure;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.ColumnData;
-
-public abstract class AbstractBoxtEditPart extends BaseEditPart implements INamedEditPart
-{
- protected ColumnData columnData = new ColumnData();
- protected BoxComponentFigure figure;
-
- protected IFigure createFigure()
- {
- figure = new BoxComponentFigure();
- figure.setBorder(new LineBorder(1));
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setStretchMinorAxis(true);
- // toolbarLayout.setMinorAlignment(ToolbarLayout.ALIGN_BOTTOMRIGHT);
- figure.setLayoutManager(toolbarLayout);
- // if(isScrollable())
- // figure.setScrollingActionListener(this);
- return figure;
- }
-
- public IFigure getContentPane()
- {
- return figure.getContentPane();
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ASDLabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ASDSelectionEditPolicy());
- }
-
- private DirectEditManager manager;
-
- public void performDirectEdit(Point cursorLocation){
- if (!isFileReadOnly() && (cursorLocation == null || hitTestFigure(figure.getHeadingFigure(), cursorLocation) && !isReadOnly())) {
- manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
- manager.show();
- }
- else if ((hitTest(figure.getLabel(), cursorLocation) ||
- hitTestFigure(figure.getHeadingFigure(), cursorLocation)) && isReadOnly()) {
- doOpenNewEditor();
- }
- }
-
- public void performRequest(Request req) {
- if (req.getType().equals(RequestConstants.REQ_DIRECT_EDIT)) {
- Point location = null;
- if (req instanceof DirectEditRequest) {
- location = ((DirectEditRequest) req).getLocation();
- }
- performDirectEdit(location);
- }
- }
-
- public Label getLabelFigure() {
- return figure.getLabel();
- }
-
- protected void refreshChildren()
- {
- super.refreshChildren();
- // getFigure().invalidateTree();
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- WSDLBaseAdapter box = (WSDLBaseAdapter) getModel();
- figure.headingFigure.setIsReadOnly(box.isReadOnly());
- figure.getLabel().setText(box.getName());
- }
-
- public void addFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder) figure.getBorder();
- boxFigureLineBorder.setWidth(2);
-// boxFigureLineBorder.setColor(ColorConstants.darkBlue);
- figure.setSelected(true);
- figure.repaint();
- }
-
- public void removeFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder) figure.getBorder();
- boxFigureLineBorder.setWidth(1);
- boxFigureLineBorder.setColor(DesignViewGraphicsConstants.defaultForegroundColor);
- figure.setSelected(false);
- figure.repaint();
- }
-
- public ColumnData getColumnData()
- {
- return columnData;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java
deleted file mode 100644
index 3f9856ba6..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.IActionProvider;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-
-public abstract class BaseEditPart extends AbstractGraphicalEditPart implements IActionProvider, IASDObjectListener, IFeedbackHandler
-{
- protected static final String[] EMPTY_ACTION_ARRAY = {};
-
- public String[] getActions(Object object)
- {
- Object model = getModel();
- if (model instanceof IActionProvider)
- {
- return ((IActionProvider)model).getActions(object);
- }
- return EMPTY_ACTION_ARRAY;
- }
-
- protected void addActionsToList(List list, String[] actions)
- {
- for (int i = 0; i < actions.length; i++)
- {
- list.add(actions[i]);
- }
- }
-
- public void activate()
- {
- super.activate();
- Object model = getModel();
- if (model instanceof IASDObject)
- {
- IASDObject object = (IASDObject)model;
- object.registerListener(this);
- }
- }
-
- public void deactivate()
- {
- Object model = getModel();
- if (model instanceof IASDObject)
- {
- IASDObject object = (IASDObject)model;
- object.unregisterListener(this);
- }
- super.deactivate();
- }
-
- public void propertyChanged(Object object, String property)
- {
- //System.out.println("propertyChanged " + this.getClass().getName());
- refresh();
- }
-
- public void refreshConnections() {
- Iterator kids = getChildren().iterator();
- while (kids.hasNext()) {
- Object item = kids.next();
- if (item instanceof BaseEditPart) {
- ((BaseEditPart) item).refreshConnections();
- }
- }
- }
-
- public void addFeedback() {
-
- }
- public void removeFeedback() {
-
- }
-
- protected boolean hitTest(Rectangle rectangle, Point location) {
- return rectangle.contains(location);
- }
-
- protected boolean hitTest(Label target, Point location) {
- Rectangle origB = target.getTextBounds().getCopy();
- Rectangle transB = target.getTextBounds().getCopy();
-
- target.translateToAbsolute(transB);
-
- int newX = origB.x + Math.abs(transB.x - origB.x);
- int newY = origB.y + Math.abs(transB.y - origB.y);
- Rectangle finalB = new Rectangle(newX, newY, origB.width, origB.height);
-
- return finalB.contains(location);
- }
-
- protected boolean hitTestFigure(Figure target, Point location) {
- Rectangle origB = target.getBounds().getCopy();
- Rectangle transB = target.getBounds().getCopy();
-
- target.translateToAbsolute(transB);
-
- int newX = origB.x + Math.abs(transB.x - origB.x);
- int newY = origB.y + Math.abs(transB.y - origB.y);
- Rectangle finalB = new Rectangle(newX, newY, origB.width, origB.height);
-
- return finalB.contains(location);
- }
-
- public boolean isReadOnly() {
- Object model = getModel();
- if (model instanceof IASDObject) {
- return ((IASDObject) model).isReadOnly();
- }
-
- return false;
- }
-
- protected void doOpenNewEditor()
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- ActionRegistry registry = (ActionRegistry) editorPart.getAdapter(ActionRegistry.class);
- if (registry != null)
- {
- IAction action = registry.getAction(OpenInNewEditor.ID);
- action.run();
- }
- }
-
- protected void createEditPolicies()
- {
- KeyBoardAccessibilityEditPolicy navigationEditPolicy = new KeyBoardAccessibilityEditPolicy()
- {
- public EditPart getRelativeEditPart(EditPart editPart, int direction)
- {
- return BaseEditPart.this.getRelativeEditPart(direction);
- }
- };
- installEditPolicy(KeyBoardAccessibilityEditPolicy.KEY, navigationEditPolicy);
- }
-
- public EditPart getRelativeEditPart(int direction)
- {
- return EditPartNavigationHandlerUtil.getRelativeEditPart(this, direction);
- }
-
- protected boolean isFileReadOnly()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null)
- {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage page = workbenchWindow.getActivePage();
- if (page != null)
- {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null)
- {
- IEditorInput editorInput = editor.getEditorInput();
- if (!(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput))
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- protected void paintFocusCursor(Rectangle r, Graphics graphics)
- {
- if (hasFocus())
- {
- try
- {
- graphics.pushState();
- graphics.drawFocus(r.x, r.y + 1, r.width - 1, r.height - 2);
- }
- finally
- {
- graphics.popState();
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingColumnEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingColumnEditPart.java
deleted file mode 100644
index 76dd73d72..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingColumnEditPart.java
+++ /dev/null
@@ -1,64 +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.asd.design.editparts;
-
-import java.util.Iterator;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutAnimator;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.BindingColumnLayout;
-
-public class BindingColumnEditPart extends ColumnEditPart
-{
- protected IFigure createFigure()
- {
- Figure figure = new Figure();
- //figure.setOpaque(true);
- //figure.setBackgroundColor(ColorConstants.yellow);
- // custom layout that can do animation
- //
- BindingColumnLayout layout = new BindingColumnLayout(this);
- figure.setLayoutManager(layout);
- return figure;
- }
-
-
-
- protected void register()
- {
- super.register();
- getFigure().addLayoutListener(LayoutAnimator.getDefault());
- }
-
- protected void unregister()
- {
- getFigure().removeLayoutListener(LayoutAnimator.getDefault());
- super.unregister();
- }
-
- // this method will expand the binding edit part
- // and collapse any other bindings as appropriate
- //public void expand(BidingEditPart bindingEditPart)
- //{
- //}
-
- public void refreshBindingEditParts()
- {
- for (Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- EditPart editPart = (EditPart)i.next();
- editPart.refresh();
- }
- getFigure().invalidateTree();
- getFigure().revalidate();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingContentEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingContentEditPart.java
deleted file mode 100644
index 2c05bd8c1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingContentEditPart.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.BindingContentPlaceHolder;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-// This class is used to represent a BindingOperation, BindingInput, BindingOutput and BindingFault
-//
-public class BindingContentEditPart extends BaseEditPart
-{
- Label label;
- protected ASDSelectionEditPolicy selectionHandlesEditPolicy = new ASDSelectionEditPolicy();
- protected IFigure createFigure()
- {
- Figure figure = new Figure()
- {
- public void paint(Graphics graphics) {
- super.paint(graphics);
- Rectangle r = getBounds();
- // bug146932
- paintFocusCursor(new Rectangle(r.x, r.y, r.width, r.height), graphics);
- }
- };
- figure.setOpaque(true);
- figure.setBackgroundColor(ColorConstants.tooltipBackground);
- ToolbarLayout toolbarLayout = new ToolbarLayout(true);
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- label = new Label();
- label.setBorder(new MarginBorder(5, 5, 2, 2));
- figure.add(label);
-
- return figure;
- }
-
-
- protected List getModelChildren()
- {
- return Collections.EMPTY_LIST;
- }
-
- protected void refreshVisuals()
- {
- if (getModel() instanceof IBindingOperation)
- {
- IBindingOperation bindingOperation = (IBindingOperation) getModel();
-
- if (bindingOperation instanceof ITreeElement) {
- label.setIcon(((ITreeElement) bindingOperation).getImage());
- }
-// label.setText(bindingOperation.getName());
- }
- else if (getModel() instanceof IBindingMessageReference)
- {
- label.setIcon(WSDLEditorPlugin.getInstance().getImage("icons/bind_asct_val_obj.gif")); //$NON-NLS-1$
-// label.setIcon(messageRef.getImage());
-// label.setText(messageRef.getName());
- }
- else if (getModel() instanceof BindingContentPlaceHolder) {
- label.setIcon(WSDLEditorPlugin.getInstance().getImage("icons/bind_asct_val_not_obj.gif")); //$NON-NLS-1$
- }
-
- super.refreshVisuals();
- }
-
- protected void createEditPolicies() {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- }
-
- public void addFeedback() {
- label.getParent().setBackgroundColor(DesignViewGraphicsConstants.tableCellSelectionColor);
- }
-
- public void removeFeedback() {
- label.getParent().setBackgroundColor(ColorConstants.tooltipBackground);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingEditPart.java
deleted file mode 100644
index 0ac31f96b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BindingEditPart.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.connections.CenteredConnectionAnchor;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.BoxComponentFigure;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ComponentReferenceConnection;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.BindingColumnLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.BindingContentLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.BindingLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class BindingEditPart extends BaseEditPart
-{
- protected ComponentReferenceConnection connectionFigure;
- protected BoxComponentFigure figure;
- protected boolean isExpanded = false;
- private Label hoverHelpLabel = new Label(""); //$NON-NLS-1$
-
- protected IFigure createFigure()
- {
- figure = new BoxComponentFigure();
- figure.getLabel().setBorder(new MarginBorder(2, 2, 1, 2));
- figure.setBorder(new LineBorder(0));
- figure.getContentPane().setLayoutManager(new BindingContentLayout(this));
- figure.getContentPane().setOpaque(true);
- figure.getContentPane().setBackgroundColor(ColorConstants.yellow);
- figure.setLayoutManager(new BindingLayout(this));
- // if(isScrollable())
- // figure.setScrollingActionListener(this);
- return figure;
- }
-
- public IFigure getContentPane()
- {
- return figure.getContentPane();
- }
-
- protected List getModelChildren()
- {
- IBinding binding = (IBinding) getModel();
- return isExpanded ? binding.getBindingContentList() : Collections.EMPTY_LIST;
- }
-
- public void activate()
- {
- super.activate();
- activateConnection();
- }
-
- public void deactivate()
- {
- super.deactivate();
- deactivateConnection();
- }
-
- public void addFeedback()
- {
- super.addFeedback();
- LineBorder boxFigureLineBorder = (LineBorder) figure.getBorder();
- boxFigureLineBorder.setWidth(2);
-// boxFigureLineBorder.setColor(ColorConstants.darkBlue);
- figure.setSelected(true);
- figure.repaint();
- if (connectionFigure != null)
- {
- connectionFigure.setHighlight(true);
- getLayer(LayerConstants.FEEDBACK_LAYER).add(connectionFigure);
- }
- }
-
- public void removeFeedback()
- {
- super.removeFeedback();
- LineBorder boxFigureLineBorder = (LineBorder) figure.getBorder();
- boxFigureLineBorder.setWidth(1);
- boxFigureLineBorder.setColor(DesignViewGraphicsConstants.defaultForegroundColor);
- figure.setSelected(false);
- figure.repaint();
- if (connectionFigure != null)
- {
- connectionFigure.setHighlight(false);
- getLayer(LayerConstants.CONNECTION_LAYER).add(connectionFigure);
- }
- }
-
-
- protected void activateConnection()
- {
- // If appropriate, create our connectionFigure and add it to the appropriate
- // layer
- if (createConnectionFigure() != null)
- {
- // Add our editpolicy as a listener on the connection, so it can stay in
- // synch
- // connectionFigure.addPropertyChangeListener((AttributeSelectionFeedbackPolicy)
- // getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE));
- // connectionFigure.addMouseListener(this);
- getLayer(LayerConstants.CONNECTION_LAYER).add(connectionFigure);
- }
- }
-
- protected void deactivateConnection()
- {
- if (connectionFigure != null)
- {
- boolean removed = false;
- removed = removeConnectionFigure(getLayer(LayerConstants.CONNECTION_LAYER));
- if (!removed)
- {
- removeConnectionFigure(getLayer(LayerConstants.FEEDBACK_LAYER));
- }
- }
- }
-
-
- private boolean removeConnectionFigure(IFigure parent)
- {
- boolean contains = false;
- Iterator it = parent.getChildren().iterator();
- while (it.hasNext())
- {
- IFigure fig = (IFigure) it.next();
- if (fig.equals(connectionFigure))
- {
- contains = true;
- break;
- }
- }
- if (contains)
- {
- parent.remove(connectionFigure);
- }
- return contains;
- }
-
- public ComponentReferenceConnection createConnectionFigure()
- {
- if (connectionFigure == null && shouldDrawConnection())
- {
- IBinding binding = (IBinding) getModel();
- Object typeBeingRef = binding.getInterface();
- if (typeBeingRef != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- if (referenceTypePart != null)
- {
- connectionFigure = new ComponentReferenceConnection();
- refreshConnections();
- }
- }
- }
- return connectionFigure;
- }
-
- protected boolean shouldDrawConnection()
- {
- if (isExpanded)
- {
- return false;
- }
- IBinding binding = (IBinding) getModel();
- Object typeBeingRef = binding.getInterface();
- if (typeBeingRef != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- if (referenceTypePart != null)
- {
- return true;
- }
- }
- return false;
- }
-
- protected void refreshVisuals()
- {
- refreshConnections();
- if (getModel() instanceof IBinding)
- {
- IBinding binding = (IBinding) getModel();
- ((BoxComponentFigure) getFigure()).headingFigure.setIsReadOnly(((IBinding) getModel()).isReadOnly());
-
- if (binding instanceof ITreeElement) {
- figure.getLabel().setIcon(((ITreeElement) binding).getImage());
- }
-
- // Show the name of the IBinding with hover help
- String prependString = Messages._UI_LABEL_BINDING;
- hoverHelpLabel.setText(" " + prependString + " : " + binding.getName() + " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- figure.setToolTip(hoverHelpLabel);
- }
-
- //getViewer().getEditPartRegistry().put(Lay.class, controller);
- super.refreshVisuals();
- }
-
- protected AbstractGraphicalEditPart getConnectionTargetEditPart()
- {
- IBinding binding = (IBinding) getModel();
- Object typeBeingRef = binding.getInterface();
- if (connectionFigure != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- return referenceTypePart;
- }
- return null;
- }
-
- public void refreshConnections()
- {
- if (shouldDrawConnection())
- {
- IBinding binding = (IBinding) getModel();
- Object typeBeingRef = binding.getInterface();
- if (connectionFigure != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- IFigure refFigure= referenceTypePart.getFigure();
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.RIGHT, 0));
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(refFigure, CenteredConnectionAnchor.HEADER_LEFT, 0, 11));
- connectionFigure.setHighlight(false);
- connectionFigure.setVisible(true);
- }
- else
- {
- activateConnection();
- }
- }
- else if (connectionFigure != null)
- {
- connectionFigure.setVisible(false);
- }
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ASDSelectionEditPolicy());
- }
-
- public boolean isExpanded()
- {
- return isExpanded;
- }
-
- public void setExpanded(boolean isExpanded)
- {
- this.isExpanded = isExpanded;
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_OPEN)
- {
- LayoutManager layoutManager = getFigure().getParent().getLayoutManager();
- if (layoutManager instanceof BindingColumnLayout)
- {
- BindingColumnLayout bindingColumnLayout = (BindingColumnLayout)layoutManager;
- bindingColumnLayout.setExpanded(this, !isExpanded);
- ((BindingColumnEditPart)getParent()).refreshBindingEditParts();
- }
- }
- }
-
- public EditPart getRelativeEditPart(int direction)
- {
- if (direction == PositionConstants.EAST)
- {
- // navigate forward along the connection (to the right)
- return getConnectionTargetEditPart();
- }
- else if (direction == PositionConstants.WEST)
- {
- // navigate backward along the connection (to the left)
- return EditPartNavigationHandlerUtil.getSourceConnectionEditPart(this);
- }
- return super.getRelativeEditPart(direction);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ColumnEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ColumnEditPart.java
deleted file mode 100644
index 0b4bf3ab6..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ColumnEditPart.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.asd.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-
-public class ColumnEditPart extends BaseEditPart
-{
- protected IFigure createFigure()
- {
- Figure figure = new Figure();
- ToolbarLayout layout = new ToolbarLayout(false);
- layout.setStretchMinorAxis(false);
- layout.setSpacing(20);
- figure.setLayoutManager(layout);
- return figure;
- }
-
- public IDescription getDescription()
- {
- return (IDescription)getModel();
- }
-
- protected void createEditPolicies()
- {
- // TODO Auto-generated method stub
- super.createEditPolicies();
- }
-
- protected List getModelChildren()
- {
- AbstractModelCollection collection = (AbstractModelCollection)getModel();
- Object children[] = collection.getChildren();
- List list = new ArrayList();
- for (int index = 0; index < children.length; index++) {
- list.add(children[index]);
- }
-
- return list;
- }
-
- public void addFeedback() {
-
- }
-
- public void removeFeedback() {
-
- }
-}
-
-
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/DefinitionsEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/DefinitionsEditPart.java
deleted file mode 100644
index e7227c30d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/DefinitionsEditPart.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LayoutListener;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.BindingColumn;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.InterfaceColumn;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.ServiceColumn;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-
-public class DefinitionsEditPart extends BaseEditPart {
- List collections = null;
- Figure contentPane;
- Label messageLabel;
- InternalLayoutListener internalLayoutListener = new InternalLayoutListener();
-
- protected IFigure createFigure()
- {
- Panel panel = new Panel();
- ToolbarLayout toolbarLayout = new ToolbarLayout(true);
- panel.setLayoutManager(toolbarLayout);
- panel.setBorder(new MarginBorder(60, 30, 30, 30));
- contentPane = new Figure();
- panel.add(contentPane);
-
- messageLabel = new Label(""); //$NON-NLS-1$
- contentPane.add(messageLabel);
-
- ToolbarLayout layout = new ToolbarLayout(true);
- layout.setStretchMinorAxis(true);
- layout.setSpacing(0);
- contentPane.setLayoutManager(layout);
- return panel;
- }
-
- public void activate()
- {
- super.activate();
-
- // here we want to ensure the binding column is listening
- // to the interface column so that it can re-layout when
- // the interface changes
- for (Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- AbstractGraphicalEditPart child = (AbstractGraphicalEditPart)i.next();
- if (child.getModel() instanceof InterfaceColumn)
- {
- child.getFigure().addLayoutListener(internalLayoutListener);
- break;
- }
- }
- }
-
- public void refresh() {
- super.refresh();
-
- // Refresh the connecting lines
- refreshConnections();
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
-
- protected void createEditPolicies()
- {
- // TODO Auto-generated method stub
- super.createEditPolicies();
- }
-
- public void setModelChildren(List list)
- {
- collections = list;
- }
-
- protected List getModelChildren()
- {
- if (collections == null)
- {
- collections = new ArrayList();
-
- IDescription description = (IDescription) getModel();
- if (description != null)
- {
- collections.add(new ServiceColumn(description));
- collections.add(new BindingColumn(description));
- collections.add(new InterfaceColumn(description));
- }
- }
-
- boolean hasChildren = false;
- for (Iterator i = collections.iterator(); i.hasNext(); )
- {
- AbstractModelCollection column = (AbstractModelCollection)i.next();
- if (column.hasChildren())
- {
- hasChildren = true;
- }
- }
-
- if (hasChildren)
- {
- messageLabel.setText(""); //$NON-NLS-1$
- if (contentPane.getChildren().contains(messageLabel))
- contentPane.remove(messageLabel);
- }
- else
- {
- messageLabel.setText(Messages._UI_LABEL_RIGHT_CLICK_TO_INSERT_CONTENT); //$NON-NLS-1$
- if (!contentPane.getChildren().contains(messageLabel))
- contentPane.add(messageLabel);
- }
-
-
- return collections;
- }
-
- public void setInput(Object object)
- {
- }
-
- private class InternalLayoutListener extends LayoutListener.Stub
- {
- public void postLayout(IFigure container)
- {
- for (Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child instanceof BindingColumnEditPart)
- {
- ((BindingColumnEditPart)child).refreshBindingEditParts();
- break;
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EditPartNavigationHandlerUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EditPartNavigationHandlerUtil.java
deleted file mode 100644
index 20ebddfe8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EditPartNavigationHandlerUtil.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.editparts;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editparts.LayerManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ComponentReferenceConnection;
-
-
-class EditPartNavigationHandlerUtil
-{
- static GraphicalEditPart getRelativeEditPart(GraphicalEditPart focusEditPart, int direction)
- {
- // these 'delta' values need to be set to some value that's large enough to cross the gap
- // between adjacent edit parts (since some layouts may space the edit parts out a bit)
- int dx = 5;
- int dy = 5;
-
- IFigure contentPane = focusEditPart.getContentPane();
-
- // we attempt to compute a rectangle that represents our current location
- Rectangle r = focusEditPart.getFigure().getBounds().getCopy();
- focusEditPart.getFigure().translateToAbsolute(r);
- if (contentPane != focusEditPart.getFigure())
- {
- // if the EditPart has a contentPane (that's no the figure) then we assume
- // effective rectangle is only the header portion of the figure
- //
- Rectangle contentPaneBounds = contentPane.getBounds().getCopy();
- contentPane.translateToAbsolute(contentPaneBounds);
-
- // we assume that when the editpart's figure and contentPane are different
- // that portion of the 'hittable' portion of editpart should not include the contentPane
- if (contentPaneBounds.y > r.y)
- {
- // if the contentPane is lower than the figure we only want the rectangle
- // above the contentPane
- r.height = contentPaneBounds.y - r.y;
- // we adjust the rectangle the right slightly since the content is nested a bit
- r.x = contentPaneBounds.x;
- }
- if (contentPaneBounds.x > r.x)
- {
- // if the contentPane is to the right of the figure we only want the rectangle
- // to the left of the content pane
- r.width = contentPaneBounds.x - r.x;
- }
- }
- Point p = null;
- if (direction == PositionConstants.NORTH)
- {
- p = r.getTopLeft();
- p.y -= dy;
- }
- else if (direction == PositionConstants.SOUTH)
- {
- p = r.getBottomLeft();
- p.x += dx;
- p.y += dy;
- }
- else if (direction == PositionConstants.EAST)
- {
- p = r.getTopRight();
- p.x += dx;
- }
- else if (direction == PositionConstants.WEST)
- {
- p = r.getLeft();
- p.x -= dx;
- }
- EditPart t = focusEditPart.getViewer().findObjectAt(p);
-
- if (t instanceof ColumnEditPart || t instanceof DefinitionsEditPart)
- {
- t = focusEditPart;
- while ((t instanceof ColumnEditPart || t instanceof DefinitionsEditPart) && t.getChildren().size() > 0)
- {
- t = (EditPart) t.getChildren().get(0);
- }
- }
- return (GraphicalEditPart)t;
- }
-
- static EditPart getNextSibling(EditPart editPart)
- {
- EditPart result = null;
- EditPart parent = editPart.getParent();
- if (parent != null)
- {
- List children = parent.getChildren();
- int index = children.indexOf(editPart);
- if (index + 1 < children.size())
- {
- result = (EditPart)children.get(index + 1);
- }
- }
- return result;
- }
-
- static EditPart getPrevSibling(EditPart editPart)
- {
- EditPart result = null;
- EditPart parent = editPart.getParent();
- if (parent != null)
- {
- List children = parent.getChildren();
- int index = children.indexOf(editPart);
- if (index - 1 >= 0)
- {
- // if this is the first child
- //
- result = (EditPart)children.get(index - 1);
- }
- }
- return result;
- }
-
- static EditPart getNextInterface(EditPart editPart)
- {
- EditPart result = null;
- for (EditPart e = editPart; e != null; e = e.getParent())
- {
- if (e instanceof InterfaceEditPart)
- {
- InterfaceEditPart ie = (InterfaceEditPart)e;
- result = EditPartNavigationHandlerUtil.getNextSibling(ie);
- break;
- }
- }
- return result;
- }
-
- static EditPart getNextService(EditPart editPart)
- {
- EditPart result = null;
- for (EditPart e = editPart; e != null; e = e.getParent())
- {
- if (e instanceof ServiceEditPart)
- {
- ServiceEditPart ie = (ServiceEditPart)e;
- result = EditPartNavigationHandlerUtil.getNextSibling(ie);
- break;
- }
- }
- return result;
- }
-
- static EditPart getSourceConnectionEditPart(AbstractGraphicalEditPart editPart)
- {
- // find the first connection that targets this editPart
- // navigate backward along the connection (to the left) to find the sourc edit part
- EditPart result = null;
- EditPartViewer viewer = editPart.getViewer();
- LayerManager manager = (LayerManager)editPart.getViewer().getEditPartRegistry().get(LayerManager.ID);
- IFigure layer = manager.getLayer(LayerConstants.CONNECTION_LAYER);
- for (Iterator i = layer.getChildren().iterator(); i.hasNext(); )
- {
- Figure figure = (Figure)i.next();
- if (figure instanceof ComponentReferenceConnection)
- {
- ComponentReferenceConnection componentReferenceConnection = (ComponentReferenceConnection)figure;
- ConnectionAnchor targetAnchor = componentReferenceConnection.getTargetAnchor();
- if (targetAnchor.getOwner() == editPart.getFigure())
- {
- ConnectionAnchor sourceAnchor = componentReferenceConnection.getSourceAnchor();
- IFigure sourceFigure = sourceAnchor.getOwner();
- EditPart part = null;
- while (part == null && sourceFigure != null)
- {
- part = (EditPart)viewer.getVisualPartMap().get(sourceFigure);
- sourceFigure = sourceFigure.getParent();
- }
- result = part;
- break;
- }
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java
deleted file mode 100644
index 1e3b271fc..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.connections.CenteredConnectionAnchor;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDLabelDirectEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ComponentReferenceConnection;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class EndPointEditPart extends BaseEditPart implements IFeedbackHandler, INamedEditPart
-{
- protected Label nameLabel;
- protected Label addressLabel;
- private Label hoverHelpLabel = new Label(""); //$NON-NLS-1$
- protected Figure addressBoxFigure;
- protected ComponentReferenceConnection connectionFigure;
- protected final static int MAX_ADDRESS_WIDTH = 150;
-
- protected IFigure createFigure()
- {
- figure = new Panel() {
- public void paint(Graphics graphics) {
- super.paint(graphics);
- Rectangle r = getBounds();
- // bug146932
- paintFocusCursor(new Rectangle(r.x, r.y + 1, r.width, r.height - 1), graphics);
- }
- };
- figure.setBorder(new MarginBorder(4));
- ToolbarLayout layout = new ToolbarLayout(false);
- // layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
- layout.setStretchMinorAxis(true);
- figure.setLayoutManager(layout);
- nameLabel = new Label();
-
- if (getModel() instanceof ITreeElement) {
- nameLabel.setIcon(((ITreeElement) getModel()).getImage());
- }
-
- nameLabel.setLabelAlignment(Label.LEFT);
- // nameLabel.setTextPlacement(PositionConstants.WEST);
- figure.add(nameLabel);
- Figure f1 = new Figure();
- f1.setBorder(new MarginBorder(0, 20, 0, 0));
- f1.setLayoutManager(new ToolbarLayout());
- figure.add(f1);
- addressBoxFigure = new RectangleFigure();
- addressBoxFigure.setForegroundColor(ColorConstants.lightGray);
- addressBoxFigure.setLayoutManager(new ToolbarLayout()
- {
- // here' we tweak the layout so that address labels aren't sized too wide
- // the Label class automatically handles the addition of the '...'
- //
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- Dimension d = super.calculatePreferredSize(container, wHint, hHint);
- d.width = Math.min(d.width, MAX_ADDRESS_WIDTH);
- return d;
- }
- });
- f1.add(addressBoxFigure);
- addressLabel = new Label();
-
- addressLabel.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
- addressLabel.setBorder(new MarginBorder(2, 6, 2, 6));
- addressLabel.setLabelAlignment(Label.LEFT);
- addressBoxFigure.add(addressLabel);
-
- // rmah: The block of code below has been moved from refreshVisuals(). We're
- // assuming the read-only state of the EditPart will never change once the
- // EditPart has been created.
- if (isReadOnly())
- {
- nameLabel.setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- addressLabel.setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- }
- else
- {
- nameLabel.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
- addressLabel.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
- }
-
- return figure;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ASDLabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ASDSelectionEditPolicy());
- }
- private DirectEditManager manager;
- private Point cursorLocation;
-
- public void performDirectEdit(Point cursorLocation)
- {
- this.cursorLocation = cursorLocation;
- if (!isReadOnly() && !isFileReadOnly() && (cursorLocation == null || hitTest(getLabelFigure(), cursorLocation))) {
- manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
- manager.show();
- }
- else if (hitTest(getFigure().getBounds(), cursorLocation) && isReadOnly()) {
- doOpenNewEditor();
- }
- }
-
- public void performRequest(Request req) {
- if (req.getType().equals(RequestConstants.REQ_DIRECT_EDIT)) {
- performDirectEdit(null);
- }
- }
-
- public Label getLabelFigure()
- {
- if (cursorLocation == null || translateBounds(nameLabel.getBounds()).contains(cursorLocation))
- {
- return nameLabel;
- }
- else if (translateBounds(addressLabel.getBounds()).contains(cursorLocation))
- {
- return addressLabel;
- }
- return null;
- }
-
- protected Rectangle translateBounds(Rectangle bounds) {
-
- ASDMultiPageEditor editor = (ASDMultiPageEditor) ASDEditorPlugin.getActiveEditor();
- FigureCanvas canvas = (FigureCanvas) ((EditPartViewer) editor.getAdapter(GraphicalViewer.class)).getControl();
- Point viewLocation = canvas.getViewport().getViewLocation();
-
- return new Rectangle(bounds.x + viewLocation.x, bounds.y + viewLocation.y, bounds.width, bounds.height);
- }
-
- protected Object getReferencedModel()
- {
- IEndPoint endPoint = (IEndPoint) getModel();
- return endPoint.getBinding();
- }
-
- protected void refreshVisuals()
- {
- IEndPoint endPoint = (IEndPoint) getModel();
- nameLabel.setText(endPoint.getName());
- addressLabel.setText(endPoint.getAddress());
-
- Rectangle textBounds = addressLabel.getTextBounds();
- Rectangle bounds = addressLabel.getBounds();
- int textPlacement = addressLabel.getTextPlacement();
- int xDelta = textBounds.x - bounds.x;
- int xTextIncrease = textPlacement - xDelta;
- int textSize = textBounds.width + xTextIncrease;
- int boundSize = bounds.width;
-
- if (textSize > boundSize) {
- hoverHelpLabel.setText(" " + endPoint.getAddress() + " "); //$NON-NLS-1$ //$NON-NLS-2$
- addressLabel.setToolTip(hoverHelpLabel);
- }
- else {
- addressLabel.setToolTip(null);
- }
-
- refreshConnections();
- super.refreshVisuals();
- }
-
- public void activate()
- {
- super.activate();
- activateConnection();
- }
-
- public void deactivate()
- {
- super.deactivate();
- deactivateConnection();
- }
-
- protected void activateConnection()
- {
- if (createConnectionFigure() != null)
- {
- getLayer(LayerConstants.CONNECTION_LAYER).add(connectionFigure);
- }
- }
-
- protected void deactivateConnection()
- {
- if (connectionFigure != null)
- {
- boolean removed = false;
- removed = removeConnectionFigure(getLayer(LayerConstants.CONNECTION_LAYER));
-
- if (!removed) {
- removeConnectionFigure(getLayer(LayerConstants.FEEDBACK_LAYER));
- }
- }
- }
-
- private boolean removeConnectionFigure(IFigure parent) {
- boolean contains = false;
- Iterator it = parent.getChildren().iterator();
- while (it.hasNext()) {
- IFigure fig = (IFigure) it.next();
- if (fig.equals(connectionFigure)) {
- contains = true;
- break;
- }
- }
-
- if (contains) {
- parent.remove(connectionFigure);
- }
-
- return contains;
- }
-
- protected boolean shouldDrawConnection()
- {
- Object typeBeingRef = getReferencedModel();
- if (typeBeingRef != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- if (referenceTypePart != null)
- {
- return true;
- }
- }
-
- return false;
- }
-
-
- public ComponentReferenceConnection createConnectionFigure()
- {
- if (connectionFigure == null && shouldDrawConnection())
- {
- Object typeBeingRef = getReferencedModel();
- if (typeBeingRef != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- if (referenceTypePart != null)
- {
- // We do reference another Type. Build a connection. We can make
- // assumptions about anchor positioning since an attribute can only
- // have a "reference" relationship, no "inheritance", no
- // "is-referenced-by"
- connectionFigure = new ComponentReferenceConnection();
- refreshConnections();
- }
- }
- }
- return connectionFigure;
- }
-
- EditPart getConnectionTargetEditPart()
- {
- Object typeBeingRef = getReferencedModel();
- if (connectionFigure != null) {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- return referenceTypePart;
- }
- return null;
- }
-
- public void refreshConnections() {
- if (shouldDrawConnection()) {
- Object typeBeingRef = getReferencedModel();
- if (connectionFigure != null) {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(typeBeingRef);
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(addressBoxFigure, CenteredConnectionAnchor.RIGHT, 0, 0));
- IFigure targetFigure = referenceTypePart.getFigure();
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(targetFigure, CenteredConnectionAnchor.HEADER_LEFT, 0, 10));
- connectionFigure.setHighlight(false);
- connectionFigure.setVisible(true);
- }
- else {
- activateConnection();
- }
- }
- else if (connectionFigure != null){
- connectionFigure.setVisible(false);
- }
- }
-
- private IFigure getFigureForFeedback()
- {
- return figure;
- }
-
- public void addFeedback()
- {
- IFigure figure = getFigureForFeedback();
- figure.setBackgroundColor(DesignViewGraphicsConstants.tableCellSelectionColor);
-
- if (connectionFigure != null) {
- connectionFigure.setHighlight(true);
- getLayer(LayerConstants.FEEDBACK_LAYER).add(connectionFigure);
- }
- }
-
- public void removeFeedback()
- {
- IFigure figure = getFigureForFeedback();
- figure.setBackgroundColor(figure.getParent().getBackgroundColor());
-
- if (connectionFigure != null) {
- connectionFigure.setHighlight(false);
- getLayer(LayerConstants.CONNECTION_LAYER).add(connectionFigure);
- }
- }
-
- // TODO: rmah: VERY UGLY HACK.... I don't see any other way to solve this
- // issue at this time.
- // EndPointEditPart contains two labels which can be direct edited. The facade
- // driving EndPointEditPart
- // contains a getSetNameCommand() and a getSetAddressCommand()... however,
- // this class (LabelDirectEditPolicy)
- // only knows about getSetNameCommand()..... This is the problem we face when
- // combining two labels into
- // one EditPart.....
- // See LabelDirectEditPolicy.getDirectEditCommand(DirectEditRequest)
- public Command getSetProperLabelCommand(String newValue)
- {
- // TODO: rmah: We need to translate the point...
- if (cursorLocation == null || translateBounds(nameLabel.getBounds()).contains(cursorLocation))
- {
- return ((IEndPoint) getModel()).getSetNameCommand(newValue);
- }
- else if (translateBounds(addressLabel.getBounds()).contains(cursorLocation))
- {
- return ((IEndPoint) getModel()).getSetAddressCommand(newValue);
- }
- return null;
- }
-
- public EditPart getRelativeEditPart(int direction)
- {
- if (direction == PositionConstants.EAST)
- {
- // navigate forward along the connection (to the right)
- return getConnectionTargetEditPart();
- }
-
- if (direction == PositionConstants.SOUTH)
- {
- return EditPartNavigationHandlerUtil.getNextService(this);
- }
-
- return super.getRelativeEditPart(direction);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/IFeedbackHandler.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/IFeedbackHandler.java
deleted file mode 100644
index e305362de..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/IFeedbackHandler.java
+++ /dev/null
@@ -1,16 +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.asd.design.editparts;
-
-public interface IFeedbackHandler {
- public void addFeedback();
- public void removeFeedback();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/INamedEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/INamedEditPart.java
deleted file mode 100644
index 4f6de3e84..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/INamedEditPart.java
+++ /dev/null
@@ -1,19 +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.asd.design.editparts;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-
-public interface INamedEditPart {
- public Label getLabelFigure();
- public void performDirectEdit(Point cursorLocation);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/InterfaceEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/InterfaceEditPart.java
deleted file mode 100644
index 4d595eab2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/InterfaceEditPart.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.BoxComponentFigure;
-//import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.BaseLinkIconFigure;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.RowLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class InterfaceEditPart extends AbstractBoxtEditPart implements IFeedbackHandler
-{
- private RectangleFigure linkIconColumn;
- protected BoxComponentFigure boxFigure;
- public InterfaceEditPart()
- {
- columnData.setColumnWeight("MessageLabel", 0); //$NON-NLS-1$
- columnData.setColumnWeight("MessageContentPane", 100); //$NON-NLS-1$
- columnData.setColumnWeight("parameterName", 50); //$NON-NLS-1$
- columnData.setColumnWeight("parameterType", 50); //$NON-NLS-1$
- }
-
- protected IFigure createFigure()
- {
- IFigure outer = new Figure() {
- public void validate() {
- super.validate();
- // If we don't layout our Link Icon Column at this point, the link icons
- // will not be properly updated in the scenario where a porttype is added
- // or removed. The link icons of the existing porttypes will not be updated.
- getLinkIconColumn().getLayoutManager().layout(getLinkIconColumn());
- }
- };
-
- outer.setLayoutManager(new ToolbarLayout(true));
- boxFigure = (BoxComponentFigure) super.createFigure();
-
- if (getModel() instanceof ITreeElement) {
- boxFigure.getLabel().setIcon(((ITreeElement) getModel()).getImage());
- }
-
- boxFigure.setBackgroundColor(ColorConstants.orange);
- boxFigure.setBorder(new LineBorder(1));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setStretchMinorAxis(true);
- boxFigure.setLayoutManager(toolbarLayout);
- outer.add(boxFigure);
- linkIconColumn = new RectangleFigure();
- linkIconColumn.setOutline(false);
- linkIconColumn.setLayoutManager(new ToolbarLayout() {
- public void layout(IFigure parent) {
- super.layout(parent);
-
- // We need to layout on the y-axis
- Iterator children = parent.getChildren().iterator();
- while (children.hasNext()) {
- Object item = children.next();
- if (item instanceof IFigure) {
- IFigure figure = (IFigure) item;
- figure.getLayoutManager().layout(figure);
- }
- }
- }
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
- Dimension dimension = super.calculatePreferredSize(container, wHint, hHint);
-
- // Calculate the height
- Iterator it = container.getParent().getChildren().iterator();
- while (it.hasNext()) {
- Object item = it.next();
- if (item instanceof BoxComponentFigure) {
- dimension.height = ((IFigure) item).getPreferredSize().height;
- break;
- }
- }
-
- return dimension;
- }
- });
-
- outer.add(linkIconColumn);
-
- // rmah: The block of code below has been moved from refreshVisuals(). We're
- // assuming the read-only state of the EditPart will never change once the
- // EditPart has been created.
- if (isReadOnly())
- {
- figure.getLabel().setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- }
- else
- {
- figure.getLabel().setForegroundColor(ColorConstants.black);
- }
-
- return outer;
- }
-
- public static void attachToInterfaceEditPart(EditPart editPart, RowLayout rowLayout)
- {
- for (EditPart parent = editPart.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof InterfaceEditPart)
- {
- InterfaceEditPart interfaceEditPart = (InterfaceEditPart)parent;
- rowLayout.setColumnData(interfaceEditPart.columnData);
- break;
- }
- }
- }
-
- protected void refreshChildren()
- {
- super.refreshChildren();
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- }
-
- protected List getModelChildren()
- {
- IInterface theInterface = (IInterface)getModel();
- return theInterface.getOperations();
- }
-
- public void addFeedback() {
- super.addFeedback();
- }
-
- public void removeFeedback() {
- super.removeFeedback();
- }
-
- public EditPart getRelativeEditPart(int direction)
- {
- if (direction == PositionConstants.WEST)
- {
- return EditPartNavigationHandlerUtil.getSourceConnectionEditPart(this);
- }
- return super.getRelativeEditPart(direction);
- }
-
- public IFigure getLinkIconColumn() {
- return linkIconColumn;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/MessageReferenceEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/MessageReferenceEditPart.java
deleted file mode 100644
index 5105e506b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/MessageReferenceEditPart.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDDragAndDropEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDGraphNodeDragTracker;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ListFigure;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ModelDiagnosticInfo;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.RowLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class MessageReferenceEditPart extends BaseEditPart implements IFeedbackHandler
-{
- protected Figure contentPane;
- protected Label label;
- protected RowLayout rowLayout;
-
- private Figure messageLabelWrapper;
- private Label messageLabel;
-
- protected ASDSelectionEditPolicy selectionHandlesEditPolicy = new ASDSelectionEditPolicy();
-
- protected IFigure createFigure()
- {
- ListFigure figure = new ListFigure(true);
- figure.setOpaque(true);
- figure.setPaintFirstLine(false);
- figure.setBackgroundColor(ColorConstants.tooltipBackground);
-
- rowLayout = new RowLayout();
- figure.setLayoutManager(rowLayout);
- label = new Label()
- {
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- // bug146932
- paintFocusCursor(getBounds(), graphics);
- }
- };
- label.setLabelAlignment(Label.LEFT);
- //label.setFont(DesignViewGraphicsConstants.mediumFont);
- label.setBorder(new MarginBorder(2, 16, 2 ,10));
- figure.add(label);
-
- contentPane = new ListFigure();
- ((ListFigure)contentPane).setOpaque(true);
- contentPane.setBackgroundColor(ColorConstants.listBackground);
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
-
- /*
- ToolbarLayout toolbarLayout = new ToolbarLayout(false)
- {
- // TODO (cs) consider minor tweak here to ensure that the row fills up the available space
- // vertically... without this a bit of trim is visible at the bottom of the list
- // when the param labels are given a margin width top and bottom < '4'
- public void layout(IFigure parent)
- {
- super.layout(parent);
- if (children.size() == 1)
- {
- Figure child = (Figure)children.get(0);
- //child.getBounds().height = parent.getClientArea().height;
- }
- }
- };
- */
- toolbarLayout.setStretchMinorAxis(true);
- contentPane.setLayoutManager(toolbarLayout);
- figure.add(contentPane);
-
- rowLayout.setConstraint(label, "MessageLabel"); //$NON-NLS-1$
- rowLayout.setConstraint(contentPane, "MessageContentPane"); //$NON-NLS-1$
-
- // rmah: The block of code below has been moved from refreshVisuals(). We're
- // assuming the read-only state of the EditPart will never change once the
- // EditPart has been created.
- if (isReadOnly())
- {
- label.setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- label.getParent().setBackgroundColor(DesignViewGraphicsConstants.readOnlyMessageRefHeadingColor);
- }
- else
- {
- label.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
- label.getParent().setBackgroundColor(ColorConstants.tooltipBackground);
- }
-
- return figure;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- if (!isReadOnly() && !isFileReadOnly()) {
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ASDDragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
- }
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- }
-
- public DragTracker getDragTracker(Request request)
- {
- return new ASDGraphNodeDragTracker((EditPart)this);
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- IMessageReference message = (IMessageReference)getModel();
-
- if (message instanceof ITreeElement) {
- label.setText(((ITreeElement) message).getText());
- label.setIcon(((ITreeElement) message).getImage());
- }
-
- // Resize column widths. Sizes may have shrunk.
- rowLayout.getColumnData().clearColumnWidths();
- for (EditPart parent = getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof InterfaceEditPart)
- {
- ((GraphicalEditPart)parent).getFigure().invalidateTree();
- break;
- }
- }
- }
-
- protected void refreshChildren() {
- super.refreshChildren();
- refreshMessage();
- }
-
- protected void refreshMessage() {
- if (getModelChildren().size() > 0) {
- if (messageLabelWrapper != null) {
- contentPane.remove(messageLabelWrapper);
- messageLabelWrapper = null;
- }
- }
- else {
- if (messageLabelWrapper == null) {
- messageLabelWrapper = new Figure();
- messageLabel = new Label();
-
- ToolbarLayout toolbarLayout = new ToolbarLayout(false)
- {
- // We want to center the text
- public void layout(IFigure parent)
- {
- super.layout(parent);
-
- if (parent.getChildren().size() == 1 && parent.getChildren().get(0) instanceof Label)
- {
- parent.setSize(parent.getSize().width, parent.getSize().height + 3);
- Label child = (Label) parent.getChildren().get(0);
- int newXAmount = (parent.getSize().width - child.getSize().width) / 2;
- Point p = child.getLocation();
- child.setLocation(new Point(p.x + newXAmount, p.y + 3));
- }
- }
- };
-
- messageLabelWrapper.setLayoutManager(toolbarLayout);
- messageLabelWrapper.add(messageLabel);
- contentPane.add(messageLabelWrapper);
- }
-
- List errorList = getErrors();
- List warnList = getWarnings();
-
- if (errorList.size() > 0) {
- ModelDiagnosticInfo info = (ModelDiagnosticInfo) errorList.get(0);
- messageLabel.setText(" " + info.getDescriptionText() + " "); //$NON-NLS-1$ //$NON-NLS-2$
- messageLabel.setForegroundColor(info.getDescriptionTextColor());
- }
- else if (warnList.size() > 0){
- ModelDiagnosticInfo info = (ModelDiagnosticInfo) warnList.get(0);
- messageLabel.setText(" " + info.getDescriptionText() + " "); //$NON-NLS-1$ //$NON-NLS-2$
- messageLabel.setForegroundColor(info.getDescriptionTextColor());
- }
- else {
- messageLabel.setText(""); //$NON-NLS-1$
- messageLabel.setForegroundColor(ColorConstants.black);
- }
- }
- }
-
- protected List getErrors() {
- IMessageReference messageRef = (IMessageReference) getModel();
- return getDiagnosticMessageType(messageRef.getDiagnosticMessages(), ModelDiagnosticInfo.ERROR_TYPE);
- }
-
- protected List getWarnings() {
- IMessageReference messageRef = (IMessageReference) getModel();
- return getDiagnosticMessageType(messageRef.getDiagnosticMessages(), ModelDiagnosticInfo.WARNING_TYPE);
- }
-
- protected List getDiagnosticMessageType(List diagnosticInfo, int type) {
- List listType = new ArrayList();
- for (int index = 0; index < diagnosticInfo.size(); index++) {
- ModelDiagnosticInfo info = (ModelDiagnosticInfo) diagnosticInfo.get(index);
- if (info.getType() == type) {
- listType.add(info);
- }
- }
-
- return listType;
- }
-
- protected List getModelChildren()
- {
- IMessageReference theMessage = (IMessageReference)getModel();
- return theMessage.getParameters();
- }
-
- public void addNotify()
- {
- InterfaceEditPart.attachToInterfaceEditPart(this, rowLayout);
- super.addNotify();
- }
-
- public void addFeedback() {
- label.getParent().setBackgroundColor(DesignViewGraphicsConstants.tableCellSelectionColor);
- }
-
- public void removeFeedback() {
- if (isReadOnly()) {
- label.getParent().setBackgroundColor(DesignViewGraphicsConstants.readOnlyMessageRefHeadingColor);
- }
- else {
- label.getParent().setBackgroundColor(ColorConstants.tooltipBackground);
- }
- }
-
- public EditPart getRelativeEditPart(int direction)
- {
- EditPart editPart = super.getRelativeEditPart(direction);
- if (direction == PositionConstants.SOUTH && editPart == null)
- {
- editPart = EditPartNavigationHandlerUtil.getNextInterface(this);
- }
- return editPart;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java
deleted file mode 100644
index 20c4a3612..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDLabelDirectEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ListFigure;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-
-public class OperationEditPart extends BaseEditPart implements INamedEditPart
-{
- protected Figure contentPane;
- protected Label label;
- private Color unselectedColor;
- private Figure labelHolder;
-
- public OperationEditPart()
- {
- }
-
- protected IFigure createFigure()
- {
- Figure figure = new Figure();
- figure.setBackgroundColor(DesignViewGraphicsConstants.tableOperationHeadingColor);
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setStretchMinorAxis(true);
- toolbarLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
- figure.setLayoutManager(toolbarLayout);
-
- labelHolder = new Panel() {
- public void paint(Graphics graphics) {
- super.paint(graphics);
- Rectangle r = getBounds();
- // bug146932
- paintFocusCursor(new Rectangle(r.x, r.y, r.width, r.height), graphics);
- }
- };
- labelHolder.setBackgroundColor(DesignViewGraphicsConstants.tableOperationHeadingColor);
- labelHolder.setLayoutManager(new ToolbarLayout(true));
- figure.add(labelHolder);
-
- label = new Label("Operation"); //$NON-NLS-1$
-// label.setFont(DesignViewGraphicsConstants.smallBoldFont);
- label.setBorder(new MarginBorder(2, 2,2,2));
- label.setTextAlignment(Label.LEFT);
- labelHolder.add(label);
-
-
- contentPane = new ListFigure();
- ToolbarLayout toolbarLayout2 = new ToolbarLayout(false);
- toolbarLayout2.setStretchMinorAxis(true);
- contentPane.setLayoutManager(toolbarLayout2);
- figure.add(contentPane);
-
- // rmah: The block of code below has been moved from refreshVisuals(). We're
- // assuming the read-only state of the EditPart will never change once the
- // EditPart has been created.
- if (isReadOnly()) {
- label.setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- figure.setBackgroundColor(DesignViewGraphicsConstants.readOnlyTableOperationHeadingColor);
- labelHolder.setBackgroundColor(DesignViewGraphicsConstants.readOnlyTableOperationHeadingColor);
- }
- else {
- label.setForegroundColor(ColorConstants.black);
- figure.setBackgroundColor(DesignViewGraphicsConstants.tableOperationHeadingColor);
- labelHolder.setBackgroundColor(DesignViewGraphicsConstants.tableOperationHeadingColor);
- }
-
- return figure;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ASDLabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ASDSelectionEditPolicy());
- }
-
- private DirectEditManager manager;
- public void performDirectEdit(Point cursorLocation){
- Rectangle textArea = getLabelFigure().getBounds();
- textArea.width = getFigure().getBounds().width;
- if (!isFileReadOnly() && (cursorLocation == null || hitTest(textArea, cursorLocation) && !isReadOnly())) {
- manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
- manager.show();
- }
- else if (getFigure() instanceof Figure && hitTestFigure((Figure) getFigure(), cursorLocation) && isReadOnly()) {
- doOpenNewEditor();
- }
- }
-
- public void performRequest(Request req) {
- if (req.getType().equals(RequestConstants.REQ_DIRECT_EDIT)) {
- performDirectEdit(null);
- }
- }
-
- public Label getLabelFigure() {
- return label;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- IOperation operation = (IOperation)getModel();
- label.setText(operation.getName());
-
- if (operation instanceof ITreeElement) {
- label.setIcon(((ITreeElement) operation).getImage());
- }
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- protected List getModelChildren()
- {
- IOperation theOperation = (IOperation)getModel();
- return theOperation.getMessages();
- }
-
- public void addFeedback() {
- unselectedColor = labelHolder.getBackgroundColor();
-// getFigure().setBackgroundColor(DesignViewGraphicsConstants.tableCellSelectionColor);
- labelHolder.setBackgroundColor(DesignViewGraphicsConstants.tableCellSelectionColor);
- }
-
- public void removeFeedback() {
- if (unselectedColor != null) {
- labelHolder.setBackgroundColor(unselectedColor);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java
deleted file mode 100644
index 1f3bdfeae..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDDragAndDropEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDGraphNodeDragTracker;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDLabelDirectEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.RowLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class ParameterEditPart extends BaseEditPart implements IFeedbackHandler, INamedEditPart
-{
- protected Figure contentPane;
- protected Label parameterName;
- protected RowLayout rowLayout = new RowLayout();
- protected Image labelImage;
-
- protected ASDSelectionEditPolicy selectionHandlesEditPolicy = new ASDSelectionEditPolicy();
-
- protected IFigure createFigure()
- {
- IFigure figure = new Figure()
- {
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- graphics.pushState();
- // this bit of code is used to draw the dividing line between
- // the parameter name and the parameter type
- // we might want to consider moving this line drawing into the
- // message reference's figure where the horizontal lines are down's
- Rectangle r = parameterName.getBounds();
- int x= r.x + r.width -1;
- graphics.setForegroundColor(ColorConstants.lightGray);
- graphics.drawLine(x, r.y, x, r.y + r.height);
- graphics.popState();
-
- // bug146932
- paintFocusCursor(new Rectangle(r.x + 1, r.y, r.width - 2, r.height), graphics);
- }
- };
- //toolbarLayout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
- figure.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
- figure.setLayoutManager(rowLayout);
- /*
- String x = "";
- int size = (int)(Math.random()*50);
- for (int i = 0; i < size; i++)
- {
- x += "x";
- }
- String y = "";
- int sizey = (int)(Math.random()*50);
- for (int i = 0; i < sizey; i++)
- {
- y += "y";
- } */
-
- contentPane = new Figure();
- ToolbarLayout toolbarLayout2 = new ToolbarLayout(false);
- toolbarLayout2.setStretchMinorAxis(true);
- contentPane.setLayoutManager(toolbarLayout2);
-
- IFigure parameterNamePane = new Panel();
- toolbarLayout2 = new ToolbarLayout(false);
- toolbarLayout2.setStretchMinorAxis(true);
- parameterNamePane.setLayoutManager(toolbarLayout2);
-
- parameterName = new Label();
- parameterName.setLabelAlignment(Label.LEFT);
- parameterName.setBorder(new MarginBorder(4,10,4,10));
-
- parameterNamePane.add(parameterName);
- figure.add(parameterNamePane);
- figure.add(contentPane);
- rowLayout.setConstraint(parameterNamePane, "parameterName"); //$NON-NLS-1$
- rowLayout.setConstraint(contentPane, "parameterType"); //$NON-NLS-1$
-
- if (getModel() instanceof ITreeElement) {
- labelImage = ((ITreeElement) getModel()).getImage();
- }
-
- // rmah: The block of code below has been moved from refreshVisuals(). We're
- // assuming the read-only state of the EditPart will never change once the
- // EditPart has been created.
- if (isReadOnly())
- {
- parameterName.setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- }
- else
- {
- parameterName.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
- }
-
- return figure;
- }
-
- public void addNotify()
- {
- InterfaceEditPart.attachToInterfaceEditPart(this, rowLayout);
- super.addNotify();
- }
-
- private DirectEditManager manager;
-
- public void performDirectEdit(Point cursorLocation){
- if (!isFileReadOnly() && !isReadOnly() && (cursorLocation == null || hitTest(getLabelFigure().getBounds(), cursorLocation))) {
- manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
- manager.show();
- }
- else if (getFigure() instanceof Figure && hitTestFigure((Figure) getFigure(), cursorLocation) && isReadOnly()) {
- doOpenNewEditor();
- }
- }
-
- public void performRequest(Request req) {
- if (req.getType().equals(RequestConstants.REQ_DIRECT_EDIT)) {
- performDirectEdit(null);
- }
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ASDLabelDirectEditPolicy());
- if (!isReadOnly() && !isFileReadOnly()) {
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ASDDragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
- }
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- }
-
- public DragTracker getDragTracker(Request request)
- {
- return new ASDGraphNodeDragTracker((EditPart)this);
- }
-
- public Label getLabelFigure() {
- return parameterName;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- IParameter parameter = (IParameter)getModel();
- parameterName.setText(parameter.getName());
- if (labelImage != null) {
- parameterName.setIcon(labelImage);
- }
-
- // Resize column widths. Sizes may have shrunk.
- rowLayout.getColumnData().clearColumnWidths();
- for (EditPart parent = getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof InterfaceEditPart)
- {
- ((GraphicalEditPart)parent).getFigure().invalidateTree();
- break;
- }
- }
- }
-
- protected List getModelChildren()
- {
- // On the facade level, one IParameter will have two editable values.
- // A name and a type reference. To make direct editing and selection
- // feedback easier, we show this one facade object as two edit parts.
- // The approach is to the same facade model, to drive the second (child
- // EditPart.
-
- // TODO (cs) Rich consider creating 2 hard code edit parts
- // the first for the parameter name
- // the second for the paramter type
- List kids = new ArrayList();
- kids.add(getModel());
- return kids;
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- public void addFeedback() {
- parameterName.getParent().setBackgroundColor(DesignViewGraphicsConstants.tableCellSelectionColor);
- }
-
- public void removeFeedback() {
- parameterName.getParent().setBackgroundColor(figure.getBackgroundColor());
- }
-
- public EditPart getRelativeEditPart(int direction)
- {
- EditPart editPart = super.getRelativeEditPart(direction);
- if (direction == PositionConstants.SOUTH && editPart == null)
- {
- editPart = EditPartNavigationHandlerUtil.getNextInterface(this);
- }
- return editPart;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterTypeEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterTypeEditPart.java
deleted file mode 100644
index d1599ffee..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterTypeEditPart.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.MouseEvent;
-import org.eclipse.draw2d.MouseListener;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.MouseMotionListener.Stub;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.TypeReferenceDirectEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.BaseLinkIconFigure;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.ModelDiagnosticInfo;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.layouts.RowLayout;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.asd.util.IOpenExternalEditorHelper;
-
-public class ParameterTypeEditPart extends BaseEditPart implements IFeedbackHandler, INamedEditPart
-{
- protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
- protected Label parameterType;
- protected RowLayout rowLayout = new RowLayout();
-
- public void performRequest(Request req) {
- if (req.getType().equals(RequestConstants.REQ_DIRECT_EDIT)) {
- performDirectEdit(null);
- }
- }
-
- protected MyMouseEventListener mouseEventListener;
- private BaseLinkIconFigure linkIconFigure;
-
- protected IFigure createFigure()
- {
- IFigure figure = new Panel() {
- public void paint(Graphics graphics) {
- super.paint(graphics);
- Rectangle r = getBounds();
- // bug146932
- paintFocusCursor(new Rectangle(r.x, r.y, r.width, r.height), graphics);
- }
- };
- figure.setLayoutManager(rowLayout);
-
- parameterType = new Label();
- parameterType.setLabelAlignment(Label.LEFT);
- parameterType.setBorder(new MarginBorder(4,12,4,20));
- figure.add(parameterType);
-
- // rmah: The block of code below has been moved from refreshVisuals(). We're
- // assuming the read-only state of the EditPart will never change once the
- // EditPart has been created.
- if (isReadOnly())
- {
- parameterType.setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- }
- else
- {
- parameterType.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
- }
-
- return figure;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- IParameter param = (IParameter) getModel();
- String name = param.getComponentName();
- parameterType.setText(name);
-
- Image image = ((ITreeElement)getModel()).getSecondaryImage();
- if (image != null)
- {
- parameterType.setIcon(image);
- }
-
- parameterType.setForegroundColor(DesignViewGraphicsConstants.defaultForegroundColor);
-
- List diagnosticMessages = param.getDiagnosticMessages();
- Iterator it = diagnosticMessages.iterator();
- ModelDiagnosticInfo errorInfo = null;
- while (it.hasNext() && errorInfo == null) {
- ModelDiagnosticInfo temp = (ModelDiagnosticInfo) it.next();
- if (temp.getType() == ModelDiagnosticInfo.ERROR_TYPE) {
- errorInfo = temp;
- break;
- }
- }
-
- if (errorInfo != null) {
- parameterType.setText(errorInfo.getDescriptionText());
- parameterType.setForegroundColor(errorInfo.getDescriptionTextColor());
- parameterType.setIcon(null);
- }
-
- // Force the LinkIconColumn to resize and relayout itself.
- if (getInterfaceEditPart() != null) {
- ((Figure) getInterfaceEditPart().getLinkIconColumn()).invalidate();
- refreshLinkFigure(new Point(-1, -1));
- }
- }
-
- private InterfaceEditPart getInterfaceEditPart() {
- EditPart ep = getParent();
- while (ep != null && !(ep instanceof InterfaceEditPart)) {
- ep = ep.getParent();
- }
-
- if (ep instanceof InterfaceEditPart) {
- return (InterfaceEditPart) ep;
- }
-
- return null;
- }
-
- public void addFeedback() {
- figure.setBackgroundColor(DesignViewGraphicsConstants.tableCellSelectionColor);
- }
-
- public void removeFeedback() {
- figure.setBackgroundColor(figure.getParent().getBackgroundColor());
- }
-
- public Label getLabelFigure() {
- return parameterType;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ASDSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
- }
-
- public void performDirectEdit(Point cursorLocation) {
- if (!isFileReadOnly() && (cursorLocation == null || (hitTest(parameterType, cursorLocation) && !isReadOnly()))) {
- IParameter param = (IParameter) getModel();
-
- TypeReferenceDirectEditManager manager = new TypeReferenceDirectEditManager(param, this, parameterType);
- simpleDirectEditPolicy.setDelegate(manager);
- manager.show();
-
-
- }
- else if (parameterType.getParent() instanceof Figure &&
- hitTestFigure((Figure) parameterType.getParent(), cursorLocation) && isReadOnly()) {
- doOpenNewEditor();
- }
- }
-
- public void activate() {
- super.activate();
-
- IFigure primaryLayer = getLayer(LayerConstants.PRIMARY_LAYER);
- mouseEventListener = new MyMouseEventListener();
- primaryLayer.addMouseMotionListener(mouseEventListener);
- primaryLayer.addMouseListener(mouseEventListener);
- }
-
- public void deactivate() {
- if (mouseEventListener != null) {
- IFigure primaryLayer = getLayer(LayerConstants.PRIMARY_LAYER);
- primaryLayer.removeMouseMotionListener(mouseEventListener);
- primaryLayer.removeMouseListener(mouseEventListener);
- }
-
- InterfaceEditPart ep = getInterfaceEditPart();
- if (ep != null && linkIconFigure != null) {
- IFigure fig = ep.getLinkIconColumn();
- if (fig.getChildren().contains(linkIconFigure)) {
- ep.getLinkIconColumn().remove(linkIconFigure);
- }
- }
- }
-
-
- private class SimpleDirectEditPolicy extends DirectEditPolicy
- {
- protected TypeReferenceDirectEditManager delegate;
-
- public void setDelegate(TypeReferenceDirectEditManager delegate)
- {
- this.delegate = delegate;
- }
-
- protected org.eclipse.gef.commands.Command getDirectEditCommand(final DirectEditRequest request)
- {
- return new Command() //AbstractCommand()
- {
- public void execute()
- {
- if (delegate != null)
- {
- delegate.performEdit(request.getCellEditor());
- }
- }
-
- public void redo()
- {
- }
-
- public void undo()
- {
- }
-
- public boolean canExecute()
- {
- return true;
- }
- };
- }
-
- protected void showCurrentEditValue(DirectEditRequest request)
- {
- //hack to prevent async layout from placing the cell editor twice.
- getHostFigure().getUpdateManager().performUpdate();
- }
- }
-
- public EditPart getRelativeEditPart(int direction)
- {
- EditPart editPart = super.getRelativeEditPart(direction);
- if (direction == PositionConstants.SOUTH && editPart == null)
- {
- editPart = EditPartNavigationHandlerUtil.getNextInterface(this);
- }
- return editPart;
- }
-
- private class MyMouseEventListener extends Stub implements MouseListener {
- public void mouseReleased(MouseEvent me) { }
- public void mouseDoubleClicked(MouseEvent me) { }
-
- public void mouseMoved(MouseEvent me) {
- Point pointer = me.getLocation();
- refreshLinkFigure(pointer);
- }
-
- public void mousePressed(MouseEvent me) {
- Point pointer = me.getLocation();
- openExternalEditor(pointer);
- }
-
- public void mouseHover(MouseEvent me) {
- Point pointer = me.getLocation();
- showPreviewDialog(pointer);
- }
- }
-
- private void showPreviewDialog(Point point) {
- Rectangle linkFigBounds = getLinkFigureBounds();
- if (linkFigBounds == null) {
- return;
- }
-
- Rectangle testbounds = new Rectangle(linkFigBounds.x, linkFigBounds.y, 0, linkFigBounds.height);
-
- if (pointerInRange(testbounds, point)) {
- IOpenExternalEditorHelper helper = getExternalEditorOpener();
- helper.showPreview();
- }
- }
-
- // Methods below handle the Link Figure.....
- private void emphasizeLinkFigure() {
- linkIconFigure.setColor(ColorConstants.blue);
- }
-
- private void unemphasizeLinkFigure() {
- linkIconFigure.setColor(ColorConstants.lightGray);
- }
-
- private boolean pointerInRange(Rectangle figBounds, Point pointer) {
- Rectangle linkBounds = getLinkFigureBounds();
-
- int entireX = figBounds.x;
- int entireY = figBounds.y;
- int entireWidth = figBounds.width + linkBounds.width;
- int entireHeight = figBounds.height;
- Rectangle entireBounds = new Rectangle(entireX, entireY, entireWidth, entireHeight);
-
- return entireBounds.contains(pointer);
- }
-
- private boolean containsLinkFigure() {
- Iterator it = getInterfaceEditPart().getLinkIconColumn().getChildren().iterator();
- while (it.hasNext()) {
- Object item = it.next();
- if (item.equals(linkIconFigure)) {
- return true;
- }
- }
-
- return false;
- }
-
- private Rectangle getLinkFigureBounds() {
- if (containsLinkFigure()) {
- return linkIconFigure.getBounds();
- }
- else {
- return null;
- }
- }
-
- private IOpenExternalEditorHelper getExternalEditorOpener() {
- IOpenExternalEditorHelper openExternalEditorHelper = null;
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActiveEditor() != null) {
- Object adapted = page.getActiveEditor().getAdapter(IOpenExternalEditorHelper.class);
- if (adapted instanceof IOpenExternalEditorHelper) {
- openExternalEditorHelper = (IOpenExternalEditorHelper) adapted;
- openExternalEditorHelper.setModel(getModel());
- }
- }
- }
-
- return openExternalEditorHelper;
- }
-
- private void refreshLinkFigure(Point point) {
- Rectangle figBounds = getFigure().getParent().getParent().getBounds();
-
- IOpenExternalEditorHelper openHelper = getExternalEditorOpener();
- if (openHelper != null && openHelper.linkApplicable()) {
- if (!figureContainsLinkFigure(getInterfaceEditPart().getLinkIconColumn())) {
- linkIconFigure = new BaseLinkIconFigure(this);
- getInterfaceEditPart().getLinkIconColumn().add(linkIconFigure);
- }
-
- if (openHelper.isValid()) {
- linkIconFigure.setLinkIconStyle(BaseLinkIconFigure.VALID_SCHEMA_LINK_STYLE);
-
- if (pointerInRange(figBounds, point)) {
- emphasizeLinkFigure();
- }
- else {
- unemphasizeLinkFigure();
- }
- }
- else {
- linkIconFigure.setLinkIconStyle(BaseLinkIconFigure.INVALID_SCHEMA_LINK_STYLE);
- }
- }
- else {
- if (containsLinkFigure()) {
- getInterfaceEditPart().getLinkIconColumn().remove(linkIconFigure);
- }
- }
- }
-
- private boolean figureContainsLinkFigure(IFigure parent) {
- Iterator it = parent.getChildren().iterator();
- while (it.hasNext()) {
- if (it.next().equals(linkIconFigure)) {
- return true;
- }
- }
-
- return false;
- }
-
- private void openExternalEditor(Point point) {
- Rectangle linkFigBounds = getLinkFigureBounds();
- if (linkFigBounds == null || getExternalEditorOpener() == null) {
- return;
- }
-
- Rectangle testbounds = new Rectangle(linkFigBounds.x, linkFigBounds.y, 0, linkFigBounds.height);
-
- if (getExternalEditorOpener().linkApplicable() && pointerInRange(testbounds, point)) {
- // Open in XSD Editor
- getExternalEditorOpener().openExternalEditor();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ServiceEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ServiceEditPart.java
deleted file mode 100644
index 3bcf5ebf4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ServiceEditPart.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.directedit.LabelEditManager;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDLabelDirectEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies.ASDSelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.figures.HeadingFigure;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IService;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class ServiceEditPart extends BaseEditPart implements INamedEditPart
-{
- IFigure contentPane;
- HeadingFigure headingFigure;
-
- public void addFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder) figure.getBorder();
- boxFigureLineBorder.setWidth(2);
-// boxFigureLineBorder.setColor(ColorConstants.darkBlue);
- headingFigure.setSelected(true);
- figure.repaint();
- }
-
- public void removeFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder) figure.getBorder();
- boxFigureLineBorder.setWidth(1);
- boxFigureLineBorder.setColor(DesignViewGraphicsConstants.defaultForegroundColor);
- headingFigure.setSelected(false);
- figure.repaint();
- }
-
- protected IFigure createFigure()
- {
- Figure figure = new Figure();
- figure.setBorder(new LineBorder(1));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- headingFigure = new HeadingFigure();
-
- if (getModel() instanceof ITreeElement) {
- headingFigure.getLabel().setIcon(((ITreeElement) getModel()).getImage());
- }
-
- figure.add(headingFigure);
-
- contentPane = new Figure()
- {
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- boolean isFirst = false;
- for (Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- Figure figure = (Figure)i.next();
- if (isFirst)
- {
- isFirst = false;
- }
- else
- {
- Rectangle r = figure.getBounds();
- graphics.drawLine(r.x, r.y +1, r.x + r.width, r.y + 1);
- }
- }
- }
- };
- ToolbarLayout toolbarLayout2 = new ToolbarLayout(false);
- toolbarLayout2.setStretchMinorAxis(true);
- contentPane.setLayoutManager(toolbarLayout2);
- figure.add(contentPane);
-
- // rmah: The block of code below has been moved from refreshVisuals(). We're
- // assuming the read-only state of the EditPart will never change once the
- // EditPart has been created.
- if (isReadOnly())
- {
- headingFigure.getLabel().setForegroundColor(DesignViewGraphicsConstants.readOnlyLabelColor);
- }
- else
- {
- headingFigure.getLabel().setForegroundColor(ColorConstants.black);
- }
-
- return figure;
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ASDLabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ASDSelectionEditPolicy());
- }
-
- private DirectEditManager manager;
-
- public void performDirectEdit(Point cursorLocation){
- if (!isFileReadOnly() && (cursorLocation == null || hitTest(headingFigure.getLabel(), cursorLocation) && !isReadOnly())) {
- manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
- manager.show();
- }
- else if ((hitTest(headingFigure.getLabel(), cursorLocation) ||
- hitTestFigure(headingFigure, cursorLocation)) && isReadOnly()) {
- doOpenNewEditor();
- }
- }
-
- public void performRequest(Request req) {
- if (req.getType().equals(RequestConstants.REQ_DIRECT_EDIT)) {
- performDirectEdit(null);
- }
- }
-
- public Label getLabelFigure() {
- return headingFigure.getLabel();
- }
-
- protected List getModelChildren()
- {
- IService service = (IService)getModel();
- return service.getEndPoints();
- }
-
- protected void refreshVisuals()
- {
- IService service = (IService)getModel();
- headingFigure.setIsReadOnly(service.isReadOnly());
- headingFigure.getLabel().setText(service.getName());
- super.refreshVisuals();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/AbstractModelCollection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/AbstractModelCollection.java
deleted file mode 100644
index baa3e8c5a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/AbstractModelCollection.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public abstract class AbstractModelCollection implements IASDObject, ITreeElement
-{
- IASDObject model;
- String kind;
-
- public AbstractModelCollection(IASDObject model, String kind)
- {
- this.model = model;
- this.kind = kind;
- }
-
- public Object getModel()
- {
- return model;
- }
-
- public void setModel(IASDObject model)
- {
- this.model = model;
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public void setKind(String kind)
- {
- this.kind = kind;
- }
-
- public Image getImage() {
- return null;
- }
-
- public Image getSecondaryImage() {
- return null;
- }
-
- public ITreeElement getParent() {
- return null;
- }
-
- public boolean isReadOnly() {
- return false;
- }
-
- public void registerListener(IASDObjectListener listener)
- {
- model.registerListener(listener);
- }
-
- public void unregisterListener(IASDObjectListener listener)
- {
- model.unregisterListener(listener);
- }
-
- public Command getDeleteCommand() {
- return null;
- }
-
- public List getDiagnosticMessages() {
- return new ArrayList();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingColumn.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingColumn.java
deleted file mode 100644
index 4ba9ffcf4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingColumn.java
+++ /dev/null
@@ -1,76 +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.asd.design.editparts.model;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.INamedObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class BindingColumn extends AbstractModelCollection {
- public BindingColumn(IDescription description) {
- super(description, "BindingColumn"); //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List bindings = ((IDescription)model).getBindings();
- Collections.sort(bindings, new BindingComparator());
- Object array[] = bindings.toArray();
-
- ITreeElement treeElement[] = new ITreeElement[array.length];
- for (int index = 0; index < array.length; index++) {
- treeElement[index] = (ITreeElement) array[index];
- }
-
- return treeElement;
- }
-
- public boolean hasChildren() {
- ITreeElement treeElement[] = getChildren();
- if (treeElement.length > 0) {
- return true;
- }
-
- return false;
- }
-
- public String getText() {
- return "definition"; //$NON-NLS-1$
- }
-
- private class BindingComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- if (o1 instanceof IBinding && o2 instanceof IBinding) {
- IInterface interface1 = ((IBinding) o1).getInterface();
- IInterface interface2 = ((IBinding) o2).getInterface();
-
- if (interface1 != null && interface2 != null) {
- String name1 = ((INamedObject) interface1).getName();
- String name2 = ((INamedObject) interface2).getName();
- return name1.compareTo(name2);
- }
- else if (interface1 != null && interface2 == null) {
- return -1;
- }
- else if (interface1 == null && interface2 != null) {
- return 1;
- }
- }
-
- return 0;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingContentPlaceHolder.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingContentPlaceHolder.java
deleted file mode 100644
index c963d26d7..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/BindingContentPlaceHolder.java
+++ /dev/null
@@ -1,23 +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.asd.design.editparts.model;
-
-public class BindingContentPlaceHolder {
- private Object model;
-
- public BindingContentPlaceHolder(Object model) {
- this.model = model;
- }
-
- public Object getModel() {
- return model;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/IActionProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/IActionProvider.java
deleted file mode 100644
index e13715d14..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/IActionProvider.java
+++ /dev/null
@@ -1,16 +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.asd.design.editparts.model;
-
-public interface IActionProvider
-{
- public String[] getActions(Object object);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/InterfaceColumn.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/InterfaceColumn.java
deleted file mode 100644
index ecd0f172b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/InterfaceColumn.java
+++ /dev/null
@@ -1,64 +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.asd.design.editparts.model;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.INamedObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-
-public class InterfaceColumn extends AbstractModelCollection {
- public InterfaceColumn(IDescription description) {
- super(description, "InterfaceColumn"); //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List interfaces = ((IDescription)model).getInterfaces();
- Comparator compare = new NamedObjectComparator();
- Collections.sort(interfaces, compare);
- Object array[] = interfaces.toArray();
-
- ITreeElement treeElement[] = new ITreeElement[array.length];
- for (int index = 0; index < array.length; index++) {
- treeElement[index] = (ITreeElement) array[index];
- }
-
- return treeElement;
- }
-
- public boolean hasChildren() {
- ITreeElement treeElement[] = getChildren();
- if (treeElement.length > 0) {
- return true;
- }
-
- return false;
- }
-
- public String getText() {
- return "definition"; //$NON-NLS-1$
- }
-
- private class NamedObjectComparator implements Comparator{
- public int compare(Object o1, Object o2) {
- if (o1 instanceof INamedObject && o2 instanceof INamedObject) {
- String name1 = ((INamedObject) o1).getName();
- String name2 = ((INamedObject) o2).getName();
- return name1.compareTo(name2);
- }
-
- return -1;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/ServiceColumn.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/ServiceColumn.java
deleted file mode 100644
index 1e6597b75..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/model/ServiceColumn.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.editparts.model;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IService;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ITreeElement;
-import org.eclipse.wst.wsdl.ui.internal.asd.util.EndPointComparator;
-
-public class ServiceColumn extends AbstractModelCollection {
- public ServiceColumn(IDescription description) {
- super(description, "ServiceColumn"); //$NON-NLS-1$
- }
-
- public ITreeElement[] getChildren() {
- List services = ((IDescription)model).getServices();
- Collections.sort(services, new ServiceComparator());
- Object array[] = services.toArray();
-
- ITreeElement treeElement[] = new ITreeElement[array.length];
- for (int index = 0; index < array.length; index++) {
- treeElement[index] = (ITreeElement) array[index];
- }
-
- return treeElement;
- }
-
- public boolean hasChildren() {
- ITreeElement treeElement[] = getChildren();
- if (treeElement.length > 0) {
- return true;
- }
-
- return false;
- }
-
- public String getText() {
- return "definition"; //$NON-NLS-1$
- }
-
- private class ServiceComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- if (o1 instanceof IService && o2 instanceof IService) {
- IEndPoint endPoint1 = getFirstAssociatedEndPoint((IService) o1);
- IEndPoint endPoint2 = getFirstAssociatedEndPoint((IService) o2);
-
- EndPointComparator comparator = new EndPointComparator();
- return comparator.compare(endPoint1, endPoint2);
- }
-
- return 0;
- }
-
- private IEndPoint getFirstAssociatedEndPoint(IService service) {
- Iterator endPoints= service.getEndPoints().iterator();
-
- while (endPoints.hasNext()) {
- IEndPoint tempEndPoint = (IEndPoint) endPoints.next();
- if (tempEndPoint.getBinding() != null) {
- return tempEndPoint;
- }
- }
-
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropCommand.java
deleted file mode 100644
index 68301db17..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropCommand.java
+++ /dev/null
@@ -1,135 +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.asd.design.editpolicies;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDragAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDragReorderAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.MessageReferenceEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ParameterEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-
-public class ASDDragAndDropCommand extends Command {
- protected EditPartViewer viewer;
- protected ChangeBoundsRequest request;
- protected Point location;
- protected ASDDragAction dragAction;
- protected boolean canExecute = false;
-
- public ASDDragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request)
- {
- this.viewer = viewer;
- this.request = request;
-
- location = request.getLocation();
- EditPart targetEditPart = viewer.findObjectAt(location);
-
- if (targetEditPart instanceof ParameterEditPart || targetEditPart instanceof MessageReferenceEditPart) {
- ((GraphicalEditPart)viewer.getRootEditPart()).getFigure().translateToRelative(location);
- GraphicalEditPart movingChildEditPart;
- Vector dragActions = new Vector();
- if (request.getType().equals(RequestConstants.REQ_ADD)) { // This really shouldn't be REQ_ADD....
- List list = request.getEditParts();
- if (list.size() <= 0) {
- canExecute = false;
- return;
- }
-
- // Grabbing the fist selection
- movingChildEditPart = (GraphicalEditPart) list.get(0);
- Object model = movingChildEditPart.getModel();
- EditPart pointerEditPart = viewer.findObjectAt(location);
-
- if (model instanceof IParameter) {
- dragActions.add(new ASDDragReorderAction(movingChildEditPart, pointerEditPart, getPointerLocation(location)));
- }
- else if (model instanceof IMessageReference) {
- IMessageReference messageRef = (IMessageReference) model;
- if (messageRef.getKind() == IMessageReference.KIND_INPUT || messageRef.getKind() == IMessageReference.KIND_OUTPUT) {
- dragActions.add(new ASDDragReorderAction(movingChildEditPart, pointerEditPart, getPointerLocation(location)));
-// dragActions.add(new WSDLDragSetMessageAction(movingChildEditPart, pointerEditPart, location));
- }
- }
-
-// else if (model instanceof Fault) {
-// dragActions.add(new WSDLDragSetMessageAction(movingChildEditPart, pointerEditPart, location));
-// }
- }
-// else if (request.getType().equals(RequestConstants.REQ_CLONE)) {
-// List list = request.getEditParts();
-// if (list.size() > 0)
-// {
-// // Grabbing the fist selection
-// movingChildEditPart = (WSDLTreeNodeEditPart) list.get(0);
-//
-// dragActions.add(new CopyWSDLElementAction(viewer,
-// (WSDLElement) movingChildEditPart.getModel(),
-// (WSDLElement) targetEditPart.getModel(),
-// null));
-// }
-// }
-
- Iterator it = dragActions.iterator();
- while (it.hasNext()) {
- dragAction = (ASDDragAction) it.next();
- canExecute = dragAction.canExecute();
- if (canExecute)
- break;
- }
- }
- }
-
- public boolean canExecute()
- {
- return canExecute;
- }
-
- public void execute() {
- if (canExecute)
- {
- dragAction.run();
- }
- }
-
- public IFigure getFeedbackFigure() {
- if (dragAction != null) {
- return dragAction.getFeedbackFigure();
- }
- else {
- return null;
- }
- }
-
- /*
- * This method compensates for the current scroll position
- */
- private Point getPointerLocation(Point origPointerLocation) {
- Point compensatedLocation = origPointerLocation;
- FigureCanvas figureCanvas = (FigureCanvas) viewer.getControl();
- int yOffset = figureCanvas.getViewport().getVerticalRangeModel().getValue();
- compensatedLocation.y = compensatedLocation.y + yOffset;
-
- return compensatedLocation;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropEditPolicy.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropEditPolicy.java
deleted file mode 100644
index 5c23ef3a6..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDDragAndDropEditPolicy.java
+++ /dev/null
@@ -1,38 +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.asd.design.editpolicies;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-
-public class ASDDragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy {
- protected EditPartViewer viewer;
- protected ASDSelectionEditPolicy selectionHandlesEditPolicy;
-
- public ASDDragAndDropEditPolicy(EditPartViewer viewer, ASDSelectionEditPolicy selectionHandlesEditPolicy) {
- this.viewer = viewer;
- this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
- }
-
- public boolean understandsRequest(Request req) {
- return true;
- }
-
- public org.eclipse.gef.commands.Command getCommand(Request request) {
- ASDDragAndDropCommand command = null;
- if (request instanceof ChangeBoundsRequest) {
- command = new ASDDragAndDropCommand(viewer, (ChangeBoundsRequest)request);
- selectionHandlesEditPolicy.setDragAndDropCommand(command);
- }
- return command;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDGraphNodeDragTracker.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDGraphNodeDragTracker.java
deleted file mode 100644
index 9e9f6c5fd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDGraphNodeDragTracker.java
+++ /dev/null
@@ -1,30 +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.asd.design.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-
-public class ASDGraphNodeDragTracker extends DragEditPartsTracker {
- protected EditPart editPart;
-
- public ASDGraphNodeDragTracker(EditPart editPart) {
- super(editPart);
- this.editPart = editPart;
- }
-
- protected Command getCommand() {
- Request request = getTargetRequest();
- return editPart.getCommand(request);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDLabelDirectEditPolicy.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDLabelDirectEditPolicy.java
deleted file mode 100644
index b54b6fe75..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDLabelDirectEditPolicy.java
+++ /dev/null
@@ -1,44 +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.asd.design.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.EndPointEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.INamedObject;
-
-public class ASDLabelDirectEditPolicy extends DirectEditPolicy {
- protected Command getDirectEditCommand(DirectEditRequest request) {
- Command command = null;
- String labelText = (String) request.getCellEditor().getValue();
- EditPart editPart= getHost();
-
- // TODO: rmah: Start VERY UGLY HACK.... I don't see any other way to solve this issue at this time.
- // EndPointEditPart contains two labels which can be direct edited. The facade driving EndPointEditPart
- // contains a getSetNameCommand() and a getSetAddressCommand()... however, this class (LabelDirectEditPolicy)
- // only knows about getSetNameCommand()..... This is the problem we face when combining two labels into
- // one EditPart.....
- if (editPart instanceof EndPointEditPart) {
- command = ((EndPointEditPart) editPart).getSetProperLabelCommand(labelText);
- }
- // End VERY UGLY HACK
- else if (editPart.getModel() instanceof INamedObject) {
- command = ((INamedObject) editPart.getModel()).getSetNameCommand(labelText);
- }
-
- return command;
- }
-
- protected void showCurrentEditValue(DirectEditRequest request) {
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDSelectionEditPolicy.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDSelectionEditPolicy.java
deleted file mode 100644
index fcafff427..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editpolicies/ASDSelectionEditPolicy.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.asd.design.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.IFeedbackHandler;
-
-public class ASDSelectionEditPolicy extends SelectionEditPolicy {
- protected ASDDragAndDropCommand dragAndDropCommand;
- protected IFigure feedback;
-
- public void setDragAndDropCommand(ASDDragAndDropCommand dragAndDropCommand) {
- this.dragAndDropCommand = dragAndDropCommand;
- }
-
- public void showSourceFeedback(Request request)
- {
- eraseChangeBoundsFeedback(null);
-
- if (dragAndDropCommand != null && dragAndDropCommand.canExecute()) {
- if (REQ_MOVE.equals(request.getType()) || REQ_ADD.equals(request.getType())) {
- showMoveChangeBoundsFeedback((ChangeBoundsRequest) request);
- }
-// else if (REQ_CLONE.equals(request.getType())) {
-// showCopyChangeBoundsFeedback((ChangeBoundsRequest) request);
-// }
- }
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- public void eraseSourceFeedback(Request request)
- {
- if (REQ_MOVE.equals(request.getType()) || REQ_ADD.equals(request.getType()))
- {
- eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
- }
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- if (feedback != null)
- {
- removeFeedback(feedback);
- }
- feedback = null;
- }
-
- protected void showMoveChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- if (dragAndDropCommand != null && dragAndDropCommand.getFeedbackFigure() != null) {
- feedback = dragAndDropCommand.getFeedbackFigure();
- addFeedback(feedback);
- }
- }
-
- protected void hideSelection() {
- if (getHost() instanceof IFeedbackHandler) {
- ((IFeedbackHandler) getHost()).removeFeedback();
- }
- }
-
- protected void showSelection() {
- if (getHost() instanceof IFeedbackHandler) {
- ((IFeedbackHandler) getHost()).addFeedback();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BaseLinkIconFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BaseLinkIconFigure.java
deleted file mode 100644
index e953e1539..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BaseLinkIconFigure.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.figures;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.swt.graphics.Color;
-
-public class BaseLinkIconFigure extends Figure {
- public static int VALID_SCHEMA_LINK_STYLE = 1;
- public static int INVALID_SCHEMA_LINK_STYLE = 2;
-
- private int linkIconStyle = VALID_SCHEMA_LINK_STYLE;
- private AbstractGraphicalEditPart editPart;
- private List childFigures = new ArrayList();
- public int figureSpacing = 7;
-
- public BaseLinkIconFigure(AbstractGraphicalEditPart ep) {
- editPart = ep;
-
- ToolbarLayout layout = new ToolbarLayout(true) {
- public void layout(IFigure parent) {
- super.layout(parent);
-
- AbstractGraphicalEditPart ep = getAssociatedEditPart();
- IFigure associatedFigure = ep.getFigure();
- if (associatedFigure != null) {
- // Update the bounds
- Rectangle associatedBounds = associatedFigure.getBounds();
- int x = associatedBounds.x + associatedBounds.width;
- int y = associatedBounds.y;
- int width = getSize().width;
- int height = associatedBounds.height;
-
- Rectangle newFigBounds = new Rectangle(x, y, width, height);
- // Set my bounds based on my associated editpart
- setBounds(newFigBounds);
-
- // Layout the children
- Iterator it = parent.getChildren().iterator();
- while (it.hasNext()) {
- IFigure fig = (IFigure) it.next();
- Point newPoint = new Point(x, y);
-
- // Indent the figure to the right to show the "broken" schema link figure
- if (fig instanceof RightInvalidIconFigure) {
- newPoint.x = newPoint.x + figureSpacing;
- }
-
- fig.setLocation(newPoint);
- }
- }
- }
- };
- setLayoutManager(layout);
-
- // Default to a ValidLinkIconFigure
- linkIconStyle = VALID_SCHEMA_LINK_STYLE;
- addChildFigure(new ValidLinkIconFigure());
- }
-
- private void removeChildFigures() {
- Iterator it = childFigures.iterator();
- while (it.hasNext()) {
- remove((IFigure) it.next());
- }
-
- childFigures.clear();
- }
-
- private void addChildFigure(IFigure fig) {
- childFigures.add(fig);
- add(fig);
- }
-
- public void setLinkIconStyle(int style) {
- if (style == VALID_SCHEMA_LINK_STYLE && linkIconStyle != VALID_SCHEMA_LINK_STYLE) {
- removeChildFigures();
- addChildFigure(new ValidLinkIconFigure());
- }
- else if (style == INVALID_SCHEMA_LINK_STYLE && linkIconStyle != INVALID_SCHEMA_LINK_STYLE) {
- removeChildFigures();
- addChildFigure(new LeftInvalidIconFigure());
- addChildFigure(new RightInvalidIconFigure());
- }
-
- linkIconStyle = style;
- }
-
- public int getLinkIconStyle() {
- return linkIconStyle;
- }
-
- public void setColor(Color color) {
- Iterator it = childFigures.iterator();
- while (it.hasNext()) {
- IFigure fig = (IFigure) it.next();
- fig.setBackgroundColor(color);
- fig.setForegroundColor(color);
- }
- }
-
- public AbstractGraphicalEditPart getAssociatedEditPart() {
- return editPart;
- }
-
- private class LeftInvalidIconFigure extends LinkIconFigure {
- public LeftInvalidIconFigure() {
- super(null);
- PointList points = new PointList();
-
- // Draw the arrow
- points.addPoint(new Point(horizontalBuffer + 0, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 5, 4 + verticalBuffer));
-
- points.addPoint(new Point(horizontalBuffer + 7, 0 + verticalBuffer)); // top slash
- points.addPoint(new Point(horizontalBuffer + 5, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 2, 10 + verticalBuffer)); // bottom slash
-
- points.addPoint(new Point(horizontalBuffer + 4, 6 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 0, 6 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 0, 4 + verticalBuffer));
-
- setForegroundColor(ColorConstants.lightGray);
- setBackgroundColor(ColorConstants.lightGray);
- setFill(true);
- setPoints(points);
- }
-
- // We increase the size of the width because we indent the figure towards the right.
- // So we indent by that same amount stored in horizontalBuffer
- public Dimension getPreferredSize(int wHint, int hHint) {
- Dimension dimension = super.getPreferredSize(wHint, hHint);
- dimension.width = dimension.width + horizontalBuffer;
-
- return dimension;
- }
-
- public void setLocation(Point point) {
- super.setLocation(point);
- // Update the points with the following method call
- setFigureLocation(point);
- }
- }
-
- private class RightInvalidIconFigure extends LinkIconFigure {
- public RightInvalidIconFigure() {
- super(null);
- PointList points = new PointList();
-
- points.addPoint(new Point(horizontalBuffer + 5, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 7, 0 + verticalBuffer)); // top slash
- points.addPoint(new Point(horizontalBuffer + 5, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 10, 4 + verticalBuffer));
-
- points.addPoint(new Point(horizontalBuffer + 10, 0 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 15, 5 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 10, 10 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 10, 6 + verticalBuffer));
-
- points.addPoint(new Point(horizontalBuffer + 4, 6 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 2, 10 + verticalBuffer)); // bottom slash
- points.addPoint(new Point(horizontalBuffer + 5, 4 + verticalBuffer));
-
- setForegroundColor(ColorConstants.lightGray);
- setBackgroundColor(ColorConstants.lightGray);
- setFill(true);
- setPoints(points);
- }
-
- public void setLocation(Point point) {
- super.setLocation(point);
- setFigureLocation(point);
- }
- }
-
- private class ValidLinkIconFigure extends LeftInvalidIconFigure {
- public ValidLinkIconFigure() {
- PointList points = new PointList();
-
- // Draw the arrow
- points.addPoint(new Point(horizontalBuffer + 0, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 15, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 15, 0 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 20, 5 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 15, 10 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 15, 6 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 0, 6 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 0, 4 + verticalBuffer));
-
- setForegroundColor(ColorConstants.lightGray);
- setBackgroundColor(ColorConstants.lightGray);
- setFill(true);
- setPoints(points);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BoxComponentFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BoxComponentFigure.java
deleted file mode 100644
index 43dbc265c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/BoxComponentFigure.java
+++ /dev/null
@@ -1,58 +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.asd.design.figures;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-
-public class BoxComponentFigure extends Figure
-{
- public HeadingFigure headingFigure;
- Figure contentPane;
- protected boolean isSelected = false;
- protected boolean isReadOnly = false;
-
- public void setSelected(boolean isSelected)
- {
- headingFigure.setSelected(isSelected);
- }
-
- public void setIsReadOnly(boolean isReadOnly)
- {
- this.isReadOnly = isReadOnly;
- }
-
- public BoxComponentFigure()
- {
- super();
- headingFigure = new HeadingFigure();
- add(headingFigure);
- contentPane = new ListFigure();
- contentPane.setLayoutManager(new ToolbarLayout());
- add(contentPane);
- }
-
- public Figure getContentPane()
- {
- return contentPane;
- }
-
- public Label getLabel()
- {
- return headingFigure.getLabel();
- }
-
- public Figure getHeadingFigure()
- {
- return headingFigure;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ComponentReferenceConnection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ComponentReferenceConnection.java
deleted file mode 100644
index 069b87668..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ComponentReferenceConnection.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-
-public class ComponentReferenceConnection extends PolylineConnection
-{
- protected boolean highlight = false;
- protected static final Color activeConnection = ColorConstants.black;
- protected static final Color inactiveConnection = new Color(null, 198, 195, 198);
-
- /**
- * Default constructor
- */
- public ComponentReferenceConnection()
- {
- super();
- setTargetDecoration(new PolygonDecoration());
- }
-
- public void setConnectionRouter(ConnectionRouter cr)
- {
- if (cr != null && getConnectionRouter() != null)// TODO:.... && !(getConnectionRouter() instanceof BOManhattanConnectionRouter))
- super.setConnectionRouter(cr);
- }
-
- /**
- * @return Returns the current highlight status.
- */
- public boolean isHighlighted()
- {
- return highlight;
- }
-
- /**
- * @param highlight
- * The highlight to set.
- */
- public void setHighlight(boolean highlight)
- {
- this.highlight = highlight;
- setForegroundColor(highlight ? DesignViewGraphicsConstants.defaultForegroundColor : inactiveConnection);
- setOpaque(highlight);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/HeadingFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/HeadingFigure.java
deleted file mode 100644
index 7dd5ba690..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/HeadingFigure.java
+++ /dev/null
@@ -1,81 +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.asd.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Color;
-
-public class HeadingFigure extends Figure
-{
- public static final Color headerColor = new Color(null, 224, 233, 246);
- Label label;
- protected Color[] gradientColor = {ColorConstants.white,
- ColorConstants.lightGray,
- ColorConstants.lightBlue,
- ColorConstants.gray};
- protected boolean isSelected = false;
- protected boolean isReadOnly = false;
-
- public HeadingFigure()
- {
- label = new Label();
- label.setBorder(new MarginBorder(2));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
- setLayoutManager(toolbarLayout);
- add(label);
- }
-
- public void setSelected(boolean isSelected)
- {
- this.isSelected = isSelected;
- }
-
- public void setIsReadOnly(boolean isReadOnly)
- {
- this.isReadOnly = isReadOnly;
- }
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
-// Color oldForeground = graphics.getForegroundColor();
- // Fill for the header section
- //
- Rectangle r = getBounds().getCopy();
- graphics.setBackgroundColor(ColorConstants.lightGray);
- //graphics.fillRectangle(r.x+1, r.y+1, r.width-1, barYcoordinate - r.y - 1);
- Color gradient1 = isReadOnly ? gradientColor[1] : headerColor;
- if (isSelected && isReadOnly) gradient1 = gradientColor[3];
- else if (isSelected && !isReadOnly) gradient1 = gradientColor[2];
- Color gradient2 = gradientColor[0];
- graphics.setForegroundColor(gradient1);
- graphics.setBackgroundColor(gradient2);
- Rectangle labelBounds = label.getBounds();
- graphics.fillGradient(r.x+1, r.y+1, r.width-2, labelBounds.height , true);
- graphics.setForegroundColor(ColorConstants.darkGray);
- label.paint(graphics);
- graphics.setForegroundColor(isSelected ? gradientColor[1] : gradientColor[3]);
- //graphics.drawLine(r.x+1, r.y + 15, r.x + r.width, r.y + 15);
- //graphics.drawLine(r.x+1, r.y + labelBounds.height, r.x + r.width, r.y + labelBounds.height);
- }
-
- public Label getLabel()
- {
- return label;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/LinkIconFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/LinkIconFigure.java
deleted file mode 100644
index 8107a381f..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/LinkIconFigure.java
+++ /dev/null
@@ -1,90 +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.asd.design.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Polygon;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-
-public class LinkIconFigure extends Polygon {
- private AbstractGraphicalEditPart editPart;
- private Point figLocation;
- private PointList points = new PointList();
- public int horizontalBuffer = 5;
- public int verticalBuffer = 7;
-
- public LinkIconFigure(AbstractGraphicalEditPart ep) {
- editPart = ep;
-
- // Draw the arrow
- points.addPoint(new Point(horizontalBuffer + 0, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 9, 4 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 9, 0 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 14, 5 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 9, 10 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 9, 6 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 0, 6 + verticalBuffer));
- points.addPoint(new Point(horizontalBuffer + 0, 4 + verticalBuffer));
-
- setFill(true);
- setPoints(points);
- }
-
- public void paintFigure(Graphics graphics) {
- super.paintFigure(graphics);
- }
-
- public void setFigureLocation(Point newStartingLocation) {
- int dy = newStartingLocation.y;
-
- if (figLocation != null) {
- dy = newStartingLocation.y - figLocation.y;
- }
-
- // Update the points
- PointList newPoints = new PointList();
- PointList pList = getPoints();
- for (int index = 0; index < pList.size(); index++) {
- Point point = pList.getPoint(index);
- // Add 5 for the padding
- Point newPoint = new Point(point.x + horizontalBuffer, point.y + dy);
- newPoints.addPoint(newPoint);
- }
- setPoints(newPoints);
-
- figLocation = newStartingLocation;
- }
-
- public void primTranslate(int dx, int dy) {
- bounds.x += dx;
- bounds.y += dy;
-
- PointList pList = getPoints();
- PointList newList = new PointList();
- for (int index = 0; index < pList.size(); index++) {
- Point point = pList.getPoint(index);
- Point newPoint = new Point(point.x + dx, point.y);
- newList.addPoint(newPoint);
- }
- setPoints(newList);
-
- if (useLocalCoordinates()) {
- fireCoordinateSystemChanged();
- return;
- }
- }
-
- public AbstractGraphicalEditPart getAssociatedEditPart() {
- return editPart;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ListFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ListFigure.java
deleted file mode 100644
index 028563aca..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ListFigure.java
+++ /dev/null
@@ -1,79 +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.asd.design.figures;
-
-import java.util.Iterator;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class ListFigure extends Figure
-{
- boolean isOpaque = false;
- boolean isHorizontal = false;
- boolean paintFirstLine = true;
-
- public ListFigure(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- public ListFigure()
- {
- this(false);
- }
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- boolean isFirst = true;
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Figure figure = (Figure) i.next();
- if (isFirst && !paintFirstLine)
- {
- isFirst = false;
- }
- else
- {
- Rectangle r = figure.getBounds();
- if (isHorizontal)
- {
- graphics.drawLine(r.x, r.y, r.x, r.y + r.height);
- }
- else
- {
- graphics.drawLine(r.x, r.y, r.x + r.width, r.y);
- }
- }
- }
- }
-
- public boolean isOpaque()
- {
- return isOpaque;
- }
-
- public void setOpaque(boolean isOpaque)
- {
- this.isOpaque = isOpaque;
- }
-
- public boolean isPaintFirstLine()
- {
- return paintFirstLine;
- }
-
- public void setPaintFirstLine(boolean paintFirstLine)
- {
- this.paintFirstLine = paintFirstLine;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ModelDiagnosticInfo.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ModelDiagnosticInfo.java
deleted file mode 100644
index 7fdd8acf6..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/figures/ModelDiagnosticInfo.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.swt.graphics.Color;
-
-/*
- * A ModelDiagnosticInfo object contains "additional" information about a model object.
- * It is passed from a model (facade) object to an EditPart. The EditPart uses the ModelDiagnosticInfo
- * object to display any additional information necessary (for example, an error message when the model
- * object is in some way invalid.
- */
-public class ModelDiagnosticInfo {
- public static int INFORMATIONAL_TYPE = 0;
- public static int ERROR_TYPE = 1;
- public static int WARNING_TYPE = 2;
-
- private int type = 1;
- private String text = ""; //$NON-NLS-1$
- private Color textColor;
-
- public ModelDiagnosticInfo(String txt, int infoType, Color color) {
- text = txt;
- type = infoType;
- textColor = color;
- }
-
- public void setDescriptionText(String txt) {
- text = txt;
- }
-
- public void setDescriptionTextColor(Color color) {
- textColor = color;
- }
-
- public void setType(int infoType) {
- type = infoType;
- }
-
- public String getDescriptionText() {
- return text;
- }
-
- public int getType() {
- return type;
- }
-
- public Color getDescriptionTextColor() {
- if (textColor != null) {
- return textColor;
- }
-
- if (type == ERROR_TYPE) {
- return ColorConstants.red;
- }
- else if (type == WARNING_TYPE) {
- return ColorConstants.lightGray;
- }
-
- return ColorConstants.black;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingColumnLayout.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingColumnLayout.java
deleted file mode 100644
index b60ac7972..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingColumnLayout.java
+++ /dev/null
@@ -1,145 +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.asd.design.layouts;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.BindingEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-
-public class BindingColumnLayout extends AbstractLayout
-{
- EditPart bindingColumnEditPart;
-
- public BindingColumnLayout(EditPart bindingColumnEditPart)
- {
- super();
- this.bindingColumnEditPart = bindingColumnEditPart;
- }
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- Rectangle clientArea = container.getClientArea();
- Dimension d = calculateChildrenSize(container.getChildren(), wHint, hHint);
- d.height = Math.max(d.height, clientArea.height);
- return d;
- }
-
- private Dimension calculateChildrenSize(List children, int wHint, int hHint)
- {
- Dimension childSize;
- IFigure child;
- int height = 0, width = 0;
- for (int i = 0; i < children.size(); i++)
- {
- child = (IFigure) children.get(i);
- childSize = child.getPreferredSize(wHint, hHint);
- height += childSize.height;
- height += 80;
- width = Math.max(width, childSize.width);
- }
- return new Dimension(Math.max(width, 150), height);
- }
-
- public void layout(IFigure container)
- {
- //System.out.println("BindingColumnLayout.layout()" + container.getChildren().size());
- Rectangle clientArea = container.getClientArea();
- Rectangle r = new Rectangle();
- r.x = clientArea.x + 50;
- r.y = clientArea.y;
- int used = 0;
-
- for (Iterator i = container.getChildren().iterator(); i.hasNext();)
- {
- Figure child = (Figure) i.next();
- Dimension d = child.getPreferredSize(-1, -1);
- r.width = d.width;
- r.height = d.height;
-
- child.setBounds(r);
- used += 30;
- used += r.height;
-
- IFigure intefaceFigure = getInterfaceFigureForExpandedEditPartFigure(child);
- if (intefaceFigure != null)
- {
- Rectangle b = intefaceFigure.getBounds();
- int width = 30;
- child.setBounds(new Rectangle(b.x - width, b.y, width, b.height));
- }
-
- r.y += d.height;
- r.y += 80;
- }
- }
-
- public void setExpanded(BindingEditPart bindingEditPart, boolean isExpanded)
- {
- // First run through all of the bindings are are expanded
- // to ensure at most one binding is expanded for each interface since
- // we may need to collapse a binding in order to expand this one.
- //
- IInterface interfaze = getInterface(bindingEditPart);
- if (interfaze != null)
- {
- bindingEditPart.setExpanded(isExpanded);
- if (isExpanded)
- {
- for (Iterator i = bindingColumnEditPart.getChildren().iterator(); i.hasNext(); )
- {
- BindingEditPart otherBindingEditPart = (BindingEditPart)i.next();
- if (otherBindingEditPart != bindingEditPart &&
- interfaze == getInterface(otherBindingEditPart))
- {
- otherBindingEditPart.setExpanded(false);
- }
- }
- }
- }
- }
-
- private IFigure getInterfaceFigureForExpandedEditPartFigure(Figure editPartFigure)
- {
- for (Iterator i = bindingColumnEditPart.getChildren().iterator(); i.hasNext(); )
- {
- BindingEditPart bindingEditPart = (BindingEditPart)i.next();
- if (bindingEditPart.isExpanded() && bindingEditPart.getFigure() == editPartFigure)
- {
- AbstractGraphicalEditPart interfaceEditPart = getMatchingEditPart(getInterface(bindingEditPart));
- if (interfaceEditPart != null)
- {
- return interfaceEditPart.getFigure();
- }
- }
- }
- return null;
- }
-
- private IInterface getInterface(BindingEditPart editPart)
- {
- IBinding binding = (IBinding)editPart.getModel();
- return binding.getInterface();
- }
-
- private AbstractGraphicalEditPart getMatchingEditPart(IInterface interfaze)
- {
- return(AbstractGraphicalEditPart)bindingColumnEditPart.getViewer().getEditPartRegistry().get(interfaze);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingContentLayout.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingContentLayout.java
deleted file mode 100644
index 201b38af8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingContentLayout.java
+++ /dev/null
@@ -1,105 +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.asd.design.layouts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.BindingEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.INamedEditPart;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.BindingContentPlaceHolder;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBindingOperation;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessageReference;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IOperation;
-
-/**
- * This class is used to layout the contents of the binding 'ruler' displayed
- * to the left side of an interface. The contents are aligned with the interface
- * figures so that correspoding binding and interface constructs are side by side.
- */
-public class BindingContentLayout extends AbstractLayout
-{
- BindingEditPart bindingEditPart;
-
- public BindingContentLayout(BindingEditPart bindingEditPart)
- {
- this.bindingEditPart = bindingEditPart;
- }
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- if (bindingEditPart.isExpanded())
- {
- Rectangle clientArea = container.getClientArea();
- return new Dimension(clientArea.width, clientArea.height);
- }
- else
- {
- return new Dimension(0,0);
- }
- }
-
- public void layout(IFigure container)
- {
- Rectangle clientArea = container.getClientArea();
- for (Iterator i = bindingEditPart.getChildren().iterator(); i.hasNext();)
- {
- AbstractGraphicalEditPart childEditPart = (AbstractGraphicalEditPart) i.next();
- AbstractGraphicalEditPart correspondingEditPart = null;
- Object model = childEditPart.getModel();
- if (model instanceof IBindingOperation)
- {
- IOperation operation = ((IBindingOperation)model).getOperation();
- correspondingEditPart = getEditPart(operation);
- }
- else if (model instanceof IBindingMessageReference)
- {
- IMessageReference messageReference = ((IBindingMessageReference)model).getMessageReference();
- correspondingEditPart = getEditPart(messageReference);
- }
- else if (model instanceof BindingContentPlaceHolder) {
- Object correspondingModel = ((BindingContentPlaceHolder) model).getModel();
- correspondingEditPart = getEditPart(correspondingModel);
- }
-
- if (correspondingEditPart != null)
- {
- IFigure figure = correspondingEditPart.getFigure();
- if (correspondingEditPart instanceof INamedEditPart)
- {
- figure = ((INamedEditPart)correspondingEditPart).getLabelFigure();
- }
- Rectangle bounds = figure.getBounds();
- Rectangle newBounds = new Rectangle(clientArea.x, bounds.y, clientArea.width, bounds.height);
- childEditPart.getFigure().setBounds(newBounds);
- }
- }
- }
-
- protected AbstractGraphicalEditPart getEditPart(Object model)
- {
- if (model != null)
- {
- EditPart editPart = (EditPart)bindingEditPart.getViewer().getEditPartRegistry().get(model);
- if (editPart instanceof AbstractGraphicalEditPart)
- {
- return (AbstractGraphicalEditPart)editPart;
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingLayout.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingLayout.java
deleted file mode 100644
index 2748e448c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/BindingLayout.java
+++ /dev/null
@@ -1,60 +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.asd.design.layouts;
-
-import java.util.List;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.BindingEditPart;
-
-// just a toolbar layout with a minor tweak to ensure the last figure fills
-// the entire available space
-public class BindingLayout extends ToolbarLayout
-{
- BindingEditPart editPart;
-
- public BindingLayout(BindingEditPart editPart)
- {
- this.editPart = editPart;
- }
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- Dimension d = super.calculatePreferredSize(container, wHint, hHint);
- //Rectangle clientArea = container.getClientArea();
- //d.width = Math.max(d.width, clientArea.width);
- //d.height = Math.max(d.height, clientArea.height);
- return d;
- }
-
- public void layout(IFigure container)
- {
- super.layout(container);
- if (editPart.isExpanded())
- {
- Rectangle clientArea = container.getClientArea();
- List children = container.getChildren();
- if (children.size() > 1)
- {
- Figure header = (Figure)children.get(0);
- Figure contentPane = (Figure)children.get(children.size() - 1);
- if (contentPane.getChildren().size() > 0)
- {
- Rectangle bounds = contentPane.getBounds();
- bounds.height = clientArea.height - header.getBounds().height;
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/ColumnData.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/ColumnData.java
deleted file mode 100644
index d2a5887aa..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/ColumnData.java
+++ /dev/null
@@ -1,83 +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.asd.design.layouts;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-public class ColumnData
-{
- HashMap map = new HashMap();
-
- class Entry
- {
- int width = 0;
- int weight = 1;
- }
-
- public void clearColumnWidths()
- {
- for (Iterator i = map.values().iterator(); i.hasNext();)
- {
- Entry entry = (Entry)i.next();
- entry.width = 0;
- }
- }
-
- private Entry lookupOrCreateColumnEntry(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry == null)
- {
- entry = new Entry();
- map.put(identifier, entry);
- }
- return entry;
- }
-
- void stretchColumnWidthIfNeeded(String identifier, int width)
- {
- Entry entry = lookupOrCreateColumnEntry(identifier);
- entry.width = Math.max(entry.width, width);
- }
-
- int getColumnWidth(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry != null)
- {
- return entry.width;
- }
- else
- {
- return 0;//hmm should we return -1 ?
- }
- }
-
- int getColumnWeight(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry != null)
- {
- return entry.weight;
- }
- else
- {
- return 0;
- }
- }
-
- public void setColumnWeight(String identifier, int weight)
- {
- Entry entry = lookupOrCreateColumnEntry(identifier);
- entry.weight = weight;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/RowLayout.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/RowLayout.java
deleted file mode 100644
index 14c7409c2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/layouts/RowLayout.java
+++ /dev/null
@@ -1,182 +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.asd.design.layouts;
-
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class RowLayout extends AbstractLayout
-{
- // layout is associated with a parent context
- // any layout manager under the parent context is connected
- // column rows are maintained accross container boundaries
- protected ColumnData columnData;
- protected HashMap figureToContstraintMap = new HashMap();
-
- public RowLayout()
- {
- super();
- }
-
-
- // this method computes the minimum size required to display the figures
- //
- private Dimension calculateChildrenSize(IFigure container, List children, int wHint, int hHint, boolean preferred)
- {
- Dimension childSize;
- IFigure child;
- int height = 0;
- int width = 0;
-
- //IRowFigure figure = (IRowFigure)container;
-
- // for each cell in the row
- //
- for (int i = 0; i < children.size(); i++)
- {
- child = (IFigure) children.get(i);
- String columnIdenifier = (String)getConstraint(child);
-
- // first we compute the child size without regard for columnData
- //
- childSize = child.getPreferredSize(wHint, hHint);// : child.getMinimumSize(wHint, hHint);
-
- // now that the columnData has been populated we can consider if the row needs to be larger
- //
- int effectiveWidth = childSize.width;
- if (columnIdenifier != null)
- {
- columnData.stretchColumnWidthIfNeeded(columnIdenifier, childSize.width);
- effectiveWidth = columnData.getColumnWidth(columnIdenifier);
- }
- height = Math.max(childSize.height, height);
- width += effectiveWidth;
- }
- return new Dimension(width, height);
- }
-
-
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- List children = container.getChildren();
- Dimension prefSize = calculateChildrenSize(container, children, wHint, hHint, true);
- //System.out.println("preferredSize=" + prefSize);
- return prefSize;
- }
-
- public void layout(IFigure parent)
- {
- // layout a table with the columns aligned
- //IRowFigure rowFigure = (IRowFigure)parent;
- Rectangle clientArea = parent.getClientArea();
- List children = parent.getChildren();
- Rectangle r = new Rectangle();
- r.x = clientArea.x;
- r.y = clientArea.y;
- r.height = clientArea.height;
-
- int childrenSize = children.size();
- Rectangle[] bounds = new Rectangle[childrenSize];
-
- // for each cell in the row
- //
- int requiredWidth = 0;
- int totalColumnWeight = 0;
- for (int i = 0; i < childrenSize; i++)
- {
- IFigure child = (IFigure) children.get(i);
- //String columnIdenifier = figure.getColumnIdentifier(child);
- // first we compute the child size without regard for columnData
- //
- Dimension childSize = child.getPreferredSize(-1, -1);
-
- int columnWidth = -1;
- //String columnIdentifier = rowFigure.getColumnIdentifier(child);
- String columnIdentifier = (String)getConstraint(child);
- if (columnIdentifier != null)
- {
- //columnData.stretchColumnWidthIfNeeded(columnIdentifier, childSize.width);
- columnWidth = columnData.getColumnWidth(columnIdentifier);
- totalColumnWeight += columnData.getColumnWeight(columnIdentifier);
- //System.out.println("columnWidth(" + columnIdentifier + ")=" + columnWidth);
- }
- r.width = Math.max(childSize.width, columnWidth);
- requiredWidth += r.width;
- bounds[i] = new Rectangle(r);
- r.x += r.width;
- }
- if (totalColumnWeight < 1)
- {
- totalColumnWeight = 1;
- }
- //System.out.println("clientArea.width=" + clientArea.width + ", " + r.x);
- int extraWidth = Math.max(clientArea.width - requiredWidth, 0);
- //System.out.println("extraWidth=" + extraWidth + " totalColumnWeight=" + totalColumnWeight);
- int extraWidthAllocated = 0;
- for (int i = 0; i < childrenSize; i++)
- {
- IFigure child = (IFigure) children.get(i);
- Rectangle b = bounds[i];
- if (extraWidth > 0)
- {
- String columnIdentifier = (String)getConstraint(child);
- if (columnIdentifier != null)
- {
- int weight = columnData.getColumnWeight(columnIdentifier);
- float fraction = (float)weight / (float)totalColumnWeight;
- int extraWidthForChild = (int)(extraWidth * fraction);
- //System.out.println("extraWidthForChild(" + fraction + ")=" + extraWidthForChild);
- b.width += extraWidthForChild;
- b.x += extraWidthAllocated;
- extraWidthAllocated += extraWidthForChild;
- }
- else
- {
- b.x += extraWidthAllocated;
- }
- }
- child.setBounds(new Rectangle(b));
- }
- }
-
- public ColumnData getColumnData()
- {
- return columnData;
- }
-
- public void setColumnData(ColumnData columnData)
- {
- this.columnData = columnData;
- }
-
- public Object getConstraint(IFigure child)
- {
- return figureToContstraintMap.get(child);
- }
-
- public void setConstraint(IFigure child, Object constraint)
- {
- figureToContstraintMap.put(child, constraint);
- }
-
- public void invalidate()
- {
- //figureToContstraintMap.clear();
- //this.columnData.clearColumnWidths();
- super.invalidate();
- //System.out.println("invalidate");
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObject.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObject.java
deleted file mode 100644
index b5a3f8539..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObject.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-
-
-public interface IASDObject
-{
- public void registerListener(IASDObjectListener listener);
- public void unregisterListener(IASDObjectListener listener);
-
- public boolean isReadOnly();
- public List getDiagnosticMessages();
- public Command getDeleteCommand();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObjectListener.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObjectListener.java
deleted file mode 100644
index 9428c38b9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IASDObjectListener.java
+++ /dev/null
@@ -1,15 +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.asd.facade;
-
-public interface IASDObjectListener {
- public void propertyChanged(Object object, String property);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBinding.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBinding.java
deleted file mode 100644
index bffcbc106..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBinding.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IBinding extends INamedObject
-{
- public IInterface getInterface();
- public List getBindingOperations();
- public List getBindingContentList();
- public List getExtensiblityObjects();
- public String getProtocol();
- public IDescription getOwnerDescription();
-
- public Command getSetInterfaceCommand(IInterface newInterface);
- public Command getGenerateBindingCommand();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingMessageReference.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingMessageReference.java
deleted file mode 100644
index 60bc967a3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingMessageReference.java
+++ /dev/null
@@ -1,19 +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.asd.facade;
-
-import java.util.List;
-
-public interface IBindingMessageReference extends INamedObject
-{
- public IMessageReference getMessageReference();
- public List getExtensiblityObjects();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingOperation.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingOperation.java
deleted file mode 100644
index 4d8b99d74..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IBindingOperation.java
+++ /dev/null
@@ -1,20 +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.asd.facade;
-
-import java.util.List;
-
-public interface IBindingOperation extends INamedObject
-{
- public IOperation getOperation();
- public List getBindingMessages();
- public List getExtensiblityObjects();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IDescription.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IDescription.java
deleted file mode 100644
index fdf7c54e1..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IDescription.java
+++ /dev/null
@@ -1,38 +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.asd.facade;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-
-
-public interface IDescription extends INamedObject
-{
- public String getTargetNamespace();
- public String getTargetNamespacePrefix();
-// public List getNamespacesInfo(); // TODO: Add this method in the future
-
- public List getImports();
- public List getTypes();
- public List getServices();
- public List getBindings();
- public List getInterfaces();
- public List getMessages();
-
- public Command getAddImportCommand();
- public Command getAddSchemaCommand();
- public Command getAddServiceCommand();
- public Command getAddBindingCommand();
- public Command getAddInterfaceCommand();
- public Command getAddMessageCommand();
-// public Command getEditNamespacesCommand(); // TODO: Add this method in the future
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IEndPoint.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IEndPoint.java
deleted file mode 100644
index 7b8fb0ebf..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IEndPoint.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IEndPoint extends INamedObject
-{
- public IService getOwnerService();
- public String getAddress();
- public IBinding getBinding();
- public String getProtocol();
-
- public Command getSetBindingCommand(IBinding binding);
- public Command getSetAddressCommand(String newAddress);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IImport.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IImport.java
deleted file mode 100644
index ebfd35333..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IImport.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-public interface IImport extends INamedObject {
- public String getNamespace();
- public String getNamespacePrefix();
- public String getLocation();
-
- public IDescription getOwnerDescription();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IInterface.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IInterface.java
deleted file mode 100644
index 6ff4defa3..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IInterface.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-
-public interface IInterface extends INamedObject {
- public List getOperations();
- /*
- * @deprecated. The method getImage() will be removed in the near future
- */
- public Image getImage();
- public Command getAddOperationCommand();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessage.java
deleted file mode 100644
index ad86c5ea6..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessage.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IMessage extends INamedObject {
- public List getParts();
-
- public IDescription getOwnerDescription();
-
- public Command getAddPartCommand();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessageReference.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessageReference.java
deleted file mode 100644
index 3340e9d25..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IMessageReference.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-
-// this is a simplification of an input, output or fault object
-// (or any other kind of object future specs might cook up)
-public interface IMessageReference extends INamedObject
-{
- public final static int KIND_INPUT = 1;
- public final static int KIND_OUTPUT = 2;
- public final static int KIND_FAULT = 3;
-
- public int getKind();
- public List getParameters();
- public IOperation getOwnerOperation();
-
- public Command getReorderParametersCommand(IParameter leftSibling, IParameter rightSibling, IParameter movingParameter);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/INamedObject.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/INamedObject.java
deleted file mode 100644
index f8d373aa0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/INamedObject.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface INamedObject extends IASDObject
-{
- public String getName();
-
- public Command getSetNameCommand(String newName);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IOperation.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IOperation.java
deleted file mode 100644
index bf328ca13..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IOperation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IOperation extends INamedObject
-{
- public List getMessages();
- public IInterface getOwnerInterface();
-
- public Command getAddInputCommand();
- public Command getAddOutputCommand();
- // TODO: rmah: We need to revisit this (Sending in an existing FaultImpl when we want to
- // add a Fault Parameter. What do we really want to do when we add a
- // 'new Fault'.... This also relates to what we really want to do when we delete a Fault...
- public Command getAddFaultCommand(Object fault);
- public Command getReorderMessageReferencesCommand(IMessageReference leftSibling, IMessageReference rightSibling, IMessageReference movingMessageRef);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IParameter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IParameter.java
deleted file mode 100644
index 80ce8a645..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IParameter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import org.eclipse.gef.commands.Command;
-
-
-// this class is used to describe in simplified descritpion of the input/output/fault structure
-// in the familiar style of a typical programming language parameter e.g. "String[] foo"
-//
-// often this class represents a simplification of a more complex service description or schema
-// this class serves common denominator to drive a simple view of an operation's message structure
-// implementation specific editors can choose to provide 'advanced' views that delve into addition details
-// of a Message structure
-public interface IParameter extends INamedObject
-{
- public Object getOwner();
-// String getKind();
- public String getComponentName();
- public String getComponentNameQualifier();
-
- // TODO: rmah: Do these strings belong here???
- public static final String SET_NEW_ACTION_ID = "SetTypeAction_AddType"; //$NON-NLS-1$
- public static final String SELECT_EXISTING_ACTION_ID = "SetTypeAction_ExistingType"; //$NON-NLS-1$
-
- public Command getSetTypeCommand(String actionId);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IService.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IService.java
deleted file mode 100644
index fe487db65..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IService.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import java.util.List;
-import org.eclipse.gef.commands.Command;
-
-public interface IService extends INamedObject
-{
- public List getEndPoints();
- public IDescription getOwnerDescription();
- public Command getAddEndPointCommand();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IType.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IType.java
deleted file mode 100644
index d997301d2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/facade/IType.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IType extends INamedObject {
- public IDescription getOwnerDescription();
- public Command getDeleteCommand();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/messages.properties b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/messages.properties
deleted file mode 100644
index a2b5e8bcd..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/messages.properties
+++ /dev/null
@@ -1,50 +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
-###############################################################################
-_UI_TAB_GRAPH=Design
-_UI_TAB_SOURCE=Source
-_UI_BUTTON_NEW=New...
-_UI_LABEL_READ_ONLY=read-only
-_UI_LABEL_NAMESPACE=Namespace
-_UI_LABEL_PORTTYPE=PortType
-_UI_LABEL_LOCATION=Location
-_UI_LABEL_ADDRESS=Address
-_UI_LABEL_BINDING=Binding
-_UI_LABEL_PREFIX=Prefix
-_UI_LABEL_NAME=Name
-_UI_LABEL_TYPE=Type
-_UI_ACTION_ADD_SERVICE=Add Service
-_UI_ACTION_ADD_MESSAGE=Add Message
-_UI_ACTION_ADD_OPERATION=Add Operation
-_UI_ACTION_ADD_IMPORT=Add Import
-_UI_ACTION_ADD_OUTPUT=Add Output
-_UI_ACTION_ADD_FAULT=Add Fault
-_UI_ACTION_ADD_PORT=Add Port
-_UI_ACTION_ADD_PORTTYPE=Add PortType
-_UI_ACTION_DELETE=Delete
-_UI_BUTTON_BROWSE=Browse...
-_UI_ACTION_NEW_PORTTYPE=New PortType...
-_UI_ACTION_NEW_BINDING=New Binding...
-_UI_ACTION_EXISTING_PORTTYPE=Existing PortType...
-_UI_GENERATE_BINDING_CONTENT=Generate Binding Content...
-_UI_ACTION_EXISTING_BINDING=Existing Binding...
-_UI_LABEL_BINDING_PROTOCOL=Protocol
-_UI_LABEL_TARGET_NAMESPACE=Target namespace
-_UI_ACTION_ADD_BINDING=Add Binding
-_UI_ACTION_ADD_SCHEMA=Add Schema
-_UI_ACTION_ADD_INPUT=Add Input
-_UI_SECTION_ADVANCED_ATTRIBUTES=Advanced
-
-_UI_ACTION_EDIT_NAMESPACES = Edit Namespaces...
-_UI_ACTION_OPEN_SCHEMA=Open Schema
-_UI_TOOLTIP_RENAME_REFACTOR=Click here to invoke the Rename refactoring.
-
-_UI_LABEL_RIGHT_CLICK_TO_INSERT_CONTENT=Right mouse click here to insert content
-_UI_ACTION_SHOW_PROPERTIES=Show properties
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlinePage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlinePage.java
deleted file mode 100644
index 955500ac9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlinePage.java
+++ /dev/null
@@ -1,98 +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.asd.outline;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-
-public class ASDContentOutlinePage extends ContentOutlinePage {
- protected ASDMultiPageEditor wsdlEditor;
- protected IDescription model;
- protected ITreeContentProvider contentProvider;
- protected ILabelProvider labelProvider;
- protected IMenuListener menuListener;
-
- public ASDContentOutlinePage(ASDMultiPageEditor editor, IMenuListener menuListener) {
- wsdlEditor = editor;
- this.menuListener = menuListener;
- }
-
- public TreeViewer getTreeViewer() {
- return super.getTreeViewer();
- }
-
- public void setContentProvider(ITreeContentProvider contentProvider) {
- this.contentProvider = contentProvider;
- }
-
- public void setLabelProvider(ILabelProvider labelProvider) {
- this.labelProvider = labelProvider;
- }
-
- public void setModel(IDescription model) {
- this.model = model;
- }
-
- public void createControl(Composite parent) {
- super.createControl(parent);
-
- getTreeViewer().setContentProvider(contentProvider);
- getTreeViewer().setLabelProvider(labelProvider);
- getTreeViewer().setInput(model);
- getTreeViewer().addSelectionChangedListener(this);
-
- MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
- menuManager.setRemoveAllWhenShown(true);
- Menu menu = menuManager.createContextMenu(getTreeViewer().getControl());
- getTreeViewer().getControl().setMenu(menu);
- menuManager.addMenuListener(menuListener);
-
- getSite().registerContextMenu("org.eclipse.wst.wsdl.ui.popup.outline", menuManager, wsdlEditor.getSelectionManager()); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),ASDEditorCSHelpIds.WSDL_OUTLINE_VIEW);
- }
-
- protected boolean processingSelectionChange = false;
-
- public void selectionChanged(SelectionChangedEvent event) {
- if (!processingSelectionChange) {
- processingSelectionChange = true;
- super.selectionChanged(event);
- Object selection = null;
-
- if (((IStructuredSelection) event.getSelection()).getFirstElement() instanceof EditPart){
- EditPart newEditPart = (EditPart) ((IStructuredSelection) event.getSelection()).getFirstElement();
- selection = newEditPart.getModel();
- }
- else {
- selection = ((IStructuredSelection) event.getSelection()).getFirstElement();
- }
-
- if (selection != null) {
- setSelection(new StructuredSelection(selection));
- }
- processingSelectionChange = false;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlineProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlineProvider.java
deleted file mode 100644
index 5cd930c60..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ASDContentOutlineProvider.java
+++ /dev/null
@@ -1,156 +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.asd.outline;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDMultiPageEditor;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.INamedObject;
-
-public class ASDContentOutlineProvider implements ITreeContentProvider, ILabelProvider, IASDObjectListener {
- protected Viewer viewer;
-
- /**
- * @deprecated
- */
- protected ASDMultiPageEditor editor;
- protected List listeners = new ArrayList();
-
- /**
- * @deprecated
- */
- protected IDescription description;
-
- public ASDContentOutlineProvider()
- {
- }
-
- public ASDContentOutlineProvider(ASDMultiPageEditor editor, IDescription description) {
- this.editor = editor;
- this.description = description;
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof ITreeElement) {
- ITreeElement[] kids = ((ITreeElement) parentElement).getChildren();
- for (int index = 0; index < kids.length; index++) {
- attachListener(kids[index]);
- }
-
- return kids;
- }
-
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- if (element instanceof ITreeElement) {
- return ((ITreeElement) element).getParent();
- }
-
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (getChildren(element).length > 0) {
- return true;
- }
-
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public void dispose() {
- unattachAllListeners();
- viewer = null;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- this.viewer = viewer;
- unattachAllListeners();
- }
-
- public Image getImage(Object element) {
- if (element instanceof ITreeElement) {
- return ((ITreeElement) element).getImage();
- }
-
- return null;
- }
-
- public String getText(Object element) {
- String text = null;
-
- if (element instanceof INamedObject) {
- text = ((INamedObject) element).getName();
- }
- else if (element instanceof ITreeElement) {
- text = ((ITreeElement) element).getText();
- }
- else {
- text = element.toString();
- }
-
- if (text == null) {
- text = ""; //$NON-NLS-1$
- }
-
- return text;
- }
-
- public void addListener(ILabelProviderListener listener) {
-
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
-
- }
-
- protected void attachListener(Object object) {
- if (object instanceof IASDObject && !listeners.contains(object)) {
- ((IASDObject) object).registerListener(this);
- listeners.add(object);
- }
- }
-
- protected void unattachAllListeners() {
- Iterator it = listeners.iterator();
- while (it.hasNext()) {
- Object item = it.next();
- ((IASDObject) item).unregisterListener(this);
- }
- }
-
- public void propertyChanged(Object object, String property) {
- if (viewer instanceof TreeViewer) {
- TreeViewer treeViewer = (TreeViewer) viewer;
- treeViewer.refresh(object);
- treeViewer.reveal(object);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ICategoryAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ICategoryAdapter.java
deleted file mode 100644
index a03d82983..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ICategoryAdapter.java
+++ /dev/null
@@ -1,17 +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.asd.outline;
-
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-
-public interface ICategoryAdapter {
- public IDescription getOwnerDescription();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ITreeElement.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ITreeElement.java
deleted file mode 100644
index 11a2d7391..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/outline/ITreeElement.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.outline;
-
-import org.eclipse.swt.graphics.Image;
-
-public interface ITreeElement {
- public final static ITreeElement[] EMPTY_LIST = {};
- ITreeElement[] getChildren();
- ITreeElement getParent();
- boolean hasChildren();
- String getText();
- Image getImage();
- Image getSecondaryImage();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDAbstractSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDAbstractSection.java
deleted file mode 100644
index 94c4db34b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDAbstractSection.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObjectListener;
-
-public class ASDAbstractSection implements ISection, IASDObjectListener, Listener, SelectionListener
-{
- private TabbedPropertySheetWidgetFactory factory;
- private Object elementModel;
- protected boolean isReadOnly = false;
- protected Composite composite;
- protected int rightMarginSpace;
- protected int tableMinimumWidth = 50;
- protected CustomListener customListener = new CustomListener();
-
- protected List listeners = new ArrayList();
-
- public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage)
- {
- createControls(parent, tabbedPropertySheetPage.getWidgetFactory());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory aFactory)
- {
- this.factory = aFactory;
- GC gc = new GC(parent);
- Point extent = gc.textExtent(" ... "); //$NON-NLS-1$
- rightMarginSpace = extent.x;
- gc.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- Assert.isTrue(selection instanceof IStructuredSelection);
- Object input = ((IStructuredSelection)selection).getFirstElement();
- elementModel = input;
- attachListener(elementModel);
-
- if (input instanceof IASDObject) {
- isReadOnly = ((IASDObject) input).isReadOnly();
- }
-
- IEditorPart owningEditor = null;
- if (part!=null) {
- if (part instanceof IEditorPart) {
- owningEditor = (IEditorPart)part;
- } else {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null) {
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- owningEditor = page.getActiveEditor();
- }
- }
- }
- }
- }
- if (owningEditor != null) {
- IEditorInput editorInput = owningEditor.getEditorInput();
- if (!(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput)) {
- isReadOnly = true;
- }
- }
- refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeShown()
- */
- public void aboutToBeShown()
- {
- refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeHidden()
- */
- public void aboutToBeHidden()
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#dispose()
- */
- public void dispose()
- {
- unattachAllListeners();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#getMinimumHeight()
- */
- public int getMinimumHeight()
- {
- return SWT.DEFAULT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#refresh()
- */
- public void refresh()
- {
- if (!composite.isDisposed())
- {
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
- }
- }
-
- /**
- * Get the widget factory.
- * @return the widget factory.
- */
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return factory;
- }
-
- public void propertyChanged(Object object, String property)
- {
- refresh();
- }
-
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {}
-
- public void doWidgetSelected(SelectionEvent e)
- {}
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
- if (isListenerEnabled() && !isInDoHandle)
- {
- isInDoHandle = true;
- doWidgetDefaultSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (isListenerEnabled() && !isInDoHandle)
- {
- isInDoHandle = true;
- doWidgetSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- boolean listenerEnabled = true;
- /**
- * Get the value of listenerEnabled.
- * @return value of listenerEnabled.
- */
- public boolean isListenerEnabled()
- {
- return listenerEnabled;
- }
-
- public void applyTextListeners(Control control)
- {
- control.addListener(SWT.FocusOut, customListener);
- control.addListener(SWT.KeyDown, customListener);
- }
-
- public void removeListeners(Control control)
- {
- control.removeListener(SWT.FocusOut, customListener);
- control.removeListener(SWT.KeyDown, customListener);
- }
-
- /**
- * Set the value of listenerEnabled.
- * @param v Value to assign to listenerEnabled.
- */
- public void setListenerEnabled(boolean v)
- {
- this.listenerEnabled = v;
- }
-
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() && !isInDoHandle)
- {
- isInDoHandle = true;
-// startDelayedEvent(event);
- doHandleEvent(event);
- isInDoHandle = false;
- } // end of if ()
- }
-
- public void doHandleEvent(Event event)
- {
-
- }
-
- protected DelayedEvent delayedTask;
-
- protected void startDelayedEvent(Event e)
- {
- if (delayedTask == null ||
- delayedTask.getEvent() == null)
- {
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500,delayedTask);
- }
- else
- {
- Event delayedEvent = delayedTask.getEvent();
-
- if (e.widget == delayedEvent.widget &&
- e.type == delayedEvent.type)
- {
- // same event, just different data, delay new event
- delayedTask.setEvent(null);
- }
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500,delayedTask);
- }
- }
-
- class DelayedEvent implements Runnable
- {
- protected Event event;
-
- /*
- * @see Runnable#run()
- */
- public void run()
- {
- if (event != null)
- {
- isInDoHandle = true;
- doHandleEvent(event);
- isInDoHandle = false;
- event = null;
- }
- }
-
- /**
- * Gets the event.
- * @return Returns a Event
- */
- public Event getEvent()
- {
- return event;
- }
-
- /**
- * Sets the event.
- * @param event The event to set
- */
- public void setEvent(Event event)
- {
- this.event = event;
- }
-
- }
-
- class CustomListener implements Listener
- {
- boolean isHandlingEvent = false;
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() && !isReadOnly)
- {
- switch (event.type)
- {
- case SWT.KeyDown :
- {
- if (event.character == SWT.CR)
- {
- if (!isHandlingEvent)
- {
- isHandlingEvent = true;
- doHandleEvent(event);
- isHandlingEvent = false;
- }
- }
- break;
- }
- case SWT.FocusOut :
- {
- if (!isHandlingEvent)
- {
- isHandlingEvent = true;
- doHandleEvent(event);
- isHandlingEvent = false;
- }
- break;
- }
- }
- }
- }
- }
-
- protected boolean isInDoHandle;
- /**
- * Get the value of isInDoHandle.
- * @return value of isInDoHandle.
- */
- public boolean isInDoHandle()
- {
- return isInDoHandle;
- }
-
- static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart)
- {
- IStatusLineManager result = null;
- try
- {
- EditorActionBarContributor contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
- result = contributor.getActionBars().getStatusLineManager();
- }
- catch (Exception e)
- {
- }
- return result;
- }
-
- public Object getModel() {
- return elementModel;
- }
-
- protected void attachListener(Object object) {
- if (object instanceof IASDObject && !listeners.contains(object)) {
- ((IASDObject) object).registerListener(this);
- listeners.add(object);
- }
- }
-
- protected void unattachAllListeners() {
- Iterator it = listeners.iterator();
- while (it.hasNext()) {
- Object item = it.next();
- ((IASDObject) item).unregisterListener(this);
- }
- }
-
- protected void setControlForegroundColor(Control control) {
- if (control != null) {
- if (isReadOnly) {
- control.setForeground(DesignViewGraphicsConstants.readOnlyLabelColor);
- }
- else {
- control.setForeground(DesignViewGraphicsConstants.defaultForegroundColor);
- }
- }
- }
-
- protected void executeCommand(Command command) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- if (page.getActiveEditor() != null && page.getActiveEditor().getAdapter(CommandStack.class) != null) {
- CommandStack stack = (CommandStack) page.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
- }
- else {
- command.execute();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDTabbedPropertySheetPage.java
deleted file mode 100644
index d1f65d62b..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ASDTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,48 +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.asd.properties.sections;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-public class ASDTabbedPropertySheetPage extends TabbedPropertySheetPage implements ISelectionChangedListener//, IElementListener
-{
- /**
- * @param tabbedPropertySheetPageContributor
- */
- public ASDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
- {
- super(tabbedPropertySheetPageContributor);
-// tabContributor = tabbedPropertySheetPageContributor;
- }
-
- public void createControl(Composite parent) {
- super.createControl(parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (!event.getSelection().isEmpty()) {
- selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
- //super.selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
- }
- }
-
- public void dispose() {
- super.dispose();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/BindingSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/BindingSection.java
deleted file mode 100644
index 80900da81..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/BindingSection.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.Messages;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetExistingInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetNewInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-
-public class BindingSection extends ReferenceSection implements SelectionListener {
- protected ComponentReferenceEditManager refManager;
- private CLabel protocolValue;
-// private CLabel optionsValue;
- private Button regenBindingButton;
-
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- comboLabel.setText(org.eclipse.wst.wsdl.ui.internal.asd.Messages._UI_LABEL_PORTTYPE + ":"); //$NON-NLS-1$ //$NON-NLS-2$
-
- CLabel protocolLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_BINDING_PROTOCOL);
- protocolValue= getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // Layout protocolLabel
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(protocolValue, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(protocolValue, 0, SWT.CENTER);
- protocolLabel.setLayoutData(data);
-
- // Layout protocolValue
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(combo, 0);
-// data.top = new FormAttachment(combo, +ITabbedPropertyConstants.VSPACE);
- protocolValue.setLayoutData(data);
-
- /*
- CLabel optionsLabel = getWidgetFactory().createCLabel(composite, Messages.getString("_UI_TITLE_OPTIONS") + ":");
- optionsValue = getWidgetFactory().createCLabel(composite, "");
-
- // Layout optionsLabel
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(optionsValue, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(optionsValue, 0, SWT.CENTER);
- optionsLabel.setLayoutData(data);
-
- // Layout optionsValue
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(protocolValue, -ITabbedPropertyConstants.VSPACE);
-// data.top = new FormAttachment(protocolValue, +ITabbedPropertyConstants.VSPACE);
- optionsValue.setLayoutData(data);
-
- String buttonLabel = org.eclipse.wst.wsdl.ui.internal.asd.Messages.getString("_UI_GENERATE_BINDING_CONTENT");
- regenBindingButton = getWidgetFactory().createButton(composite, buttonLabel, SWT.PUSH);
-
- // Layout button
- data = new FormData();
- data.left = new FormAttachment(0, 0);
-// data.right = new FormAttachment(optionsValue, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(optionsLabel, 0);
- regenBindingButton.setLayoutData(data);
- */
-
- String buttonLabel = org.eclipse.wst.wsdl.ui.internal.asd.Messages._UI_GENERATE_BINDING_CONTENT;
- regenBindingButton = getWidgetFactory().createButton(composite, buttonLabel, SWT.PUSH);
-
- // Layout button
- data = new FormData();
- data.left = new FormAttachment(0, 0);
-// data.right = new FormAttachment(optionsValue, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(protocolLabel, 0);
- regenBindingButton.setLayoutData(data);
-
- regenBindingButton.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(protocolValue, ASDEditorCSHelpIds.PROPERTIES_BINDING_PROTOCOL_TEXT);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(regenBindingButton, ASDEditorCSHelpIds.PROPERTIES_BINDING_GEN_BINDING_BUTTON);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, ASDEditorCSHelpIds.PROPERTIES_BINDING_PORTTYPE_COMBO);
- }
-
- public void refresh() {
- super.refresh();
- IBinding binding = getIBinding();
- String protocol = binding.getProtocol();
- ContentGeneratorUIExtensionRegistry registry = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry();
- ContentGeneratorUIExtension ext = registry.getExtensionForName(protocol);
- if (ext != null) {
- protocol = ext.getLabel();
- }
-
- if (protocol == null || protocol.equals("")) { //$NON-NLS-1$
- protocol = "----"; //$NON-NLS-1$
- }
- protocolValue.setText(protocol);
-
-// optionsValue.setText("");
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager() {
- if (refManager != null) {
- return refManager;
- }
-
- refManager = ReferenceEditManagerHelper.getInterfaceReferenceEditManager((IASDObject) getModel());
-
- return refManager;
- }
-
- protected List getComboItems() {
- ComponentReferenceEditManager manager = getComponentReferenceEditManager();
-
- List items = new ArrayList();
- items.add(BROWSE_STRING);
- items.add(NEW_STRING);
-
- if (manager != null) {
- ComponentSpecification[] comboItems = manager.getQuickPicks();
- for (int index = 0; index < comboItems.length; index++)
- {
- items.add(comboItems[index]);
- }
- }
- return items;
- }
-
- protected Object getCurrentComboItem() {
- IBinding binding = getIBinding();
- return binding.getInterface();
- }
-
- protected String getComboItemName(Object item) {
- String name = ""; //$NON-NLS-1$
- if (item instanceof ComponentSpecification) {
- name = ((ComponentSpecification) item).getName();
- }
- else if (item instanceof IInterface) {
- name = ((IInterface) item).getName();
- }
- else if (item instanceof String) {
- name = (String) item;
- }
-
- return name;
- }
-
- protected void performComboSelection(Object item) {
- ComponentSpecification spec = null;
-
- if (item instanceof ComponentSpecification) {
- spec = (ComponentSpecification) item;
- ComponentReferenceEditManager manager = getComponentReferenceEditManager();
- manager.modifyComponentReference((IBinding) getModel(), spec);
- }
- else if (item instanceof String) {
- if (item.equals(BROWSE_STRING)) {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- ASDSetExistingInterfaceAction action = new ASDSetExistingInterfaceAction(part);
- action.setIBinding((IBinding) getModel());
- action.run();
- }
- else if (item.equals(NEW_STRING)) {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- ASDSetNewInterfaceAction action = new ASDSetNewInterfaceAction(part);
- action.setIBinding((IBinding) getModel());
- action.run();
- }
- }
-
- refresh();
- }
-
- private IBinding getIBinding() {
- return (IBinding) getModel();
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == regenBindingButton) {
- Command command = getIBinding().getGenerateBindingCommand();
- CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class);
- stack.execute(command);
- }
- }
-
- public void doWidgetSelected(SelectionEvent e) {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/DocumentationSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/DocumentationSection.java
deleted file mode 100644
index a762c92fc..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/DocumentationSection.java
+++ /dev/null
@@ -1,154 +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.asd.properties.sections;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementAction;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class DocumentationSection extends ASDAbstractSection {
- Text docText;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- docText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE | SWT.H_SCROLL | SWT.V_SCROLL); //$NON-NLS-1$
- docText.addListener(SWT.KeyDown, this);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- docText.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(docText, ASDEditorCSHelpIds.PROPERTIES_DOCUMENTATION_TAB);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- /*
- * TODO: the doHandleEvent() and refresh() methods both use WSDL11 specific
- * knowledge. This class (DocumentationSection) should be generic. In Post 1.5,
- * we need to add documentation support methods to our facade so we don't need
- * to know WSDL specific implementation.......
- */
- public void refresh()
- {
- super.refresh();
- if (docText.isFocusControl())
- {
- return;
- }
- setListenerEnabled(false);
- docText.setText(""); //$NON-NLS-1$
- if (getModel() != null && getElement() != null)
- {
- Element docNode = getElement().getDocumentationElement();
- if (docNode != null)
- {
- Node textNode = docNode.getFirstChild();
- if (textNode != null)
- {
- String docValue = textNode.getNodeValue();
- if (docValue != null)
- {
- docText.setText(docValue);
- }
- }
- }
- }
- setListenerEnabled(true);
- }
-
- /*
- * TODO: the doHandleEvent() and refresh() methods both use WSDL11 specific
- * knowledge. This class (DocumentationSection) should be generic. In Post 1.5,
- * we need to add documentation support methods to our facade so we don't need
- * to know WSDL specific implementation.......
- */
- public void doHandleEvent(Event event)
- {
- if (event.widget == docText)
- {
- String value = docText.getText();
- if (getModel() != null && getElement() != null)
- {
- Element docNode = getElement().getDocumentationElement();
- if (docNode != null)
- {
- Node textNode = docNode.getFirstChild();
- if (textNode != null)
- {
- textNode.setNodeValue(value);
- }
- else
- {
- if (value.length() > 0)
- {
- Document document = docNode.getOwnerDocument();
- org.w3c.dom.Text newTextNode = document.createTextNode(value);
- docNode.appendChild(newTextNode);
- }
- }
- }
- else
- {
- Element element = getElement().getElement();
- AddElementAction action = new AddElementAction(element, element.getPrefix(), "documentation", element.getFirstChild()); //$NON-NLS-1$
- action.run();
- Element newDocumentation = action.getNewElement();
-
- Document document = newDocumentation.getOwnerDocument();
- org.w3c.dom.Text newTextNode = document.createTextNode(value);
- newDocumentation.appendChild(newTextNode);
- getElement().setDocumentationElement(newDocumentation);
- }
- }
- }
- }
-
- private WSDLElement getElement() {
- WSDLElement element = null;
- Object model = getModel();
-
- if (model instanceof AbstractModelCollection) {
- model = ((AbstractModelCollection) model).getModel();
- }
-
- // TODO: Should we be handling the XML Schema case here as well?
- if (model instanceof WSDLBaseAdapter) {
- Object target = ((WSDLBaseAdapter) model).getTarget();
- if (target instanceof WSDLElement) {
- element = (WSDLElement) target;
- }
- }
-
- return element;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/EndPointSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/EndPointSection.java
deleted file mode 100644
index 7e346d8ce..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/EndPointSection.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 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.asd.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11EndPoint;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetExistingBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDSetNewBindingAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtension;
-import org.eclipse.wst.wsdl.ui.internal.asd.contentgenerator.ui.extension.ContentGeneratorUIExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-
-public class EndPointSection extends ReferenceSection {
- protected Text addressText;
- protected CCombo protocolCombo;
-
- protected List bindingsInCombo = new ArrayList();
-
- protected ComponentReferenceEditManager refManager;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- FormData data;
-
- // Address row
- CLabel addressLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ADDRESS + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- addressText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(addressText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(addressText, 0, SWT.CENTER);
- addressLabel.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(combo, +ITabbedPropertyConstants.VSPACE);
- addressText.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(addressText, ASDEditorCSHelpIds.PROPERTIES_PORT_ADDRESS_TEXT);
-
- // Protocol Row
- CLabel protocolLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_BINDING_PROTOCOL + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- protocolCombo = getWidgetFactory().createCCombo(composite); //$NON-NLS-1$
-
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(protocolCombo, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(protocolCombo, 0, SWT.CENTER);
- protocolLabel.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(addressText, +ITabbedPropertyConstants.VSPACE);
- protocolCombo.setLayoutData(data);
- protocolCombo.addListener(SWT.Modify, this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(protocolCombo, ASDEditorCSHelpIds.PROPERTIES_PORT_PROTOCOL_TEXT);
-
- comboLabel.setText(Messages._UI_LABEL_BINDING + ":"); //$NON-NLS-1$ //$NON-NLS-2$
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, ASDEditorCSHelpIds.PROPERTIES_PORT_BINDING_COMBO);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- removeListeners(addressText);
- protocolCombo.removeListener(SWT.Modify, this);
-
- super.refresh();
-
- IEndPoint endPoint = (IEndPoint) getModel();
- if (endPoint.getAddress() != null) {
- if (!endPoint.getAddress().equals(addressText.getText())) {
- addressText.setText(endPoint.getAddress());
- }
- }
-
- protocolCombo.removeAll();
- if (endPoint instanceof W11EndPoint) {
- String protocolValue = ((W11EndPoint) endPoint).getProtocol();
- ContentGeneratorUIExtensionRegistry registry = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry();
- ContentGeneratorUIExtension extt = registry.getExtensionForName(protocolValue);
- if (extt != null) {
- protocolValue = extt.getLabel();
- }
- List protocols = ((W11EndPoint) getModel()).getApplicableProtocol();
- Iterator it = protocols.iterator();
- while (it.hasNext()) {
- String protocol = (String) it.next();
- ContentGeneratorUIExtension ext = registry.getExtensionForName(protocol);
- if (ext != null) {
- String label = ext.getLabel();
- if (label != null) {
- protocolCombo.add(label);
- }
- }
- }
-
- protocolCombo.setText(protocolValue);
- }
-
- setControlForegroundColor(addressText);
- setControlForegroundColor(protocolCombo);
- applyTextListeners(addressText);
- protocolCombo.addListener(SWT.Modify, this);
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager() {
- if (refManager != null) {
- return refManager;
- }
-
- refManager = ReferenceEditManagerHelper.getBindingReferenceEditManager((IASDObject) getModel());
-
- return refManager;
- }
-
- protected List getComboItems() {
- ComponentReferenceEditManager manager = getComponentReferenceEditManager();
-
- List items = new ArrayList();
- items.add(BROWSE_STRING);
- items.add(NEW_STRING);
-
- if (manager != null) {
- ComponentSpecification[] comboItems = manager.getQuickPicks();
- for (int index = 0; index < comboItems.length; index++) {
- items.add(comboItems[index]);
- }
- }
- return items;
- }
-
- protected Object getCurrentComboItem() {
- IEndPoint endPoint = (IEndPoint) getModel();
- return endPoint.getBinding();
- }
-
- protected String getComboItemName(Object item) {
- String name = ""; //$NON-NLS-1$
- if (item instanceof ComponentSpecification) {
- name = ((ComponentSpecification) item).getName();
- }
- else if (item instanceof IBinding) {
- name = ((IBinding) item).getName();
- }
- else if (item instanceof String) {
- name = (String) item;
- }
-
- return name;
- }
-
- protected void performComboSelection(Object item) {
- ComponentSpecification spec = null;
-
- if (item instanceof ComponentSpecification) {
- spec = (ComponentSpecification) item;
- ComponentReferenceEditManager manager = getComponentReferenceEditManager();
- manager.modifyComponentReference((IEndPoint) getModel(), spec);
- }
- else if (item instanceof String) {
- if (item.equals(BROWSE_STRING)) {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- ASDSetExistingBindingAction action = new ASDSetExistingBindingAction(part);
- action.setIEndPoint((IEndPoint) getModel());
- action.run();
- }
- else if (item.equals(NEW_STRING)) {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- ASDSetNewBindingAction action = new ASDSetNewBindingAction(part);
- action.setIEndPoint((IEndPoint) getModel());
- action.run();
- }
- }
-
- refresh();
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void doHandleEvent(Event event)
- {
- if (event.widget == addressText && !addressText.isDisposed()) {
- String newAddress = addressText.getText();
- if (newAddress == null) {
- newAddress = ""; //$NON-NLS-1$
- }
-
- String oldAddress = getOldAddress();
- if (oldAddress.equals(newAddress))
- return;
-
- IEndPoint endPoint = (IEndPoint) getModel();
- Command command = endPoint.getSetAddressCommand(newAddress);
- executeCommand(command);
- }
- else if (event.widget == protocolCombo && !protocolCombo.isDisposed()) {
- String newProtocol = protocolCombo.getText();
- ContentGeneratorUIExtensionRegistry registry = WSDLEditorPlugin.getInstance().getContentGeneratorUIExtensionRegistry();
- ContentGeneratorUIExtension ext = registry.getExtensionForLabel(newProtocol);
- if (ext != null)
- {
- newProtocol = ext.getName();
- }
- if (newProtocol != null && getModel() instanceof W11EndPoint) {
- W11EndPoint endPoint = (W11EndPoint) getModel();
-
- // Don't update the protocol if it's the same as the old one
-
- String oldProtocol = getOldProtocol(endPoint);
- if (oldProtocol.equals(newProtocol))
- return;
-
- endPoint.setProtocol(newProtocol);
- }
- }
- else {
- super.doHandleEvent(event);
- }
- }
-
- private String getOldAddress() {
- String value = null;
- if (getModel() instanceof W11EndPoint) {
- value = ((W11EndPoint) getModel()).getAddress();
- }
-
- if (value == null) {
- value = ""; //$NON-NLS-1$
- }
- return value;
- }
-
- private String getOldProtocol(W11EndPoint endPoint) {
- String value = null;
- value = endPoint.getProtocol();
-
- if (value == null) {
- value = ""; //$NON-NLS-1$
- }
- return value;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ImportSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ImportSection.java
deleted file mode 100644
index b168d54af..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ImportSection.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.properties.sections;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Import;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IImport;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.emf.common.util.URI;
-import org.w3c.dom.Element;
-
-public class ImportSection extends ASDAbstractSection
-{
- protected Text namespaceText, prefixText, locationText;
- private String oldPrefixValue;
- Button button;
- // TODO: Remove: IEditorPart editorPart
- IEditorPart editorPart;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data;
-
- namespaceText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- namespaceText.setEditable(false);
-// namespaceText.addListener(SWT.Modify, this);
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(0, 0);
- namespaceText.setLayoutData(data);
-
- CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_NAMESPACE); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(namespaceText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(namespaceText, 0, SWT.CENTER);
- namespaceLabel.setLayoutData(data);
-
- prefixText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-// prefixText.setEditable(false);
- applyTextListeners(prefixText);
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(namespaceText, +ITabbedPropertyConstants.VSPACE);
- prefixText.setLayoutData(data);
-
- CLabel prefixLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_PREFIX); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(prefixText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(prefixText, 0, SWT.CENTER);
- prefixLabel.setLayoutData(data);
-
- locationText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- locationText.setEditable(false);
-// locationText.addListener(SWT.Modify, this);
-
- CLabel locationLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_LOCATION); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(locationText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(locationText, 0, SWT.CENTER);
- locationLabel.setLayoutData(data);
-
- button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
- button.setImage(WSDLEditorPlugin.getInstance().getImage("icons/browsebutton.gif")); //$NON-NLS-1$
-
- button.addSelectionListener(this);
- data = new FormData();
- data.left = new FormAttachment(100, -rightMarginSpace + 2);
- data.right = new FormAttachment(100,0);
- data.top = new FormAttachment(locationText, 0, SWT.CENTER);
- button.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(button, 0);
- data.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
- locationText.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- setListenerEnabled(false);
- Object obj = getModel();
- boolean refreshPrefixText = true;
- boolean refreshLocationText = true;
- boolean refreshNamespaceText = true;
- if (prefixText.isFocusControl())
- {
- refreshPrefixText = false;
- }
- if (locationText.isFocusControl())
- {
- refreshLocationText = false;
- }
- if (namespaceText.isFocusControl())
- {
- refreshNamespaceText = false;
- }
-
- if (refreshPrefixText)
- {
- prefixText.setText(""); //$NON-NLS-1$
- }
- if (refreshLocationText)
- {
- locationText.setText(""); //$NON-NLS-1$
- }
- if (refreshNamespaceText)
- {
- namespaceText.setText(""); //$NON-NLS-1$
- }
- if (obj instanceof IImport)
- {
- IImport theImport = (IImport) obj;
- if (refreshLocationText)
- {
- String locationValue = theImport.getLocation();
- locationText.setText(locationValue != null ? locationValue : ""); //$NON-NLS-1$
- }
-
- String namespaceValue = theImport.getNamespace();
- if (refreshNamespaceText)
- {
- namespaceText.setText(namespaceValue != null ? namespaceValue : ""); //$NON-NLS-1$
- }
-
- if (refreshPrefixText)
- {
- String prefix = theImport.getNamespacePrefix();
- prefixText.setText(prefix != null ? prefix : ""); //$NON-NLS-1$
- }
- }
- oldPrefixValue = prefixText.getText();
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event) {
- // TODO: We have some WSDL11 Impl specific knowledge below... We should try to remove this...
- if (event.widget == prefixText && locationText.getText().length() > 0 && namespaceText.getText().length() > 0 && getModel() instanceof W11Import) {
- if (oldPrefixValue.equals(prefixText.getText()))
- return;
-
- W11Import w11Import = (W11Import) getModel();
- Import importObj = (Import) w11Import.getTarget();
-// org.w3c.dom.Element importElement = WSDLEditorUtil.getInstance().getElementForObject(importObj);
- Map namespacesMap = importObj.getEnclosingDefinition().getNamespaces();
-
- if (namespacesMap.containsKey(prefixText.getText())) {
- // We should add error messages.........
- // setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_PREFIX_EXISTS"));
- }
- else {
- Element definitionElement = importObj.getEnclosingDefinition().getElement();
- definitionElement.removeAttribute("xmlns:"+oldPrefixValue); //$NON-NLS-1$
- definitionElement.setAttribute("xmlns:" + prefixText.getText(), namespaceText.getText()); //$NON-NLS-1$
-
-// clearErrorMessage();
- oldPrefixValue = prefixText.getText();
- }
- }
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- // TODO: We have some WSDL11 Impl specific knowledge below... We should try to remove this...
- if (e.widget == button && getModel() instanceof W11Import)
- {
- W11Import w11Import = (W11Import) getModel();
-
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(WSDLEditorPlugin.getShell(), null, true);
-
- IFile currentWSDLFile = null;
- IEditorInput editorInput = editor.getEditorInput();
- String [] filters = { "xsd", "wsdl" }; //$NON-NLS-1$ //$NON-NLS-2$
-
- if (editorInput instanceof IFileEditorInput)
- {
- currentWSDLFile = ((IFileEditorInput)editorInput).getFile();
- IFile [] excludedFiles = { currentWSDLFile };
- dialog.addFilterExtensions(filters, excludedFiles);
- }
- else
- {
- IFile [] excludedFiles = { };
- dialog.addFilterExtensions(filters, excludedFiles);
- }
-
- dialog.create();
- dialog.getShell().setText(org.eclipse.wst.wsdl.ui.internal.Messages._UI_TITLE_SELECT); //$NON-NLS-1$
- dialog.setTitle(org.eclipse.wst.wsdl.ui.internal.Messages._UI_TITLE_SELECT_FILE); //$NON-NLS-1$
- dialog.setMessage(org.eclipse.wst.wsdl.ui.internal.Messages._UI_DESCRIPTION_SELECT_WSDL_OR_XSD); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == IDialogConstants.OK_ID)
- {
- IFile selectedFile = dialog.getFile();
-
- //if (selectedFile.getLocation().toOSString().equals(currentWSDLFile.getLocation().toOSString()))
- //{
- // System.out.println("SAME FILE:" + currentWSDLFile.getLocation());
- //}
-
- String location = ComponentReferenceUtil.computeRelativeURI(selectedFile, currentWSDLFile, true);
-
- Import importObj = (Import) w11Import.getTarget();
-// org.w3c.dom.Element importElement = WSDLEditorUtil.getInstance().getElementForObject(importObj);
- Definition definition = importObj.getEnclosingDefinition();
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
-
- String importTargetNamespace = ""; //$NON-NLS-1$
- String prefix = prefixText.getText();
- String uniquePrefix = ""; //$NON-NLS-1$
-
- URI uri = URI.createPlatformResourceURI(selectedFile.getFullPath().toString());
-
- // note that the getTargetNamespaceURIForSchema works for both schema and wsdl files
- // I should change the name of this convenience method
- importTargetNamespace = WSDLEditorUtil.getTargetNamespaceURIForSchema(uri.toString());
-
- if (prefix.trim().equals("")) //$NON-NLS-1$
- {
- uniquePrefix = getUniquePrefix(definition, uri.fileExtension());
- }
- else
- {
- uniquePrefix = prefix;
- }
-
-
- if (importTargetNamespace == null ||
- (importTargetNamespace != null && importTargetNamespace.trim().length() == 0))
- {
- return; // what to do with no namespace docs?
- }
-
- importObj.setLocationURI(location);
- importObj.setNamespaceURI(importTargetNamespace);
- ((ImportImpl) importObj).importDefinitionOrSchema();
-
- definitionElement.setAttribute("xmlns:" + uniquePrefix, importTargetNamespace); //$NON-NLS-1$
-
- namespaceText.setText(importTargetNamespace);
- locationText.setText(location);
- prefixText.setText(uniquePrefix);
- }
- refresh();
- }
- }
-
- private String getUniquePrefix(Definition definition, String initPrefix)
- {
- String uniquePrefix;
- Map map = definition.getNamespaces();
-
- if (definition.getNamespace(initPrefix) == null)
- {
- uniquePrefix = initPrefix;
- }
- else // if used, then try to create a unique one
- {
- String tempPrefix = initPrefix;
- int i = 1;
- while(map.containsKey(tempPrefix + i))
- {
- i++;
- }
- uniquePrefix = tempPrefix + i;
- }
- return uniquePrefix;
- }
-
- // TODO: Remove metod setEditorPart() below
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NameSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NameSection.java
deleted file mode 100644
index ffaa41fe8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NameSection.java
+++ /dev/null
@@ -1,243 +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.asd.properties.sections;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.ImageHyperlink;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.ISelectionMapper;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IMessage;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.INamedObject;
-import org.eclipse.wst.wsdl.ui.internal.refactor.actions.RenameComponentAction;
-
-public class NameSection extends ASDAbstractSection implements IHyperlinkListener {
- CLabel nameLabel;
- protected Text nameText;
- /**
- * Clicking on it invokes the refactor->rename action.
- */
- protected ImageHyperlink renameHyperlink;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
-
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- FormData data;
-
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace);
- data.top = new FormAttachment(0, 0);
- nameText.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText, ASDEditorCSHelpIds.PROPERTIES_NAME_TEXT);
-
- nameLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_NAME + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(nameText, 0, SWT.CENTER);
- nameLabel.setLayoutData(data);
- applyTextListeners(nameText);
- }
-
- private void showRefactorButton() {
- if (isReadOnly) {
- return;
- }
-
- if (renameHyperlink == null) {
- renameHyperlink = getWidgetFactory().createImageHyperlink(composite, SWT.NONE);
-
- renameHyperlink.setImage(WSDLEditorPlugin.getInstance().getImage("icons/quickassist.gif")); //$NON-NLS-1$
- renameHyperlink.setToolTipText(Messages._UI_TOOLTIP_RENAME_REFACTOR);
- renameHyperlink.addHyperlinkListener(this);
- }
-
- FormData data = new FormData();
- data.right = new FormAttachment(100, -rightMarginSpace);
- data.top = new FormAttachment(0, 0);
- renameHyperlink.setLayoutData(data);
-
- data = (FormData) nameText.getLayoutData();
- FormAttachment right = data.right;
- right.control = renameHyperlink;
- right.offset = -ITabbedPropertyConstants.HSPACE;
- right.alignment = SWT.LEFT;
- data.top = new FormAttachment(renameHyperlink, 0, SWT.CENTER);
- renameHyperlink.setVisible(true);
- }
-
- private void hideRefactorButton() {
- if (isReadOnly) {
- return;
- }
-
- if (renameHyperlink == null) {
- return;
- }
- FormData data = (FormData) nameText.getLayoutData();
- FormAttachment right = data.right;
- right.control = null;
- right.numerator = 100;
- right.offset = -rightMarginSpace;
- data.top = new FormAttachment(0, 0);
- renameHyperlink.setVisible(false);
- }
-
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- super.refresh();
- if (nameText.isDisposed() || nameText.isFocusControl()) {
- return;
- }
-
- setListenerEnabled(false);
- String name = null;
- if (getModel() instanceof INamedObject) {
- name = ((INamedObject) getModel()).getName();
- }
- else if (getModel() instanceof EditPart) {
- Object model = ((EditPart) getModel()).getModel();
- name = ((INamedObject) model).getName();
- }
-
- if (name == null) {
- name = ""; //$NON-NLS-1$
- }
-
- nameText.setText(name);
- setControlForegroundColor(nameText);
-
- if (canRefactor()) {
- showRefactorButton();
- }
- else {
- hideRefactorButton();
- }
- setListenerEnabled(true);
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void doHandleEvent(Event event)
- {
- if (event.widget == nameText && !nameText.isDisposed()) {
- String newValue = nameText.getText();
- Object model = getModel();
- INamedObject namedObject = null;
-
- if (model instanceof INamedObject) {
- namedObject = (INamedObject) model;
- }
-
- if (namedObject != null) {
- if ( !newValue.equals( namedObject.getName() ) ){
- Command command = namedObject.getSetNameCommand(newValue);
- executeCommand(command);
- }
- }
- }
- }
-
- private void invokeRenameRefactoring() {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Definition definition = (Definition)editor.getAdapter(Definition.class);
- ISelection selection = editor.getSite().getSelectionProvider().getSelection();
- ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
- selection = mapper != null ? mapper.mapSelection(selection) : selection;
- RenameComponentAction action = new RenameComponentAction(selection, definition);
- action.update(selection);
- action.run();
- }
-
- private Object getRealModel() {
- Object realModel = getModel();
-
- if (realModel instanceof EditPart) {
- realModel = ((EditPart) getModel()).getModel();
- }
-
- return realModel;
- }
-
- /**
- * Determines if the model object's name can be refactored.
- * @return true if the model object can be refactored, false otherwise.
- */
- private boolean canRefactor() {
- Object model = getRealModel();
-
- boolean canRefactor = model instanceof IMessage ||
- model instanceof IBinding ||
- model instanceof IInterface;
- return canRefactor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkActivated(HyperlinkEvent e)
- {
- invokeRenameRefactoring();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkEntered(HyperlinkEvent e)
- {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkExited(HyperlinkEvent e)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NamespaceSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NamespaceSection.java
deleted file mode 100644
index b83cd8266..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/NamespaceSection.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.properties.sections;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
-import org.eclipse.wst.wsdl.ui.internal.adapters.commands.W11EditNamespacesCommand;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDEditNamespacesAction;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IDescription;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.INamedObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.outline.ICategoryAdapter;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesTargetFieldDialog;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonNamespaceInfoTable;
-
-public class NamespaceSection extends ASDAbstractSection {
- protected String targetNamespace;
- protected List namespaceInfoList;
- protected CommonEditNamespacesTargetFieldDialog editWSDLNamespacesControl;
- protected Button button;
-
- Text nameText;
- Text prefixText;
- Text targetNamespaceText;
- protected CommonNamespaceInfoTable tableViewer;
- private boolean handlingEvent;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- String nameString = Messages._UI_LABEL_NAME + ":"; //$NON-NLS-1$ //$NON-NLS-2$
- String prefixString = Messages._UI_LABEL_PREFIX + ":"; //$NON-NLS-1$ //$NON-NLS-2$
- String namespaceString = Messages._UI_LABEL_TARGET_NAMESPACE; //$NON-NLS-1$
- GC gc = new GC(parent);
- int xoffset = Math.max(115, gc.textExtent(nameString).x + 20); // adds 20 due to borders
- xoffset = Math.max(xoffset, gc.textExtent(prefixString).x + 20); // adds 20 due to borders
- xoffset = Math.max(xoffset, gc.textExtent(namespaceString).x + 20); // adds 20 due to borders
- gc.dispose();
-
- // name
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, nameString); //$NON-NLS-1$
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText, ASDEditorCSHelpIds.PROPERTIES_NAME_TEXT);
-
- // prefix
- CLabel prefixLabel = getWidgetFactory().createCLabel(composite, prefixString); //$NON-NLS-1$
- prefixText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(prefixText, ASDEditorCSHelpIds.PROPERTIES_DEF_PREFIX_TEXT);
-
- // targetnamespace
- CLabel targetNamespaceLabel = getWidgetFactory().createCLabel(composite, namespaceString); //$NON-NLS-1$
- targetNamespaceText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(targetNamespaceText, ASDEditorCSHelpIds.PROPERTIES_DEF_TNS_TEXT);
-
- // Advanced button
- button = getWidgetFactory().createButton(composite, Messages._UI_SECTION_ADVANCED_ATTRIBUTES + "...", SWT.PUSH); //$NON-NLS-1$ //$NON-NLS-2$
-
-
- ///////////////////// Labels
- // name layout
- FormData dataNameLabel = new FormData();
- dataNameLabel.top = new FormAttachment(nameText, 0, SWT.CENTER);
- nameLabel.setLayoutData(dataNameLabel);
-
- // prefix layout
- FormData dataPrefixLabel = new FormData();
- dataPrefixLabel.left = new FormAttachment(0, 0);
- dataPrefixLabel.top = new FormAttachment(prefixText, 0, SWT.CENTER);
- prefixLabel.setLayoutData(dataPrefixLabel);
-
- // targetNamespaceLabel layout
- FormData datatnsLabel = new FormData();
- datatnsLabel.left = new FormAttachment(0, 0);
- datatnsLabel.right = new FormAttachment(targetNamespaceText, 0);
- datatnsLabel.top = new FormAttachment(targetNamespaceText, 0, SWT.CENTER);
- targetNamespaceLabel.setLayoutData(datatnsLabel);
-
-
- ///////////////////// Text Fields
- // name text field
- FormData dataNameText = new FormData();
- dataNameText.left = new FormAttachment(0, xoffset);
- dataNameText.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- dataNameText.top = new FormAttachment(0, 0);
- nameText.setLayoutData(dataNameText);
- applyTextListeners(nameText);
-
- // prefix text field
- FormData dataPrefixText = new FormData();
- dataPrefixText.left = new FormAttachment(0, xoffset);
- dataPrefixText.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- dataPrefixText.top = new FormAttachment(nameText, +ITabbedPropertyConstants.VSPACE);
- prefixText.setLayoutData(dataPrefixText);
- applyTextListeners(prefixText);
-
- // targetnamespace text field
- FormData data = new FormData();
- data.left = new FormAttachment(0, xoffset);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
- targetNamespaceText.setLayoutData(data);
- applyTextListeners(targetNamespaceText);
-
- // Advanced button layout
- FormData dataButton = new FormData();
-// dataButton.left = new FormAttachment(100, -rightMarginSpace + 2);
- dataButton.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- dataButton.top = new FormAttachment(targetNamespaceText, +ITabbedPropertyConstants.VSPACE);
-// dataButton.top = new FormAttachment(targetNamespaceText, 0, SWT.CENTER);
- button.setLayoutData(dataButton);
- button.addSelectionListener(this);
- }
-
- public void doHandleEvent(Event event)
- {
- handlingEvent = true;
- Object obj = getDescription();
- if (obj instanceof IDescription) {
- IDescription description = (IDescription) obj;
-
- if (event.widget == nameText) {
- String newName = nameText.getText();
- if (!newName.equals(description.getName())) {
- Command command = description.getSetNameCommand(newName);
- executeCommand(command);
- }
- }
- else if (event.widget == prefixText || event.widget == targetNamespaceText) {
- String newTargetNS = targetNamespaceText.getText();
- String newPrefix = prefixText.getText();
-
- boolean targetNSdiff = !newTargetNS.equals(description.getTargetNamespace());
- boolean prefixDiff = !newPrefix.equals(description.getTargetNamespacePrefix());
- if (targetNSdiff || prefixDiff ) {
- // TODO: The code below is not generic. We need to revisit this to ensure it is
- // generic. IDescription needs a getNamespacesInfo() and getEditNamespacesCommand()...
- W11EditNamespacesCommand command =
- (W11EditNamespacesCommand) ((W11Description) description).getEditNamespacesCommand();
- if (targetNSdiff)
- command.setTargetNamespace(newTargetNS);
- if (prefixDiff)
- command.setTargetNamespacePrefix(newPrefix);
- executeCommand(command);
- }
- }
- }
-
- handlingEvent = false;
- }
-
- protected Object getDescription() {
- Object model = getModel();
- if (model instanceof AbstractModelCollection) {
- model = ((AbstractModelCollection) model).getModel();
- if (model instanceof IDescription) {
- return (IDescription) model;
- }
- }
- else if (model instanceof ICategoryAdapter) {
- return ((ICategoryAdapter) model).getOwnerDescription();
- }
-
- return model;
- }
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
-
- // Set nameText
- if (nameText == null || nameText.isFocusControl()) {
- return;
- }
- setListenerEnabled(false);
- nameText.setText(""); //$NON-NLS-1$
- if (getDescription() instanceof INamedObject) {
- nameText.setText(((INamedObject) getDescription()).getName());
- }
- setListenerEnabled(true);
-
-
- // Set targetNamespaceText and prefixText
- if (targetNamespaceText == null || targetNamespaceText.isFocusControl() || handlingEvent)
- {
- return;
- }
- setListenerEnabled(false);
- Object obj = getDescription();
- if (obj instanceof IDescription)
- {
- IDescription description = (IDescription) obj;
- String targetNS = description.getTargetNamespace();
- String newPrefix = description.getTargetNamespacePrefix();
- prefixText.setText(newPrefix != null ? newPrefix : ""); //$NON-NLS-1$
-
- // set targetnamespace field and prefix field
- if (targetNS != null)
- {
- targetNamespaceText.setText(targetNS);
- }
- else
- {
- targetNamespaceText.setText(""); //$NON-NLS-1$
- }
- if (newPrefix != null)
- {
- prefixText.setText(newPrefix);
- }
- }
- setListenerEnabled(true);
- }
-
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == button) {
- Object obj = getDescription();
- if (obj instanceof IDescription) {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- ASDEditNamespacesAction action = new ASDEditNamespacesAction(part, (IDescription) obj);
- action.run();
- refresh();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ParameterSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ParameterSection.java
deleted file mode 100644
index be88d73b4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ParameterSection.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.properties.sections;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.wsdl.ui.internal.asd.ASDEditorCSHelpIds;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IASDObject;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IParameter;
-import org.eclipse.wst.wsdl.ui.internal.util.ReferenceEditManagerHelper;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-
-public class ParameterSection extends NameSection {
- protected static String NEW_STRING = Messages._UI_BUTTON_NEW; //$NON-NLS-1$
- protected static String BROWSE_STRING = Messages._UI_BUTTON_BROWSE; //$NON-NLS-1$
- protected CLabel comboLabel;
- protected CCombo combo;
- protected boolean handleTypeScenario = true;
- protected ComponentReferenceEditManager parameterRefManager;
-
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- createControlArea();
- }
-
- public void createControlArea()
- {
- FormData data;
-
- combo = getWidgetFactory().createCCombo(composite);
- combo.setBackground(composite.getBackground());
- combo.addListener(SWT.Modify, this);
- combo.addSelectionListener(this);
-
- comboLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_TYPE + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(combo, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(combo, 0, SWT.CENTER);
- comboLabel.setLayoutData(data);
-
-// Button button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
-// button.setImage(InterfaceUIPlugin.getDefault().getImage("icons/obj16/browsebutton.gif")); //$NON-NLS-1$
-//
-// button.addSelectionListener(this);
-// data = new FormData();
-// data.left = new FormAttachment(100, -rightMarginSpace + 2);
-// data.right = new FormAttachment(100, 0);
-// data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-// button.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
-// data.right = new FormAttachment(button, 0);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(nameText, +ITabbedPropertyConstants.VSPACE);
- combo.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- super.refresh();
- if (nameText.isFocusControl()) {
- return;
- }
-
- setListenerEnabled(false);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, ASDEditorCSHelpIds.PROPERTIES_PART_ELEMENT_COMBO);
-
- if (handleTypeScenario) {
- refreshCombo();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, ASDEditorCSHelpIds.PROPERTIES_PART_TYPE_COMBO);
- }
-
- setControlForegroundColor(combo);
-
- setListenerEnabled(true);
- }
-
- protected void refreshCombo() {
- IParameter param = null;
- Object model = getModel();
- setListenerEnabled(false);
-
- if (model instanceof IParameter) {
- param = (IParameter) model;
- }
-
- String name = ""; //$NON-NLS-1$
- String typeName = ""; //$NON-NLS-1$
- if (param != null) {
- name = param.getName();
- typeName = param.getComponentName();
- }
-
- if (!nameText.isFocusControl()) {
- nameText.setText(name);
- }
-
- // Populate the type Combo
- combo.removeAll();
- combo.add(BROWSE_STRING);
- combo.add(NEW_STRING);
-
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null) {
- ComponentSpecification[] specs = editManager.getQuickPicks();
- for (int index = 0; index < specs.length; index++) {
- combo.add((String) specs[index].getName());
- }
-
- specs = editManager.getHistory();
- for (int index = 0; index < specs.length; index++) {
- combo.add((String) specs[index].getName());
- }
- }
-
- // Display the type in the Combo
- String[] items = combo.getItems();
- int index;
- for (index = 0; index < items.length; index++) {
- if (items[index].equals(typeName)) {
- break;
- }
- }
-
- if (index < items.length) {
- // Found a match
- combo.select(index);
- }
- else {
- combo.setText(typeName);
- }
-
- setListenerEnabled(true);
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void handleEvent(Event event)
- {
- if (event.widget == combo) {
- if (isListenerEnabled() && !isInDoHandle)
- {
- isInDoHandle = true;
- startDelayedEvent(event);
- isInDoHandle = false;
- }
- }
- else {
- super.handleEvent(event);
- }
- }
-
- public void doHandleEvent(Event event)
- {
- super.doHandleEvent(event);
- if (event.widget == combo && handleTypeScenario) {
- handleComboSelection();
- refresh();
- }
- }
-
- protected void handleComboSelection() {
- String value = combo.getItem(combo.getSelectionIndex());
-
- IParameter parameter = (IParameter) this.getModel();
-
- if (value.equals(NEW_STRING)) {
- Command command = parameter.getSetTypeCommand(IParameter.SET_NEW_ACTION_ID);
- command.execute();
- }
- else if (value.equals(BROWSE_STRING)) {
- Command command = parameter.getSetTypeCommand(IParameter.SELECT_EXISTING_ACTION_ID);
- command.execute();
- }
- else {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- ComponentSpecification spec = getComponentSpecificationForValue((String)value);
- if (spec != null) {
- editManager.modifyComponentReference(parameter, spec);
- }
- }
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager() {
- if (parameterRefManager != null) {
- return parameterRefManager;
- }
- if (getModel() instanceof IASDObject)
- {
- parameterRefManager = ReferenceEditManagerHelper.getXSDTypeReferenceEditManager((IASDObject) getModel());
- }
- else
- {
- System.out.println("model" + getModel()); //$NON-NLS-1$
- }
- return parameterRefManager;
- }
-
- // TODO: rmah: This code should live in a common place..... This code is also used in other UI scenarios when
- // a similar combo box is used. For example in Direct Edit...(TypeReferenceDirectEditManager) Also used in the XSDEditor...
- protected ComponentSpecification getComponentSpecificationForValue(String value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ReferenceSection.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ReferenceSection.java
deleted file mode 100644
index 1722ddf52..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/properties/sections/ReferenceSection.java
+++ /dev/null
@@ -1,138 +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.asd.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
-
-public abstract class ReferenceSection extends NameSection {
- public static String BROWSE_STRING = Messages._UI_BUTTON_BROWSE; //$NON-NLS-1$
- public static String NEW_STRING = Messages._UI_BUTTON_NEW; //$NON-NLS-1$
- protected CCombo combo;
- protected CLabel comboLabel;
-
- protected List itemsInCombo = new ArrayList();
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- FormData data;
-
- // Create Combo row of widgets
- comboLabel = getWidgetFactory().createCLabel(composite, "Reference"); //$NON-NLS-1$
- combo = getWidgetFactory().createCCombo(composite);
- combo.setBackground(composite.getBackground());
-
- // Layout Combo Label
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(combo, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(combo, 0, SWT.CENTER);
- comboLabel.setLayoutData(data);
-
- // Layout Combo
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(nameText, +ITabbedPropertyConstants.VSPACE);
- combo.setLayoutData(data);
-
- combo.addListener(SWT.Modify, this);
- }
-
- public void handleEvent(Event event)
- {
- if (event.widget == combo) {
- if (isListenerEnabled() && !isInDoHandle)
- {
- isInDoHandle = true;
- startDelayedEvent(event);
- isInDoHandle = false;
- }
- }
- else {
- super.handleEvent(event);
- }
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- combo.removeListener(SWT.Modify, this);
-
- super.refresh();
-
- List comboItems = getComboItems();
- if (comboItems.size() > 0) {
- combo.removeAll();
- itemsInCombo.clear();
-
- // We need to populate this combo with the available references
- // TODO: rmah: We should include the prefix as well
- String currentComboItemName = getComboItemName(getCurrentComboItem());
- int currentBindingIndex = -1;
-
- List items = getComboItems();
- for (int index = 0; index < items.size(); index++) {
- Object item = items.get(index);
- String itemName = getComboItemName(item);
- combo.add(itemName);
- itemsInCombo.add(item);
-
- if (itemName.equals(currentComboItemName)) {
- currentBindingIndex = index;
- }
- }
-
- if (currentBindingIndex != -1) {
- combo.select(currentBindingIndex);
- }
- }
-
- setControlForegroundColor(combo);
- combo.addListener(SWT.Modify, this);
- }
-
- protected abstract List getComboItems();
- protected abstract Object getCurrentComboItem();
- protected abstract String getComboItemName(Object item);
- protected abstract void performComboSelection(Object item);
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void doHandleEvent(Event event)
- {
- super.doHandleEvent(event);
- if (event.widget == combo && !combo.isDisposed()) {
- int selectionIndex = combo.getSelectionIndex();
- performComboSelection(itemsInCombo.get(selectionIndex));
- refresh();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/ASDEditPartFactoryHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/ASDEditPartFactoryHelper.java
deleted file mode 100644
index 389b559f2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/ASDEditPartFactoryHelper.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.asd.util;
-
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.ASDEditPartFactory;
-
-/**
- * @depracated
- */
-public class ASDEditPartFactoryHelper {
- private static ASDEditPartFactoryHelper instance;
-
- private EditPartFactory editPartFactory;
-
- public static ASDEditPartFactoryHelper getInstance() {
- if (instance == null) {
- instance = new ASDEditPartFactoryHelper();
- }
-
- return instance;
- }
-
- public EditPartFactory getEditPartFactory() {
- if (editPartFactory == null) {
- editPartFactory = new ASDEditPartFactory();
- }
- return editPartFactory;
- }
-
- public void setEditPartFactory(EditPartFactory factory) {
- editPartFactory = factory;
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object adapter = editor.getAdapter(GraphicalViewer.class);
- if (adapter instanceof DesignViewGraphicalViewer) {
- ((DesignViewGraphicalViewer) adapter).setEditPartFactory(factory);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/EndPointComparator.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/EndPointComparator.java
deleted file mode 100644
index bf9a3ab6e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/EndPointComparator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.util;
-
-import java.util.Comparator;
-
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IBinding;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IEndPoint;
-import org.eclipse.wst.wsdl.ui.internal.asd.facade.IInterface;
-
-public class EndPointComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- if (o1 instanceof IEndPoint && o2 instanceof IEndPoint) {
- IBinding binding1 = ((IEndPoint) o1).getBinding();
- IBinding binding2 = ((IEndPoint) o2).getBinding();
-
- if (binding1 != null && binding2 != null) {
- IInterface interface1 = binding1.getInterface();
- IInterface interface2 = binding2.getInterface();
-
- if (interface1 != null && interface2 != null) {
- String name1 = interface1.getName();
- String name2 = interface2.getName();
- return name1.compareTo(name2);
- }
-
- return doNullComparison(interface1, interface2);
- }
-
- return doNullComparison(binding1, binding2);
- }
-
- return doNullComparison(o1, o2);
- }
-
- private int doNullComparison(Object o1, Object o2) {
- if (o1 != null && o2 == null) {
- return -1;
- }
- else if (o1 == null && o2 != null) {
- return 1;
- }
-
- return 0;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/IOpenExternalEditorHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/IOpenExternalEditorHelper.java
deleted file mode 100644
index 8ba3df411..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/util/IOpenExternalEditorHelper.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.asd.util;
-
-public interface IOpenExternalEditorHelper {
- public void setModel(Object object);
- public void openExternalEditor();
- public boolean linkApplicable();
- public boolean isValid();
- public void showPreview();
-}
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
deleted file mode 100644
index ecfc73d5d..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/WSDLComponentRenameParticipant.java
+++ /dev/null
@@ -1,43 +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.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"; //$NON-NLS-1$
- }
-}
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
deleted file mode 100644
index 0939528e2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/RenameComponentAction.java
+++ /dev/null
@@ -1,204 +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.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.swt.widgets.Display;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.common.ui.internal.dialogs.SaveDirtyFilesDialog;
-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.DefinitionImpl;
-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) {
-
- boolean rc = SaveDirtyFilesDialog.saveDirtyFiles();
- if (!rc)
- {
- return;
- }
- 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)
- {
- public boolean performFinish()
- {
- // TODO Auto-generated method stub
- boolean rc = super.performFinish();
- //((DefinitionImpl)getDefinition()).reconcileReferences(true);
- return rc;
- }
-
- };
- RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
- wizard);
- op.run(WSDLEditorPlugin.getShell(), wizard
- .getDefaultPageTitle());
- triggerBuild();
-
- Display.getCurrent().asyncExec(new Runnable()
- {
- public void run()
- {
- ((DefinitionImpl)getDefinition()).reconcileReferences(true);
- }
- });
-
- } catch (InterruptedException e) {
- // do nothing. User action got cancelled
- }
-
- if (getModel() instanceof DefinitionImpl) {
- ((DefinitionImpl) getModel()).reconcileReferences(true);
- }
- }
-
- 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
deleted file mode 100644
index cd4a71692..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorActionGroup.java
+++ /dev/null
@@ -1,46 +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.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
deleted file mode 100644
index 3d580dcde..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLRefactorGroupActionDelegate.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.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.ui.ide.FileStoreEditorInput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.ISelectionMapper;
-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();
- IEditorInput editorInput = editor.getEditorInput();
- boolean shouldFillMenu = editor != null && (editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput);
- if (shouldFillMenu)
- {
- ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
- ISelection selection = mapper != null ? mapper.mapSelection(fSelection) : fSelection;
- Definition definition = (Definition) editor.getAdapter(Definition.class);
- if (definition != null)
- {
- RefactorActionGroup refactorMenuGroup = new WSDLRefactorActionGroup(selection, definition);
- RefactorGroupSubMenu subMenu = new RefactorGroupSubMenu(refactorMenuGroup);
- subMenu.fill(menu, -1);
- }
- }
- }
- }
-} \ No newline at end of file
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
deleted file mode 100644
index a80f6344c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/refactor/actions/WSDLSelectionDispatchAction.java
+++ /dev/null
@@ -1,39 +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.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
deleted file mode 100644
index 236c5c710..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/IWSDLSearchConstants.java
+++ /dev/null
@@ -1,34 +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.search;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-
-public interface IWSDLSearchConstants {
-
- public static final String WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/"; //$NON-NLS-1$
- public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
-
- public static String WSDL_CONTENT_TYPE_ID = "org.eclipse.wst.wsdl.wsdlsource"; //$NON-NLS-1$
-
- public static final QualifiedName MESSAGE_META_NAME = new QualifiedName(
- WSDL_NAMESPACE, "message"); //$NON-NLS-1$
-
- public static final QualifiedName PORT_TYPE_META_NAME = new QualifiedName(
- WSDL_NAMESPACE, "portType"); //$NON-NLS-1$
-
- public static final QualifiedName BINDING_META_NAME = new QualifiedName(
- WSDL_NAMESPACE, "binding"); //$NON-NLS-1$
-
-
-
-}
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
deleted file mode 100644
index fcd230ed8..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchContributor.java
+++ /dev/null
@@ -1,77 +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.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"); //$NON-NLS-1$ //$NON-NLS-2$
- declarations.put(IWSDLSearchConstants.MESSAGE_META_NAME, pattern);
-
- pattern = new XMLSearchPattern( ns, "portType", "name"); //$NON-NLS-1$ //$NON-NLS-2$
- declarations.put(IWSDLSearchConstants.PORT_TYPE_META_NAME, pattern);
-
- pattern = new XMLSearchPattern(ns, "binding", "name"); //$NON-NLS-1$ //$NON-NLS-2$
- 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")); //$NON-NLS-1$ //$NON-NLS-2$
- references.put(IXSDSearchConstants.ELEMENT_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern(ns, "part", "type")); //$NON-NLS-1$ //$NON-NLS-2$
- references.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern(ns, "part", "type")); //$NON-NLS-1$ //$NON-NLS-2$
- references.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern(ns, "input", "message")); //$NON-NLS-1$ //$NON-NLS-2$
- patterns.add(new XMLSearchPattern(ns, "output", "message")); //$NON-NLS-1$ //$NON-NLS-2$
- patterns.add(new XMLSearchPattern(ns, "fault", "message")); //$NON-NLS-1$ //$NON-NLS-2$
- references.put(IWSDLSearchConstants.MESSAGE_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern(ns, "binding", "type")); //$NON-NLS-1$ //$NON-NLS-2$
- references.put(IWSDLSearchConstants.PORT_TYPE_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern( ns, "port", "binding")); //$NON-NLS-1$ //$NON-NLS-2$
- 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
deleted file mode 100644
index 1025523e0..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-refactor/org/eclipse/wst/wsdl/ui/internal/search/WSDLSearchParticipant.java
+++ /dev/null
@@ -1,130 +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.search;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-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"; //$NON-NLS-1$
- private static String XSD_PARTICIPANNT_ID = "org.eclipse.wst.xsd.search.XSDSearchParticipant"; //$NON-NLS-1$
-
-
- public WSDLSearchParticipant()
- {
- super();
- id = ID;
- }
-
- public String[] getSupportedContentTypes()
- {
- String[] result = { "org.eclipse.wst.wsdl.wsdlsource" }; //$NON-NLS-1$
- return result;
- }
-
- public boolean isApplicable(SearchPattern pattern, Map searchOptions)
- {
- 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, Map searchOptions) {
-
- super.beginSearching(pattern, searchOptions);
- 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/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesAction.java
deleted file mode 100644
index 381c744a4..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesAction.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.actions;
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.core.search.scope.WorkspaceSearchScope;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Binding;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Interface;
-import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Message;
-import org.eclipse.wst.wsdl.ui.internal.search.IWSDLSearchConstants;
-import org.eclipse.wst.xsd.ui.internal.editor.ISelectionMapper;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-import org.eclipse.wst.xsd.ui.internal.search.actions.FindAction;
-
-public class WSDLFindReferencesAction extends FindAction
-{
- private WSDLBaseAdapter component;
- private IFile file;
- private QualifiedName[] names;
-
- public WSDLFindReferencesAction(IEditorPart editor)
- {
- super(editor);
- init();
- }
-
- protected void init() {
- component = getWSDLNamedComponent();
- file = getCurrentFile();
- names = determineMetaAndQualifiedName(component);
- if (file == null || component == null || names == null)
- setEnabled(false);
- }
-
- public void setActionDefinitionId(String string)
- {
- }
-
- /**
- * To be used by subclass in its run() Returns the file where the selection of
- * a component (from the user) occurs ie. Returns the file that the user is
- * currently working on.
- *
- * @return The IFile representation of the current working file.
- */
- protected IFile getCurrentFile()
- {
- if (editor != null)
- {
- IEditorInput input = editor.getEditorInput();
- if (input instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) input;
- return fileEditorInput.getFile();
- }
- }
- return null;
- }
-
- /**
- * To be used by subclass in its run().. Determines the metaName of the WSDL
- * component given to this method.
- *
- * @param component
- * The component of which we want to determine the name
- * @return
- * The first one is for MetaName/Type, second for ElementQualifiedName
- */
- protected QualifiedName[] determineMetaAndQualifiedName(WSDLBaseAdapter component)
- {
- QualifiedName names[] = null;
- QName qName;
- if (component instanceof W11Message )
- {
- names = new QualifiedName[2];
- names[0] = IWSDLSearchConstants.MESSAGE_META_NAME;
- qName = ((Message) component.getTarget()).getQName();
- names[1] = new QualifiedName(qName.getNamespaceURI(), qName.getLocalPart());
- }
- else if (component instanceof W11Interface)
- {
- names = new QualifiedName[2];
- names[0] = IWSDLSearchConstants.PORT_TYPE_META_NAME;
- qName = ((PortType) component.getTarget()).getQName();
- names[1] = new QualifiedName(qName.getNamespaceURI(), qName.getLocalPart());
- }
- else if (component instanceof W11Binding)
- {
- names = new QualifiedName[2];
- names[0] = IWSDLSearchConstants.BINDING_META_NAME;
- qName = ((Binding) component.getTarget()).getQName();
- names[1] = new QualifiedName(qName.getNamespaceURI(), qName.getLocalPart());
-
- }
- return names;
- }
-
- protected WSDLBaseAdapter getWSDLNamedComponent()
- {
- if (editor != null)
- {
- ISelectionProvider provider = (ISelectionProvider) editor.getAdapter(ISelectionProvider.class);
- ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
- if (provider != null)
- {
- ISelection selection = provider.getSelection();
- if (mapper != null)
- {
- selection = mapper.mapSelection(selection);
- }
- if (selection != null && selection instanceof IStructuredSelection)
- {
- IStructuredSelection s = (IStructuredSelection) selection;
- Object o = s.getFirstElement();
- if (o != null && o instanceof WSDLBaseAdapter)
- {
- return (WSDLBaseAdapter) o;
- }
- }
- }
- }
- // The expected component we get from the editor does not meet
- // our expectation
- return null;
- }
-
- public void run()
- {
- String pattern = ""; //$NON-NLS-1$
- if (file != null && component != null && names != null)
- {
- SearchScope scope = new WorkspaceSearchScope();
- String scopeDescription = "Workspace";
- XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, names[1],
- names[0], XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
- NewSearchUI.activateSearchResultView();
- NewSearchUI.runQueryInBackground(searchQuery);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInProjectAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInProjectAction.java
deleted file mode 100644
index 5d840f037..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInProjectAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.ProjectSearchScope;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-
-public class WSDLFindReferencesInProjectAction extends WSDLFindReferencesAction{
- public WSDLFindReferencesInProjectAction(IEditorPart editor)
- {
- super(editor);
- }
-
- public void run()
- {
- String pattern = ""; //$NON-NLS-1$
- WSDLBaseAdapter component = getWSDLNamedComponent();
- IFile file = getCurrentFile();
- QualifiedName[] names = determineMetaAndQualifiedName(component);
- if (file != null && component != null && names != null)
- {
- IPath fullPath = file.getFullPath();
- ProjectSearchScope scope = new ProjectSearchScope(fullPath);
- String scopeDescription = "Project";
- XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, names[1],
- names[0], XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
- NewSearchUI.activateSearchResultView();
- NewSearchUI.runQueryInBackground(searchQuery);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInWorkingSetAction.java b/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInWorkingSetAction.java
deleted file mode 100644
index 7d93d7a1c..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLFindReferencesInWorkingSetAction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.window.Window;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.WorkingSetSearchScope;
-import org.eclipse.wst.wsdl.ui.internal.adapters.WSDLBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-
-public class WSDLFindReferencesInWorkingSetAction extends WSDLFindReferencesAction{
-
- public WSDLFindReferencesInWorkingSetAction(IEditorPart editor) {
- super(editor);
- }
-
- public void run(){
- IWorkingSet[] workingSets = queryWorkingSets();
- if ( workingSets == null || workingSets.length == 0)
- // The user chooses nothing, no point to continue.
- return;
- String pattern = ""; //$NON-NLS-1$
-
- WSDLBaseAdapter component = getWSDLNamedComponent();
- IFile file = getCurrentFile();
- QualifiedName[] names = determineMetaAndQualifiedName(component);
- if ( file != null && component != null){
- // Create a scope from the selected working sets
- WorkingSetSearchScope scope = new WorkingSetSearchScope();
- for (int i = 0; i < workingSets.length; i++){
- IAdaptable[] elements = workingSets[i].getElements();
- scope.addAWorkingSetToScope(elements);
- }
-
- String scopeDescription = "Working Set";
- XSDSearchQuery searchQuery =
- new XSDSearchQuery(pattern, file, names[1], names[0], XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
- NewSearchUI.activateSearchResultView();
- NewSearchUI.runQueryInBackground(searchQuery);
- }
- }
-
- /**
- * Calls a dialog asking the user to choose the working Sets he wants
- * to do the search on
- * @return
- */
- public static IWorkingSet[] queryWorkingSets(){
- Shell shell= XSDEditorPlugin.getShell();
- if (shell == null)
- return null;
- IWorkingSetSelectionDialog dialog =
- PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true);
- if (dialog.open() == Window.OK) {
- IWorkingSet[] workingSets= dialog.getSelection();
- if (workingSets.length > 0)
- return workingSets;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLReferencesSearchGroup.java b/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLReferencesSearchGroup.java
deleted file mode 100644
index 6ef6fe0bb..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLReferencesSearchGroup.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.actions;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.search.SearchMessages;
-import org.eclipse.wst.xsd.ui.internal.search.actions.ReferencesSearchGroup;
-
-public class WSDLReferencesSearchGroup extends ReferencesSearchGroup {
- /**
- * Note: This constructor is for internal use only. Clients should not call this constructor.
- * @param editor
- */
- public WSDLReferencesSearchGroup(IEditorPart editor) {
- super(editor);
- }
-
- protected void initialize() {
-// fGroupId= ITextEditorActionConstants.GROUP_FIND;
-
- fFindReferencesAction= new WSDLFindReferencesAction(fEditor);
- fFindReferencesAction.setText(SearchMessages.Search_FindDeclarationAction_label);
- fFindReferencesAction.setActionDefinitionId("SEARCH_REFERENCES_IN_WORKSPACE"); //$NON-NLS-1$
- //fEditor.setAction("SearchReferencesInWorkspace", fFindReferencesAction); //$NON-NLS-1$
-
- fFindReferencesInProjectAction= new WSDLFindReferencesInProjectAction(fEditor);
- fFindReferencesInProjectAction.setText(SearchMessages.Search_FindDeclarationsInProjectAction_label);
- fFindReferencesInProjectAction.setActionDefinitionId("SEARCH_REFERENCES_IN_PROJECT"); //$NON-NLS-1$
- //fEditor.setAction("SearchReferencesInProject", fFindReferencesInProjectAction); //$NON-NLS-1$
-
- fFindReferencesInWorkingSetAction= new WSDLFindReferencesInWorkingSetAction(fEditor);
- fFindReferencesInWorkingSetAction.setText(SearchMessages.Search_FindDeclarationsInWorkingSetAction_label);
- fFindReferencesInWorkingSetAction.setActionDefinitionId(".SEARCH_REFERENCES_IN_WORKING_SET"); //$NON-NLS-1$
- //fEditor.setAction("SearchReferencesInWorkingSet", fFindReferencesInWorkingSetAction); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLSearchReferencesGroupActionDelegate.java b/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLSearchReferencesGroupActionDelegate.java
deleted file mode 100644
index 55fc2095a..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-search/org/eclipse/wst/wsdl/ui/internal/search/actions/WSDLSearchReferencesGroupActionDelegate.java
+++ /dev/null
@@ -1,46 +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.search.actions;
-
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.wst.xsd.ui.internal.search.actions.BaseGroupActionDelegate;
-import org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchGroupSubMenu;
-
-public class WSDLSearchReferencesGroupActionDelegate extends BaseGroupActionDelegate
-{
- protected void fillMenu(Menu menu) {
- try
- {
- if (fSelection == null) {
- return;
- }
- if (workbenchPart != null)
- {
- IWorkbenchPartSite site = workbenchPart.getSite();
- if (site == null)
- return;
-
- IEditorPart editor = site.getPage().getActiveEditor();
- if ( editor != null ){
- WSDLReferencesSearchGroup referencesGroup = new WSDLReferencesSearchGroup(editor);
- XSDSearchGroupSubMenu subMenu = new XSDSearchGroupSubMenu(referencesGroup);
- subMenu.fill(menu, -1);
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/Messages.java b/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/Messages.java
deleted file mode 100644
index b71c21717..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/Messages.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.soap.customizations;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.wsdl.ui.internal.soap.customizations.messages"; //$NON-NLS-1$
-
- public static String UI_SPECIFY_PARTS_DIALOG_TITLE;
- public static String UI_PARTS_BUTTON;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPNodeEditorProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPNodeEditorProvider.java
deleted file mode 100644
index 69669104e..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPNodeEditorProvider.java
+++ /dev/null
@@ -1,96 +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.soap.customizations;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.binding.soap.SOAPBody;
-import org.eclipse.wst.wsdl.ui.internal.util.NodeAssociationManager;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.DialogNodeEditorConfiguration;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeEditorConfiguration;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeEditorProvider;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class is provided as an example of how a NodeEditorProvider can utilize the WSDL model if required
- * (and is not limited to the DOM model). It's hope that potential adopters can provide feedback and open
- * bugs where they find support is lacking or inconvenient.
- */
-public class SOAPNodeEditorProvider extends NodeEditorProvider
-{
- public NodeEditorConfiguration getNodeEditorConfiguration(String parentName, String nodeName)
- {
- // TODO (cs) this extension is only designed to work when used via the WSDL Editor context.
- // Reuse from other context is possible too if the editor provides the appropriate 'getAdapter' behaviour.
- // We need to revisit this and get more feedback from adopters to see if different approach is required
- // in order to obtain a WSDL model.
-// /
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- final Definition definition = (Definition)editor.getAdapter(Definition.class);
- if (definition != null)
- {
- if (parentName.equals("body") && nodeName.equals("parts")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- // gee... this case sounds sorta morbid eh?
- //
- return new DialogNodeEditorConfiguration()
- {
- public void invokeDialog()
- {
- Node parentNode = getParentNode();
- if (parentNode instanceof Element)
- {
- Element element = (Element)getParentNode();
-
- // TODO (cs) I think we should push this function down to the WSDL model (ala XSD model)
- //
- NodeAssociationManager nodeAssociationManager = new NodeAssociationManager();
- Object o = nodeAssociationManager.getModelObjectForNode(definition, element);
- if (o instanceof SOAPBody)
- {
- SOAPSelectPartsDialog dialog = new SOAPSelectPartsDialog(Display.getCurrent().getActiveShell(), definition, (SOAPBody)o);
- dialog.create();
- dialog.getShell().setText(Messages.UI_SPECIFY_PARTS_DIALOG_TITLE); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == Dialog.OK)
- {
- String value = ""; //$NON-NLS-1$
- Part[] parts = dialog.getSelectedParts();
- for (int i = 0; i < parts.length; i++)
- {
- Part part = parts[i];
- value += part.getName();
- value += " "; //$NON-NLS-1$
- }
-
- // TODO (cs) we need to provide 'command' support so that we can handle undo properly
- //
- element.setAttribute("parts", value); //$NON-NLS-1$
- }
- }
- }
- }
- public String getButonText()
- {
- return Messages.UI_PARTS_BUTTON; //$NON-NLS-1$
- }
- };
- }
- }
- return null;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPSelectPartsDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPSelectPartsDialog.java
deleted file mode 100644
index d1de0e2e9..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/SOAPSelectPartsDialog.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 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.soap.customizations;
-
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.binding.soap.SOAPBody;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-
-public class SOAPSelectPartsDialog extends Dialog
-{
- Definition definition;
- SOAPBody body;
- CheckboxTreeViewer checkList;
- Part[] selectedParts = {};
-
- public SOAPSelectPartsDialog(Shell parentShell, Definition definition, SOAPBody body)
- {
- super(parentShell);
- this.definition = definition;
- this.body = body;
- }
-
- protected Control createDialogArea(Composite parent)
- {
- Composite composite = (Composite)super.createDialogArea(parent);
- checkList = new CheckboxTreeViewer(composite, SWT.NONE);
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.heightHint = 100;
- gridData.widthHint = 200;
- checkList.getControl().setLayoutData(gridData);
- checkList.setContentProvider(new InternalTreeContentProvider());
- checkList.setLabelProvider(new InternalLabelProvider());
- checkList.setInput(""); //$NON-NLS-1$
-
- List list = body.getParts();
- checkList.setCheckedElements(list.toArray());
- return composite;
- }
-
- protected void okPressed()
- {
- Object[] checked = checkList.getCheckedElements();
- selectedParts = new Part[checked.length];
- for (int i = 0; i < checked.length; i++)
- {
- selectedParts[i] = (Part)checked[i];
- }
- super.okPressed();
- }
-
-
- class InternalLabelProvider extends LabelProvider
- {
- public String getText(Object element)
- {
- Part part = (Part)element;
- return part.getName();
- }
-
- public Image getImage(Object element)
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/part_obj.gif"); //$NON-NLS-1$
- }
- }
-
- class InternalTreeContentProvider implements ITreeContentProvider
- {
- public Object[] getElements(Object inputElement)
- {
- EObject container = body.eContainer();
- MessageReference messageReference = null;
- if (container instanceof BindingInput)
- {
- messageReference = ComponentReferenceUtil.computeInput((BindingInput)container);
- }
- else if (container instanceof BindingOutput)
- {
- messageReference = ComponentReferenceUtil.computeOutput((BindingOutput)container);
- }
- if (messageReference != null && messageReference.getEMessage() != null)
- {
- return messageReference.getEMessage().getEParts().toArray();
- }
- return Collections.EMPTY_LIST.toArray();
- }
-
- public Object[] getChildren(Object parentElement)
- {
- return Collections.EMPTY_LIST.toArray();
- }
-
- public Object getParent(Object element)
- {
- return null;
- }
-
- public boolean hasChildren(Object element)
- {
- return false;
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
- }
-
- public Part[] getSelectedParts()
- {
- return selectedParts;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/messages.properties b/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/messages.properties
deleted file mode 100644
index 943fa8eb2..000000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src-soap/org/eclipse/wst/wsdl/ui/internal/soap/customizations/messages.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-UI_SPECIFY_PARTS_DIALOG_TITLE=Specify Parts
-UI_PARTS_BUTTON=...

Back to the top