diff options
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs')
6 files changed, 0 insertions, 1007 deletions
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 77a78cc30..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, 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 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.getString("_UI_REGEN_BINDINDS_ON_SAVE"); // TODO: Translations needed.... //$NON-NLS-1$ - private static String dialogMessage = Messages.getString("_UI_REGEN_BINDINGS_ON_SAVE_QUESTIONMARK"); //$NON-NLS-1$ - private static String[] buttons = new String[]{Messages.getString("_UI_YES_LABEL"), Messages.getString("_UI_NO_LABEL"), Messages.getString("_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.getString("_UI_REMEMBER_MY_DECISION_LABEL")); // TODO: Externalize... //$NON-NLS-1$ - 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.getString("_UI_PREF_PAGE_PROMPT_REGEN_BINDING_ON_SAVE"), false); //$NON-NLS-1$ - - String generateID = Messages.getString("_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 a4cdacfc3..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/NewComponentDialog.java +++ /dev/null @@ -1,186 +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.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; - -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.getString("_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("error message goes here"); - 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.getString("_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 a38b47d1a..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/ProtocolComponentControl.java +++ /dev/null @@ -1,340 +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.ArrayList; -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.part.PageBook; -import org.eclipse.wst.wsdl.internal.generator.BaseGenerator; -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.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(); - - // List of ContentGenerators for each Protocol found in protocolCombo - protected List contentGenerators; - - //protected boolean isBindingComponent = true; - //protected boolean isNewComponent = true; - protected String name; - protected String refName; - - protected String UNSPECIFIED = Messages.getString("_UI_UNSPECIFIED"); //$NON-NLS-1$ - //protected BindingGenerator bindingGenerator; - - public ProtocolComponentControl(Composite parent, BaseGenerator generator, boolean showOverwriteButton) - { - super(parent, SWT.NONE); - this.generator = generator; - contentGenerators = new ArrayList(); - - 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); - //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); - - //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.getString("_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); - //createPlaceHolder(labelValueComposite); - - // optional overwrite button - // - if (showOverwriteButton) - { - overwriteButton = new Button(this, SWT.CHECK); - overwriteButton.setText(Messages.getString("_UI_CHECKBOX_OVERWRITE")); //$NON-NLS-1$ - overwriteButton.addSelectionListener(this); - } - - // 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(generator.getProtocol()); - } - - public Text getComponentNameField() - { - return componentNameField; - } - - public String getComponentNameLabelText() - { - return Messages.getString("_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; - } - -// private Control createPlaceHolder(Composite parent) -// { -// Label label = new Label(parent, SWT.NONE); -// return label; -// } - public BaseGenerator getGenerator() - { - return generator; - } - - // implements SelectionListener - // - public void widgetDefaultSelected(SelectionEvent event) - { - } - - public void widgetSelected(SelectionEvent event) - { - if (event.widget == overwriteButton && overwriteButton != null) - { - getGenerator().setOverwrite(overwriteButton.getSelection()); - } - else if (event.widget == refNameCombo) - { - int index = refNameCombo.getSelectionIndex(); - String refName = refNameCombo.getItem(index); - if (refName.equals(UNSPECIFIED)) { - getGenerator().setRefName(""); //$NON-NLS-1$ - } - else { - getGenerator().setRefName(refName); - } - } - else if (event.widget == protocolCombo) - { - int index = protocolCombo.getSelectionIndex(); - String protocol = (index != -1) ? protocolCombo.getItem(index) : null; - getGenerator().setContentGenerator((ContentGenerator) contentGenerators.get(index)); - 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(getGenerator()); - Control control = page.createControl(pageBook); - control.setData(IS_OVERWRITE_APPLICABLE, new Boolean(page.isOverwriteApplicable())); - pageMap.put(protocol, page); - } - -// if (page != null) -// { -// 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(); - - List list = new ArrayList(); - list.add(UNSPECIFIED); -// list.addAll(WSDLEditorPlugin.getInstance().getContentGeneratorExtensionRegistry().getBindingExtensionNames()); - list.addAll(ContentGeneratorExtensionFactoryRegistry.getInstance().getBindingExtensionNames()); - - String protocolText = generator.getProtocol(); - - for (Iterator i = list.iterator(); i.hasNext();) - { - String protocol = (String) i.next(); - protocolCombo.add(protocol); - - if (protocol.equals(UNSPECIFIED)) { - contentGenerators.add(null); - } - else { - ContentGenerator gen = ContentGeneratorExtensionFactoryRegistry.getInstance().getGeneratorClassFromName(protocol); - contentGenerators.add(gen); - } - } - - if (protocolText == null && protocolCombo.getItemCount() > 0) - { - protocolText = protocolCombo.getItem(0); -// generator.setProtocol(!UNSPECIFIED.equals(protocolText) ? protocolText : null); - } - protocolCombo.setText(protocolText); - - ContentGenerator gen = ContentGeneratorExtensionFactoryRegistry.getInstance().getGeneratorClassFromName(protocolText); - generator.setContentGenerator(gen); - } - - 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(); - 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 b83e517fa..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11BrowseComponentDialog.java +++ /dev/null @@ -1,139 +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 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) { - // TODO Auto-generated method stub - - } - - 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.getString("_UI_LABEL_NAME_FILTER")); - configuration.setDescriptionProvider(descriptionProvider); - configuration.setSearchListProvider(searchListProvider); - - String dialogTitle = Messages.getString("_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.getString("_UI_LABEL_NAME_FILTER")); - configuration.setDescriptionProvider(descriptionProvider); - configuration.setSearchListProvider(searchListProvider); - //configuration.setNewComponentHandler(new NewTypeButtonHandler()); - - String dialogTitle = Messages.getString("_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.getString("_UI_LABEL_NAME_FILTER")); - configuration.setDescriptionProvider(descriptionProvider); - configuration.setSearchListProvider(searchListProvider); - //configuration.setNewComponentHandler(new NewTypeButtonHandler()); - - String dialogTitle = Messages.getString("_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 a041c6b89..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/dialogs/W11NewComponentDialog.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.dialogs; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Notifier; -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.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.ASDEditorPlugin; -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.getString("_UI_LABEL_NEW_BINDING"); //$NON-NLS-1$ - String baseName = NameUtil.buildUniqueBindingName(getDefinition(), "NewBinding"); //$NON-NLS-1$ - dialog = new NewComponentDialog(shell, dialogTitle, baseName); - } - else if (qualifiedName == IWSDLSearchConstants.PORT_TYPE_META_NAME) { - String dialogTitle = Messages.getString("_UI_LABEL_NEW_PORTTYPE"); //$NON-NLS-1$ - String baseName = NameUtil.buildUniquePortTypeName(getDefinition(), "NewPortType"); //$NON-NLS-1$ - dialog = new NewComponentDialog(shell, dialogTitle, baseName); - } - else if (qualifiedName == IWSDLSearchConstants.MESSAGE_META_NAME) { - String dialogTitle = Messages.getString("_UI_LABEL_NEW_MESSAGE"); //$NON-NLS-1$ - String baseName = NameUtil.buildUniqueMessageName(getDefinition(), "NewMessage"); //$NON-NLS-1$ - dialog = new NewComponentDialog(shell, dialogTitle, baseName); - } - - } - - 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()); - CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class); - stack.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()); - CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class); - stack.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()); - CommandStack stack = (CommandStack) ASDEditorPlugin.getActiveEditor().getAdapter(CommandStack.class); - stack.execute(command); - - Object newWSDLObject = command.getNewMessage(); - newObject = (IASDObject) WSDLAdapterFactoryHelper.getInstance().adapt((Notifier) newWSDLObject); - } - } - - return rValue; - } -} |