diff options
Diffstat (limited to 'bundles/org.eclipse.jst.ws.ui')
30 files changed, 0 insertions, 3109 deletions
diff --git a/bundles/org.eclipse.jst.ws.ui/.classpath b/bundles/org.eclipse.jst.ws.ui/.classpath deleted file mode 100644 index cb0105380..000000000 --- a/bundles/org.eclipse.jst.ws.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src/"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.jst.ws.ui/.cvsignore b/bundles/org.eclipse.jst.ws.ui/.cvsignore deleted file mode 100644 index 1d99ec986..000000000 --- a/bundles/org.eclipse.jst.ws.ui/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -bin -build.xml -temp.folder -ws-ui.jar -@dot -src.zip diff --git a/bundles/org.eclipse.jst.ws.ui/.project b/bundles/org.eclipse.jst.ws.ui/.project deleted file mode 100644 index 17ef9ac85..000000000 --- a/bundles/org.eclipse.jst.ws.ui/.project +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.jst.ws.ui</name> - <comment></comment> - <projects> - <project>org.eclipse.wst.command.env</project> - <project>org.eclipse.wst.command.env.core</project> - <project>org.eclipse.jst.ws</project> - </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.jst.ws.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.ui/META-INF/MANIFEST.MF deleted file mode 100644 index f5cefbc03..000000000 --- a/bundles/org.eclipse.jst.ws.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,32 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %PLUGIN_NAME -Bundle-SymbolicName: org.eclipse.jst.ws.ui; singleton:=true -Bundle-Version: 1.0.0 -Bundle-Activator: org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin -Bundle-Vendor: %PLUGIN_PROVIDER -Bundle-Localization: plugin -Export-Package: org.eclipse.jst.ws.internal.ui.action, - org.eclipse.jst.ws.internal.ui.common, - org.eclipse.jst.ws.internal.ui.dialog, - org.eclipse.jst.ws.internal.ui.plugin, - org.eclipse.jst.ws.internal.ui.preferences, - org.eclipse.jst.ws.internal.ui.uddi, - org.eclipse.jst.ws.internal.ui -Require-Bundle: org.eclipse.wst.command.env, - org.eclipse.wst.command.env.ui, - org.eclipse.wst.command.env.core, - org.eclipse.jst.ws, - org.eclipse.jdt.core, - org.eclipse.jdt.ui, - org.eclipse.ui.ide, - org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.emf.ecore, - org.eclipse.jem.util, - org.eclipse.wst.server.core, - org.eclipse.jst.j2ee, - org.eclipse.wst.ws.explorer, - org.eclipse.jst.j2ee.core -Eclipse-AutoStart: true diff --git a/bundles/org.eclipse.jst.ws.ui/about.html b/bundles/org.eclipse.jst.ws.ui/about.html deleted file mode 100644 index 6f6b96c4c..000000000 --- a/bundles/org.eclipse.jst.ws.ui/about.html +++ /dev/null @@ -1,22 +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"> -<h2>About This Content</h2> - -<p>February 24, 2005</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/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</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.</p> - -</body> -</html>
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.ui/build.properties b/bundles/org.eclipse.jst.ws.ui/build.properties deleted file mode 100644 index e1dec33b5..000000000 --- a/bundles/org.eclipse.jst.ws.ui/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/ -bin.includes = .,\ - icons/,\ - plugin.properties,\ - plugin.xml,\ - META-INF/,\ - about.html diff --git a/bundles/org.eclipse.jst.ws.ui/icons/jar_obj.gif b/bundles/org.eclipse.jst.ws.ui/icons/jar_obj.gif Binary files differdeleted file mode 100644 index 152f4f2b3..000000000 --- a/bundles/org.eclipse.jst.ws.ui/icons/jar_obj.gif +++ /dev/null diff --git a/bundles/org.eclipse.jst.ws.ui/plugin.properties b/bundles/org.eclipse.jst.ws.ui/plugin.properties deleted file mode 100644 index bf5d6cf21..000000000 --- a/bundles/org.eclipse.jst.ws.ui/plugin.properties +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2004 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -# -# Messages in plugin.xml. -# -PLUGIN_NAME=Web Services Graphical User Interface -PLUGIN_PROVIDER=Eclipse.org - -PLUGIN_NEW_CATEGORY_NAME_WS=Web Services - -# -# Web Services Preferance Pages -# -# Categories -PREFERENCE_CATEGORY_RESOURCE_MANAGEMENT=Resource Management - -# -# WS-I Preference pages -# -# WS-I Compliance Page -# -PREFERENCE_CATEGORY_WSI=WS-I Compliance - -# -# Popup action Category -# -LABEL_POPUP_CATEGORY_WEB_SERVICES=Web Services - -# -# Messages for popup action (Test with Web Services Explorer) -# -POPUP_TEST_WSDL=Test with Web Services Explorer - - - - - - - diff --git a/bundles/org.eclipse.jst.ws.ui/plugin.xml b/bundles/org.eclipse.jst.ws.ui/plugin.xml deleted file mode 100644 index 375662aaf..000000000 --- a/bundles/org.eclipse.jst.ws.ui/plugin.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> - -<plugin> - - <extension - point="org.eclipse.ui.newWizards"> - <category - name="%PLUGIN_NEW_CATEGORY_NAME_WS" - id="org.eclipse.jst.ws.ui.new"> - </category> - </extension> - - <extension - point="org.eclipse.ui.preferencePages"> - - <page - name="%PREFERENCE_CATEGORY_RESOURCE_MANAGEMENT" - category="org.eclipse.wst.ws.internal.ui.preferences.name" - class="org.eclipse.jst.ws.internal.ui.preferences.ResourceManagmentPreferencePage" - id="org.eclipse.jst.ws.internal.ui.preferences.ResourceManagmentPreferencePage"> - </page> - - </extension> - - <extension - point="org.eclipse.ui.propertyPages"> - - - - </extension> - - <extension - point="org.eclipse.ui.popupMenus"> - - <objectContribution - objectClass="org.eclipse.core.resources.IResource" - adaptable="true" - id="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu"> - <menu - label="%LABEL_POPUP_CATEGORY_WEB_SERVICES" - path="additions" - id="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu"> - <separator - name="popupActions"> - </separator> - </menu> - </objectContribution> - - - <objectContribution - objectClass="org.eclipse.jst.j2ee.ejb.EnterpriseBean" - adaptable="true" - id="org.eclipse.jst.ws.atk.ui.webservice.category.ejb.popupMenu"> - <menu - label="%LABEL_POPUP_CATEGORY_WEB_SERVICES" - path="additions" - id="org.eclipse.jst.ws.atk.ui.webservice.category.ejb.popupMenu"> - <separator - name="popupActions"> - </separator> - </menu> - </objectContribution> - - - <objectContribution - objectClass="org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef" - nameFilter="*" - id="org.eclipse.jst.ws.internal.consumption.ui.action.WSDLFileMenu"> - <action - label="%POPUP_TEST_WSDL" - class="org.eclipse.wst.ws.internal.explorer.popup.PopupTestWSDL" - menubarPath="additions" - id="org.eclipse.wst.ws.internal.explorer.popup.PopupTestWSDL"> - </action> - </objectContribution> - </extension> - -</plugin> diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/WSUIPlugin.properties b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/WSUIPlugin.properties deleted file mode 100644 index 21d64a1fb..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/WSUIPlugin.properties +++ /dev/null @@ -1,105 +0,0 @@ -############################################################################### -# Copyright (c) 2004 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -# -# Messages in plugin.xml. -# -PLUGIN_NAME=Web Services Graphical User Interface -PLUGIN_VENDOR=Eclipse.org -PLUGIN_DESC=\ -The Web services GUI plugin delivers the graphical \ -user interface to the Web services function of the \ -Web services plugin. - -PLUGIN_NEW_CATEGORY_NAME_WS=Web Services - -# -# Web Services Preferance Pages -# -# Categories -PREFERENCE_CATEGORY_RESOURCE_MANAGEMENT=Resource Management -PREFERENCE_CATEGORY_CODE_GENERATION=Code Generation -PREFERENCE_CATEGORY_SCENARIO_DEFAULTS=Scenario Defaults -PREFERENCE_CATEGORY_PROJECT_TOPOLOGY=Project Topology -PREFERENCE_CATEGORY_DRIVER_JARS=JDBC drivers - -# -#Scenario Defaults -BUTTON_LAUNCH_SAMPLE=Launch the sample when generated -LABEL_MOVE_UP=Move up -LABEL_MOVE_DOWN=Move down - -# -# Preferences Tooltips -# - -#Scenario Defaults -TOOLTIP_PPSD_PAGE=Set the defaults for the Web service scenarios. -TOOLTIP_PPSD_CHECKBOX_LAUNCH_SAMPLE=Launch the sample application after generation. -TOOLTIP_CLIENT_TYPE_TABLE_VIEWER=Preferred order of the list of client types -TOOLTIP_MOVE_UP=Move the selected client type up the list -TOOLTIP_MOVE_DOWN=Move the selected client type down the list - -# -# Resource Managment -TOOLTIP_PPRM_PAGE=Set preferences that control resources used/generated by the Web service. -TOOLTIP_PPRM_CHECKBOX_OVERWRITE_FILES=Overwrite files without warning. -TOOLTIP_PPRM_CHECKBOX_CREATE_FOLDERS=Create folders when necessary. -TOOLTIP_PPRM_CHECKBOX_CHECK_OUT=Check out files without warning. -BUTTON_CREATE_FOLDERS=Create folders when necessary -BUTTON_OVERWRITE_FILES=Overwrite files without warning -BUTTON_CHECKOUT_FILES=Check out files without warning - -# -# General messages. -# -ISTATUS_WITHOUT_EXCEPTION={0} -ISTATUS_WITH_EXCEPTION={0}\nException: {1} -MSG_INFO_SAVED_STATUS=IWAB0297I Press the Details button to see informational messages. - -# -# TypeSelectionDialog -# -DIALOG_TITLE_CLASS_BROWSE=Browse Classes -DIALOG_TITLE_INTERFACE_BROWSE=Browse Interfaces - -# -# Common wizard strings. -# -LABEL_SAMPLE_TYPES=Java proxy sample - -# -# ResourceSelectionDialog -# -DIALOG_TITLE_RESOURCE_BROWSE=Browse Files -LABEL_RESOURCE_FILTER=Filter: - -# -# Tooltips for dialog.ResourceSelectionDialog -# DRES=Dialog/RESources -# -TOOLTIP_DRES_COMBO_RESOURCE_TYPE=Type of resources to browse. -TOOLTIP_DRES_TREE_RESOURCE=Resources available for selection. - -# -# Messages for project topology preference page -# -TOOLTIP_PTPP_PAGE=Preference that control the project topology of your Web service and client scenarios. -TOOLTIP_ENABLE_TWO_EARS=Enable this option if you want to generate your Web service and Web service client in different EAR projects. - -LABEL_ENABLE_TWO_EARS=Generate Web service and Web service client in different EAR projects -LABEL_CLIENT_TYPE_NAME=Client type: - -# -# Resource Browser -# -DIALOG_TITLE_RESOURCE_BROWSER=Resource browser -TOOLTIP_RESOURCE_TREE=Choose a resource. diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/WSUIPluginMessages.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/WSUIPluginMessages.java deleted file mode 100644 index 7f57583f9..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/WSUIPluginMessages.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui; - -import org.eclipse.osgi.util.NLS; - -public final class WSUIPluginMessages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.jst.ws.internal.ui.WSUIPlugin";//$NON-NLS-1$ - - private WSUIPluginMessages() { - // Do not instantiate - } - - public static String PLUGIN_NAME; - public static String PLUGIN_VENDOR; - public static String PLUGIN_DESC; - public static String PLUGIN_NEW_CATEGORY_NAME_WS; - public static String PREFERENCE_CATEGORY_RESOURCE_MANAGEMENT; - public static String PREFERENCE_CATEGORY_CODE_GENERATION; - public static String PREFERENCE_CATEGORY_SCENARIO_DEFAULTS; - public static String PREFERENCE_CATEGORY_PROJECT_TOPOLOGY; - public static String PREFERENCE_CATEGORY_DRIVER_JARS; - public static String BUTTON_LAUNCH_SAMPLE; - public static String LABEL_MOVE_UP; - public static String LABEL_MOVE_DOWN; - public static String TOOLTIP_PPSD_PAGE; - public static String TOOLTIP_PPSD_CHECKBOX_LAUNCH_SAMPLE; - public static String TOOLTIP_CLIENT_TYPE_TABLE_VIEWER; - public static String TOOLTIP_MOVE_UP; - public static String TOOLTIP_MOVE_DOWN; - public static String TOOLTIP_PPRM_PAGE; - public static String TOOLTIP_PPRM_CHECKBOX_OVERWRITE_FILES; - public static String TOOLTIP_PPRM_CHECKBOX_CREATE_FOLDERS; - public static String TOOLTIP_PPRM_CHECKBOX_CHECK_OUT; - public static String BUTTON_CREATE_FOLDERS; - public static String BUTTON_OVERWRITE_FILES; - public static String BUTTON_CHECKOUT_FILES; - public static String ISTATUS_WITHOUT_EXCEPTION; - public static String ISTATUS_WITH_EXCEPTION; - public static String MSG_INFO_SAVED_STATUS; - public static String DIALOG_TITLE_CLASS_BROWSE; - public static String DIALOG_TITLE_INTERFACE_BROWSE; - public static String LABEL_SAMPLE_TYPES; - public static String DIALOG_TITLE_RESOURCE_BROWSE; - public static String LABEL_RESOURCE_FILTER; - public static String TOOLTIP_DRES_COMBO_RESOURCE_TYPE; - public static String TOOLTIP_DRES_TREE_RESOURCE; - public static String TOOLTIP_PTPP_PAGE; - public static String TOOLTIP_ENABLE_TWO_EARS; - public static String LABEL_ENABLE_TWO_EARS; - public static String LABEL_CLIENT_TYPE_NAME; - public static String DIALOG_TITLE_RESOURCE_BROWSER; - public static String TOOLTIP_RESOURCE_TREE; - - static { - NLS.initializeMessages(BUNDLE_NAME, WSUIPluginMessages.class); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/LaunchImportWizardAction.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/LaunchImportWizardAction.java deleted file mode 100644 index 9597ab97b..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/LaunchImportWizardAction.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui.action; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.IActionDelegate; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.command.internal.env.ui.widgets.DynamicWizard; - - -/** - * This class launches the import wizard. - */ -public class LaunchImportWizardAction implements IActionDelegate -{ - private IStructuredSelection selection_; - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run(IAction action) - { - DynamicWizard wizard = new DynamicWizard(); - - try - { - wizard.setInitialData( "wsimport" ); - wizard.init( PlatformUI.getWorkbench(), selection_ ); - } - catch( CoreException exc ) - { - // Do nothing. - return; - } - - WizardDialog dialog= new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard); - dialog.setPageSize( 500, 400 ); - dialog.create(); - dialog.open(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) - { - if( selection instanceof IStructuredSelection ) - { - selection_ = (IStructuredSelection)selection; - } - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeploy.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeploy.java deleted file mode 100644 index e8d48b71f..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeploy.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.action; -import org.eclipse.core.resources.IResource; - - -public interface WebServiceDeploy { - public void run(IResource selection); -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeployAction.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeployAction.java deleted file mode 100644 index a1db9cbbc..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeployAction.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.action; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jst.ws.internal.common.ServerUtils; - -public class WebServiceDeployAction extends WindowActionDelegate { -public void run(org.eclipse.jface.action.IAction action) { - - IProject project = getSelectedResourceProject(); - - String [] typeIds = ServerUtils.getServerTypeIdsByModule(project); - Object theAction = null; - - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] elements = reg.getConfigurationElementsFor("org.eclipse.jst.ws.ui", "webservicedeploy"); - try { - - if (typeIds == null || typeIds.length <= 0) - { - // that means the module is not attached to a server then pick the first extension found - theAction = elements[0].createExecutableExtension("class"); - } - else if ( typeIds.length == 1) - { - // that means the module is attached to one server then finds it id and a matchin extension or give a message - for (int i = 0; i < elements.length; i++) - { - String id = elements[i].getAttribute("factoryId"); - if ( typeIds[0].equals(id)) - { - theAction = elements[i].createExecutableExtension("class"); - break; - } - } - if (theAction == null ) - { - // give a message - } - } - else - { - // The module is attached to more than one server find the first server-extension couple - // TBD: add a dialog to choose the server for deployment - for (int i = 0; i < elements.length; i++) - { - String id = elements[i].getAttribute("factoryId"); - for ( int k=0; k< typeIds.length; k++) - { - if ( typeIds[k].equals(id)) - { - theAction = elements[i].createExecutableExtension("class"); - break; - } - } - if (theAction != null) break; - } - if (theAction == null) - { - // give a Message - } - } - - if (theAction instanceof WebServiceDeploy) - ((WebServiceDeploy)theAction).run(project); - } - - catch (Exception e) {} -} -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WindowActionDelegate.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WindowActionDelegate.java deleted file mode 100644 index 837e28409..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WindowActionDelegate.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.action; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; - - -public abstract class WindowActionDelegate implements IWorkbenchWindowActionDelegate { -protected IStructuredSelection fSelection; - -public WindowActionDelegate() { - super(); - } - -public void dispose() - { - } - -public void init(org.eclipse.ui.IWorkbenchWindow window) { } - -public void selectionChanged(org.eclipse.jface.action.IAction action, - org.eclipse.jface.viewers.ISelection selection) { - if (selection instanceof IStructuredSelection) - fSelection = (IStructuredSelection) selection; - } - -public void setSelection(IStructuredSelection selection) { - fSelection = selection; -} -public IStructuredSelection getSelection() { - return fSelection; -} - -public IProject getSelectedResourceProject() { - IProject project = null; - IResource resource_ = null; - try { - if (fSelection != null && fSelection.size() == 1) { - Object obj = fSelection.getFirstElement(); - - if (obj != null) { - if ( obj instanceof IResource) - { - resource_ = (IResource) obj; - } - else if (obj instanceof ICompilationUnit) - { - ICompilationUnit compUnit = (ICompilationUnit)obj; - resource_= compUnit.getCorrespondingResource(); - } - else if (obj instanceof IJavaProject) { - project = ((IJavaProject) obj).getProject(); - } - - else if (obj instanceof EObject) { - project = ProjectUtilities.getProject((EObject) obj); - } - - if ( resource_ != null ) - project = resource_.getProject(); - - } - } - } - catch (Exception e) {} - return project; - } - -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/DialogResourceBrowser.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/DialogResourceBrowser.java deleted file mode 100644 index 6d25ca1ea..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/DialogResourceBrowser.java +++ /dev/null @@ -1,218 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.common; - -import java.util.Iterator; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.viewers.DecoratingLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.jst.ws.internal.ui.WSUIPluginMessages; -import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin; -import org.eclipse.swt.SWT; -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.swt.widgets.Tree; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** -* This class provides a dialog for browsing workspace resources. -*/ -public class DialogResourceBrowser extends Dialog -{ - private final String INFOPOP_RESOURCE_TREE = WebServiceUIPlugin.ID + ".DRES0001"; - - private IResource root_; - private IFilter[] filters_; - private boolean multipleSelectionEnabled_; - private IResource[] selection_; - private Tree resourceTree_; - private TreeViewer fileViewer_; - - public DialogResourceBrowser(Shell shell, IResource root, IFilter filter) - { - this(shell, root, new IFilter[]{filter}); - } - - /** - * Constructs a new <code>DialogResourceBrowser</code> - * under the given <code>parent Shell</code>. - * The dialog renders all resources including and - * under the given <code>root IResource</code> - * @param parent The parent {@link org.eclipse.swt.widgets.Shell}. - * or null to create a top-level shell. - * @param root The root {@link org.eclipse.core.resources.IResource}, - * or null to begin with the workspace root. - * @param filters An array of java.lang.String - */ - public DialogResourceBrowser(Shell shell, IResource root, IFilter[] filters) - { - super(shell); - - IResource moduleRoot = root; - if (root instanceof IProject) - { - IProject p = (IProject)moduleRoot; - - moduleRoot = p; - - } - - root_ = (moduleRoot == null) ? ResourcesPlugin.getWorkspace().getRoot() : moduleRoot; - filters_ = (filters == null) ? new IFilter[0] : filters; - multipleSelectionEnabled_ = false; - setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL); - } - - /** - * Enables or disables multiple selection in the tree view. - * Multiple selection is disabled by default. - * @param multipleSelectionEnabled True to enabled or false to disable. - */ - public void setMultipleSelectionEnabled(boolean multipleSelectionEnabled) - { - multipleSelectionEnabled_ = multipleSelectionEnabled; - } - - /** - * Returns the selections made in the dialog if OK was pressed, - * or null if Cancel was pressed. Returns null if the dialog - * has never been opened. - * @return An array of selected resources, possibly empty, possibly null. - */ - public IResource[] getSelection() - { - return selection_; - } - - public IResource getFirstSelection() - { - if (selection_ != null && selection_.length > 0) - return selection_[0]; - else - return null; - } - - /** - * Called when the Cancel button is pressed. - * Insures that {@link #getResult} will return null. - */ - protected void cancelPressed() - { - selection_ = null; - setReturnCode(Dialog.CANCEL); - super.cancelPressed(); - } - - /** - * Called when the OK button is pressed. - * Squirrels away the list of zero or more selected - * <code>IResource</code>s to be returned by {@link #getResult}. - */ - protected void okPressed() - { - ISelection selection = fileViewer_.getSelection(); - if (selection instanceof IStructuredSelection) - { - IStructuredSelection structuredSelection = (IStructuredSelection)selection; - selection_ = new IResource[structuredSelection.size()]; - int i = 0; - Iterator it = structuredSelection.iterator(); - while (it.hasNext()) - { - Object object = it.next(); - if (object instanceof IResource) - selection_[i++] = (IResource)object; - } - } - setReturnCode(Dialog.OK); - super.okPressed(); - } - - /** - * See {@link org.eclipse.jface.window.Window#configureShell}. - * @param shell The shell. - */ - protected void configureShell(Shell shell) - { - super.configureShell(shell); - shell.setText(WSUIPluginMessages.DIALOG_TITLE_RESOURCE_BROWSER); - } - - /** - * Creates the dialog area. - * @param parent The parent composite. - * @return The control area. - */ - protected Control createDialogArea(Composite parent) - { - Composite composite = (Composite)super.createDialogArea(parent); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL); - gd.widthHint = 400; - gd.heightHint = 300; - gd.grabExcessVerticalSpace = true; - gd.grabExcessHorizontalSpace = true; - composite.setLayoutData(gd); - - if (multipleSelectionEnabled_) - { - resourceTree_ = new Tree(composite,SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - } - else - { - resourceTree_ = new Tree(composite,SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - } - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL); - gd.grabExcessVerticalSpace = true; - gd.grabExcessHorizontalSpace = true; - resourceTree_.setLayoutData(gd); - resourceTree_.setToolTipText(WSUIPluginMessages.TOOLTIP_RESOURCE_TREE); - PlatformUI.getWorkbench().getHelpSystem().setHelp(resourceTree_, INFOPOP_RESOURCE_TREE); - - fileViewer_ = new TreeViewer(resourceTree_); - fileViewer_.setContentProvider(new WorkbenchContentProvider()); - fileViewer_.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), WebServiceUIPlugin.getInstance().getWorkbench().getDecoratorManager().getLabelDecorator())); - fileViewer_.addFilter( - new ViewerFilter() - { - public boolean select(Viewer viewer, Object parentObject, Object object) - { - if ((object instanceof IResource) && ((IResource)object).getType() != IResource.FILE) - return true; - else - { - for (int i = 0; i < filters_.length; i++) - { - if (filters_[i].accepts(object)) - return true; - } - return false; - } - } - } - ); - fileViewer_.setInput(root_); - return composite; - } - -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/FileExtensionFilter.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/FileExtensionFilter.java deleted file mode 100644 index ed355c40d..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/FileExtensionFilter.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.common; - -import org.eclipse.core.resources.IFile; - -/** -* This is the interface for a class of objects that filter -* other objects for inclusion or exclusion by some consumer. -*/ -public class FileExtensionFilter implements IFilter -{ - private String[] extensions_; - - public FileExtensionFilter(String[] extensions) - { - extensions_ = (extensions != null) ? extensions : new String[0]; - } - - /** - * Returns the locale-specific name of this filter. - * @return The locale-specific name of this filter. - */ - public String getName() - { - return "org.eclipse.jst.ws.atk.ui.editor.common.FileExtensionFilter"; - } - - /** - * Returns the locale-specific description of this filter. - * @return The locale-specific description of this filter. - */ - public String getDescription() - { - return "org.eclipse.jst.ws.atk.ui.editor.common.FileExtensionFilter"; - } - - /** - * Returns true if and only if this <code>Filter</code> - * accepts the given <code>object</code>. This method - * must return true if and only if {@link #statusOf} - * returns an <code>IStatus</code> with a severity of - * less than <code>IStatus.ERROR</code>. - * @param object The object to filter. - * @return True if and only if this <code>Filter</code> - * accepts the given <code>object</code>. - */ - public boolean accepts(Object object) - { - if (object instanceof IFile) - { - IFile file = (IFile)object; - for (int i = 0; i < extensions_.length; i++) - { - if (file.getFileExtension() != null && file.getFileExtension().equals(extensions_[i])) - return true; - } - } - return false; - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/IFilter.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/IFilter.java deleted file mode 100644 index 2e5db8b50..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/IFilter.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.common; - -/** -* This is the interface for a class of objects that filter -* other objects for inclusion or exclusion by some consumer. -*/ -public interface IFilter -{ - /** - * Returns the locale-specific name of this filter. - * @return The locale-specific name of this filter. - */ - public String getName(); - - /** - * Returns the locale-specific description of this filter. - * @return The locale-specific description of this filter. - */ - public String getDescription(); - - /** - * Returns true if and only if this <code>Filter</code> - * accepts the given <code>object</code>. This method - * must return true if and only if {@link #statusOf} - * returns an <code>IStatus</code> with a severity of - * less than <code>IStatus.ERROR</code>. - * @param object The object to filter. - * @return True if and only if this <code>Filter</code> - * accepts the given <code>object</code>. - */ - public boolean accepts(Object object); -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/UIUtils.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/UIUtils.java deleted file mode 100644 index 1497e855f..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/UIUtils.java +++ /dev/null @@ -1,209 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui.common; - -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.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.PlatformUI; - - -public class UIUtils -{ - String infoPopid_; - - public UIUtils( String infoPopid ) - { - infoPopid_ = infoPopid; - } - - public Button createRadioButton( Composite parent, String labelName, String tooltip, String infopop ) - { - return createButton( SWT.RADIO, parent, labelName, tooltip, infopop ); - } - - public Button createCheckbox( Composite parent, String labelName, String tooltip, String infopop ) - { - return createButton( SWT.CHECK, parent, labelName, tooltip, infopop ); - } - - public Button createPushButton( Composite parent, String labelName, String tooltip, String infopop ) - { - return createButton( SWT.NONE, parent, labelName, tooltip, infopop ); - } - - public Button createButton( int kind, Composite parent, String labelName, String tooltip, String infopop ) - { - Button button = new Button( parent, kind ); - - tooltip = tooltip == null ? labelName : tooltip; - button.setText( labelName ); - button.setToolTipText( tooltip ); - - if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp( button, infoPopid_ + "." + infopop ); - - return button; - } - - public Combo createCombo( Composite parent, String labelName, String tooltip, String infopop, int style ) - { - tooltip = tooltip == null ? labelName : tooltip; - - if( labelName != null ) - { - Label label = new Label( parent, SWT.WRAP); - label.setText( labelName ); - label.setToolTipText( tooltip ); - } - - Combo combo = new Combo( parent, style ); - GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - - combo.setLayoutData( griddata ); - combo.setToolTipText( tooltip ); - - if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp( combo, infoPopid_ + "." + infopop ); - - return combo; - } - - public Text createText( Composite parent, String labelName, String tooltip, String infopop, int style ) - { - tooltip = tooltip == null ? labelName : tooltip; - - if( labelName != null ) - { - Label label = new Label( parent, SWT.WRAP); - label.setText( labelName ); - label.setToolTipText( tooltip ); - } - - Text text = new Text( parent, style ); - GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - - text.setLayoutData( griddata ); - text.setToolTipText( tooltip); - - if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp( text, infoPopid_ + "." + infopop ); - - return text; - } - - public Composite createComposite( Composite parent, int columns ) - { - return createComposite( parent, columns, -1, -1 ); - } - - public Composite createComposite( Composite parent, int columns, int marginHeight, int marginWidth ) - { - Composite composite = new Composite( parent, SWT.NONE ); - - GridLayout gridlayout = new GridLayout(); - gridlayout.numColumns = columns; - - if( marginHeight >= 0 ) gridlayout.marginHeight = marginHeight; - if( marginWidth >= 0 ) gridlayout.marginWidth = marginWidth; - - composite.setLayout( gridlayout ); - GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - composite.setLayoutData( griddata ); - - return composite; - - } - public Group createGroup( Composite parent, String groupName, String tooltip, String infopop ) - { - return createGroup( parent, groupName, tooltip, infopop, 1, -1, -1 ); - } - - public Group createGroup( Composite parent, String groupName, String tooltip, String infopop, int columns, int marginHeight, int marginWidth ) - { - Group newGroup = new Group( parent, SWT.NONE ); - GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - GridLayout gridlayout = new GridLayout(); - - gridlayout.numColumns = columns; - - if( marginHeight >= 0 ) gridlayout.marginHeight = marginHeight; - if( marginWidth >= 0 ) gridlayout.marginWidth = marginWidth; - - tooltip = tooltip == null ? groupName : tooltip; - newGroup.setLayout( gridlayout ); - newGroup.setText( groupName ); - newGroup.setLayoutData( griddata ); - newGroup.setToolTipText( tooltip ); - - if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp(newGroup, infoPopid_ + "." + infopop); - - return newGroup; - } - - public Tree createTree( Composite parent, String tooltip, String infopop, int style ) - { - - tooltip = tooltip == null ? "" : tooltip; - - Tree tree = new Tree( parent, style ); - - tree.setLayoutData( createFillAll() ); - tree.setToolTipText( tooltip); - - if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp( tree, infoPopid_ + "." + infopop ); - - return tree; - - } - - public Table createTable( Composite parent, String tooltip, String infopop, int style ) - { - - tooltip = tooltip == null ? "" : tooltip; - - Table table = new Table( parent, style ); - - //table.setLayoutData( createFillAll() ); - table.setToolTipText( tooltip); - - if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp( table, infoPopid_ + "." + infopop ); - - return table; - - } - - public Label createHorizontalSeparator( Composite parent, int spacing ) - { - Composite composite = createComposite( parent, 1, spacing, -1 ); - - Label separator = new Label( composite, SWT.SEPARATOR | SWT.HORIZONTAL ); - - GridData griddata = new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL ); - separator.setLayoutData( griddata ); - - return separator; - } - - public GridData createFillAll() - { - GridData data = new GridData( GridData.HORIZONTAL_ALIGN_FILL | - GridData.GRAB_HORIZONTAL | - GridData.VERTICAL_ALIGN_FILL | - GridData.GRAB_VERTICAL ); - return data; - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/DialogUtils.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/DialogUtils.java deleted file mode 100644 index 1472a56e4..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/DialogUtils.java +++ /dev/null @@ -1,244 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.dialog; - -import java.util.Vector; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.search.IJavaSearchScope; -import org.eclipse.jdt.core.search.SearchEngine; -import org.eclipse.jdt.ui.IJavaElementSearchConstants; -import org.eclipse.jdt.ui.JavaUI; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.jface.wizard.IWizardContainer; -import org.eclipse.jst.ws.internal.common.Filter; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.ui.WSUIPluginMessages; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.ContainerSelectionDialog; -import org.eclipse.ui.dialogs.SelectionDialog; - - -/** -* Contains utility methods for launching various common dialogs. -*/ -public final class DialogUtils -{ - - /** - * Raises a dialog for browsing containers. - * @param parentShell The parent shell, optionally null. - * @param initialPathname The initial selection. - * @return The selected container or null if the dialog - * is cancelled, or there is no selection, or the selection - * is not a project or a folder. - */ - public static String browseContainers ( Shell parentShell, String initialPathname ) - { - String selectedPathname = null; - IPath initialPath = new Path(initialPathname); - IResource initialResource = ResourceUtils.getWorkspaceRoot().findMember(initialPath); - if (initialResource == null) - { - if (initialPath.segmentCount() == 1) - { - initialResource = ResourceUtils.getWorkspaceRoot().getProject(initialPath.segment(0)); - } - else if (initialPath.segmentCount() > 1) - { - initialResource = ResourceUtils.getWorkspaceRoot().getFolder(initialPath); - } - } - else - { - if (initialResource.getType() == IResource.FILE) - { - initialResource = initialResource.getParent(); - } - } - ContainerSelectionDialog dialog = new ContainerSelectionDialog(parentShell,(IContainer)initialResource,true,null); - dialog.open(); - Object[] result = dialog.getResult(); - if (result != null && result.length > 0) - { - if (result[0] instanceof IPath) - { - IPath path = (IPath)result[0]; - selectedPathname = path.toString(); - } - } - return selectedPathname; - } - - /** - * Raises a dialog for browsing resources. - * @param parentShell The parent shell, optionally null. - * @param topResource The resource under which to browse. - * If null, all resources in the workspace are browsed. - * @param initialSelection The initial selection, or null for none. - * If the initial selection is not null and exists in the set of - * resources found by the browser, that resource is selected by default. - * @param filter The resource filter object. - * @return The selected resource. - */ - public static IResource browseResources ( Shell parentShell, IResource topResource, IResource initialSelection, Filter filter) - { - ResourceSelectionDialog rds = new ResourceSelectionDialog(parentShell,topResource,initialSelection,filter); - rds.setMultipleSelectionEnabled(false); - if (rds.open() == Dialog.OK) - { - IResource[] resources = rds.getResult(); - if (resources != null && resources.length > 0) - { - return resources[0]; - } - } - return null; - } - - /** - * <b>Implementation remains TBD.</b><br> - * Raises a dialog for browsing classes on a project's class path. - * @param parentShell The parent shell, optionally null. - * @param project The project. - * @return The qualified name of the selected java class. - */ - public static String browseClasses ( Shell parentShell, IProject project ) - { - return browseClasses(parentShell, project, (IRunnableContext)null); - } - - public static String browseClasses ( Shell parentShell, IProject project, IWizardContainer container) - { - return browseClasses(parentShell, project, (IRunnableContext)container); - } - - /** - * Raises a dialog for browsing classes on a project's class path. - * @param parentShell The parent shell, optionally null. - * @param project The project. - * @param container The container of the launching wizard. - * @return The qualified name of the selected java class. - */ - public static String browseClasses ( Shell parentShell, - IProject project, - IRunnableContext ctxt) - { - return browseClasses(parentShell, new IResource[] {project}, ctxt); - } - - public static String browseClasses(Shell parentShell, IResource[] resources, IRunnableContext ctxt) - { - IType itype = browseClassesAsIType(parentShell, resources, ctxt); - if (itype != null) - return itype.getFullyQualifiedName(); - else - return null; - } - - public static IType browseClassesAsIType(Shell parentShell, IResource[] resources, IRunnableContext ctxt) - { - Vector javaElements = new Vector(); - for (int i = 0; i < resources.length; i++) - { - IJavaElement javaElement = JavaCore.create(resources[i]); - if (javaElement != null) - javaElements.add(javaElement); - } - IJavaElement[] elements = (IJavaElement[])javaElements.toArray(new IJavaElement[0]); - - IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements); - scope.setIncludesClasspaths(true); - scope.setIncludesBinaries(true); - - //Creating and opening a TypeSelectionDialog - try - { - SelectionDialog dialog = JavaUI.createTypeDialog(parentShell, ctxt, scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false); - dialog.setTitle(WSUIPluginMessages.DIALOG_TITLE_CLASS_BROWSE); - dialog.setMessage(WSUIPluginMessages.DIALOG_TITLE_CLASS_BROWSE); - dialog.open(); - - //Getting the result and returning it - Object[] results = dialog.getResult(); - if (results != null && results.length > 0) - { - if (results[0] instanceof IType) - { - return (IType)results[0]; - } - } - } - catch (JavaModelException jme) - { - } - return null; - } - - /** - * Raises a dialog for browsing interfaces on a project's class path. - * @param parentShell The parent shell, optionally null. - * @param project The project. - * @param container The container of the launching wizard. - * @return The qualified name of the selected java interface. - */ - public static String browseInterfaces( Shell parentShell, - IProject project, - IWizardContainer container) - - { - String interfaceName = null; - - //Limiting search scope to the project - IResource[] resources = new IResource[1]; - resources[0]=project; - IJavaElement[] elements = new IJavaElement[1]; - elements[0] = JavaCore.create(resources[0]); - IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements); - scope.setIncludesClasspaths(true); - scope.setIncludesBinaries(true); - - //Creating and opening a TypeSelectionDialog - try - { - SelectionDialog dialog = JavaUI.createTypeDialog(parentShell, container, scope, IJavaElementSearchConstants.CONSIDER_TYPES, false); - dialog.setTitle(WSUIPluginMessages.DIALOG_TITLE_INTERFACE_BROWSE); - dialog.setMessage(WSUIPluginMessages.DIALOG_TITLE_INTERFACE_BROWSE); - dialog.open(); - - //Getting the result and returning it - Object[] results = dialog.getResult(); - if (results != null && results.length > 0) - { - if (results[0] instanceof IType) - { - IType resultInterface = (IType)results[0]; - interfaceName = resultInterface.getFullyQualifiedName(); - } - } - } - catch (JavaModelException jme) - { - } - - return interfaceName; - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/ResourceSelectionDialog.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/ResourceSelectionDialog.java deleted file mode 100644 index 1d88d39d6..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/ResourceSelectionDialog.java +++ /dev/null @@ -1,319 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.dialog; - -import java.util.Iterator; - -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.viewers.DecoratingLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -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.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.jst.ws.internal.common.AnyFilter; -import org.eclipse.jst.ws.internal.common.Filter; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.ui.WSUIPluginMessages; -import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - - -/** -* This class provides a dialog for browsing workspace resources. -* See also {@link DialogUtils#browseResources}. -*/ -public class ResourceSelectionDialog extends Dialog implements Listener -{ - - // Dialog controls. - // - private Label filterLabel_; - private Combo filterCombo_; - /*CONTEXT_ID DRES0001 for the Resource Type combo box of the Resource Selection Dialog*/ - private static final String INFOPOP_DRES_COMBO_RESOURCE_TYPE = WebServiceUIPlugin.ID + ".DRES0001"; - - private Tree resourceTree_; - private TreeViewer fileViewer_; - /*CONTEXT_ID DRES0002 for the Resource tree of the Resource Selection Dialog*/ - private static final String INFOPOP_DRES_TREE_RESOURCE = WebServiceUIPlugin.ID + ".DRES0002"; - - // - // Essential goodies. - // - private IResource root_; - private IResource initialSelection_; - private Filter[] filters_; - private Filter currentFilter_; - private IResource[] selection_; - private boolean multipleSelectionEnabled_; - - /** - * Constructs a new <code>ResourceSelectionDialog</code> - * under the given <code>parent Shell</code>. - * The dialog renders all resources including and - * under the given <code>root IResource</code>. - * @param parent The parent {@link org.eclipse.swt.widgets.Shell}, - * or null to create a top-level shell. - * @param root The root {@link org.eclipse.core.resources.IResource}, - * or null to begin with the workspace root. - * @param initialSelection The initially selected object or null if none. - */ - public ResourceSelectionDialog ( Shell parent, IResource root, IResource initialSelection ) - { - this(parent,root,initialSelection,new Filter[] {new AnyFilter()}); - } - - /** - * Constructs a new <code>ResourceSelectionDialog</code> - * under the given <code>parent Shell</code>. - * The dialog renders all resources including and - * under the given <code>root IResource</code> that - * are accepted by the given filter. - * See {@link org.eclipse.jst.ws.internal.common.Filter#accepts}. - * @param parent The parent {@link org.eclipse.swt.widgets.Shell}, - * or null to create a top-level shell. - * @param root The root {@link org.eclipse.core.resources.IResource}, - * or null to begin with the workspace root. - * @param initialSelection The initially selected object or null if none. - * @param filter The {@link org.eclipse.jst.ws.internal.common.Filter}, - * or null to default to all resources under the <code>root</code>. - */ - public ResourceSelectionDialog ( Shell parent, IResource root, IResource initialSelection, Filter filter ) - { - this(parent,root,initialSelection,new Filter[] {filter}); - } - - /** - * Constructs a new <code>ResourceSelectionDialog</code> - * under the given <code>parent Shell</code>. - * The dialog renders all resources including and - * under the given <code>root IResource</code> that - * are accepted by the given filters. - * See {@link org.eclipse.jst.ws.internal.common.Filter#accepts}. - * @param parent The parent {@link org.eclipse.swt.widgets.Shell}. - * or null to create a top-level shell. - * @param root The root {@link org.eclipse.core.resources.IResource}, - * or null to begin with the workspace root. - * @param initialSelection The initially selected object or null if none. - * @param filters An array of {@link org.eclipse.jst.ws.internal.common.Filter} - * objects. - * If the array is null or of length zero, then all resources are accepted - * (ie. equivalent to <code>ResourceSelectionDialog(parent,root)</code>. - * If the array is of length one, then the dialog will consist of a single - * control showing a list of all filtered resources. - * If the array is of length greater than one, then the dialog will - * consist of a combo box containing the names of the filters and with the - * first filter (ie. <code>filters[0]</code>) selected by default, followed - * by a control showing a list of all resources filtered by the selected filter. - */ - public ResourceSelectionDialog ( Shell parent, IResource root, IResource initialSelection, Filter[] filters ) - { - super(parent); - root_ = root == null ? ResourceUtils.getWorkspaceRoot() : root; - initialSelection_ = initialSelection; - filters_ = (filters == null || filters.length == 0) ? new Filter[] {new AnyFilter()} : filters; - currentFilter_ = filters_[0]; - multipleSelectionEnabled_ = false; - setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL); - } - - /** - * Enables or disables multiple selection in the tree view. - * Multiple selection is disabled by default. - * @param multipleSelectionEnabled True to enabled or false to disable. - */ - public void setMultipleSelectionEnabled ( boolean multipleSelectionEnabled ) - { - multipleSelectionEnabled_ = multipleSelectionEnabled; - } - - /** - * Returns the selections made in the dialog if OK was pressed, - * or null if Cancel was pressed. Returns null if the dialog - * has never been opened. - * @return An array of selected resources, possibly empty, possibly null. - */ - public IResource[] getResult () - { - return selection_; - } - - /** - * Called when the Cancel button is pressed. - * Insures that {@link #getResult} will return null. - */ - protected void cancelPressed () - { - selection_ = null; - setReturnCode(Dialog.CANCEL); - super.cancelPressed(); - } - - /** - * Called when the OK button is pressed. - * Squirrels away the list of zero or more selected - * <code>IResource</code>s to be returned by {@link #getResult}. - */ - protected void okPressed () - { - ISelection selection = fileViewer_.getSelection(); - if (selection instanceof IStructuredSelection) - { - IStructuredSelection structuredSelection = (IStructuredSelection)selection; - selection_ = new IResource[structuredSelection.size()]; - int i=0; - Iterator iter = structuredSelection.iterator(); - while (iter.hasNext()) - { - Object object = iter.next(); - if (object instanceof IResource) - { - selection_[i++] = (IResource)object; - } - } - } - setReturnCode(Dialog.OK); - super.okPressed(); - } - - /** - * See {@link org.eclipse.jface.window.Window#configureShell}. - * @param shell The shell. - */ - protected void configureShell ( Shell shell ) - { - super.configureShell(shell); - shell.setText(WSUIPluginMessages.DIALOG_TITLE_RESOURCE_BROWSE); - } - - /** - * Creates the dialog area. - * @param parent The parent composite. - * @return The control area. - */ - protected Control createDialogArea ( Composite parent ) - { - GridLayout gl; - GridData gd; - - Composite composite = (Composite)super.createDialogArea(parent); - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL); - gd.widthHint = 400; - gd.heightHint = 300; - gd.grabExcessVerticalSpace = true; - gd.grabExcessHorizontalSpace = true; - composite.setLayoutData(gd); - - if (filters_.length > 1) - { - Composite f = new Composite(composite,SWT.NONE); - gl = new GridLayout(); - gl.numColumns = 2; - gl.marginHeight = 0; - gl.marginWidth = 0; - f.setLayout(gl); - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - f.setLayoutData(gd); - - filterLabel_ = new Label(f,SWT.WRAP); - filterLabel_.setText(WSUIPluginMessages.LABEL_RESOURCE_FILTER); - filterLabel_.setToolTipText(WSUIPluginMessages.TOOLTIP_DRES_COMBO_RESOURCE_TYPE); - - filterCombo_ = new Combo(f,SWT.DROP_DOWN | SWT.READ_ONLY); - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - filterCombo_.setLayoutData(gd); - filterCombo_.addListener(SWT.Selection,this); - filterCombo_.setToolTipText(WSUIPluginMessages.TOOLTIP_DRES_COMBO_RESOURCE_TYPE); - PlatformUI.getWorkbench().getHelpSystem().setHelp(filterCombo_,INFOPOP_DRES_COMBO_RESOURCE_TYPE); - } - - if (multipleSelectionEnabled_) - { - resourceTree_ = new Tree(composite,SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - } - else - { - resourceTree_ = new Tree(composite,SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - } - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL); - gd.grabExcessVerticalSpace = true; - gd.grabExcessHorizontalSpace = true; - resourceTree_.setLayoutData(gd); -// resourceTree_.addListener(SWT.Selection,this); - resourceTree_.setToolTipText(WSUIPluginMessages.TOOLTIP_DRES_TREE_RESOURCE); - PlatformUI.getWorkbench().getHelpSystem().setHelp(resourceTree_,INFOPOP_DRES_TREE_RESOURCE); - - fileViewer_ = new TreeViewer(resourceTree_); - fileViewer_.setContentProvider(new WorkbenchContentProvider()); - fileViewer_.setLabelProvider( - new DecoratingLabelProvider( - new WorkbenchLabelProvider(), - WebServiceUIPlugin.getInstance().getWorkbench().getDecoratorManager().getLabelDecorator())); - fileViewer_.addFilter( - new ViewerFilter () - { - public boolean select ( Viewer viewer, Object parentObject, Object object ) - { - return - ( - ((object instanceof IResource) && ((IResource)object).getType() != IResource.FILE) - || (ResourceSelectionDialog.this.currentFilter_.accepts(object)) - ); - } - } - ); - fileViewer_.setInput(root_); - fileViewer_.addSelectionChangedListener( - new ISelectionChangedListener () - { - public void selectionChanged ( SelectionChangedEvent event ) - { -// ResourceSelectionDialog.this.validatePageToStatus(); - } - } - ); - if (initialSelection_ != null) - { - fileViewer_.setSelection(new StructuredSelection(ResourceSelectionDialog.this.initialSelection_),true); - } - - return composite; - } - - /** - * Called when an event occurs on the page. - * Handles the event and revalidates the page. - * @param event The event that occured. - */ - public void handleEvent ( Event event ) - { -// validatePageToStatus(); - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/plugin/WebServiceUIPlugin.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/plugin/WebServiceUIPlugin.java deleted file mode 100644 index 722b311a5..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/plugin/WebServiceUIPlugin.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui.plugin; - -import java.net.MalformedURLException; -import java.net.URL; -import java.text.MessageFormat; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jst.ws.internal.ui.preferences.PersistentActionDialogsContext; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.eclipse.wst.command.internal.env.core.common.MessageUtils; - - -/** -* This is the plugin class for the Web Services plugin. -* <p> -* This plugin contains the graphic user interface to the -* Web Services runtime found in org.eclipse.jst.ws. -*/ -public class WebServiceUIPlugin extends AbstractUIPlugin -{ - - /** - * The identifier of the descriptor of this plugin in plugin.xml. - */ - public static final String ID = "org.eclipse.jst.ws.ui"; - - /** - * The reference to the singleton instance of this plugin. - */ - private static WebServiceUIPlugin instance_; - - private PersistentActionDialogsContext actionDialogsContext_; - - /** - * Constructs a runtime plugin object for this plugin. - */ - public WebServiceUIPlugin() { - super(); - instance_ = this; - } - - /** - * Returns the singleton instance of this plugin. Equivalent to calling - * (WebServiceUIPlugin)Platform.getPlugin("org.eclipse.jst.ws.ui"); - * @return The WebServiceUIPlugin singleton. - */ - static public WebServiceUIPlugin getInstance() { - return instance_; - } - - - public PersistentActionDialogsContext getActionDialogsContext() - { - if (actionDialogsContext_ == null) - { - actionDialogsContext_ = new PersistentActionDialogsContext(); - actionDialogsContext_.load(); - } - return actionDialogsContext_; - } - - /** - * Returns the message string identified by the given key from - * the plugin.properties file for the appropriate locale. - * @param key The message key string prefixed by a "%" symbol. - * That is, the string passed in must be of the form "%KEY" - * where the plugin.properties file contains a line of the - * form: "KEY = value". - * @return The locale-specific message. - */ - public static String getMessage(String key) - { - MessageUtils msgUtils = new MessageUtils( "org.eclipse.jst.ws.ui.plugin", instance_ ); - - if( key.startsWith("%")) - { - key = key.substring( 1, key.length() ); - } - - return msgUtils.getMessage(key); - } - - /** - * Returns the message string identified by the given key from - * the plugin.properties file for the appropriate locale. - * Substitution sequences in the message string - * are replaced by the given array of substitution objects (which - * are most frequently strings). See java.text.MessageFormat for - * further details on substitution. - * @param key The message key string prefixed by a "%" symbol. - * That is, the string passed in must be of the form "%KEY" - * where the plugin.properties file contains a line of the - * form: "KEY = value". - * @param args The substitution values for the message - * as required by the message in plugin.properties and - * by the rules of class java.text.MessageFormat. - * @return The locale-specific message. - */ - public static String getMessage(String key, Object[] args) { - return MessageFormat.format(getMessage(key), args); - } - - /** - * Returns an image descriptor for the named resource - * as relative to the plugin install location. - * @return An image descriptor, possibly null. - */ - public static ImageDescriptor getImageDescriptor(String name) { - try { - URL installURL = instance_.getBundle().getEntry("/"); - URL imageURL = new URL(installURL, name); - return ImageDescriptor.createFromURL(imageURL); - } catch (MalformedURLException e) { - return null; - } - } - -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceType.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceType.java deleted file mode 100644 index 7e2ba9c7d..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceType.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.preferences; - -public class ActionDialogPreferenceType { - - private String id_; - public void setId (String id) { - id_ = id; - } - public String getId() { - return id_; - } - - private String name_; - public void setName(String name) { - name_ = name; - } - public String getName() { - return name_; - } - - private String infopop_; - public void setInfopop (String infopop) { - infopop_ = infopop; - } - public String getInfopop () { - return infopop_; - } - - private String tooltip_; - public void setTooltip (String tooltip) { - tooltip_= tooltip; - } - public String getTooltip () { - return tooltip_; - } - - } diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceTypeRegistry.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceTypeRegistry.java deleted file mode 100644 index e6a3a3f39..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceTypeRegistry.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.preferences; - -import java.util.Enumeration; -import java.util.Hashtable; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; - -public class ActionDialogPreferenceTypeRegistry -{ - private static ActionDialogPreferenceTypeRegistry instance_; - - private Hashtable typesByName_; - - // - // Loads WebServiceType objects into this registry. - // This is done by querying the plugin registry for all extensions - // hanging on the webServiceType extension point. Extensions - // must implement the org.eclipse.jst.ws.ui.wizard.WebServiceType - // interface. - // - private void loadDialogsPreferences () - { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] config = reg.getConfigurationElementsFor( - "org.eclipse.jst.ws.ui", - "actionDialogPreferenceType"); - for(int idx=0; idx<config.length; idx++) - { - IConfigurationElement elem = config[idx]; - try - { - Object actionDialogPreferenceType = elem.createExecutableExtension("class"); - if (actionDialogPreferenceType instanceof ActionDialogPreferenceType) - { - ActionDialogPreferenceType dialog = (ActionDialogPreferenceType) actionDialogPreferenceType; - dialog.setId((String)elem.getAttribute("id")); - dialog.setName((String)elem.getAttribute("name")); - dialog.setInfopop((String)elem.getAttribute("infopop")); - dialog.setTooltip((String)elem.getAttribute("tooltip")); - add(dialog); - } - } catch (CoreException e) - { - } - } - } - - // - // Loads actionDialogPreferenceType objects into this registry. - // See method getInstance(). - // - private void load () - { - typesByName_ = new Hashtable(); - loadDialogsPreferences(); - } - - // - // Add the given WebServiceType to this registry. - // See method load(). - // - private void add ( ActionDialogPreferenceType dialog ) - { - typesByName_.put(dialog.getId(),dialog); - } - - /** - * Returns a singleton instance of this class. - * @return A singleton WebServiceTypeRegistry object. - */ - public static ActionDialogPreferenceTypeRegistry getInstance () - { - if (instance_ == null) - { - instance_ = new ActionDialogPreferenceTypeRegistry(); - instance_.load(); - } - return instance_; - } - - /** - * Returns all registered <code>WebServiceType</code> objects. - * @return All registered <code>WebServiceType</code> objects. - */ - public ActionDialogPreferenceType[] getActionDialogsPrefrences () - { - ActionDialogPreferenceType[] dialogs = new ActionDialogPreferenceType[typesByName_.size()]; - Enumeration e = typesByName_.elements(); - for (int i=0; e.hasMoreElements(); i++) - { - dialogs[i] = (ActionDialogPreferenceType)e.nextElement(); - } - return dialogs; - } - - public ActionDialogPreferenceType getActionDialogPrefrenceTypeByName (String name) - { - return (name == null ? null : (ActionDialogPreferenceType)typesByName_.get(name)); - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogsPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogsPreferencePage.java deleted file mode 100644 index 8e25b5130..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogsPreferencePage.java +++ /dev/null @@ -1,220 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui.preferences; - -import java.util.Enumeration; -import java.util.Hashtable; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin; -import org.eclipse.swt.SWT; -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.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.wst.command.internal.env.ui.EnvironmentUIMessages; - -; - -public class ActionDialogsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener -{ - /*CONTEXT_ID PPAD0001 for the Action Dialogs Preference Page*/ - private String INFOPOP_PPAD_PAGE = WebServiceUIPlugin.ID + ".PPAD0001"; - // - private Button showAll; - /*CONTEXT_ID PPAD0002 for the show all check box on the Action Dialogs Preference Page*/ - private String INFOPOP_PPAD_BUTTON_SHOW_ALL = WebServiceUIPlugin.ID + ".PPAD0002"; - // - private Button hideAll; - /*CONTEXT_ID PPAD0003 for the hide all check box on the Action Dialogs Preference Page*/ - private String INFOPOP_PPAD_BUTTON_HIDE_ALL = WebServiceUIPlugin.ID + ".PPAD0003"; - - private Hashtable checkBoxes_; - - /** - * Creates preference page controls on demand. - * @param parent the parent for the preference page - */ - protected Control createContents(Composite superparent) - { - checkBoxes_ = new Hashtable(); - addOptionalDialogsCheckBoxes (superparent); - new Label(superparent, SWT.HORIZONTAL); - - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite parent = new Composite( superparent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - parent.setLayout( layout ); - parent.setToolTipText(EnvironmentUIMessages.TOOLTIP_PPAD_PAGE); - helpSystem.setHelp(parent,INFOPOP_PPAD_PAGE); - - showAll = new Button(parent, SWT.NONE); - showAll.setText(EnvironmentUIMessages.BUTTON_SHOW_ALL_DIALOGS); - showAll.addListener(SWT.Selection, this); - showAll.setToolTipText(EnvironmentUIMessages.TOOLTIP_PPAD_BUTTON_SHOW_ALL); - helpSystem.setHelp(showAll,INFOPOP_PPAD_BUTTON_SHOW_ALL); - - hideAll = new Button(parent, SWT.NONE); - hideAll.setText(EnvironmentUIMessages.BUTTON_HIDE_ALL_DIALOGS); - hideAll.addListener ( SWT.Selection, this); - hideAll.setToolTipText(EnvironmentUIMessages.TOOLTIP_PPAD_BUTTON_HIDE_ALL); - helpSystem.setHelp(hideAll,INFOPOP_PPAD_BUTTON_HIDE_ALL); - - initializeValues(); - org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent); - return parent; - } - - private String getMessage(String key) - { - return WebServiceUIPlugin.getMessage(key); - } - - public void handleEvent (Event event) - { - if (showAll == event.widget) - handleShowAllEvent(); - - else if ( hideAll == event.widget) - handleHideAllEvent(); - } - - private void handleShowAllEvent () - { - Enumeration e = checkBoxes_.elements(); - for (int i=0; e.hasMoreElements(); i++) - { - Button dialog = (Button) e.nextElement(); - dialog.setSelection( true ); - } - } - - private void handleHideAllEvent () - { - Enumeration e = checkBoxes_.elements(); - for (int i=0; e.hasMoreElements(); i++) - { - Button dialog = (Button) e.nextElement(); - dialog.setSelection( false ); - } - } - - private void addOptionalDialogsCheckBoxes ( Composite parent) - { - PersistentActionDialogsContext context = WebServiceUIPlugin.getInstance().getActionDialogsContext(); - ActionDialogPreferenceType[] dialogs = context.getDialogs(); - for (int i = 0; i < dialogs.length; i++) { - Button checkBox = createCheckBox(parent , dialogs[i].getName()); - checkBox.setToolTipText(getMessage(dialogs[i].getTooltip())); - PlatformUI.getWorkbench().getHelpSystem().setHelp(checkBox,dialogs[i].getInfopop()); - checkBoxes_.put(dialogs[i].getId(), checkBox); - } - } - - private Button createCheckBox( Composite parent, String text ) - { - Button button = new Button( parent, SWT.CHECK ); - button.setText( text ); - return button; - } - - /** - * Does anything necessary because the default button has been pressed. - */ - protected void performDefaults() - { - super.performDefaults(); - initializeDefaults(); - } - - /** - * Do anything necessary because the OK button has been pressed. - * @return whether it is okay to close the preference page - */ - public boolean performOk() - { - storeValues(); - return true; - } - - protected void performApply() - { - performOk(); - } - - /** - * @see IWorkbenchPreferencePage - */ - public void init(IWorkbench workbench) { } - - /** - * The proxy information is stored in the preference store. - */ - public IPreferenceStore getPreferenceStore() - { - return WebServiceUIPlugin.getInstance().getPreferenceStore(); - } - - /** - * Initializes states of the controls using default values - * in the preference store. - */ - private void initializeDefaults() - { - Enumeration e = checkBoxes_.elements(); - for (int i=0; e.hasMoreElements(); i++) - { - Button dialog = (Button) e.nextElement(); - dialog.setSelection(true); - } - } - - /** - * Initializes states of the controls from the preferences. - */ - private void initializeValues() - { - PersistentActionDialogsContext context = WebServiceUIPlugin.getInstance().getActionDialogsContext(); - Enumeration e = checkBoxes_.keys(); - for (int i=0; e.hasMoreElements(); i++) - { - String id = (String) e.nextElement(); - Button button = (Button) checkBoxes_.get(id); - button.setSelection(context.isActionDialogEnabled(id)); - } - } - - /** - * Stores the values of the controls back to the preference store. - */ - private void storeValues() - { - PersistentActionDialogsContext context = WebServiceUIPlugin.getInstance().getActionDialogsContext(); - - Enumeration e = checkBoxes_.keys(); - for (int i=0; e.hasMoreElements(); i++) - { - String id = (String) e.nextElement(); - context.setActionDialogEnabled(id, ((Button)checkBoxes_.get(id)).getSelection()); - } - } -} - diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/PersistentActionDialogsContext.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/PersistentActionDialogsContext.java deleted file mode 100644 index cabefe40f..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/PersistentActionDialogsContext.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.preferences; - -import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin; -import org.eclipse.wst.command.internal.env.context.PersistentContext; - - -public class PersistentActionDialogsContext extends PersistentContext -{ - private ActionDialogPreferenceType [] dialogs_; - -public PersistentActionDialogsContext () -{ - super( WebServiceUIPlugin.getInstance()); -} -public void load() -{ - ActionDialogPreferenceTypeRegistry reg = ActionDialogPreferenceTypeRegistry.getInstance(); - dialogs_ = reg.getActionDialogsPrefrences(); - for (int i = 0; i < dialogs_.length; i++) { - setDefault(dialogs_[i].getId(), true); - } -} - -public ActionDialogPreferenceType[] getDialogs() -{ - return dialogs_; -} - -public void setActionDialogEnabled ( String id, boolean value) -{ - setValue (id, value); -} - -public boolean isActionDialogEnabled( String id) -{ - if (id == null ) - return true; - return getValueAsBoolean(id); -} - -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ProjectTopologyPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ProjectTopologyPreferencePage.java deleted file mode 100644 index 6737baaaf..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ProjectTopologyPreferencePage.java +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.ui.preferences; - -import java.util.Vector; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jst.ws.internal.context.ProjectTopologyContext; -import org.eclipse.jst.ws.internal.context.ProjectTopologyDefaults; -import org.eclipse.jst.ws.internal.plugin.WebServicePlugin; -import org.eclipse.jst.ws.internal.ui.WSUIPluginMessages; -import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Image; -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.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.PlatformUI; - - - -public class ProjectTopologyPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, SelectionListener -{ - /*CONTEXT_ID PPSD0001 for the Project Topology Preference Page*/ - private String INFOPOP_PTPP_PAGE = WebServiceUIPlugin.ID + ".PPTP0001"; - - private TableViewer clientTypeViewer_; - private Button moveUp_; - private Button moveDown_; - private Vector clientTypes_; - - private Button twoEAR_; - - /** - * Creates preference page controls on demand. - * @param parent the parent for the preference page - */ - protected Control createContents(Composite superparent) - { - Composite parent = new Composite( superparent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - parent.setLayout( layout ); - parent.setToolTipText(WSUIPluginMessages.TOOLTIP_PTPP_PAGE); - parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,INFOPOP_PTPP_PAGE); - - Text clientTypeLabel = new Text(parent, SWT.READ_ONLY | SWT.WRAP); - clientTypeLabel.setText(WSUIPluginMessages.LABEL_CLIENT_TYPE_NAME); - clientTypeLabel.setLayoutData( new GridData( GridData.FILL_HORIZONTAL)); - - Composite clientTypeComposite = new Composite(parent, SWT.NONE); - GridLayout gl = new GridLayout(); - gl.numColumns = 2; - gl.marginHeight = 0; - gl.marginWidth = 0; - clientTypeComposite.setLayout(gl); - clientTypeComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL )); - - Table table= new Table(clientTypeComposite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); - GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); - gd.widthHint = 256; - table.setLayoutData(gd); - table.setToolTipText(WSUIPluginMessages.TOOLTIP_CLIENT_TYPE_TABLE_VIEWER); - - clientTypes_ = new Vector(); - clientTypeViewer_ = new TableViewer(table); - clientTypeViewer_.setContentProvider(new ClientTypeContentProvider()); - clientTypeViewer_.setLabelProvider(new ClientTypeLabelProvider()); - clientTypeViewer_.setInput(clientTypes_); - - TableLayout tableLayout = new TableLayout(); - TableColumn tableColumn = new TableColumn(table, SWT.NONE); - tableColumn.setText(WSUIPluginMessages.LABEL_CLIENT_TYPE_NAME); - ColumnWeightData columnData = new ColumnWeightData(256, 256, false); - tableLayout.addColumnData(columnData); - table.setLayout(tableLayout); - - Composite c = new Composite(clientTypeComposite, SWT.NONE); - gl = new GridLayout(); - gl.numColumns = 1; - gl.marginHeight = 10; - gl.marginWidth = 0; - c.setLayout(gl); - - moveUp_ = new Button(c, SWT.PUSH); - moveUp_.setText(WSUIPluginMessages.LABEL_MOVE_UP); - moveUp_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - moveUp_.addSelectionListener(this); - moveUp_.setToolTipText(WSUIPluginMessages.TOOLTIP_MOVE_UP); - - moveDown_ = new Button(c, SWT.PUSH); - moveDown_.setText(WSUIPluginMessages.LABEL_MOVE_DOWN); - moveDown_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - moveDown_.addSelectionListener(this); - moveDown_.setToolTipText(WSUIPluginMessages.TOOLTIP_MOVE_DOWN); - - twoEAR_ = new Button(parent, SWT.CHECK | SWT.WRAP ); - twoEAR_.setText(WSUIPluginMessages.LABEL_ENABLE_TWO_EARS); - twoEAR_.setToolTipText(WSUIPluginMessages.TOOLTIP_ENABLE_TWO_EARS); - - initializeValues(); - org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent); - - return parent; - } - - /** - * Does anything necessary because the default button has been pressed. - */ - protected void performDefaults() - { - super.performDefaults(); - initializeDefaults(); - } - - /** - * Do anything necessary because the OK button has been pressed. - * @return whether it is okay to close the preference page - */ - public boolean performOk() - { - storeValues(); - return true; - } - - protected void performApply() - { - performOk(); - } - - /** - * @see IWorkbenchPreferencePage - */ - public void init(IWorkbench workbench) { } - - /** - * Initializes states of the controls to their burned-in defaults. - */ - private void initializeDefaults() - { - clientTypes_.clear(); - String[] types = ProjectTopologyDefaults.getClientTypes(); - for (int i = 0; i < types.length; i++) - clientTypes_.add(types[i]); - clientTypeViewer_.refresh(); - twoEAR_.setSelection(true); - } - - /** - * Initializes states of the controls from the preference helper. - */ - private void initializeValues() - { - ProjectTopologyContext context = WebServicePlugin.getInstance().getProjectTopologyContext(); - String[] types = context.getClientTypes(); - for (int i = 0; i < types.length; i++) - clientTypes_.add(types[i]); - // check whether we missed any types from the default list - boolean missed = false; - types = ProjectTopologyDefaults.getClientTypes(); - for (int i = 0; i < types.length; i++) - { - if (clientTypes_.indexOf(types[i]) == -1) - { - clientTypes_.add(types[i]); - missed = true; - } - } - if (missed) - { - types = new String[clientTypes_.size()]; - clientTypes_.copyInto(types); - context.setClientTypes(types); - } - // refresh viewer - clientTypeViewer_.refresh(); - twoEAR_.setSelection(context.isUseTwoEARs()); - } - - /** - * Stores the values of the controls back to the preference helper. - */ - private void storeValues() - { - ProjectTopologyContext context = WebServicePlugin.getInstance().getProjectTopologyContext(); - String[] types = new String[clientTypes_.size()]; - clientTypes_.copyInto(types); - context.setClientTypes(types); - context.setUseTwoEARs(twoEAR_.getSelection()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - - public void widgetSelected(SelectionEvent e) - { - int index = clientTypeViewer_.getTable().getSelectionIndex(); - if (index != -1) - { - if (e.widget == moveUp_ && index > 0) - { - Object object = clientTypes_.remove(index); - clientTypes_.insertElementAt(object, index-1); - clientTypeViewer_.refresh(); - } - else if (e.widget == moveDown_ && index < clientTypes_.size()-1) - { - Object object = clientTypes_.remove(index); - clientTypes_.insertElementAt(object, index+1); - clientTypeViewer_.refresh(); - } - } - } - - private class ClientTypeContentProvider implements IStructuredContentProvider - { - /** - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object) - */ - public Object[] getElements(Object value) - { - return ((Vector)value).toArray(new String[0]); - } - - /** - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() - { - } - - /** - * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object) - */ - public void inputChanged(Viewer arg0, Object arg1, Object arg2) - { - } - } - - private class ClientTypeLabelProvider extends LabelProvider - { - private IConfigurationElement[] configElements_; - - public ClientTypeLabelProvider() - { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - configElements_ = reg.getConfigurationElementsFor("org.eclipse.jst.ws.consumption.ui", "clientProjectType"); - } - - private IConfigurationElement getElementByAttribute(String name, String value) - { - for (int i = 0; i < configElements_.length; i++) - if (configElements_[i].getAttribute(name).equals(value)) - return configElements_[i]; - return null; - } - - /** - * @see org.eclipse.jface.viewers.ILabelProvider#getImage(Object) - */ - public Image getImage(Object arg0) - { - return null; - } - - /** - * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object) - */ - public String getText(Object value) - { - return getElementByAttribute("id", value.toString()).getAttribute("label"); - } - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ResourceManagmentPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ResourceManagmentPreferencePage.java deleted file mode 100644 index 7c1f7c611..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ResourceManagmentPreferencePage.java +++ /dev/null @@ -1,152 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui.preferences; - -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jst.ws.internal.plugin.WebServicePlugin; -import org.eclipse.jst.ws.internal.ui.WSUIPluginMessages; -import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin; -import org.eclipse.swt.SWT; -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.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.IWorkbenchHelpSystem; -import org.eclipse.wst.command.internal.env.core.context.ResourceContext; -import org.eclipse.wst.command.internal.env.core.context.ResourceDefaults; - - - -public class ResourceManagmentPreferencePage extends PreferencePage implements IWorkbenchPreferencePage -{ - /*CONTEXT_ID PPRM0001 for the Resource Managment Preference Page*/ - private String INFOPOP_PPRM_PAGE = WebServiceUIPlugin.ID + ".PPRM0001"; - // - private Button overWriteFiles; - /*CONTEXT_ID PPRM0002 for the file overwrite check box on the Resource Management Preference Page*/ - private String INFOPOP_PPRM_CHECKBOX_OVERWRITE_FILES = WebServiceUIPlugin.ID + ".PPRM0002"; - // - private Button createFolders; - /*CONTEXT_ID PPRM0003 for the create folders check box on the Resource Management Preference Page*/ - private String INFOPOP_PPRM_CHECKBOX_CREATE_FOLDERS = WebServiceUIPlugin.ID + ".PPRM0003"; - // - private Button checkoutFiles; - /*CONTEXT_ID PPRM0004 for the checkout files check box on the Resource Management Preference Page*/ - private String INFOPOP_PPRM_CHECKBOX_CHECK_OUT = WebServiceUIPlugin.ID + ".PPRM0004"; - - /** - * Creates preference page controls on demand. - * @param parent the parent for the preference page - */ - protected Control createContents(Composite superparent) - { - IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); - - Composite parent = new Composite( superparent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - parent.setLayout( layout ); - parent.setToolTipText(WSUIPluginMessages.TOOLTIP_PPRM_PAGE); - helpSystem.setHelp(parent, INFOPOP_PPRM_PAGE); - - overWriteFiles = createCheckBox(parent, WSUIPluginMessages.BUTTON_OVERWRITE_FILES); - overWriteFiles.setToolTipText(WSUIPluginMessages.TOOLTIP_PPRM_CHECKBOX_OVERWRITE_FILES); - helpSystem.setHelp(overWriteFiles, INFOPOP_PPRM_CHECKBOX_OVERWRITE_FILES); - - createFolders = createCheckBox(parent, WSUIPluginMessages.BUTTON_CREATE_FOLDERS); - createFolders.setToolTipText(WSUIPluginMessages.TOOLTIP_PPRM_CHECKBOX_CREATE_FOLDERS); - helpSystem.setHelp(createFolders, INFOPOP_PPRM_CHECKBOX_CREATE_FOLDERS); - - checkoutFiles = createCheckBox(parent, WSUIPluginMessages.BUTTON_CHECKOUT_FILES); - checkoutFiles.setToolTipText(WSUIPluginMessages.TOOLTIP_PPRM_CHECKBOX_CHECK_OUT); - helpSystem.setHelp(checkoutFiles, INFOPOP_PPRM_CHECKBOX_CHECK_OUT); - - initializeValues(); - org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent); - - return parent; - } - - private Button createCheckBox( Composite parent, String text ) - { - Button button = new Button( parent, SWT.CHECK ); - button.setText( text ); - return button; - } - - /** - * Does anything necessary because the default button has been pressed. - */ - protected void performDefaults() - { - super.performDefaults(); - initializeDefaults(); - } - - /** - * Do anything necessary because the OK button has been pressed. - * @return whether it is okay to close the preference page - */ - public boolean performOk() - { - storeValues(); - return true; - } - - protected void performApply() - { - performOk(); - } - - /** - * @see IWorkbenchPreferencePage - */ - public void init(IWorkbench workbench) { } - - /** - * Initializes states of the controls using default values - * in the preference store. - */ - private void initializeDefaults() - { - overWriteFiles.setSelection( ResourceDefaults.getOverwriteFilesDefault()); - createFolders.setSelection( ResourceDefaults.getCreateFoldersDefault()); - checkoutFiles.setSelection( ResourceDefaults.getCheckoutFilesDefault()); - } - - /** - * Initializes states of the controls from the preference store. - */ - private void initializeValues() - { - // get the persistent context from the plugin - ResourceContext context = WebServicePlugin.getInstance().getResourceContext(); - overWriteFiles.setSelection( context.isOverwriteFilesEnabled()); - createFolders.setSelection( context.isCreateFoldersEnabled()); - checkoutFiles.setSelection( context.isCheckoutFilesEnabled()); - } - - /** - * Stores the values of the controls back to the preference store. - */ - private void storeValues() - { - // get the persistent context from the plugin - ResourceContext context = WebServicePlugin.getInstance().getResourceContext(); - context.setOverwriteFilesEnabled( overWriteFiles.getSelection() ); - context.setCreateFoldersEnabled( createFolders.getSelection() ); - context.setCheckoutFilesEnabled( checkoutFiles.getSelection() ); - } -} - diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ScenarioDefaultsPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ScenarioDefaultsPreferencePage.java deleted file mode 100644 index f7a8bf148..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ScenarioDefaultsPreferencePage.java +++ /dev/null @@ -1,313 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui.preferences; - -import java.util.Vector; - -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jst.ws.internal.context.ScenarioContext; -import org.eclipse.jst.ws.internal.context.ScenarioDefaults; -import org.eclipse.jst.ws.internal.plugin.WebServicePlugin; -import org.eclipse.jst.ws.internal.ui.WSUIPluginMessages; -import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Image; -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.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.PlatformUI; - - - -public class ScenarioDefaultsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, SelectionListener -{ - - private TableViewer webServiceTestTypeViewer_; - private Button moveUp_; - private Button moveDown_; - private Vector webServiceTestTypes_; - - /*CONTEXT_ID PPSD0001 for the Scenario Defaults Preference Page*/ - private String INFOPOP_PPSD_PAGE = WebServiceUIPlugin.ID + ".PPSD0001"; - // - private Button launchSample; - /*CONTEXT_ID PPSD0002 for the launch sample check box on the Scenario Defaults Preference Page*/ - private final String INFOPOP_PPSD_CHECKBOX_LAUNCH_SAMPLE = WebServiceUIPlugin.ID + ".PPSD0002"; - // - - /** - * Creates preference page controls on demand. - * @param parent the parent for the preference page - */ - protected Control createContents(Composite superparent) - { - - Composite parent = new Composite( superparent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - parent.setLayout( layout ); - parent.setToolTipText(WSUIPluginMessages.TOOLTIP_PPSD_PAGE); - parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,INFOPOP_PPSD_PAGE); - - launchSample = createCheckBox(parent, WSUIPluginMessages.BUTTON_LAUNCH_SAMPLE); - launchSample.setToolTipText(WSUIPluginMessages.TOOLTIP_PPSD_CHECKBOX_LAUNCH_SAMPLE); - PlatformUI.getWorkbench().getHelpSystem().setHelp(launchSample, INFOPOP_PPSD_CHECKBOX_LAUNCH_SAMPLE); - - - Text testServiceTypeLabel = new Text(parent, SWT.READ_ONLY | SWT.WRAP); - testServiceTypeLabel.setText(WSUIPluginMessages.LABEL_SAMPLE_TYPES); - testServiceTypeLabel.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - - Composite webServiceTestTypeComposite = new Composite(parent, SWT.NONE); - GridLayout gl = new GridLayout(); - gl.numColumns = 2; - gl.marginHeight = 0; - gl.marginWidth = 0; - webServiceTestTypeComposite.setLayout(gl); - webServiceTestTypeComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - - Table table= new Table(webServiceTestTypeComposite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); - GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); - gd.widthHint = 256; - table.setLayoutData(gd); - table.setToolTipText(WSUIPluginMessages.TOOLTIP_CLIENT_TYPE_TABLE_VIEWER); - - webServiceTestTypes_ = new Vector(); - webServiceTestTypeViewer_ = new TableViewer(table); - webServiceTestTypeViewer_.setContentProvider(new WebServiceTestTypeContentProvider()); - webServiceTestTypeViewer_.setLabelProvider(new WebServiceTestTypeLabelProvider()); - webServiceTestTypeViewer_.setInput(webServiceTestTypes_); - - TableLayout tableLayout = new TableLayout(); - TableColumn tableColumn = new TableColumn(table, SWT.NONE); - tableColumn.setText(WSUIPluginMessages.LABEL_CLIENT_TYPE_NAME); - ColumnWeightData columnData = new ColumnWeightData(256, 256, false); - tableLayout.addColumnData(columnData); - table.setLayout(tableLayout); - - Composite c = new Composite(webServiceTestTypeComposite, SWT.NONE); - gl = new GridLayout(); - gl.numColumns = 1; - gl.marginHeight = 10; - gl.marginWidth = 0; - c.setLayout(gl); - - moveUp_ = new Button(c, SWT.PUSH); - moveUp_.setText(WSUIPluginMessages.LABEL_MOVE_UP); - moveUp_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - moveUp_.addSelectionListener(this); - moveUp_.setToolTipText(WSUIPluginMessages.TOOLTIP_MOVE_UP); - - moveDown_ = new Button(c, SWT.PUSH); - moveDown_.setText(WSUIPluginMessages.LABEL_MOVE_DOWN); - moveDown_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - moveDown_.addSelectionListener(this); - moveDown_.setToolTipText(WSUIPluginMessages.TOOLTIP_MOVE_DOWN); - - initializeValues(); - org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent); - - return parent; - } - - private Button createCheckBox( Composite parent, String text ) - { - Button button = new Button( parent, SWT.CHECK ); - button.setText( text ); - return button; - } - - /** - * Does anything necessary because the default button has been pressed. - */ - protected void performDefaults() - { - super.performDefaults(); - initializeDefaults(); - } - - /** - * Do anything necessary because the OK button has been pressed. - * @return whether it is okay to close the preference page - */ - public boolean performOk() - { - try{ - storeValues(); - }catch (Exception exc){ - exc.printStackTrace();} - return true; - } - - protected void performApply() - { - try{ - performOk(); - }catch(NullPointerException exc){ - exc.printStackTrace(); - } - } - - /** - * @see IWorkbenchPreferencePage - */ - public void init(IWorkbench workbench) { } - - /** - * Initializes states of the controls to their burned-in defaults. - */ - private void initializeDefaults() - { - ScenarioDefaults defaults = new ScenarioDefaults(); - //pgm launchSample.setSelection( defaults.getLaunchSampleDefault()); - - webServiceTestTypes_.clear(); - String[] types = defaults.getWebServiceTestTypes(); - for (int i = 0; i < types.length; i++) - webServiceTestTypes_.add(types[i]); - webServiceTestTypeViewer_.refresh(); - } - - /** - * Initializes states of the controls from the preference helper. - */ - private void initializeValues() - { - ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext(); - ScenarioDefaults defaults = new ScenarioDefaults(); - //pgm launchSample.setSelection( context.isLaunchSampleEnabled()); - - String[] types = context.getWebServiceTestTypes(); - for (int i = 0; i < types.length; i++) - webServiceTestTypes_.add(types[i]); - // check whether we missed any types from the default list - boolean missed = false; - types = defaults.getWebServiceTestTypes(); - for (int i = 0; i < types.length; i++) - { - if (webServiceTestTypes_.indexOf(types[i]) == -1) - { - webServiceTestTypes_.add(types[i]); - missed = true; - } - } - if (missed) - { - types = new String[webServiceTestTypes_.size()]; - webServiceTestTypes_.copyInto(types); - context.setWebServiceTestTypes(types); - } - // refresh viewer - webServiceTestTypeViewer_.refresh(); - } - - /** - * Stores the values of the controls back to the preference helper. - */ - private void storeValues() - { - ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext(); - String[] types = new String[webServiceTestTypes_.size()]; - webServiceTestTypes_.copyInto(types); - context.setWebServiceTestTypes(types); - - //pgm context.setLaunchSampleEnabled(launchSample.getSelection()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - - public void widgetSelected(SelectionEvent e) - { - int index = webServiceTestTypeViewer_.getTable().getSelectionIndex(); - if (index != -1) - { - if (e.widget == moveUp_ && index > 0) - { - Object object = webServiceTestTypes_.remove(index); - webServiceTestTypes_.insertElementAt(object, index-1); - webServiceTestTypeViewer_.refresh(); - } - else if (e.widget == moveDown_ && index < webServiceTestTypes_.size()-1) - { - Object object = webServiceTestTypes_.remove(index); - webServiceTestTypes_.insertElementAt(object, index+1); - webServiceTestTypeViewer_.refresh(); - } - } - } - - private class WebServiceTestTypeContentProvider implements IStructuredContentProvider - { - /** - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object) - */ - public Object[] getElements(Object value) - { - return ((Vector)value).toArray(new String[0]); - } - - /** - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() - { - } - - /** - * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object) - */ - public void inputChanged(Viewer arg0, Object arg1, Object arg2) - { - } - } - - private class WebServiceTestTypeLabelProvider extends LabelProvider - { - public WebServiceTestTypeLabelProvider() - { - } - - /** - * @see org.eclipse.jface.viewers.ILabelProvider#getImage(Object) - */ - public Image getImage(Object arg0) - { - return null; - } - - /** - * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object) - */ - public String getText(Object value) - { - //return getElementByAttribute("id", value.toString()).getAttribute("label"); - return value.toString(); - } - } -} diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/uddi/PrivateUDDIRegistryType.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/uddi/PrivateUDDIRegistryType.java deleted file mode 100644 index e37abc3d3..000000000 --- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/uddi/PrivateUDDIRegistryType.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.ui.uddi; - -import org.eclipse.wst.command.internal.env.ui.widgets.CommandWidgetBinding; - -public interface PrivateUDDIRegistryType -{ - public boolean isPrivateUDDIRegistryInstalled(); - public String[] getPrivateUDDIRegistryInquiryAPI(); - public String[] getPrivateUDDIRegistryPublishAPI(); - public CommandWidgetBinding getBinding(); -} |