Skip to main content

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

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard')
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddEditFilterMappingDialog.java606
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizard.java85
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java193
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizard.java82
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java252
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java91
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java192
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AvailableWebLibProvider.java67
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebModuleTypeDialog.java78
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/FilterMappingsArrayTableWizardSection.java343
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/IWebWizardConstants.java133
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFileSelectionDialog.java666
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFilterFileSelectionDialog.java600
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassOptionsWizardPage.java104
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassWizardPage.java93
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassOptionsWizardPage.java21
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassWizardPage.java69
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassOptionsWizardPage.java218
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassWizardPage.java113
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebArtifactWizard.java111
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassOptionsWizardPage.java69
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassWizardPage.java189
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebWizard.java57
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ServletDataModelSyncHelper.java183
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/SimpleTypedElementSelectionValidator.java79
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringArrayTableWizardSectionCallback.java35
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringMatcher.java392
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.java211
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.properties13
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportPage.java66
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportWizard.java77
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportPage.java68
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWebLibsPage.java229
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWizard.java98
34 files changed, 0 insertions, 5883 deletions
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddEditFilterMappingDialog.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddEditFilterMappingDialog.java
deleted file mode 100644
index f47ebd9fb..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddEditFilterMappingDialog.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ERROR;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.FORWARD;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.INCLUDE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.REQUEST;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.URL_PATTERN_LABEL;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jst.j2ee.internal.dialogs.TwoArrayQuickSorter;
-import org.eclipse.jst.j2ee.internal.web.operations.FilterMappingItem;
-import org.eclipse.jst.j2ee.internal.web.operations.IFilterMappingItem;
-import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin;
-import org.eclipse.jst.j2ee.internal.web.providers.WebAppEditResourceHandler;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-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.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionStatusDialog;
-import org.eclipse.ui.internal.layout.CellLayout;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Insert the type's description here.
- * Creation date: (7/30/2001 11:16:36 AM)
- */
-public class AddEditFilterMappingDialog extends SelectionStatusDialog implements SelectionListener {
-
- private static class TypeRenderer extends LabelProvider {
- private final Image SERVLET_ICON =
- ImageDescriptor.createFromURL((URL) WebPlugin.getDefault().getImage("servlet")).createImage();
-
- public String getText(Object element) {
- return ((String) element);
- }
-
- public Image getImage(Object element) {
- return SERVLET_ICON;
- }
-
- }
-
- public final static int SERVLET = 0;
- public final static int URL_PATTERN = 1;
- protected Button fServletButton;
- protected Button fURLPatternButton;
- protected int fSelection = -1;
- protected PageBook fPageBook = null;
- protected Control fURLPatternControl = null;
- protected Control fServletControl = null;
- protected Composite fChild = null;
- // construction parameters
- protected IRunnableContext fRunnableContext;
- protected ILabelProvider fElementRenderer;
- private Object[] fElements;
- private boolean fIgnoreCase = true;
- private String fUpperListLabel;
-
- // SWT widgets
- private Table fUpperList;
- protected Text fURLText;
- private String[] fServletNames;
- private String[] fRenderedStrings;
- private int dispatchers;
- private Button fRequest;
- private Button fForward;
- private Button fInclude;
- private Button fErorr;
- private IFilterMappingItem selectedItem;
-
- /**
- * MultiSelectFilteredFileSelectionDialog constructor comment.
- * @param parent Shell
- * @param title String
- * @param message String
- * @parent extensions String[]
- * @param allowMultiple boolean
- */
- public AddEditFilterMappingDialog(Shell parent, String title, IProject project,
- List<IFilterMappingItem> elements, IFilterMappingItem item) {
- super(parent);
- selectedItem = item;
- setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
-
- if (title == null)
- setTitle(WebAppEditResourceHandler.getString("File_Selection_UI_")); //$NON-NLS-1$
- else setTitle(title);
-
- Status currStatus = new Status(Status.OK, ServletUIPlugin.PLUGIN_ID, Status.OK, "", null);
-
- updateStatus(currStatus);
- fElementRenderer = new TypeRenderer();
- fRunnableContext = ServletUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- try {
- IModelProvider provider = ModelProviderManager.getModelProvider(project);
- Object mObj = provider.getModelObject();
- ArrayList<String> servletsList = new ArrayList<String>();
- if (mObj instanceof org.eclipse.jst.j2ee.webapplication.WebApp) {
- org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) mObj;
- List<Servlet> servlets = webApp.getServlets();
- for (Servlet servlet : servlets) {
- String servletName = servlet.getServletName();
- if (!servletName.equals(item != null ? item.getName() : null) &&
- isAlreadyAdded(servletName, elements)) continue;
- servletsList.add(servletName);
- }
- } else if (mObj instanceof org.eclipse.jst.javaee.web.WebApp) {
- org.eclipse.jst.javaee.web.WebApp webApp= (org.eclipse.jst.javaee.web.WebApp) mObj;
- List<org.eclipse.jst.javaee.web.Servlet> servlets = webApp.getServlets();
- for (org.eclipse.jst.javaee.web.Servlet servlet : servlets) {
- String servletName = servlet.getServletName();
- if (!servletName.equals(item != null ? item.getName() : null) &&
- isAlreadyAdded(servletName, elements)) continue;
- servletsList.add(servletName);
- }
- }
-
- fServletNames = (String[]) servletsList.toArray(new String[servletsList.size()]);
- servletsList = null;
- } catch (Exception e) {
- ServletUIPlugin.log(e);
- }
- }
-
- private boolean isAlreadyAdded(String servlet, List<IFilterMappingItem> elements) {
- for (Iterator iterator = elements.iterator(); iterator.hasNext();) {
- IFilterMappingItem item = (IFilterMappingItem) iterator.next();
- if (item.isServletNameType() && item.getName().equals(servlet))
- return true;
- }
- return false;
- }
-
- /**
- * @private
- */
- protected void computeResult() {
- if (fSelection == URL_PATTERN) {
- java.util.List result = new ArrayList(1);
- dispatchers = getDispatchers();
- FilterMappingItem mappingItem =
- new FilterMappingItem(FilterMappingItem.URL_PATTERN, fURLText.getText().trim(),
- dispatchers);
- result.add(mappingItem);
- setResult(result);
- } else {
- String servletName = (String) getWidgetSelection();
- if (servletName == null) {
-// String title = WebAppEditResourceHandler.getString("Select_Class_UI_"); //$NON-NLS-1$ = "Select Class"
-// String message = WebAppEditResourceHandler.getString("Could_not_uniquely_map_the_ERROR_"); //$NON-NLS-1$ = "Could not uniquely map the class name to a class."
-// MessageDialog.openError(getShell(), title, message);
- setResult(null);
- } else {
- dispatchers = getDispatchers();
- java.util.List result = new ArrayList(1);
- FilterMappingItem mappingItem =
- new FilterMappingItem(FilterMappingItem.SERVLET_NAME, servletName, dispatchers);
- result.add(mappingItem);
- setResult(result);
- }
- }
- }
-
- private int getDispatchers() {
- int dispatchers = 0;
- if (fRequest.getSelection()) {
- dispatchers |= IFilterMappingItem.REQUEST;
- }
- if (fForward.getSelection()) {
- dispatchers |= IFilterMappingItem.FORWARD;
- }
- if (fInclude.getSelection()) {
- dispatchers |= IFilterMappingItem.INCLUDE;
- }
- if (fErorr.getSelection()) {
- dispatchers |= IFilterMappingItem.ERROR;
- }
- return dispatchers;
- }
-
- public void create() {
- super.create();
- if (selectedItem == null && (fServletNames != null && fServletNames.length > 0)) fSelection = SERVLET;
- updateOkState();
- }
-
- /**
- * Creates and returns the contents of this dialog's
- * button bar.
- * <p>
- * The <code>Dialog</code> implementation of this framework method
- * lays out a button bar and calls the <code>createButtonsForButtonBar</code>
- * framework method to populate it. Subclasses may override.
- * </p>
- *
- * @param parent the parent composite to contain the button bar
- * @return the button bar control
- */
- protected Control createButtonBar(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
-
- layout.numColumns = 2;
-
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite composite2 = new Composite(composite, SWT.NONE);
-
- // create a layout with spacing and margins appropriate for the font size.
- layout = new GridLayout();
- layout.numColumns = 0; // this is incremented by createButton
- layout.makeColumnsEqualWidth = true;
- layout.marginWidth = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_MARGIN);
- layout.marginHeight = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_MARGIN);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_SPACING);
- layout.verticalSpacing = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_SPACING);
-
- composite2.setLayout(layout);
-
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
- composite2.setLayoutData(data);
-
- composite2.setFont(parent.getFont());
-
- // Add the buttons to the button bar.
- super.createButtonsForButtonBar(composite2);
-
- return composite;
- }
-
- /*
- * @private
- */
- protected Control createDialogArea(Composite parent) {
- GridData gd = new GridData();
-
- fChild = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- fChild.setLayout(gl);
-
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessVerticalSpace = true;
- fChild.setLayoutData(gd);
-
- // Create the Web Type radio buttons and text fields.
- fServletButton = new Button(fChild, SWT.RADIO);
- fServletButton.setText(WebAppEditResourceHandler.getString("Servlet_UI_")); //$NON-NLS-1$ = Servlet
- gd = new GridData();
- fServletButton.setLayoutData(gd);
- fServletButton.addSelectionListener(this);
-
- fURLPatternButton = new Button(fChild, SWT.RADIO);
- fURLPatternButton.setText(WebAppEditResourceHandler.getString("URL_pattern_UI_")); //$NON-NLS-1$
- gd = new GridData();
- fURLPatternButton.setLayoutData(gd);
- fURLPatternButton.addSelectionListener(this);
-
- //Create URL Pattern page
- fPageBook = new PageBook(fChild, SWT.NONE);
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- gd.grabExcessVerticalSpace = true;
- gd.horizontalSpan = 2;
- fPageBook.setLayoutData(gd);
-
- Composite composite = new Composite(fPageBook, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
-
- Label messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(URL_PATTERN_LABEL); //$NON-NLS-1$
-
- fURLText = new Text(composite, SWT.BORDER);
- GridData spec = new GridData();
- spec.grabExcessVerticalSpace = false;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.BEGINNING;
- fURLText.setLayoutData(spec);
- Listener l = new Listener() {
- public void handleEvent(Event evt) {
- updateOkState();
- }
- };
- fURLText.addListener(SWT.Modify, l);
- fURLPatternControl = composite;
-
- //Create Servlet page
- composite = new Composite(fPageBook, SWT.NONE);
- layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
-
- messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(WebAppEditResourceHandler.getString("Choose_a_servlet__2")); //$NON-NLS-1$
-
- fUpperList = createUpperList(composite);
-
- fServletControl = composite;
-
- //Create Dispatchers control
- Group dispatchers = new Group(fChild, SWT.SHADOW_IN);
- dispatchers.setText(WebAppEditResourceHandler.getString("Select_Dispatchers_UI_"));
- dispatchers.setLayout(new CellLayout(2).setMargins(10,10).setSpacing(5,5));
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- gridData.horizontalSpan = 2;
- dispatchers.setLayoutData(gridData);
- fRequest = new Button(dispatchers, SWT.CHECK);
- fRequest.setText(REQUEST);
- fForward = new Button(dispatchers, SWT.CHECK);
- fForward.setText(FORWARD);
- fInclude = new Button(dispatchers, SWT.CHECK);
- fInclude.setText(INCLUDE);
- fErorr = new Button(dispatchers, SWT.CHECK);
- fErorr.setText(ERROR);
-
- if (selectedItem != null) {
- if (selectedItem.isUrlPatternType()) {
- fSelection = URL_PATTERN;
- } else {
- fSelection = SERVLET;
- }
- } else {
- if (fServletNames == null || fServletNames.length == 0) {
- fSelection = URL_PATTERN;
- }
- }
- updateUpperListWidget();
-
- fServletButton.setEnabled(true);
- if (fSelection == URL_PATTERN) {
- fURLPatternButton.setSelection(true);
- fPageBook.showPage(fURLPatternControl);
- fServletButton.setSelection(false);
- if (fServletNames == null || fServletNames.length == 0) {
- fServletButton.setEnabled(false);
- }
- if (selectedItem != null) {
- fURLText.setText(selectedItem.getName());
- setDispatchers(selectedItem.getDispatchers());
- }
- } else {
- fServletButton.setSelection(true);
- fPageBook.showPage(fServletControl);
- if (selectedItem != null) {
- fUpperList.setSelection(getServletIndex(fUpperList, selectedItem.getName()));
- setDispatchers(selectedItem.getDispatchers());
- }
- }
- updateOkState();
- return parent;
- }
-
- private int getServletIndex(Table list, String name) {
- TableItem[] items = list.getItems();
- for (int i = 0; i < items.length; i++) {
- TableItem tableItem = items[i];
- if (tableItem.getText().equals(name)) return i;
- }
- return -1;
- }
-
- private void setDispatchers(int dispatchers) {
- if ((dispatchers & IFilterMappingItem.REQUEST) > 0) {
- fRequest.setSelection(true);
- }
- if ((dispatchers & IFilterMappingItem.FORWARD) > 0) {
- fForward.setSelection(true);
- }
- if ((dispatchers & IFilterMappingItem.INCLUDE) > 0) {
- fInclude.setSelection(true);
- }
- if ((dispatchers & IFilterMappingItem.ERROR) > 0) {
- fErorr.setSelection(true);
- }
- }
-
- /**
- * Creates the list widget and sets layout data.
- * @return org.eclipse.swt.widgets.List
- */
- private Table createUpperList(Composite parent) {
- if (fUpperListLabel != null)
- (new Label(parent, SWT.NONE)).setText(fUpperListLabel);
-
- Table list = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-// list.addListener(SWT.Selection, new Listener() {
-// public void handleEvent(Event evt) {
-// handleUpperSelectionChanged();
-// }
-// });
- list.addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event evt) {
- handleUpperDoubleClick();
- }
- });
- list.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- fElementRenderer.dispose();
- }
- });
- GridData spec = new GridData();
- spec.widthHint = convertWidthInCharsToPixels(50);
- spec.heightHint = convertHeightInCharsToPixels(4);
- spec.grabExcessVerticalSpace = true;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.FILL;
- list.setLayoutData(spec);
- return list;
- }
-
- /**
- * @return the ID of the button that is 'pressed' on doubleClick in the lists.
- * By default it is the OK button.
- * Override to change this setting.
- */
- protected int getDefaultButtonID() {
- return IDialogConstants.OK_ID;
- }
-
- public int getSelectedItem() {
- return fSelection;
- }
-
- protected Object getWidgetSelection() {
- int index = fUpperList.getSelectionIndex();
- return index >= 0 ? fElements[index] : null;
- }
-
- protected final void handleLowerDoubleClick() {
- if (getWidgetSelection() != null)
- buttonPressed(getDefaultButtonID());
- }
-
- protected final void handleLowerSelectionChanged() {
- updateOkState();
- }
-
- protected final void handleUpperDoubleClick() {
- if (getWidgetSelection() != null)
- buttonPressed(getDefaultButtonID());
- }
-
- public int open() {
- if (fServletNames == null || fServletNames.length == 0) {
- fSelection = URL_PATTERN;
- }
-
- setElements(fServletNames);
- setInitialSelections(new Object[] { "" }); //$NON-NLS-1$
- return super.open();
- }
-
- /**
- *
- * @return java.lang.String[]
- * @param p org.eclipse.jface.elements.IIndexedProperty
- */
- private String[] renderStrings(Object[] p) {
- String[] strings = new String[p.length];
- int size = strings.length;
- for (int i = 0; i < size; i++) {
- strings[i] = fElementRenderer.getText(p[i]);
- }
- new TwoArrayQuickSorter(fIgnoreCase).sort(strings, p);
- return strings;
- }
-
- public void setElements(Object[] elements) {
- if (elements == null) elements = new Object[0];
- fElements = elements;
- fRenderedStrings = renderStrings(fElements);
- }
-
- public void setSelectedItem(int newSelection) {
- fSelection = newSelection;
- }
-
- private void updateOkState() {
- Button okButton = getOkButton();
- if (okButton != null)
- if (fSelection == SERVLET) {
- okButton.setEnabled(getWidgetSelection() != null);
- } else {
- String result = fURLText.getText().trim();
- okButton.setEnabled(result.length() > 0);
- }
- }
-
- private void updateUpperListWidget() {
- fUpperList.setRedraw(false);
- fUpperList.clearAll();
- for (int i = 0; i < fRenderedStrings.length; i++) {
- TableItem ti = new TableItem(fUpperList, SWT.NONE);
- ti.setText(fRenderedStrings[i]);
- // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
- Image img = fElementRenderer.getImage(fRenderedStrings[i]);
- ti.setImage(img);
- }
- if (fUpperList.getItemCount() > 0) {
- fUpperList.setSelection(0);
- }
- fUpperList.setRedraw(true);
- }
-
- /**
- * Sent when default selection occurs in the control.
- * <p>
- * For example, on some platforms default selection occurs
- * in a List when the user double-clicks an item or types
- * return in a Text.
- * </p>
- *
- * @param e an event containing information about the default selection
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- // Do nothing
- }
-
- /**
- * Sent when selection occurs in the control.
- * <p>
- * For example, on some platforms selection occurs in
- * a List when the user selects an item or items.
- * </p>
- *
- * @param e an event containing information about the selection
- */
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == fURLPatternButton) {
- fSelection = URL_PATTERN;
- fPageBook.showPage(fURLPatternControl);
- updateOkState();
- } else if (e.widget == fServletButton) {
- fSelection = SERVLET;
- fPageBook.showPage(fServletControl);
- getShell().pack();
- } else
- fSelection = -1;
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizard.java
deleted file mode 100644
index d87fed908..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizard.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_FILTER_WIZARD_PAGE_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_FILTER_WIZARD_WINDOW_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.web.operations.NewFilterClassDataModelProvider;
-import org.eclipse.jst.servlet.ui.IWebUIContextIds;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * New servlet filter wizard
- */
-public class AddFilterWizard extends NewWebArtifactWizard {
-
- public AddFilterWizard() {
- this(null);
- }
-
- public AddFilterWizard(IDataModel model) {
- super(model);
- }
-
- @Override
- protected String getTitle() {
- return ADD_FILTER_WIZARD_WINDOW_TITLE;
- }
-
- @Override
- protected ImageDescriptor getImage() {
- return getImageFromJ2EEPlugin("newfilter_wiz"); //$NON-NLS-1$
- }
-
- @Override
- public void doAddPages() {
- NewFilterClassWizardPage page1 = new NewFilterClassWizardPage(
- getDataModel(),
- PAGE_ONE,
- NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC,
- ADD_FILTER_WIZARD_PAGE_TITLE,
- J2EEProjectUtilities.DYNAMIC_WEB);
- page1.setInfopopID(IWebUIContextIds.WEBEDITOR_FILTER_PAGE_ADD_FILTER_WIZARD_1);
- addPage(page1);
-
- AddFilterWizardPage page2 = new AddFilterWizardPage(getDataModel(), PAGE_TWO);
- page2.setInfopopID(IWebUIContextIds.WEBEDITOR_FILTER_PAGE_ADD_FILTER_WIZARD_2);
- addPage(page2);
-
- NewFilterClassOptionsWizardPage page3 = new NewFilterClassOptionsWizardPage(
- getDataModel(),
- PAGE_THREE,
- NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC,
- ADD_FILTER_WIZARD_PAGE_TITLE);
- page3.setInfopopID(IWebUIContextIds.WEBEDITOR_FILTER_PAGE_ADD_FILTER_WIZARD_3);
- addPage(page3);
- }
-
- @Override
- protected IDataModelProvider getDefaultProvider() {
- return new NewFilterClassDataModelProvider();
- }
-
- @Override
- protected void postPerformFinish() throws InvocationTargetException {
- //open new filter class in java editor
- openJavaClass();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java
deleted file mode 100644
index 49933b2a2..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.FILTER_MAPPINGS;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.INIT_PARAM;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DESCRIPTION;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DISPLAY_NAME;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_FILTER_WIZARD_PAGE_DESC;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_FILTER_WIZARD_PAGE_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DESCRIPTION_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DESCRIPTION_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DISPATCHERS_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.EDIT_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.INIT_PARAM_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.INIT_PARAM_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NAME_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NAME_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NO_WEB_PROJECTS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.REMOVE_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.URL_SERVLET_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.VALUE_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.VALUE_TITLE;
-import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties.PROJECT_NAME;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jst.j2ee.internal.web.operations.FilterMappingItem;
-import org.eclipse.jst.j2ee.internal.web.operations.IFilterMappingItem;
-import org.eclipse.jst.j2ee.internal.wizard.StringArrayTableWizardSection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-/**
- * Filter Wizard Setting Page
- */
-public class AddFilterWizardPage extends DataModelWizardPage {
-
- final static String[] FILTEREXTENSIONS = {"java"}; //$NON-NLS-1$
-
- private Text displayNameText;
-
- FilterMappingsArrayTableWizardSection mappingSection;
-
- public AddFilterWizardPage(IDataModel model, String pageName) {
- super(model, pageName);
- setDescription(ADD_FILTER_WIZARD_PAGE_DESC);
- setTitle(ADD_FILTER_WIZARD_PAGE_TITLE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.ui.wizard.WTPWizardPage#getValidationPropertyNames()
- */
- protected String[] getValidationPropertyNames() {
- return new String[] { DISPLAY_NAME,
- INIT_PARAM,
- FILTER_MAPPINGS };
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 300;
- composite.setLayoutData(data);
-
- createNameDescription(composite);
-
- StringArrayTableWizardSectionCallback callback = new StringArrayTableWizardSectionCallback();
- StringArrayTableWizardSection initSection = new StringArrayTableWizardSection(
- composite,
- INIT_PARAM_LABEL,
- INIT_PARAM_TITLE,
- ADD_BUTTON_LABEL,
- EDIT_BUTTON_LABEL,
- REMOVE_BUTTON_LABEL,
- new String[] { NAME_TITLE, VALUE_TITLE, DESCRIPTION_TITLE },
- new String[] { NAME_LABEL, VALUE_LABEL, DESCRIPTION_LABEL },
- null,// WebPlugin.getDefault().getImage("initializ_parameter"),
- model,
- INIT_PARAM);
- initSection.setCallback(callback);
-
- String[] buttons = new String[] {
- ADD_BUTTON_LABEL,
- EDIT_BUTTON_LABEL,
- REMOVE_BUTTON_LABEL
- };
- String[] columnNames = new String[] {
- null,
- URL_SERVLET_LABEL,
- DISPATCHERS_LABEL
- };
- mappingSection = new FilterMappingsArrayTableWizardSection(composite,
- model, FILTER_MAPPINGS);
-
- String text = displayNameText.getText();
- // Set default URL Pattern
- List input = new ArrayList();
- input.add(new FilterMappingItem(IFilterMappingItem.URL_PATTERN, "/" + text)); //$NON-NLS-1$
- if (mappingSection != null)
- mappingSection.setInput(input);
- displayNameText.setFocus();
-
- IStatus projectStatus = validateProjectName();
- if (!projectStatus.isOK()) {
- setErrorMessage(projectStatus.getMessage());
- composite.setEnabled(false);
- }
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- protected IStatus validateProjectName() {
- // check for empty
- if (model.getStringProperty(PROJECT_NAME) == null || model.getStringProperty(PROJECT_NAME).trim().length() == 0) {
- return WTPCommonPlugin.createErrorStatus(NO_WEB_PROJECTS);
- }
- return WTPCommonPlugin.OK_STATUS;
- }
-
- protected void createNameDescription(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(2, false));
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- // display name
- Label displayNameLabel = new Label(composite, SWT.LEFT);
- displayNameLabel.setText(NAME_LABEL);
- displayNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- displayNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- displayNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- displayNameText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String text = displayNameText.getText();
- // Set default URL Pattern
- List input = new ArrayList();
- input.add(new FilterMappingItem(IFilterMappingItem.URL_PATTERN, "/" + text)); //$NON-NLS-1$
- if (mappingSection != null)
- mappingSection.setInput(input);
- }
-
- });
- synchHelper.synchText(displayNameText, DISPLAY_NAME, null);
-
- // description
- Label descLabel = new Label(composite, SWT.LEFT);
- descLabel.setText(DESCRIPTION_LABEL);
- descLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- Text descText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- descText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- synchHelper.synchText(descText, DESCRIPTION, null);
- }
-
- public String getDisplayName() {
- return displayNameText.getText();
- }
-
- public boolean canFlipToNextPage() {
- if (model.getBooleanProperty(USE_EXISTING_CLASS))
- return false;
- return super.canFlipToNextPage();
- }
-
- @Override
- protected boolean showValidationErrorsOnEnter() {
- return true;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizard.java
deleted file mode 100644
index 1b90021d8..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizard.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_PAGE_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_WINDOW_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.web.operations.NewListenerClassDataModelProvider;
-import org.eclipse.jst.servlet.ui.IWebUIContextIds;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * New application lifecycle listener wizard
- */
-public class AddListenerWizard extends NewWebArtifactWizard {
-
- public AddListenerWizard() {
- this(null);
- }
-
- public AddListenerWizard(IDataModel model) {
- super(model);
- }
-
- @Override
- protected String getTitle() {
- return ADD_LISTENER_WIZARD_WINDOW_TITLE;
- }
-
- @Override
- protected ImageDescriptor getImage() {
- return getImageFromJ2EEPlugin("newlistener_wiz"); //$NON-NLS-1$
- }
-
- @Override
- public void doAddPages() {
- NewListenerClassWizardPage page1 = new NewListenerClassWizardPage(
- getDataModel(),
- PAGE_ONE,
- NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC,
- ADD_LISTENER_WIZARD_PAGE_TITLE, J2EEProjectUtilities.DYNAMIC_WEB);
- page1.setInfopopID(IWebUIContextIds.WEBEDITOR_LISTENER_PAGE_ADD_LISTENER_WIZARD_1);
- addPage(page1);
- AddListenerWizardPage page2 = new AddListenerWizardPage(getDataModel(), PAGE_TWO);
- page2.setInfopopID(IWebUIContextIds.WEBEDITOR_LISTENER_PAGE_ADD_LISTENER_WIZARD_2);
- addPage(page2);
- NewListenerClassOptionsWizardPage page3 = new NewListenerClassOptionsWizardPage(
- getDataModel(),
- PAGE_THREE,
- NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC,
- ADD_LISTENER_WIZARD_PAGE_TITLE);
- page3.setInfopopID(IWebUIContextIds.WEBEDITOR_LISTENER_PAGE_ADD_LISTENER_WIZARD_3);
- addPage(page3);
- }
-
- @Override
- protected void postPerformFinish() throws InvocationTargetException {
- // open new listener class in java editor
- openJavaClass();
- }
-
- @Override
- protected IDataModelProvider getDefaultProvider() {
- return new NewListenerClassDataModelProvider();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java
deleted file mode 100644
index 1cc17843d..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.INTERFACES;
-import static org.eclipse.jst.j2ee.internal.web.operations.NewListenerClassDataModelProvider.LISTENER_INTERFACES;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_HTTP_SESSION_ACTIVATION_LISTENER;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_HTTP_SESSION_ATTRIBUTE_LISTENER;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_HTTP_SESSION_BINDING_LISTENER;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_HTTP_SESSION_LISTENER;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_SERVLET_CONTEXT_ATTRIBUTE_LISTENER;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_SERVLET_CONTEXT_LISTENER;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_SERVLET_REQUEST_ATTRIBUTE_LISTENER;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_SERVLET_REQUEST_LISTENER;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_CHANGES_TO_ATTRIBUTES;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_HTTP_SESSION_EVENTS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_LIFECYCLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_OBJECT_BINDING;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_PAGE_DESC;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_PAGE_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_SERVLET_CONTEXT_EVENTS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_SERVLET_REQUEST_EVENTS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_LISTENER_WIZARD_SESSION_MIGRATION;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.CLEAR_BUTTON;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.SELECT_ALL_BUTTON;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jdt.internal.ui.JavaPluginImages;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-
-public class AddListenerWizardPage extends DataModelWizardPage {
-
- private static final Image IMG_INTERFACE = JavaPluginImages.get(JavaPluginImages.IMG_OBJS_INTERFACE);
-
- protected ServletDataModelSyncHelper synchHelper;
-
- public AddListenerWizardPage(IDataModel model, String pageName) {
- super(model, pageName);
- setDescription(ADD_LISTENER_WIZARD_PAGE_DESC);
- setTitle(ADD_LISTENER_WIZARD_PAGE_TITLE);
- synchHelper = initializeSynchHelper(model);
- }
-
- public ServletDataModelSyncHelper initializeSynchHelper(IDataModel dm) {
- return new ServletDataModelSyncHelper(dm);
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(1, false));
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 300;
- composite.setLayoutData(data);
-
- createServletContextEvents(composite);
- createHttpSessionEvents(composite);
- createServletRequestEvents(composite);
- createSelectAllGroup(composite);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- INTERFACES
- };
- }
-
- @Override
- protected void enter() {
- super.enter();
- synchHelper.synchUIWithModel(INTERFACES, DataModelEvent.VALUE_CHG);
- }
-
- private void createServletContextEvents(Composite parent) {
- Group group = createGroup(parent, ADD_LISTENER_WIZARD_SERVLET_CONTEXT_EVENTS);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_LIFECYCLE,
- QUALIFIED_SERVLET_CONTEXT_LISTENER,
- INTERFACES);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_CHANGES_TO_ATTRIBUTES,
- QUALIFIED_SERVLET_CONTEXT_ATTRIBUTE_LISTENER,
- INTERFACES);
- }
-
- private void createHttpSessionEvents(Composite parent) {
- Group group = createGroup(parent, ADD_LISTENER_WIZARD_HTTP_SESSION_EVENTS);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_LIFECYCLE,
- QUALIFIED_HTTP_SESSION_LISTENER,
- INTERFACES);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_CHANGES_TO_ATTRIBUTES,
- QUALIFIED_HTTP_SESSION_ATTRIBUTE_LISTENER,
- INTERFACES);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_SESSION_MIGRATION,
- QUALIFIED_HTTP_SESSION_ACTIVATION_LISTENER,
- INTERFACES);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_OBJECT_BINDING,
- QUALIFIED_HTTP_SESSION_BINDING_LISTENER,
- INTERFACES);
- }
-
- private void createServletRequestEvents(Composite parent) {
- Group group = createGroup(parent, ADD_LISTENER_WIZARD_SERVLET_REQUEST_EVENTS);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_LIFECYCLE,
- QUALIFIED_SERVLET_REQUEST_LISTENER,
- INTERFACES);
-
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_CHANGES_TO_ATTRIBUTES,
- QUALIFIED_SERVLET_REQUEST_ATTRIBUTE_LISTENER,
- INTERFACES);
- }
-
- private Group createGroup(Composite parent, String text) {
- Group group = new Group(parent, SWT.NONE);
-
- group.setLayout(new GridLayout(3, false));
- group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- group.setText(text);
-
- return group;
- }
-
- private void createEventListenerRow(Composite parent, String event, String listener, String property) {
- createCheckbox(parent, event, listener, property);
- createInterfaceIcon(parent);
- createInterfaceLabel(parent, listener);
- }
-
- private Button createCheckbox(Composite parent, String text, String value, String property) {
- Button button = new Button(parent, SWT.CHECK);
-
- button.setText(text);
- button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
- synchHelper.synchCheckbox(button, value, property, null);
-
- return button;
- }
-
- private Label createInterfaceIcon(Composite parent) {
- GridData data = new GridData();
- data.horizontalIndent = 50;
-
- Label label = new Label(parent, SWT.RIGHT);
- label.setImage(IMG_INTERFACE);
- label.setLayoutData(data);
-
- return label;
- }
-
- private Label createInterfaceLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
-
- label.setText(text);
-
- return label;
- }
-
- private void createSelectAllGroup(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(2, false));
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Button selectAll = new Button(composite, SWT.PUSH);
- selectAll.setText(SELECT_ALL_BUTTON);
- selectAll.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleSelectAll();
- }
- });
-
- Button clear = new Button(composite, SWT.PUSH);
- clear.setText(CLEAR_BUTTON);
- clear.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleSelectNone();
- }
- });
- }
-
- private void handleSelectAll() {
- List interfaces = (List) model.getProperty(INTERFACES);
- if (interfaces == null) {
- interfaces = new ArrayList();
- model.setProperty(INTERFACES, interfaces);
- }
-
- for (String iface : LISTENER_INTERFACES) {
- if (!interfaces.contains(iface)) {
- interfaces.add(iface);
- }
- }
-
- synchHelper.synchUIWithModel(INTERFACES, DataModelEvent.VALUE_CHG);
- model.notifyPropertyChange(INTERFACES, DataModelEvent.VALUE_CHG);
- }
-
- private void handleSelectNone() {
- List interfaces = (List) model.getProperty(INTERFACES);
- if (interfaces == null) {
- interfaces = new ArrayList();
- model.setProperty(INTERFACES, interfaces);
- }
-
- interfaces.removeAll(Arrays.asList(LISTENER_INTERFACES));
-
- synchHelper.synchUIWithModel(INTERFACES, DataModelEvent.VALUE_CHG);
- model.notifyPropertyChange(INTERFACES, DataModelEvent.VALUE_CHG);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java
deleted file mode 100644
index b3a35d657..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Kaloyan Raev, kaloyan.raev@sap.com
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.IS_SERVLET_TYPE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_SERVLET_WIZARD_PAGE_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_SERVLET_WIZARD_WINDOW_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModelProvider;
-import org.eclipse.jst.servlet.ui.IWebUIContextIds;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * New servlet wizard
- */
-public class AddServletWizard extends NewWebArtifactWizard {
-
- public AddServletWizard() {
- this(null);
- }
-
- public AddServletWizard(IDataModel model) {
- super(model);
- }
-
- @Override
- protected String getTitle() {
- return ADD_SERVLET_WIZARD_WINDOW_TITLE;
- }
-
- @Override
- protected ImageDescriptor getImage() {
- return J2EEUIPlugin.getDefault().getImageDescriptor("newservlet_wiz"); //$NON-NLS-1$
- }
-
- @Override
- public void doAddPages() {
- NewServletClassWizardPage page1 = new NewServletClassWizardPage(
- getDataModel(),
- PAGE_ONE,
- NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC,
- ADD_SERVLET_WIZARD_PAGE_TITLE, J2EEProjectUtilities.DYNAMIC_WEB);
- page1.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_1);
- addPage(page1);
- AddServletWizardPage page2 = new AddServletWizardPage(getDataModel(), PAGE_TWO);
- page2.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_2);
- addPage(page2);
- NewServletClassOptionsWizardPage page3 = new NewServletClassOptionsWizardPage(
- getDataModel(),
- PAGE_THREE,
- NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC,
- ADD_SERVLET_WIZARD_PAGE_TITLE);
- page3.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_3);
- addPage(page3);
- }
-
- @Override
- protected void postPerformFinish() throws InvocationTargetException {
- boolean isServlet = getDataModel().getBooleanProperty(IS_SERVLET_TYPE);
- if (isServlet) {
- // open new servlet class in java editor
- openJavaClass();
- } else {
- // open new jsp file in jsp editor
- openWebFile();
- }
- }
-
- @Override
- protected IDataModelProvider getDefaultProvider() {
- return new NewServletClassDataModelProvider();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java
deleted file mode 100644
index 32861cbcb..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- * Kaloyan Raev, kaloyan.raev@sap.com
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.INIT_PARAM;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.URL_MAPPINGS;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DESCRIPTION;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DISPLAY_NAME;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_SERVLET_WIZARD_PAGE_DESC;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_SERVLET_WIZARD_PAGE_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DESCRIPTION_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DESCRIPTION_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.EDIT_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.INIT_PARAM_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.INIT_PARAM_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NAME_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NAME_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NO_WEB_PROJECTS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.REMOVE_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.URL_MAPPINGS_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.URL_MAPPINGS_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.URL_PATTERN_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.URL_PATTERN_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.VALUE_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.VALUE_TITLE;
-import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties.PROJECT_NAME;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jst.j2ee.internal.wizard.StringArrayTableWizardSection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-/**
- * Servlet Wizard Setting Page
- */
-public class AddServletWizardPage extends DataModelWizardPage {
- final static String[] JSPEXTENSIONS = {"jsp"}; //$NON-NLS-1$
-
- private Text displayNameText;
-
- private StringArrayTableWizardSection urlSection;
-
- public AddServletWizardPage(IDataModel model, String pageName) {
- super(model, pageName);
- setDescription(ADD_SERVLET_WIZARD_PAGE_DESC);
- this.setTitle(ADD_SERVLET_WIZARD_PAGE_TITLE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.ui.wizard.WTPWizardPage#getValidationPropertyNames()
- */
- protected String[] getValidationPropertyNames() {
- return new String[] { DISPLAY_NAME, INIT_PARAM, URL_MAPPINGS };
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 300;
- composite.setLayoutData(data);
-
- createNameDescription(composite);
-
- StringArrayTableWizardSectionCallback callback = new StringArrayTableWizardSectionCallback();
- StringArrayTableWizardSection initSection = new StringArrayTableWizardSection(
- composite,
- INIT_PARAM_LABEL,
- INIT_PARAM_TITLE,
- ADD_BUTTON_LABEL,
- EDIT_BUTTON_LABEL,
- REMOVE_BUTTON_LABEL,
- new String[] { NAME_TITLE, VALUE_TITLE, DESCRIPTION_TITLE },
- new String[] { NAME_LABEL, VALUE_LABEL, DESCRIPTION_LABEL },
- null,// WebPlugin.getDefault().getImage("initializ_parameter"),
- model,
- INIT_PARAM);
- initSection.setCallback(callback);
- urlSection = new StringArrayTableWizardSection(
- composite,
- URL_MAPPINGS_LABEL,
- URL_MAPPINGS_TITLE,
- ADD_BUTTON_LABEL,
- EDIT_BUTTON_LABEL,
- REMOVE_BUTTON_LABEL,
- new String[] { URL_PATTERN_TITLE },
- new String[] { URL_PATTERN_LABEL },
- null,// WebPlugin.getDefault().getImage("url_type"),
- model,
- URL_MAPPINGS);
- urlSection.setCallback(callback);
-
- String text = displayNameText.getText();
- // Set default URL Pattern
- List input = new ArrayList();
- input.add(new String[]{"/" + text}); //$NON-NLS-1$
- if (urlSection != null)
- urlSection.setInput(input);
- displayNameText.setFocus();
-
- IStatus projectStatus = validateProjectName();
- if (!projectStatus.isOK()) {
- setErrorMessage(projectStatus.getMessage());
- composite.setEnabled(false);
- }
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- protected IStatus validateProjectName() {
- // check for empty
- if (model.getStringProperty(PROJECT_NAME) == null || model.getStringProperty(PROJECT_NAME).trim().length() == 0) {
- return WTPCommonPlugin.createErrorStatus(NO_WEB_PROJECTS);
- }
- return WTPCommonPlugin.OK_STATUS;
- }
-
- protected void createNameDescription(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(2, false));
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- // display name
- Label displayNameLabel = new Label(composite, SWT.LEFT);
- displayNameLabel.setText(NAME_LABEL);
- displayNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- displayNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- displayNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- displayNameText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String text = displayNameText.getText();
- // Set default URL Pattern
- List input = new ArrayList();
- input.add(new String[]{"/" + text}); //$NON-NLS-1$
- if (urlSection != null)
- urlSection.setInput(input);
- }
-
- });
- synchHelper.synchText(displayNameText, DISPLAY_NAME, null);
-
- // description
- Label descLabel = new Label(composite, SWT.LEFT);
- descLabel.setText(DESCRIPTION_LABEL);
- descLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- Text descText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- descText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- synchHelper.synchText(descText, DESCRIPTION, null);
- }
-
- public String getDisplayName() {
- return displayNameText.getText();
- }
-
- public boolean canFlipToNextPage() {
- if (model.getBooleanProperty(USE_EXISTING_CLASS))
- return false;
- return super.canFlipToNextPage();
- }
-
- @Override
- protected boolean showValidationErrorsOnEnter() {
- return true;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AvailableWebLibProvider.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AvailableWebLibProvider.java
deleted file mode 100644
index 8ce5e4a85..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AvailableWebLibProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper;
-import org.eclipse.jst.j2ee.internal.wizard.AvailableJarsProvider;
-import org.eclipse.swt.graphics.Image;
-
-public class AvailableWebLibProvider implements IStructuredContentProvider, ITableLabelProvider {
-
- public AvailableWebLibProvider() {
- }
-
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof ArchiveWrapper) {
- Object[] array = ((ArchiveWrapper) inputElement).getWebLibs().toArray();
- Arrays.sort(array, new Comparator() {
- public int compare(Object o1, Object o2) {
- return getColumnText(o1, 0).compareTo(getColumnText(o2, 0));
- }
-
- });
- return array;
- }
- return new Object[0];
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return AvailableJarsProvider.getUtilImage();
- }
-
- public String getColumnText(Object element, int columnIndex) {
- ArchiveWrapper wrapper = (ArchiveWrapper)element;
- return wrapper.getName();
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void addListener(ILabelProviderListener listener) {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebModuleTypeDialog.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebModuleTypeDialog.java
deleted file mode 100644
index e44d7c3b1..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebModuleTypeDialog.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.IShellProvider;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class ConvertToWebModuleTypeDialog extends Dialog {
-
- private String fShellTitle = IWebWizardConstants.CONVERT_TO_WEB_TITLE;
- private String fLabelText = IWebWizardConstants.SELECT_WEB_VERSION;
- private static String fSelection= null;
- private String[] fAllowedStrings = new String[] {J2EEVersionConstants.VERSION_2_2_TEXT, J2EEVersionConstants.VERSION_2_3_TEXT, J2EEVersionConstants.VERSION_2_4_TEXT, J2EEVersionConstants.VERSION_2_5_TEXT};
- private int fInitialSelectionIndex = fAllowedStrings.length-1;
-
- public static String getSelectedVersion() {
- return fSelection;
- }
-
- public ConvertToWebModuleTypeDialog(IShellProvider parentShell) {
- super(parentShell);
- }
-
- public ConvertToWebModuleTypeDialog(Shell parentShell) {
- super(parentShell);
- }
-
- protected Control createDialogArea(Composite parent) {
- getShell().setText(fShellTitle);
-
- Composite composite = (Composite)super.createDialogArea(parent);
- Composite innerComposite = new Composite(composite, SWT.NONE);
- innerComposite.setLayoutData(new GridData());
- GridLayout gl= new GridLayout();
- gl.numColumns= 2;
- innerComposite.setLayout(gl);
-
- Label label= new Label(innerComposite, SWT.NONE);
- label.setText(fLabelText);
- label.setLayoutData(new GridData());
-
- final Combo combo= new Combo(innerComposite, SWT.READ_ONLY);
- for (int i = 0; i < fAllowedStrings.length; i++) {
- combo.add(fAllowedStrings[i]);
- }
- combo.select(fInitialSelectionIndex);
- fSelection= combo.getItem(combo.getSelectionIndex());
- GridData gd= new GridData();
- combo.setLayoutData(gd);
- combo.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- fSelection= combo.getItem(combo.getSelectionIndex());
- }
- });
- return composite;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/FilterMappingsArrayTableWizardSection.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/FilterMappingsArrayTableWizardSection.java
deleted file mode 100644
index 92a7feca4..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/FilterMappingsArrayTableWizardSection.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DISPATCHERS_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.EDIT_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.FILTER_MAPPINGS_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.REMOVE_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.URL_SERVLET_LABEL;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.j2ee.internal.web.operations.FilterMappingItem;
-import org.eclipse.jst.j2ee.internal.web.operations.IFilterMappingItem;
-import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin;
-import org.eclipse.jst.j2ee.internal.web.providers.WebAppEditResourceHandler;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class FilterMappingsArrayTableWizardSection extends Composite {
-
- protected class StringArrayListContentProvider implements IStructuredContentProvider {
- public boolean isDeleted(Object element) {
- return false;
- }
- public Object[] getElements(Object element) {
- if (element instanceof List) {
- return ((List<FilterMappingItem>) element).toArray();
- }
- return new Object[0];
- }
- public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) {
- //Default nothing
- }
- public void dispose() {
- //Default nothing
- }
- }
- protected class StringArrayListLabelProvider extends LabelProvider implements ITableLabelProvider {
- private final Image URL_PATTERN_ICON =
- ImageDescriptor.createFromURL((URL) WebPlugin.getDefault().getImage("url_mapping")).createImage();
- private final Image SERVLET_ICON =
- ImageDescriptor.createFromURL((URL) WebPlugin.getDefault().getImage("servlet")).createImage();
-
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- FilterMappingItem item = (FilterMappingItem) element;
- if (item.isServletNameType()) {
- return SERVLET_ICON;
- } else if (item.isUrlPatternType()) {
- return URL_PATTERN_ICON;
- }
-
- }
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (columnIndex == 1) {
- return ((FilterMappingItem) element).getName();
- } else if (columnIndex == 2) {
- return ((FilterMappingItem) element).getDispatchersAsString();
- }
- return null;
- }
-
- }
-
- final static int ICON_WIDTH = 25;
- final static int DISPATCHERS_WIDTH = 100;
- private final static String ICON_PROP = "ICON_PROP";
- private final static String NAME_PROP = "NAME_PROP";
- private final static String DISPATCHERS_PROP = "DISPATCHERS_PROP";
-
- private TableViewer viewer;
- private Button addButton;
- private Button editButton;
- private Button removeButton;
- private IDataModel model;
- private String propertyName;
-
- public FilterMappingsArrayTableWizardSection(Composite parent, IDataModel model, String propertyName) {
- super(parent, SWT.NONE);
-
- this.model = model;
- this.propertyName = propertyName;
-
- GridLayout layout = new GridLayout(2, false);
- layout.marginHeight = 4;
- layout.marginWidth = 0;
- this.setLayout(layout);
- this.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label titleLabel = new Label(this, SWT.LEFT);
- titleLabel.setText(FILTER_MAPPINGS_LABEL);
- GridData data = new GridData();
- data.horizontalSpan = 2;
- titleLabel.setLayoutData(data);
-
- Table table = new Table(this, SWT.FULL_SELECTION | SWT.BORDER);
- viewer = new TableViewer(table);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- viewer.setContentProvider(new StringArrayListContentProvider());
- viewer.setLabelProvider(new StringArrayListLabelProvider());
-
- final Composite buttonCompo = new Composite(this, SWT.NULL);
- layout = new GridLayout();
- layout.marginHeight = 0;
- buttonCompo.setLayout(layout);
- buttonCompo.setLayoutData(new GridData(GridData.FILL_VERTICAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- addButton = new Button(buttonCompo, SWT.PUSH);
- addButton.setText(ADD_BUTTON_LABEL);
- addButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL));
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- handleAddButtonSelected();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- //Do nothing
- }
- });
-
- editButton = new Button(buttonCompo, SWT.PUSH);
- editButton.setText(EDIT_BUTTON_LABEL);
- editButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL));
- editButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- handleEditButtonSelected();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- //Do nothing
- }
- });
- editButton.setEnabled(false);
-
- removeButton = new Button(buttonCompo, SWT.PUSH);
- removeButton.setText(REMOVE_BUTTON_LABEL);
- removeButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL));
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- handleRemoveButtonSelected();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- //Do nothing
- }
- });
- removeButton.setEnabled(false);
-
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (editButton != null) {
- boolean enabled = ((IStructuredSelection) selection).size() == 1;
- editButton.setEnabled(enabled);
- }
- removeButton.setEnabled(!selection.isEmpty());
- }
- });
-
- if (editButton != null) {
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- handleEditButtonSelected();
- }
- });
- }
-
- TableColumn tableColumn = new TableColumn(table, SWT.NONE);
- tableColumn.setWidth(ICON_WIDTH);
- tableColumn.setResizable(false);
- tableColumn = new TableColumn(table, SWT.NONE);
- tableColumn.setText(URL_SERVLET_LABEL);
- tableColumn.setResizable(true);
- tableColumn = new TableColumn(table, SWT.NONE);
- tableColumn.setText(DISPATCHERS_LABEL);
- tableColumn.setWidth(DISPATCHERS_WIDTH);
- tableColumn.setResizable(false);
- viewer.setColumnProperties(new String[] {ICON_PROP, NAME_PROP, DISPATCHERS_PROP});
- table.setHeaderVisible(true);
- this.addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Table table = viewer.getTable();
- TableColumn[] columns = table.getColumns();
- Point buttonArea = buttonCompo.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle area = table.getParent().getClientArea();
- Point preferredSize = viewer.getTable().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2*table.getBorderWidth() - buttonArea.x - columns.length*2;
- if (preferredSize.y > area.height + table.getHeaderHeight()) {
- // Subtract the scrollbar width from the total column width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
- Point oldSize = table.getSize();
- for (int i=0; i < columns.length; i++) {
- if (oldSize.x > area.width) {
- // table is getting smaller so make the columns
- // smaller first and then resize the table to
- // match the client area width
- if (i == 1) columns[i].setWidth(width - ICON_WIDTH - DISPATCHERS_WIDTH);
- table.setSize(area.width - buttonArea.x - columns.length*2, area.height);
- } else {
- // table is getting bigger so make the table
- // bigger first and then make the columns wider
- // to match the client area width
- table.setSize(area.width - buttonArea.x - columns.length*2, area.height);
- if (i == 1) columns[i].setWidth(width - ICON_WIDTH - DISPATCHERS_WIDTH);
- }
- }
- }
- });
- }
-
- private void handleAddButtonSelected() {
- String title = WebAppEditResourceHandler.getString("Add_Filter_Mapping_Title_UI_");
- IProject p = (IProject) model.getProperty(PROJECT);
- List valueList = (List) viewer.getInput();
- AddEditFilterMappingDialog dialog =
- new AddEditFilterMappingDialog(getShell(), title, p, valueList, null);
- dialog.open();
- Object[] result = dialog.getResult();
-
- addFilterMapping((result != null && result.length > 0) ? (IFilterMappingItem) result[0] : null);
- }
-
- private void handleEditButtonSelected() {
- String title = WebAppEditResourceHandler.getString("Edit_Filter_Mapping_Title_UI_");
- ISelection s = viewer.getSelection();
- if (!(s instanceof IStructuredSelection))
- return;
- IStructuredSelection selection = (IStructuredSelection) s;
- if (selection.size() != 1)
- return;
- List valueList = (List) viewer.getInput();
- Object selectedObj = selection.getFirstElement();
- FilterMappingItem value = (FilterMappingItem) selectedObj;
- IProject p = (IProject) model.getProperty(PROJECT);
- AddEditFilterMappingDialog dialog =
- new AddEditFilterMappingDialog(getShell(), title, p, valueList, value);
- dialog.open();
- Object[] result = dialog.getResult();
- if (result == null || result.length == 0) return;
- editFilterMapping(value, (IFilterMappingItem) result[0]);
- }
-
- private void handleRemoveButtonSelected() {
- ISelection selection = viewer.getSelection();
- if (selection.isEmpty() || !(selection instanceof IStructuredSelection))
- return;
- List selectedObj = ((IStructuredSelection) selection).toList();
- removeFilterMappings(selectedObj);
- }
-
- private void addFilterMapping(IFilterMappingItem filterMapping) {
- if (filterMapping == null) return;
- List valueList = (List) viewer.getInput();
- if (valueList == null) {
- valueList = new ArrayList();
- }
- valueList.add(filterMapping);
- setInput(valueList);
- }
-
- private void editFilterMapping(IFilterMappingItem oldFilterMapping, IFilterMappingItem newFilterMapping) {
- if (newFilterMapping == null) return;
- List valueList = (List) viewer.getInput();
- if (valueList == null) {
- valueList = new ArrayList();
- }
- int index = valueList.indexOf(oldFilterMapping);
- if (index == -1) {
- valueList.add(newFilterMapping);
- } else {
- valueList.set(index, newFilterMapping);
- }
-
- setInput(valueList);
- }
-
- private void removeFilterMappings(Collection selectedFilterMappings) {
- List valueList = (List) viewer.getInput();
- valueList.removeAll(selectedFilterMappings);
- setInput(valueList);
- }
-
- public void setInput(List input) {
- viewer.setInput(input);
- // Create a new list to trigger property change
- List newInput = new ArrayList();
- newInput.addAll(input);
- model.setProperty(propertyName, newInput);
- }
-
- public List getInput() {
- List valueList = (List) viewer.getInput();
- if (valueList == null) {
- valueList = new ArrayList();
- }
- return valueList;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/IWebWizardConstants.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/IWebWizardConstants.java
deleted file mode 100644
index 3727531b6..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/IWebWizardConstants.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages;
-
-public interface IWebWizardConstants {
-
- // AddServletWizard
- public final static String ADD_SERVLET_WIZARD_WINDOW_TITLE = WEBUIMessages.ADD_SERVLET_WIZARD_WINDOW_TITLE;
- public final static String ADD_SERVLET_WIZARD_PAGE_TITLE = WEBUIMessages.ADD_SERVLET_WIZARD_PAGE_TITLE;
- public final static String ADD_SERVLET_WIZARD_PAGE_DESC = WEBUIMessages.ADD_SERVLET_WIZARD_PAGE_DESC;
-
- public final static String DEFAULT_PACKAGE = WEBUIMessages.DEFAULT_PACKAGE;
- public final static String SELECT_CLASS_TITLE = WEBUIMessages.SELECT_CLASS_TITLE;
- public final static String MAP_CLASS_NAME_TO_CLASS_ERROR_MSG = WEBUIMessages.MAP_CLASS_NAME_TO_CLASS_ERROR_MSG;
- public final static String EMPTY_LIST_MSG = WEBUIMessages.EMPTY_LIST_MSG;
- public final static String ADD_LABEL = WEBUIMessages.ADD_LABEL;
- public final static String USE_EXISTING_SERVLET_CLASS = WEBUIMessages.USE_EXISTING_SERVLET_CLASS;
- public final static String INIT_PARAM_TITLE = WEBUIMessages.INIT_PARAM_TITLE;
- public final static String INIT_PARAM_LABEL = WEBUIMessages.INIT_PARAM_LABEL;
- public final static String URL_MAPPINGS_TITLE = WEBUIMessages.URL_MAPPINGS_TITLE;
- public final static String URL_MAPPINGS_LABEL = WEBUIMessages.URL_MAPPINGS_LABEL;
- public final static String CHOOSE_SERVLET_CLASS = WEBUIMessages.CHOOSE_SERVLET_CLASS;
-
- // NewServletWizard
- public final static String NEW_SERVLET_WIZARD_WINDOW_TITLE = WEBUIMessages.NEW_SERVLET_WIZARD_WINDOW_TITLE;
- public final static String NEW_SERVLET_WIZARD_PAGE_TITLE = WEBUIMessages.NEW_SERVLET_WIZARD_PAGE_TITLE;
- public final static String NEW_SERVLET_WIZARD_PAGE_DESC = WEBUIMessages.NEW_SERVLET_WIZARD_PAGE_DESC;
- public final static String SERVLET_PACKAGE_LABEL = WEBUIMessages.SERVLET_PACKAGE_LABEL;
- public final static String SERVLET_NAME_LABEL = WEBUIMessages.SERVLET_NAME_LABEL;
-
- // AddFilterWizard
- public final static String ADD_FILTER_WIZARD_WINDOW_TITLE = WEBUIMessages.ADD_FILTER_WIZARD_WINDOW_TITLE;
- public final static String ADD_FILTER_WIZARD_PAGE_TITLE = WEBUIMessages.ADD_FILTER_WIZARD_PAGE_TITLE;
- public final static String ADD_FILTER_WIZARD_PAGE_DESC = WEBUIMessages.ADD_FILTER_WIZARD_PAGE_DESC;
-
- public final static String USE_EXISTING_FILTER_CLASS = WEBUIMessages.USE_EXISTING_FILTER_CLASS;
- public final static String CHOOSE_FILTER_CLASS = WEBUIMessages.CHOOSE_FILTER_CLASS;
- public final static String SERVLET_MAPPINGS_LABEL = WEBUIMessages.SERVLET_MAPPINGS_LABEL;
- public final static String FILTER_MAPPINGS_LABEL = WEBUIMessages.FILTER_MAPPINGS_LABEL;
- public final static String URL_SERVLET_LABEL = WEBUIMessages.URL_SERVLET_LABEL;
- public final static String DISPATCHERS_LABEL = WEBUIMessages.DISPATCHERS_LABEL;
-
- public static String REQUEST = WEBUIMessages.DISPATCHER_REQUEST;
- public static String FORWARD = WEBUIMessages.DISPATCHER_FORWARD;
- public static String INCLUDE = WEBUIMessages.DISPATCHER_INCLUDE;
- public static String ERROR = WEBUIMessages.DISPATCHER_ERROR;
-
- // NewFilterWizard
- public final static String NEW_FILTER_WIZARD_WINDOW_TITLE = WEBUIMessages.NEW_FILTER_WIZARD_WINDOW_TITLE;
-
- // AddListenerWizard
- public final static String ADD_LISTENER_WIZARD_WINDOW_TITLE = WEBUIMessages.ADD_LISTENER_WIZARD_WINDOW_TITLE;
- public final static String ADD_LISTENER_WIZARD_PAGE_TITLE = WEBUIMessages.ADD_LISTENER_WIZARD_PAGE_TITLE;
- public final static String ADD_LISTENER_WIZARD_PAGE_DESC = WEBUIMessages.ADD_LISTENER_WIZARD_PAGE_DESC;
-
- public final static String USE_EXISTING_LISTENER_CLASS = WEBUIMessages.USE_EXISTING_LISTENER_CLASS;
- public final static String ADD_LISTENER_WIZARD_SERVLET_CONTEXT_EVENTS = WEBUIMessages.ADD_LISTENER_WIZARD_SERVLET_CONTEXT_EVENTS;
- public final static String ADD_LISTENER_WIZARD_HTTP_SESSION_EVENTS = WEBUIMessages.ADD_LISTENER_WIZARD_HTTP_SESSION_EVENTS;
- public final static String ADD_LISTENER_WIZARD_SERVLET_REQUEST_EVENTS = WEBUIMessages.ADD_LISTENER_WIZARD_SERVLET_REQUEST_EVENTS;
- public final static String ADD_LISTENER_WIZARD_LIFECYCLE = WEBUIMessages.ADD_LISTENER_WIZARD_LIFECYCLE;
- public final static String ADD_LISTENER_WIZARD_CHANGES_TO_ATTRIBUTES = WEBUIMessages.ADD_LISTENER_WIZARD_CHANGES_TO_ATTRIBUTES;
- public final static String ADD_LISTENER_WIZARD_SESSION_MIGRATION = WEBUIMessages.ADD_LISTENER_WIZARD_SESSION_MIGRATION;
- public final static String ADD_LISTENER_WIZARD_OBJECT_BINDING = WEBUIMessages.ADD_LISTENER_WIZARD_OBJECT_BINDING;
-
- // common
- public final static String ADD_BUTTON_LABEL = WEBUIMessages.ADD_BUTTON_LABEL;
- public final static String EDIT_BUTTON_LABEL = WEBUIMessages.EDIT_BUTTON_LABEL;
- public final static String REMOVE_BUTTON_LABEL = WEBUIMessages.REMOVE_BUTTON_LABEL;
- public final static String URL_PATTERN_TITLE = WEBUIMessages.URL_PATTERN_TITLE;
- public final static String URL_PATTERN_LABEL = WEBUIMessages.URL_PATTERN_LABEL;
- public final static String FOLDER_LABEL = WEBUIMessages.FOLDER_LABEL;
- public final static String JAVA_PACKAGE_LABEL = WEBUIMessages.JAVA_PACKAGE_LABEL;
- public final static String CLASS_NAME_LABEL = WEBUIMessages.CLASS_NAME_LABEL;
- public final static String SUPERCLASS_LABEL = WEBUIMessages.SUPERCLASS_LABEL;
- public final static String CONTAINER_SELECTION_DIALOG_TITLE = WEBUIMessages.CONTAINER_SELECTION_DIALOG_TITLE;
- public final static String CONTAINER_SELECTION_DIALOG_DESC = WEBUIMessages.CONTAINER_SELECTION_DIALOG_DESC;
- public final static String CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG = WEBUIMessages.CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG;
- public final static String PACKAGE_SELECTION_DIALOG_TITLE = WEBUIMessages.PACKAGE_SELECTION_DIALOG_TITLE;
- public final static String PACKAGE_SELECTION_DIALOG_DESC = WEBUIMessages.PACKAGE_SELECTION_DIALOG_DESC;
- public final static String PACKAGE_SELECTION_DIALOG_MSG_NONE = WEBUIMessages.PACKAGE_SELECTION_DIALOG_MSG_NONE;
- public final static String SUPERCLASS_SELECTION_DIALOG_TITLE = WEBUIMessages.SUPERCLASS_SELECTION_DIALOG_TITLE;
- public final static String SUPERCLASS_SELECTION_DIALOG_DESC = WEBUIMessages.SUPERCLASS_SELECTION_DIALOG_DESC;
- public final static String INTERFACE_SELECTION_DIALOG_TITLE = WEBUIMessages.INTERFACE_SELECTION_DIALOG_TITLE;
- public final static String INTERFACE_SELECTION_DIALOG_DESC = WEBUIMessages.INTERFACE_SELECTION_DIALOG_DESC;
- public final static String INTERFACE_SELECTION_DIALOG_MSG_NONE = WEBUIMessages.INTERFACE_SELECTION_DIALOG_MSG_NONE;
- public final static String JAVA_CLASS_MODIFIERS_LABEL = WEBUIMessages.JAVA_CLASS_MODIFIERS_LABEL;
- public final static String JAVA_CLASS_INTERFACES_LABEL = WEBUIMessages.JAVA_CLASS_INTERFACES_LABEL;
- public final static String JAVA_CLASS_METHOD_STUBS_LABEL = WEBUIMessages.JAVA_CLASS_METHOD_STUBS_LABEL;
- public final static String JAVA_CLASS_PUBLIC_CHECKBOX_LABEL = WEBUIMessages.JAVA_CLASS_PUBLIC_CHECKBOX_LABEL;
- public final static String JAVA_CLASS_ABSTRACT_CHECKBOX_LABEL = WEBUIMessages.JAVA_CLASS_ABSTRACT_CHECKBOX_LABEL;
- public final static String JAVA_CLASS_FINAL_CHECKBOX_LABEL = WEBUIMessages.JAVA_CLASS_FINAL_CHECKBOX_LABEL;
- public final static String JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL = WEBUIMessages.JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL;
- public final static String JAVA_CLASS_MAIN_CHECKBOX_LABEL = WEBUIMessages.JAVA_CLASS_MAIN_CHECKBOX_LABEL;
- public final static String JAVA_CLASS_INHERIT_CHECKBOX_LABEL = WEBUIMessages.JAVA_CLASS_INHERIT_CHECKBOX_LABEL;
- public final static String JAVA_CLASS_BROWER_DIALOG_TITLE = WEBUIMessages.JAVA_CLASS_BROWER_DIALOG_TITLE;
- public final static String JAVA_CLASS_BROWER_DIALOG_MESSAGE = WEBUIMessages.JAVA_CLASS_BROWER_DIALOG_MESSAGE;
-
- public final static String NAME_TITLE = WEBUIMessages.NAME_TITLE;
- public final static String NAME_LABEL = WEBUIMessages.NAME_LABEL;
- public final static String DESCRIPTION_TITLE = WEBUIMessages.DESCRIPTION_TITLE;
- public final static String DESCRIPTION_LABEL = WEBUIMessages.DESCRIPTION_LABEL;
- public final static String VALUE_TITLE = WEBUIMessages.VALUE_TITLE;
- public final static String VALUE_LABEL = WEBUIMessages.VALUE_LABEL;
- public final static String EMPTY_STRING = ""; //$NON-NLS-1$
- public final static String BROWSE_BUTTON_LABEL = WEBUIMessages.BROWSE_BUTTON_LABEL;
- public static final String REMOVE_BUTTON = WEBUIMessages.REMOVE_BUTTON;
- public final static String SELECT_ALL_BUTTON = WEBUIMessages.SELECT_ALL_BUTTON;
- public final static String CLEAR_BUTTON = WEBUIMessages.CLEAR_BUTTON;
-
-
- public final static String NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC = WEBUIMessages.NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC;
- public final static String NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC = WEBUIMessages.NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC;
-
- public final static String ImportWARAction_UI_ = WEBUIMessages.ImportWARAction_UI_;
- public final static String ExportWARAction_UI_ = WEBUIMessages.ExportWARAction_UI_;
-
- public final static String NO_WEB_PROJECTS = WEBUIMessages.NO_WEB_PROJECTS;
-
- public static final String SERVLETS = WEBUIMessages.SERVLETS;
-
- public static final String CONVERT_TO_WEB_TITLE = WEBUIMessages.ConvertToWebTitle;
- public static final String SELECT_WEB_VERSION = WEBUIMessages.SelectWebVersion;
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFileSelectionDialog.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFileSelectionDialog.java
deleted file mode 100644
index 5736cb90f..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFileSelectionDialog.java
+++ /dev/null
@@ -1,666 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Kaloyan Raev, kaloyan.raev@sap.com
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_SERVLET;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DEFAULT_PACKAGE;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.ui.ISharedImages;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jst.j2ee.internal.dialogs.FilteredFileSelectionDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.TwoArrayQuickSorter;
-import org.eclipse.jst.j2ee.internal.dialogs.TypedFileViewerFilter;
-import org.eclipse.jst.j2ee.internal.web.providers.WebAppEditResourceHandler;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Insert the type's description here.
- * Creation date: (7/30/2001 11:16:36 AM)
- */
-public class MultiSelectFilteredFileSelectionDialog extends
- FilteredFileSelectionDialog implements SelectionListener {
-
-
- private static class PackageRenderer extends LabelProvider {
- private final Image PACKAGE_ICON = JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_PACKAGE);
-
- public String getText(Object element) {
- IType type = (IType) element;
- String p = type.getPackageFragment().getElementName();
- if ("".equals(p)) //$NON-NLS-1$
- p = DEFAULT_PACKAGE;
- return (p + " - " + type.getPackageFragment().getParent().getPath().toString()); //$NON-NLS-1$
- }
- public Image getImage(Object element) {
- return PACKAGE_ICON;
- }
- }
-
- private static class TypeRenderer extends LabelProvider {
- private final Image CLASS_ICON = JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CLASS);
-
- public String getText(Object element) {
- IType e = ((IType) element);
- return e.getElementName();
- }
-
- public Image getImage(Object element) {
- return CLASS_ICON;
- }
-
- }
- public final static int JSP = 0;
- public final static int SERVLET = 1;
- protected Button fServletButton;
- protected Button fJSPButton;
- protected int fSelection = -1;
- protected PageBook fPageBook = null;
- protected Control fJspControl = null;
- protected Control fServletControl = null;
- protected Composite fChild = null;
- // construction parameters
- protected IRunnableContext fRunnableContext;
- protected ILabelProvider fElementRenderer;
- protected ILabelProvider fQualifierRenderer;
- private Object[] fElements;
- private boolean fIgnoreCase = true;
- private String fUpperListLabel;
- private String fLowerListLabel;
- // SWT widgets
- private Table fUpperList;
- private Table fLowerList;
- protected Text fText;
- private IType[] fIT;
- private String[] fRenderedStrings;
- private int[] fElementMap;
- private Integer[] fQualifierMap;
-
- private ISelectionStatusValidator fLocalValidator = null;
- /**
- * MultiSelectFilteredFileSelectionDialog constructor comment.
- * @param parent Shell
- * @param title String
- * @param message String
- * @parent extensions String[]
- * @param allowMultiple boolean
- */
- public MultiSelectFilteredFileSelectionDialog(Shell parent, String title, String message, String[] extensions, boolean allowMultiple, IProject project) {
- super(parent, title, message, extensions, allowMultiple);
- setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
-
- if (title == null)
- setTitle(WebAppEditResourceHandler.getString("File_Selection_UI_")); //$NON-NLS-1$
- if (message == null)
- message = WebAppEditResourceHandler.getString("Select_a_file__UI_"); //$NON-NLS-1$
- setMessage(message);
- setExtensions(extensions);
- addFilter(new TypedFileViewerFilter(extensions));
- fLocalValidator = new SimpleTypedElementSelectionValidator(new Class[] { IFile.class }, allowMultiple);
- setValidator(fLocalValidator);
-
- //StatusInfo currStatus = new StatusInfo();
- //currStatus.setOK();
- Status currStatus = new Status(Status.OK, ServletUIPlugin.PLUGIN_ID, Status.OK, "", null);
-
- updateStatus(currStatus);
- fElementRenderer = new TypeRenderer();
- fQualifierRenderer = new PackageRenderer();
- fRunnableContext = ServletUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- try {
- IJavaElement jelem = null;
- IProject proj = null;
- jelem = (IJavaElement) project.getAdapter(IJavaElement.class);
- if (jelem == null) {
- IResource resource = (IResource) project.getAdapter(IResource.class);
- if (resource != null) {
- proj = resource.getProject();
- if (proj != null) {
- jelem = org.eclipse.jdt.core.JavaCore.create(proj);
- }
- }
- }
- IJavaProject jp = jelem.getJavaProject();
-
- IType servletType = jp.findType(QUALIFIED_SERVLET);
- // next 3 lines fix defect 177686
- if (servletType == null) {
- return;
- }
-
- ArrayList servletClasses = new ArrayList();
- ITypeHierarchy tH = servletType.newTypeHierarchy(jp, null);
- IType[] types = tH.getAllSubtypes(servletType);
- for (int i = 0; i < types.length; i++) {
- if (types[i].isClass() && !servletClasses.contains(types[i]))
- servletClasses.add(types[i]);
- }
- fIT = (IType[]) servletClasses.toArray(new IType[servletClasses.size()]);
- servletClasses = null;
-
- } catch (Exception e) {
- ServletUIPlugin.log(e);
- }
- }
-
- /**
- * @private
- */
- protected void computeResult() {
- if (fSelection == JSP) {
- super.computeResult();
- } else {
- IType type = (IType) getWidgetSelection();
- if (type != null) {
- if (type == null) {
- String title = WebAppEditResourceHandler.getString("Select_Class_UI_"); //$NON-NLS-1$ = "Select Class"
- String message = WebAppEditResourceHandler.getString("Could_not_uniquely_map_the_ERROR_"); //$NON-NLS-1$ = "Could not uniquely map the class name to a class."
- MessageDialog.openError(getShell(), title, message);
- setResult(null);
- } else {
- java.util.List result = new ArrayList(1);
- result.add(type);
- setResult(result);
- }
- }
- }
- }
-
- public void create() {
- super.create();
- fText.setFocus();
- rematch(""); //$NON-NLS-1$
- updateOkState();
- }
-
- /**
- * Creates and returns the contents of this dialog's
- * button bar.
- * <p>
- * The <code>Dialog</code> implementation of this framework method
- * lays out a button bar and calls the <code>createButtonsForButtonBar</code>
- * framework method to populate it. Subclasses may override.
- * </p>
- *
- * @param parent the parent composite to contain the button bar
- * @return the button bar control
- */
- protected Control createButtonBar(Composite parent) {
-
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
-
- layout.numColumns = 2;
-
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite composite2 = new Composite(composite, SWT.NONE);
-
- // create a layout with spacing and margins appropriate for the font size.
- layout = new GridLayout();
- layout.numColumns = 0; // this is incremented by createButton
- layout.makeColumnsEqualWidth = true;
- layout.marginWidth = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_MARGIN);
- layout.marginHeight = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_MARGIN);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_SPACING);
- layout.verticalSpacing = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_SPACING);
-
- composite2.setLayout(layout);
-
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
- composite2.setLayoutData(data);
-
- composite2.setFont(parent.getFont());
-
- // Add the buttons to the button bar.
- super.createButtonsForButtonBar(composite2);
-
- return composite;
- }
-
- /*
- * @private
- */
- protected Control createDialogArea(Composite parent) {
- GridData gd = new GridData();
-
- fChild = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- fChild.setLayout(gl);
-
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessVerticalSpace = true;
- fChild.setLayoutData(gd);
-
- // Create the Web Type radio buttons and text fields.
- fServletButton = new Button(fChild, SWT.RADIO);
- fServletButton.setText(WebAppEditResourceHandler.getString("Servlet_UI_")); //$NON-NLS-1$ = Servlet
- gd = new GridData();
- fServletButton.setLayoutData(gd);
- fServletButton.addSelectionListener(this);
-
- fJSPButton = new Button(fChild, SWT.RADIO);
- fJSPButton.setText("JSP"); //$NON-NLS-1$
- gd = new GridData();
- fJSPButton.setLayoutData(gd);
- fJSPButton.addSelectionListener(this);
-
- if (fSelection == JSP)
- fJSPButton.setSelection(true);
- else {
- fServletButton.setSelection(true);
- fSelection = SERVLET;
- }
-
- fPageBook = new PageBook(fChild, SWT.NONE);
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- gd.grabExcessVerticalSpace = true;
- gd.horizontalSpan = 2;
- fPageBook.setLayoutData(gd);
- fJspControl = super.createDialogArea(fPageBook);
-
- Composite composite = new Composite(fPageBook, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
-
- Label messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(WebAppEditResourceHandler.getString("Choose_a_servlet__1")); //$NON-NLS-1$
-
- fText = createText(composite);
-
- messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(WebAppEditResourceHandler.getString("Matching_servlets__2")); //$NON-NLS-1$
-
- fUpperList = createUpperList(composite);
-
- messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(WebAppEditResourceHandler.getString("Qualifier__3")); //$NON-NLS-1$
-
- fLowerList = createLowerList(composite);
-
- fServletControl = composite;
-
- if (fSelection == JSP)
- fPageBook.showPage(fJspControl);
- else
- fPageBook.showPage(fServletControl);
- return parent;
- }
-
- /**
- * Creates the list widget and sets layout data.
- * @return org.eclipse.swt.widgets.List
- */
- private Table createLowerList(Composite parent) {
- if (fLowerListLabel != null)
- (new Label(parent, SWT.NONE)).setText(fLowerListLabel);
-
- Table list = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- list.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- handleLowerSelectionChanged();
- }
- });
- list.addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event evt) {
- handleLowerDoubleClick();
- }
- });
- list.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- fQualifierRenderer.dispose();
- }
- });
- GridData spec = new GridData();
- spec.widthHint = convertWidthInCharsToPixels(50);
- spec.heightHint = convertHeightInCharsToPixels(5);
- spec.grabExcessVerticalSpace = true;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.FILL;
- list.setLayoutData(spec);
- return list;
- }
-
- /**
- * Creates the text widget and sets layout data.
- * @return org.eclipse.swt.widgets.Text
- */
- private Text createText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER);
- GridData spec = new GridData();
- spec.grabExcessVerticalSpace = false;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.BEGINNING;
- text.setLayoutData(spec);
- Listener l = new Listener() {
- public void handleEvent(Event evt) {
- rematch(fText.getText());
- }
- };
- text.addListener(SWT.Modify, l);
- return text;
- }
-
- /**
- * Creates the list widget and sets layout data.
- * @return org.eclipse.swt.widgets.List
- */
- private Table createUpperList(Composite parent) {
- if (fUpperListLabel != null)
- (new Label(parent, SWT.NONE)).setText(fUpperListLabel);
-
- Table list = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- list.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- handleUpperSelectionChanged();
- }
- });
- list.addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event evt) {
- handleUpperDoubleClick();
- }
- });
- list.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- fElementRenderer.dispose();
- }
- });
- GridData spec = new GridData();
- spec.widthHint = convertWidthInCharsToPixels(50);
- spec.heightHint = convertHeightInCharsToPixels(15);
- spec.grabExcessVerticalSpace = true;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.FILL;
- list.setLayoutData(spec);
- return list;
- }
-
- /**
- * @return the ID of the button that is 'pressed' on doubleClick in the lists.
- * By default it is the OK button.
- * Override to change this setting.
- */
- protected int getDefaultButtonID() {
- return IDialogConstants.OK_ID;
- }
-
- public int getSelectedItem() {
- return fSelection;
- }
-
- protected Object getWidgetSelection() {
- int i = fLowerList.getSelectionIndex();
- if (fQualifierMap != null) {
- if (fQualifierMap.length == 1)
- i = 0;
- if (i < 0) {
- return null;
- }
- Integer index = fQualifierMap[i];
- return fElements[index.intValue()];
- }
- return null;
- }
-
- protected final void handleLowerDoubleClick() {
- if (getWidgetSelection() != null)
- buttonPressed(getDefaultButtonID());
- }
-
- protected final void handleLowerSelectionChanged() {
- updateOkState();
- }
-
- protected final void handleUpperDoubleClick() {
- if (getWidgetSelection() != null)
- buttonPressed(getDefaultButtonID());
- }
-
- protected final void handleUpperSelectionChanged() {
- int selection = fUpperList.getSelectionIndex();
- if (selection >= 0) {
- int i = fElementMap[selection];
- int k = i;
- int length = fRenderedStrings.length;
- while (k < length && fRenderedStrings[k].equals(fRenderedStrings[i])) {
- k++;
- }
- updateLowerListWidget(i, k);
- } else
- updateLowerListWidget(0, 0);
- }
-
- public int open() {
-
- if (fIT == null || fIT.length == 0) {
- MessageDialog.openInformation(getShell(), WebAppEditResourceHandler.getString("Empty_List_1"), WebAppEditResourceHandler.getString("_INFO_No_servlets_exist_to_add._1")); //$NON-NLS-2$ //$NON-NLS-1$
- return CANCEL;
- }
-
- setElements(fIT);
- setInitialSelection(""); //$NON-NLS-1$
- return super.open();
- }
-
- /**
- * update the list to reflect a new match string.
- * @param matchString java.lang.String
- */
- protected final void rematch(String matchString) {
- int k = 0;
- String text = fText.getText();
- StringMatcher matcher = new StringMatcher(text + "*", fIgnoreCase, false); //$NON-NLS-1$
- String lastString = null;
- int length = fElements.length;
- for (int i = 0; i < length; i++) {
- while (i < length && fRenderedStrings[i].equals(lastString))
- i++;
- if (i < length) {
- lastString = fRenderedStrings[i];
- if (matcher.match(fRenderedStrings[i])) {
- fElementMap[k] = i;
- k++;
- }
- }
- }
- fElementMap[k] = -1;
-
- updateUpperListWidget(fElementMap, k);
- }
-
- /**
- *
- * @return java.lang.String[]
- * @param p org.eclipse.jface.elements.IIndexedProperty
- */
- private String[] renderStrings(Object[] p) {
- String[] strings = new String[p.length];
- int size = strings.length;
- for (int i = 0; i < size; i++) {
- strings[i] = fElementRenderer.getText(p[i]);
- }
- new TwoArrayQuickSorter(fIgnoreCase).sort(strings, p);
- return strings;
- }
-
- public void setElements(Object[] elements) {
- fElements = elements;
- fElementMap = new int[fElements.length + 1];
- fRenderedStrings = renderStrings(fElements);
- }
-
- public void setSelectedItem(int newSelection) {
- fSelection = newSelection;
- }
-
- private void updateLowerListWidget(int from, int to) {
- fLowerList.removeAll();
- fQualifierMap = new Integer[to - from];
- String[] qualifiers = new String[to - from];
- for (int i = from; i < to; i++) {
- // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
- qualifiers[i - from] = fQualifierRenderer.getText(fElements[i]);
- fQualifierMap[i - from] = new Integer(i);
- }
-
- new TwoArrayQuickSorter(fIgnoreCase).sort(qualifiers, fQualifierMap);
-
- for (int i = 0; i < to - from; i++) {
- TableItem ti = new TableItem(fLowerList, i);
- ti.setText(qualifiers[i]);
- // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
- Image img = fQualifierRenderer.getImage(fElements[from + i]);
- if (img != null)
- ti.setImage(img);
- }
-
- if (fLowerList.getItemCount() > 0)
- fLowerList.setSelection(0);
- updateOkState();
- }
-
- private void updateOkState() {
- Button okButton = getOkButton();
- if (okButton != null)
- okButton.setEnabled(getWidgetSelection() != null);
- }
-
- private void updateUpperListWidget(int[] indices, int size) {
- fUpperList.setRedraw(false);
- int itemCount = fUpperList.getItemCount();
- if (size < itemCount)
- fUpperList.remove(0, itemCount - size - 1);
- TableItem[] items = fUpperList.getItems();
- for (int i = 0; i < size; i++) {
- TableItem ti = null;
- if (i < itemCount)
- ti = items[i];
- else
- ti = new TableItem(fUpperList, i);
- ti.setText(fRenderedStrings[indices[i]]);
- // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
- Image img = fElementRenderer.getImage(fElements[indices[i]]);
- if (img != null)
- ti.setImage(img);
- }
- if (fUpperList.getItemCount() > 0)
- fUpperList.setSelection(0);
- fUpperList.setRedraw(true);
- handleUpperSelectionChanged();
- }
-
- /**
- * Sent when default selection occurs in the control.
- * <p>
- * For example, on some platforms default selection occurs
- * in a List when the user double-clicks an item or types
- * return in a Text.
- * </p>
- *
- * @param e an event containing information about the default selection
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- // Do nothing
- }
-
- /**
- * Sent when selection occurs in the control.
- * <p>
- * For example, on some platforms selection occurs in
- * a List when the user selects an item or items.
- * </p>
- *
- * @param e an event containing information about the selection
- */
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == fJSPButton) {
- fSelection = JSP;
- fPageBook.showPage(fJspControl);
- updateOKStatus();
- } else if (e.widget == fServletButton) {
- fSelection = SERVLET;
- fPageBook.showPage(fServletControl);
- } else
- fSelection = -1;
- }
-
- /**
- * @see ElementTreeSelectionDialog#updateOKStatus()
- */
- protected void updateOKStatus() {
- super.updateOKStatus();
- Button okButton = getOkButton();
- if (okButton != null)
- okButton.setEnabled(fLocalValidator.validate(getResult()).isOK());
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFilterFileSelectionDialog.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFilterFileSelectionDialog.java
deleted file mode 100644
index d34208822..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFilterFileSelectionDialog.java
+++ /dev/null
@@ -1,600 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_FILTER;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DEFAULT_PACKAGE;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.ui.ISharedImages;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jst.j2ee.internal.dialogs.FilteredFileSelectionDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.TwoArrayQuickSorter;
-import org.eclipse.jst.j2ee.internal.dialogs.TypedFileViewerFilter;
-import org.eclipse.jst.j2ee.internal.web.providers.WebAppEditResourceHandler;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Insert the type's description here.
- * Creation date: (7/30/2001 11:16:36 AM)
- */
-public class MultiSelectFilteredFilterFileSelectionDialog extends
- FilteredFileSelectionDialog {
-
-
- private static class PackageRenderer extends LabelProvider {
- private final Image PACKAGE_ICON = JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_PACKAGE);
-
- public String getText(Object element) {
- IType type = (IType) element;
- String p = type.getPackageFragment().getElementName();
- if ("".equals(p)) //$NON-NLS-1$
- p = DEFAULT_PACKAGE;
- return (p + " - " + type.getPackageFragment().getParent().getPath().toString()); //$NON-NLS-1$
- }
- public Image getImage(Object element) {
- return PACKAGE_ICON;
- }
- }
-
- private static class TypeRenderer extends LabelProvider {
- private final Image CLASS_ICON = JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CLASS);
-
- public String getText(Object element) {
- IType e = ((IType) element);
- return e.getElementName();
- }
-
- public Image getImage(Object element) {
- return CLASS_ICON;
- }
-
- }
- protected PageBook fPageBook = null;
- protected Control fServletControl = null;
- protected Composite fChild = null;
- // construction parameters
- protected IRunnableContext fRunnableContext;
- protected ILabelProvider fElementRenderer;
- protected ILabelProvider fQualifierRenderer;
- private Object[] fElements;
- private boolean fIgnoreCase = true;
- private String fUpperListLabel;
- private String fLowerListLabel;
- // SWT widgets
- private Table fUpperList;
- private Table fLowerList;
- protected Text fText;
- private IType[] fIT;
- private String[] fRenderedStrings;
- private int[] fElementMap;
- private Integer[] fQualifierMap;
-
- private ISelectionStatusValidator fLocalValidator = null;
- /**
- * This is a selection dialog for available servlet.
- * @param parent Shell
- * @param title String
- * @param message String
- * @parent extensions String[]
- * @param allowMultiple boolean
- */
- public MultiSelectFilteredFilterFileSelectionDialog(Shell parent, String title, String message, String[] extensions, boolean allowMultiple, IProject project) {
- super(parent, title, message, extensions, allowMultiple);
- setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
-
- if (title == null)
- setTitle(WebAppEditResourceHandler.getString("File_Selection_UI_")); //$NON-NLS-1$
- if (message == null)
- message = WebAppEditResourceHandler.getString("Select_a_file__UI_"); //$NON-NLS-1$
- setMessage(message);
- setExtensions(extensions);
- addFilter(new TypedFileViewerFilter(extensions));
- fLocalValidator = new SimpleTypedElementSelectionValidator(new Class[] { IFile.class }, allowMultiple);
- setValidator(fLocalValidator);
-
- //StatusInfo currStatus = new StatusInfo();
- //currStatus.setOK();
- Status currStatus = new Status(Status.OK, ServletUIPlugin.PLUGIN_ID, Status.OK, "", null);
-
- updateStatus(currStatus);
- fElementRenderer = new TypeRenderer();
- fQualifierRenderer = new PackageRenderer();
- fRunnableContext = ServletUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- try {
- IJavaElement jelem = null;
- IProject proj = null;
- jelem = (IJavaElement) project.getAdapter(IJavaElement.class);
- if (jelem == null) {
- IResource resource = (IResource) project.getAdapter(IResource.class);
- if (resource != null) {
- proj = resource.getProject();
- if (proj != null) {
- jelem = org.eclipse.jdt.core.JavaCore.create(proj);
- }
- }
- }
- IJavaProject jp = jelem.getJavaProject();
- IType filterType = jp.findType(QUALIFIED_FILTER); //$NON-NLS-1$
- // next 3 lines fix defect 177686
- if (filterType == null) {
- return;
- }
- ArrayList filterClasses = new ArrayList();
- ITypeHierarchy tH = filterType.newTypeHierarchy(jp, null);
- IType[] types = tH.getAllSubtypes(filterType);
- for (int i = 0; i < types.length; i++) {
- if (types[i].isClass() && !filterClasses.contains(types[i]))
- filterClasses.add(types[i]);
- }
- fIT = (IType[]) filterClasses.toArray(new IType[filterClasses.size()]);
- filterClasses = null;
- } catch (Exception e) {
- ServletUIPlugin.log(e);
- }
- }
-
- /**
- * @private
- */
- protected void computeResult() {
- IType type = (IType) getWidgetSelection();
- if (type != null) {
- if (type == null) {
- String title = WebAppEditResourceHandler.getString("Select_Class_UI_"); //$NON-NLS-1$ = "Select Class"
- String message = WebAppEditResourceHandler.getString("Could_not_uniquely_map_the_ERROR_"); //$NON-NLS-1$ = "Could not uniquely map the class name to a class."
- MessageDialog.openError(getShell(), title, message);
- setResult(null);
- } else {
- java.util.List result = new ArrayList(1);
- result.add(type);
- setResult(result);
- }
- }
- }
-
- public void create() {
- super.create();
- fText.setFocus();
- rematch(""); //$NON-NLS-1$
- updateOkState();
- }
-
- /**
- * Creates and returns the contents of this dialog's
- * button bar.
- * <p>
- * The <code>Dialog</code> implementation of this framework method
- * lays out a button bar and calls the <code>createButtonsForButtonBar</code>
- * framework method to populate it. Subclasses may override.
- * </p>
- *
- * @param parent the parent composite to contain the button bar
- * @return the button bar control
- */
- protected Control createButtonBar(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
-
- layout.numColumns = 2;
-
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite composite2 = new Composite(composite, SWT.NONE);
-
- // create a layout with spacing and margins appropriate for the font size.
- layout = new GridLayout();
- layout.numColumns = 0; // this is incremented by createButton
- layout.makeColumnsEqualWidth = true;
- layout.marginWidth = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_MARGIN);
- layout.marginHeight = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_MARGIN);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_SPACING);
- layout.verticalSpacing = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_SPACING);
-
- composite2.setLayout(layout);
-
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
- composite2.setLayoutData(data);
-
- composite2.setFont(parent.getFont());
-
- // Add the buttons to the button bar.
- super.createButtonsForButtonBar(composite2);
-
- return composite;
- }
-
- /*
- * @private
- */
- protected Control createDialogArea(Composite parent) {
- GridData gd = new GridData();
-
- fChild = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 5;
- fChild.setLayout(gl);
-
- gd.verticalAlignment = GridData.FILL;
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessVerticalSpace = true;
- fChild.setLayoutData(gd);
-
- fPageBook = new PageBook(fChild, SWT.NONE);
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- gd.grabExcessVerticalSpace = true;
- gd.horizontalSpan = 2;
- fPageBook.setLayoutData(gd);
- super.createDialogArea(fPageBook);
-
- Composite composite = new Composite(fPageBook, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
-
- Label messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(WebAppEditResourceHandler.getString("Choose_a_filter__1")); //$NON-NLS-1$
-
- fText = createText(composite);
-
- messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(WebAppEditResourceHandler.getString("Matching_filters__2")); //$NON-NLS-1$
-
- fUpperList = createUpperList(composite);
-
- messageLabel = new Label(composite, SWT.NONE);
- gd = new GridData();
- messageLabel.setLayoutData(gd);
- messageLabel.setText(WebAppEditResourceHandler.getString("Qualifier__3")); //$NON-NLS-1$
-
- fLowerList = createLowerList(composite);
-
- fServletControl = composite;
-
- fPageBook.showPage(fServletControl);
- return parent;
- }
-
- /**
- * Creates the list widget and sets layout data.
- * @return org.eclipse.swt.widgets.List
- */
- private Table createLowerList(Composite parent) {
- if (fLowerListLabel != null)
- (new Label(parent, SWT.NONE)).setText(fLowerListLabel);
-
- Table list = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- list.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- handleLowerSelectionChanged();
- }
- });
- list.addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event evt) {
- handleLowerDoubleClick();
- }
- });
- list.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- fQualifierRenderer.dispose();
- }
- });
- GridData spec = new GridData();
- spec.widthHint = convertWidthInCharsToPixels(50);
- spec.heightHint = convertHeightInCharsToPixels(5);
- spec.grabExcessVerticalSpace = true;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.FILL;
- list.setLayoutData(spec);
- return list;
- }
-
- /**
- * Creates the text widget and sets layout data.
- * @return org.eclipse.swt.widgets.Text
- */
- private Text createText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER);
- GridData spec = new GridData();
- spec.grabExcessVerticalSpace = false;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.BEGINNING;
- text.setLayoutData(spec);
- Listener l = new Listener() {
- public void handleEvent(Event evt) {
- rematch(fText.getText());
- }
- };
- text.addListener(SWT.Modify, l);
- return text;
- }
-
- /**
- * Creates the list widget and sets layout data.
- * @return org.eclipse.swt.widgets.List
- */
- private Table createUpperList(Composite parent) {
- if (fUpperListLabel != null)
- (new Label(parent, SWT.NONE)).setText(fUpperListLabel);
-
- Table list = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- list.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event evt) {
- handleUpperSelectionChanged();
- }
- });
- list.addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event evt) {
- handleUpperDoubleClick();
- }
- });
- list.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- fElementRenderer.dispose();
- }
- });
- GridData spec = new GridData();
- spec.widthHint = convertWidthInCharsToPixels(50);
- spec.heightHint = convertHeightInCharsToPixels(15);
- spec.grabExcessVerticalSpace = true;
- spec.grabExcessHorizontalSpace = true;
- spec.horizontalAlignment = GridData.FILL;
- spec.verticalAlignment = GridData.FILL;
- list.setLayoutData(spec);
- return list;
- }
-
- /**
- * @return the ID of the button that is 'pressed' on doubleClick in the lists.
- * By default it is the OK button.
- * Override to change this setting.
- */
- protected int getDefaultButtonID() {
- return IDialogConstants.OK_ID;
- }
-
- protected Object getWidgetSelection() {
- int i = fLowerList.getSelectionIndex();
- if (fQualifierMap != null) {
- if (fQualifierMap.length == 1)
- i = 0;
- if (i < 0) {
- return null;
- }
- Integer index = fQualifierMap[i];
- return fElements[index.intValue()];
- }
- return null;
- }
-
- protected final void handleLowerDoubleClick() {
- if (getWidgetSelection() != null)
- buttonPressed(getDefaultButtonID());
- }
-
- protected final void handleLowerSelectionChanged() {
- updateOkState();
- }
-
- protected final void handleUpperDoubleClick() {
- if (getWidgetSelection() != null)
- buttonPressed(getDefaultButtonID());
- }
-
- protected final void handleUpperSelectionChanged() {
- int selection = fUpperList.getSelectionIndex();
- if (selection >= 0) {
- int i = fElementMap[selection];
- int k = i;
- int length = fRenderedStrings.length;
- while (k < length && fRenderedStrings[k].equals(fRenderedStrings[i])) {
- k++;
- }
- updateLowerListWidget(i, k);
- } else
- updateLowerListWidget(0, 0);
- }
-
- public int open() {
- if (fIT == null || fIT.length == 0) {
- MessageDialog.openInformation(getShell(),
- WebAppEditResourceHandler.getString("Empty_List_1"),
- WebAppEditResourceHandler.getString("_INFO_No_filters_exist_to_add._1")); //$NON-NLS-2$ //$NON-NLS-1$
- return CANCEL;
- }
-
- setElements(fIT);
- setInitialSelection(""); //$NON-NLS-1$
- return super.open();
- }
-
- /**
- * update the list to reflect a new match string.
- * @param matchString java.lang.String
- */
- protected final void rematch(String matchString) {
- int k = 0;
- String text = fText.getText();
- StringMatcher matcher = new StringMatcher(text + "*", fIgnoreCase, false); //$NON-NLS-1$
- String lastString = null;
- int length = fElements.length;
- for (int i = 0; i < length; i++) {
- while (i < length && fRenderedStrings[i].equals(lastString))
- i++;
- if (i < length) {
- lastString = fRenderedStrings[i];
- if (matcher.match(fRenderedStrings[i])) {
- fElementMap[k] = i;
- k++;
- }
- }
- }
- fElementMap[k] = -1;
-
- updateUpperListWidget(fElementMap, k);
- }
-
- /**
- *
- * @return java.lang.String[]
- * @param p org.eclipse.jface.elements.IIndexedProperty
- */
- private String[] renderStrings(Object[] p) {
- String[] strings = new String[p.length];
- int size = strings.length;
- for (int i = 0; i < size; i++) {
- strings[i] = fElementRenderer.getText(p[i]);
- }
- new TwoArrayQuickSorter(fIgnoreCase).sort(strings, p);
- return strings;
- }
-
- public void setElements(Object[] elements) {
- fElements = elements;
- fElementMap = new int[fElements.length + 1];
- fRenderedStrings = renderStrings(fElements);
- }
-
- private void updateLowerListWidget(int from, int to) {
- fLowerList.removeAll();
- fQualifierMap = new Integer[to - from];
- String[] qualifiers = new String[to - from];
- for (int i = from; i < to; i++) {
- // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
- qualifiers[i - from] = fQualifierRenderer.getText(fElements[i]);
- fQualifierMap[i - from] = new Integer(i);
- }
-
- new TwoArrayQuickSorter(fIgnoreCase).sort(qualifiers, fQualifierMap);
-
- for (int i = 0; i < to - from; i++) {
- TableItem ti = new TableItem(fLowerList, i);
- ti.setText(qualifiers[i]);
- // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
- Image img = fQualifierRenderer.getImage(fElements[from + i]);
- if (img != null)
- ti.setImage(img);
- }
-
- if (fLowerList.getItemCount() > 0)
- fLowerList.setSelection(0);
- updateOkState();
- }
-
- private void updateOkState() {
- Button okButton = getOkButton();
- if (okButton != null)
- okButton.setEnabled(getWidgetSelection() != null);
- }
-
- private void updateUpperListWidget(int[] indices, int size) {
- fUpperList.setRedraw(false);
- int itemCount = fUpperList.getItemCount();
- if (size < itemCount)
- fUpperList.remove(0, itemCount - size - 1);
- TableItem[] items = fUpperList.getItems();
- for (int i = 0; i < size; i++) {
- TableItem ti = null;
- if (i < itemCount)
- ti = items[i];
- else
- ti = new TableItem(fUpperList, i);
- ti.setText(fRenderedStrings[indices[i]]);
- // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
- Image img = fElementRenderer.getImage(fElements[indices[i]]);
- if (img != null)
- ti.setImage(img);
- }
- if (fUpperList.getItemCount() > 0)
- fUpperList.setSelection(0);
- fUpperList.setRedraw(true);
- handleUpperSelectionChanged();
- }
-
- /**
- * Sent when default selection occurs in the control.
- * <p>
- * For example, on some platforms default selection occurs
- * in a List when the user double-clicks an item or types
- * return in a Text.
- * </p>
- *
- * @param e an event containing information about the default selection
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- // Do nothing
- }
-
- /**
- * @see ElementTreeSelectionDialog#updateOKStatus()
- */
- protected void updateOKStatus() {
- super.updateOKStatus();
- Button okButton = getOkButton();
- if (okButton != null)
- okButton.setEnabled(fLocalValidator.validate(getResult()).isOK());
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassOptionsWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassOptionsWizardPage.java
deleted file mode 100644
index 35a59c021..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassOptionsWizardPage.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.DESTROY;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.DO_FILTER;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.INIT;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_FILTER;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.j2ee.internal.web.operations.FilterSupertypesValidator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewFilterClassOptionsWizardPage extends
- NewWebClassOptionsWizardPage implements ISelectionChangedListener {
-
- protected Button initButton;
- protected Button destroyButton;
- protected Button doFilterButton;
-
- public NewFilterClassOptionsWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle) {
- super(model, pageName, pageDesc, pageTitle);
- }
-
- /**
- * Create the composite with all the stubs
- */
- @Override
- protected void createStubsComposite(Composite parent) {
- super.createStubsComposite(parent);
-
- Composite comp = new Composite(methodStubs, SWT.NULL);
- GridLayout layout = new GridLayout(3, false);
- layout.marginWidth = 0;
- layout.makeColumnsEqualWidth = true;
- comp.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- comp.setLayoutData(data);
-
- initButton = new Button(comp, SWT.CHECK);
- initButton.setText("&init"); //$NON-NLS-1$
- synchHelper.synchCheckbox(initButton, INIT, null);
-
- destroyButton = new Button(comp, SWT.CHECK);
- destroyButton.setText("destro&y"); //$NON-NLS-1$
- synchHelper.synchCheckbox(destroyButton, DESTROY, null);
-
- doFilterButton = new Button(comp, SWT.CHECK);
- doFilterButton.setText("do&Filter"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doFilterButton, DO_FILTER, null);
-
- interfaceViewer.addSelectionChangedListener(this);
-
- Dialog.applyDialogFont(parent);
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- StructuredSelection selection = (StructuredSelection) event.getSelection();
-
- // if the selection is empty, then the remove button is disabled
- if (selection.isEmpty()) {
- removeButton.setEnabled(false);
- return;
- }
-
- // if the selection is non-empty and the filter extends a class which
- // implements javax.servlet.Filter, then the remove button is enabled
- if (FilterSupertypesValidator.isFilterSuperclass(model)) {
- removeButton.setEnabled(true);
- return;
- }
-
- // if the selection is non-empty and the filter does not extend a class
- // which implements javax.servlet.Filter, then the remove button is
- // disabled only if the Filter interface is in the selection
- Iterator iter = selection.iterator();
- while (iter.hasNext()) {
- if (QUALIFIED_FILTER.equals(iter.next()))
- removeButton.setEnabled(false);
- return;
- }
-
- // in all other cases the remove button is enabled
- removeButton.setEnabled(true);
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassWizardPage.java
deleted file mode 100644
index 4990e576b..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewFilterClassWizardPage.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.CHOOSE_FILTER_CLASS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_FILTER_WIZARD_WINDOW_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.USE_EXISTING_FILTER_CLASS;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.internal.war.ui.util.WebFiltersGroupItemProvider;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jee.ui.internal.navigator.web.GroupFiltersItemProvider;
-import org.eclipse.jst.jee.ui.internal.navigator.web.WebAppProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewFilterClassWizardPage extends NewWebClassWizardPage {
-
- private final static String[] FILTEREXTENSIONS = { "java" }; //$NON-NLS-1$
-
- public NewFilterClassWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle, String moduleType) {
- super(model, pageName, pageDesc, pageTitle, moduleType);
- }
-
- @Override
- protected String getUseExistingCheckboxText() {
- return USE_EXISTING_FILTER_CLASS;
- }
-
- @Override
- protected String getUseExistingProperty() {
- return USE_EXISTING_CLASS;
- }
-
- @Override
- protected IProject getExtendedSelectedProject(Object selection) {
- if (selection instanceof WebFiltersGroupItemProvider) {
- WebApp webApp = (WebApp)((WebFiltersGroupItemProvider) selection).getParent();
- return ProjectUtilities.getProject(webApp);
- }else if(selection instanceof WebAppProvider){
- return ((WebAppProvider) selection).getProject();
- } if(selection instanceof GroupFiltersItemProvider){
- org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp) ((GroupFiltersItemProvider) selection).getJavaEEObject();
- return ProjectUtilities.getProject(webApp);
- }
-
- return super.getExtendedSelectedProject(selection);
- }
-
- @Override
- protected void handleClassButtonSelected() {
- getControl().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
- IProject project = (IProject) model.getProperty(PROJECT);
- IVirtualComponent component = ComponentCore.createComponent(project);
- MultiSelectFilteredFilterFileSelectionDialog ms = new MultiSelectFilteredFilterFileSelectionDialog(
- getShell(),
- NEW_FILTER_WIZARD_WINDOW_TITLE,
- CHOOSE_FILTER_CLASS,
- FILTEREXTENSIONS,
- false,
- project);
- IContainer root = component.getRootFolder().getUnderlyingFolder();
- ms.setInput(root);
- ms.open();
- if (ms.getReturnCode() == Window.OK) {
- String qualifiedClassName = ""; //$NON-NLS-1$
- IType type = (IType) ms.getFirstResult();
- if (type != null) {
- qualifiedClassName = type.getFullyQualifiedName();
- }
- existingClassText.setText(qualifiedClassName);
- }
- getControl().setCursor(null);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassOptionsWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassOptionsWizardPage.java
deleted file mode 100644
index 6d4d26558..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassOptionsWizardPage.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewListenerClassOptionsWizardPage extends NewWebClassOptionsWizardPage {
-
- public NewListenerClassOptionsWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle) {
- super(model, pageName, pageDesc, pageTitle);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassWizardPage.java
deleted file mode 100644
index 5ffc33a88..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewListenerClassWizardPage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.USE_EXISTING_LISTENER_CLASS;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jst.j2ee.internal.war.ui.util.WebListenerGroupItemProvider;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jee.ui.internal.navigator.web.GroupListenerItemProvider;
-import org.eclipse.jst.jee.ui.internal.navigator.web.WebAppProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewListenerClassWizardPage extends NewWebClassWizardPage {
-
- public NewListenerClassWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle, String moduleType) {
- super(model, pageName, pageDesc, pageTitle, moduleType);
- }
-
- @Override
- protected String getUseExistingCheckboxText() {
- return USE_EXISTING_LISTENER_CLASS;
- }
-
- @Override
- protected String getUseExistingProperty() {
- return USE_EXISTING_CLASS;
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = super.createTopLevelComposite(parent);
-
- existingButton.setEnabled(false);
-
- return composite;
- }
-
- @Override
- protected IProject getExtendedSelectedProject(Object selection) {
- if (selection instanceof WebListenerGroupItemProvider) {
- WebApp webApp = (WebApp)((WebListenerGroupItemProvider) selection).getParent();
- return ProjectUtilities.getProject(webApp);
- }else if(selection instanceof WebAppProvider){
- return ((WebAppProvider) selection).getProject();
- } else if(selection instanceof GroupListenerItemProvider){
- org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp) ((GroupListenerItemProvider) selection).getJavaEEObject();
- return ProjectUtilities.getProject(webApp);
- }
-
- return super.getExtendedSelectedProject(selection);
- }
-
- @Override
- protected void handleClassButtonSelected() {
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassOptionsWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassOptionsWizardPage.java
deleted file mode 100644
index 637223320..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassOptionsWizardPage.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * David Schneider, david.schneider@unisys.com - bug 142500
- * Kiril Mitov, k.mitov@sap.com - bug 204160
- * Kaloyan Raev, kaloyan.raev@sap.com
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_SERVLET;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties;
-import org.eclipse.jst.j2ee.internal.web.operations.ServletSupertypesValidator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewServletClassOptionsWizardPage extends
- NewWebClassOptionsWizardPage implements ISelectionChangedListener {
-
- protected Button initButton;
- protected Button destroyButton;
- protected Button getConfigButton;
- protected Button getInfoButton;
- protected Button serviceButton;
- protected Button doGetButton;
- protected Button doPostButton;
- protected Button doPutButton;
- protected Button doDeleteButton;
- protected Button doHeadButton;
- protected Button doOptionsButton;
- protected Button doTraceButton;
-
- public NewServletClassOptionsWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle) {
- super(model, pageName, pageDesc, pageTitle);
- }
-
- @Override
- protected void enter() {
- super.enter();
-
- boolean httpServlet = ServletSupertypesValidator.isHttpServletSuperclass(model);
- doGetButton.setVisible(httpServlet);
- doPostButton.setVisible(httpServlet);
- doPutButton.setVisible(httpServlet);
- doDeleteButton.setVisible(httpServlet);
- doHeadButton.setVisible(httpServlet);
- doOptionsButton.setVisible(httpServlet);
- doTraceButton.setVisible(httpServlet);
- }
-
- /**
- * Create the composite with all the stubs
- */
- @Override
- protected void createStubsComposite(Composite parent) {
- super.createStubsComposite(parent);
-
- inheritButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- boolean enable = inheritButton.getSelection();
- enableGenericServletButtons(enable);
- enableHttpServletButtons(enable);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- //Do nothing
- }
-
- private void enableGenericServletButtons(boolean enable) {
- if (ServletSupertypesValidator.isGenericServletSuperclass(model)) {
- initButton.setEnabled(enable);
- destroyButton.setEnabled(enable);
- getConfigButton.setEnabled(enable);
- getInfoButton.setEnabled(enable);
- serviceButton.setEnabled(enable);
- }
- }
-
- private void enableHttpServletButtons(boolean enable) {
- doGetButton.setEnabled(enable);
- doPostButton.setEnabled(enable);
- doPutButton.setEnabled(enable);
- doDeleteButton.setEnabled(enable);
- doHeadButton.setEnabled(enable);
- doOptionsButton.setEnabled(enable);
- doTraceButton.setEnabled(enable);
- }
- });
-
- Composite comp = new Composite(methodStubs, SWT.NULL);
- GridLayout layout = new GridLayout(3, false);
- layout.marginWidth = 0;
- layout.makeColumnsEqualWidth = true;
- comp.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- comp.setLayoutData(data);
-
- initButton = new Button(comp, SWT.CHECK);
- initButton.setText("&init"); //$NON-NLS-1$
- synchHelper.synchCheckbox(initButton, INewServletClassDataModelProperties.INIT, null);
-
- destroyButton = new Button(comp, SWT.CHECK);
- destroyButton.setText("destro&y"); //$NON-NLS-1$
- synchHelper.synchCheckbox(destroyButton, INewServletClassDataModelProperties.DESTROY, null);
-
- getConfigButton = new Button(comp, SWT.CHECK);
- getConfigButton.setText("getServlet&Config"); //$NON-NLS-1$
- synchHelper.synchCheckbox(getConfigButton, INewServletClassDataModelProperties.GET_SERVLET_CONFIG, null);
-
- getInfoButton = new Button(comp, SWT.CHECK);
- getInfoButton.setText("getServletI&nfo"); //$NON-NLS-1$
- synchHelper.synchCheckbox(getInfoButton, INewServletClassDataModelProperties.GET_SERVLET_INFO, null);
-
- serviceButton = new Button(comp, SWT.CHECK);
- serviceButton.setText("&service"); //$NON-NLS-1$
- synchHelper.synchCheckbox(serviceButton, INewServletClassDataModelProperties.SERVICE, null);
-
- doGetButton = new Button(comp, SWT.CHECK);
- doGetButton.setText("do&Get"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doGetButton, INewServletClassDataModelProperties.DO_GET, null);
-
- doPostButton = new Button(comp, SWT.CHECK);
- doPostButton.setText("do&Post"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doPostButton, INewServletClassDataModelProperties.DO_POST, null);
-
- doPutButton = new Button(comp, SWT.CHECK);
- doPutButton.setText("doP&ut"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doPutButton, INewServletClassDataModelProperties.DO_PUT, null);
-
- doDeleteButton = new Button(comp, SWT.CHECK);
- doDeleteButton.setText("do&Delete"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doDeleteButton, INewServletClassDataModelProperties.DO_DELETE, null);
-
- doHeadButton = new Button(comp, SWT.CHECK);
- doHeadButton.setText("do&Head"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doHeadButton, INewServletClassDataModelProperties.DO_HEAD, null);
-
- doOptionsButton = new Button(comp, SWT.CHECK);
- doOptionsButton.setText("do&Options"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doOptionsButton, INewServletClassDataModelProperties.DO_OPTIONS, null);
-
- doTraceButton = new Button(comp, SWT.CHECK);
- doTraceButton.setText("do&Trace"); //$NON-NLS-1$
- synchHelper.synchCheckbox(doTraceButton, INewServletClassDataModelProperties.DO_TRACE, null);
-
- interfaceViewer.addSelectionChangedListener(this);
-
- Dialog.applyDialogFont(parent);
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- removeButton.setEnabled(canRemoveSelectedInterfaces(selection));
- }
-
- protected KeyListener getInterfaceKeyListener() {
- return new KeyListener() {
-
- public void keyPressed(KeyEvent e) {
- }
-
- public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.DEL) {
- IStructuredSelection selection = (IStructuredSelection) interfaceViewer.getSelection();
- if (canRemoveSelectedInterfaces(selection)) {
- handleInterfaceRemoveButtonSelected();
- }
- }
- }
-
- };
- }
-
- private boolean canRemoveSelectedInterfaces(IStructuredSelection selection) {
- // if the selection is empty, then remove is not possible
- if (selection.isEmpty()) {
- return false;
- }
-
- // if the selection is non-empty and the servlet extends GenericServlet, then
- // remove is possible
- if (ServletSupertypesValidator.isGenericServletSuperclass(model)) {
- return true;
- }
-
- // if the selection is non-empty and the servlet does not extend GenericServlet,
- // then remove is not possible only if the Servlet interface is in the selection
- Iterator iter = selection.iterator();
- while (iter.hasNext()) {
- if (QUALIFIED_SERVLET.equals(iter.next())) {
- return false;
- }
- }
-
- // in all other cases remove is possible
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassWizardPage.java
deleted file mode 100644
index 7eb7f67fe..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassWizardPage.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Kaloyan Raev, kaloyan.raev@sap.com
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.IS_SERVLET_TYPE;
-import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.CHOOSE_SERVLET_CLASS;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_SERVLET_WIZARD_WINDOW_TITLE;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.USE_EXISTING_SERVLET_CLASS;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.internal.war.ui.util.WebServletGroupItemProvider;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jee.ui.internal.navigator.web.GroupServletItemProvider;
-import org.eclipse.jst.jee.ui.internal.navigator.web.WebAppProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewServletClassWizardPage extends NewWebClassWizardPage {
-
- private final static String[] JSPEXTENSIONS = { "jsp" }; //$NON-NLS-1$
-
- public NewServletClassWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle, String moduleType) {
- super(model, pageName, pageDesc, pageTitle, moduleType);
- }
-
- @Override
- protected String getUseExistingCheckboxText() {
- return USE_EXISTING_SERVLET_CLASS;
- }
-
- @Override
- protected String getUseExistingProperty() {
- return USE_EXISTING_CLASS;
- }
-
- @Override
- protected IProject getExtendedSelectedProject(Object selection) {
- if (selection instanceof WebServletGroupItemProvider) {
- WebApp webApp = (WebApp) ((WebServletGroupItemProvider) selection).getParent();
- return ProjectUtilities.getProject(webApp);
- } else if(selection instanceof WebAppProvider){
- return ((WebAppProvider) selection).getProject();
- } else if(selection instanceof GroupServletItemProvider){
- org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp) ((GroupServletItemProvider) selection).getJavaEEObject();
- return ProjectUtilities.getProject(webApp);
- }
-
- return super.getExtendedSelectedProject(selection);
- }
-
- @Override
- protected void handleClassButtonSelected() {
- getControl().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
- IProject project = (IProject) model.getProperty(PROJECT);
- IVirtualComponent component = ComponentCore.createComponent(project);
- MultiSelectFilteredFileSelectionDialog ms = new MultiSelectFilteredFileSelectionDialog(
- getShell(),
- NEW_SERVLET_WIZARD_WINDOW_TITLE,
- CHOOSE_SERVLET_CLASS,
- JSPEXTENSIONS,
- false,
- project);
- IContainer root = component.getRootFolder().getUnderlyingFolder();
- ms.setInput(root);
- ms.open();
- if (ms.getReturnCode() == Window.OK) {
- String qualifiedClassName = ""; //$NON-NLS-1$
- if (ms.getSelectedItem() == MultiSelectFilteredFileSelectionDialog.JSP) {
- Object obj = ms.getFirstResult();
- if (obj != null) {
- if (obj instanceof IFile) {
- IFile file = (IFile) obj;
- IPath pFull = file.getFullPath();
- IPath pBase = root.getFullPath();
- IPath path = pFull.removeFirstSegments(pBase.segmentCount());
- qualifiedClassName = path.makeAbsolute().toString();
- model.setProperty(IS_SERVLET_TYPE, new Boolean(false));
- }
- }
- }
- else {
- IType type = (IType) ms.getFirstResult();
- if (type != null) {
- qualifiedClassName = type.getFullyQualifiedName();
- model.setProperty(IS_SERVLET_TYPE, new Boolean(true));
- }
- }
- existingClassText.setText(qualifiedClassName);
- }
- getControl().setCursor(null);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebArtifactWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebArtifactWizard.java
deleted file mode 100644
index b718464b1..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebArtifactWizard.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.CLASS_NAME;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.OPEN_IN_EDITOR;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.QUALIFIED_CLASS_NAME;
-
-import java.net.URL;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEEditorUtility;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class NewWebArtifactWizard extends NewWebWizard {
-
- protected static final String PAGE_ONE = "pageOne"; //$NON-NLS-1$
- protected static final String PAGE_TWO = "pageTwo"; //$NON-NLS-1$
- protected static final String PAGE_THREE = "pageThree"; //$NON-NLS-1$
-
- public NewWebArtifactWizard(IDataModel model) {
- super(model);
- setWindowTitle(getTitle());
- setDefaultPageImageDescriptor(getImage());
- }
-
- @Override
- protected boolean runForked() {
- return false;
- }
-
- @Override
- public boolean canFinish() {
- return getDataModel().isValid();
- }
-
- protected abstract String getTitle();
-
- protected abstract ImageDescriptor getImage();
-
- protected ImageDescriptor getImageFromJ2EEPlugin(String key) {
- URL url = (URL) J2EEPlugin.getDefault().getImage(key); //$NON-NLS-1$
- return ImageDescriptor.createFromURL(url);
- }
-
- protected void openJavaClass() {
- try {
- String className = getDataModel().getStringProperty(QUALIFIED_CLASS_NAME);
- IProject p = (IProject) getDataModel().getProperty(PROJECT);
- IJavaProject javaProject = J2EEEditorUtility.getJavaProject(p);
- IFile file = (IFile) javaProject.findType(className).getResource();
- openEditor(file);
- } catch (Exception cantOpen) {
- ServletUIPlugin.log(cantOpen);
- }
- }
-
- protected void openWebFile() {
- try {
- String className = getDataModel().getStringProperty(CLASS_NAME);
- IProject p = (IProject) getDataModel().getProperty(PROJECT);
- IVirtualComponent component = ComponentCore.createComponent(p);
- IContainer webContent = component.getRootFolder().getUnderlyingFolder();
- IFile file = webContent.getFile(new Path(className));
- openEditor(file);
- } catch (Exception cantOpen) {
- ServletUIPlugin.log(cantOpen);
- }
- }
-
- protected void openEditor(final IFile file) {
- if (getDataModel().getBooleanProperty(OPEN_IN_EDITOR)) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- ServletUIPlugin.log(e);
- }
- }
- });
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassOptionsWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassOptionsWizardPage.java
deleted file mode 100644
index 5a55cca8e..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassOptionsWizardPage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.ABSTRACT_METHODS;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.CONSTRUCTOR;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.INTERFACES;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.JAVA_CLASS_INHERIT_CHECKBOX_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.JAVA_CLASS_METHOD_STUBS_LABEL;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassOptionsWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewWebClassOptionsWizardPage extends NewJavaClassOptionsWizardPage {
-
- protected Composite methodStubs;
-
- public NewWebClassOptionsWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle) {
- super(model, pageName, pageDesc, pageTitle);
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] { INTERFACES };
- }
-
- @Override
- protected void createStubsComposite(Composite parent) {
- Label stubLabel = new Label(parent, SWT.NONE);
- stubLabel.setText(JAVA_CLASS_METHOD_STUBS_LABEL);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- stubLabel.setLayoutData(data);
-
- methodStubs = new Composite(parent, SWT.NULL);
- methodStubs.setLayout(new GridLayout());
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- data.horizontalIndent = 15;
- methodStubs.setLayoutData(data);
-
- constructorButton = new Button(methodStubs, SWT.CHECK);
- constructorButton.setText(JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL);
- synchHelper.synchCheckbox(constructorButton, CONSTRUCTOR, null);
-
- inheritButton = new Button(methodStubs, SWT.CHECK);
- inheritButton.setText(JAVA_CLASS_INHERIT_CHECKBOX_LABEL);
- synchHelper.synchCheckbox(inheritButton, ABSTRACT_METHODS, null);
-
- Dialog.applyDialogFont(parent);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassWizardPage.java
deleted file mode 100644
index ba7ef94d6..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebClassWizardPage.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 SAP AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import static org.eclipse.jst.j2ee.application.internal.operations.IAnnotationsDataModel.USE_ANNOTATIONS;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.CLASS_NAME;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.BROWSE_BUTTON_LABEL;
-import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.CLASS_NAME_LABEL;
-import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties.PROJECT_NAME;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.GENERATE_DD;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.wizard.AnnotationsStandaloneGroup;
-import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassWizardPage;
-import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils;
-import org.eclipse.jst.servlet.ui.internal.navigator.CompressedJavaProject;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public abstract class NewWebClassWizardPage extends NewJavaClassWizardPage {
-
- protected AnnotationsStandaloneGroup annotationsGroup;
-
- protected Button existingClassButton;
- protected Label existingClassLabel;
- protected Text existingClassText;
- protected Button existingButton;
-
- public NewWebClassWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle, String moduleType) {
- super(model, pageName, pageDesc, pageTitle, moduleType);
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = super.createTopLevelComposite(parent);
-
- projectNameLabel.setText(WEBUIMessages.WEB_PROJECT_LBL);
-
- addSeperator(composite, 3);
- createUseExistingGroup(composite);
- createAnnotationsGroup(composite);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- @Override
- protected IProject getExtendedSelectedProject(Object selection) {
- if (selection instanceof CompressedJavaProject) {
- return ((CompressedJavaProject) selection).getProject().getProject();
- }
-
- return super.getExtendedSelectedProject(selection);
- }
-
- protected abstract String getUseExistingCheckboxText();
-
- protected abstract String getUseExistingProperty();
-
- protected abstract void handleClassButtonSelected();
-
- /**
- * Create annotations group and set default enablement
- */
- private void createAnnotationsGroup(Composite parent) {
- if (isWebDocletProject()) {
- annotationsGroup = new AnnotationsStandaloneGroup(parent, model, J2EEProjectUtilities.EJB.equals(projectType),
- J2EEProjectUtilities.DYNAMIC_WEB.equals(projectType));
- if (!model.isPropertySet(PROJECT_NAME))
- return;
- IProject project = ProjectUtilities.getProject(model.getStringProperty(PROJECT_NAME));
- annotationsGroup.setEnablement(project);
- // annotationsGroup.setUseAnnotations(true);
- } else {
- // not a Web Doclet project - make sure that the USE_ANNOTATIONS property is off
- model.setProperty(USE_ANNOTATIONS, false);
- }
- }
-
- private void createUseExistingGroup(Composite composite) {
- existingButton = new Button(composite, SWT.CHECK);
- existingButton.setText(getUseExistingCheckboxText());
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- existingButton.setLayoutData(data);
- synchHelper.synchCheckbox(existingButton, getUseExistingProperty(), null);
- existingButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleExistingButtonSelected();
- }
- });
-
- existingClassLabel = new Label(composite, SWT.LEFT);
- existingClassLabel.setText(CLASS_NAME_LABEL);
- existingClassLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- existingClassLabel.setEnabled(false);
-
- existingClassText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
- existingClassText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- existingClassText.setEnabled(false);
- synchHelper.synchText(existingClassText, CLASS_NAME, null);
-
- existingClassButton = new Button(composite, SWT.PUSH);
- existingClassButton.setText(BROWSE_BUTTON_LABEL);
- existingClassButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- existingClassButton.setEnabled(false);
- existingClassButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleClassButtonSelected();
- }
- });
- }
-
- private void handleExistingButtonSelected() {
- boolean enable = existingButton.getSelection();
- existingClassLabel.setEnabled(enable);
- existingClassButton.setEnabled(enable);
- packageText.setEnabled(!enable);
- packageButton.setEnabled(!enable);
- packageLabel.setEnabled(!enable);
- classText.setEnabled(!enable);
- classLabel.setEnabled(!enable);
- superText.setEnabled(!enable);
- superButton.setEnabled(!enable);
- superLabel.setEnabled(!enable);
- }
-
- private boolean isWebDocletProject() {
- String projectName = model.getStringProperty(PROJECT_NAME);
- if(projectName != null && !"".equals(projectName.trim())){
- IProject project = ProjectUtilities.getProject(projectName);
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- return facetedProject.hasProjectFacet(WebFacetUtils.WEB_XDOCLET_FACET);
- } catch (CoreException e) {
- ServletUIPlugin.log(e);
- }
- }
- return false;
- }
-
- protected void validateProjectRequirements(IProject project)
- {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if(component.getRootFolder() != null
- && component.getRootFolder().getUnderlyingFolder() != null){
- IFile ddXmlFile = component.getRootFolder().getUnderlyingFolder().getFile(new Path(J2EEConstants.WEBAPP_DD_URI));
- if (!ddXmlFile.exists())
- {
- // add a flag into the model to create the DD at the beginning of the operation
- model.setBooleanProperty(GENERATE_DD, Boolean.TRUE);
- }
- else
- {
- // don't create a DD, since one already exists.
- model.setBooleanProperty(GENERATE_DD, Boolean.FALSE);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebWizard.java
deleted file mode 100644
index d1f6fb952..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebWizard.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Kaloyan Raev, kaloyan.raev@sap.com
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-
-/**
- * @author jlanuti
- */
-public abstract class NewWebWizard extends DataModelWizard implements INewWizard {
-
- /**
- * @param model
- */
- public NewWebWizard(IDataModel model) {
- super(model);
- }
-
- /**
- * Default constructor
- */
- public NewWebWizard() {
- super();
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- getDataModel();
- }
-
- protected IStructuredSelection getCurrentSelection() {
- IWorkbenchWindow window = ServletUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- ISelection selection = window.getSelectionService().getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
- }
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ServletDataModelSyncHelper.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ServletDataModelSyncHelper.java
deleted file mode 100644
index 6ca077c7c..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ServletDataModelSyncHelper.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-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.swt.widgets.Widget;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
-
-public class ServletDataModelSyncHelper extends DataModelSynchHelper {
- protected Map widgetToValueHash;
- protected MultipleCheckboxSelectionListener multipleCheckboxSelectionListener;
-
- public ServletDataModelSyncHelper(IDataModel model) {
- super(model);
- }
-
- /**
- * Sets the UI to have the property value defined in the model
- *
- * @param propertyName
- * @link IDataModelListener for the flag values.
- */
- public void synchUIWithModel(final String propertyName, final int flag) {
- if (null != propertyToWidgetHash && propertyToWidgetHash.containsKey(propertyName)) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- try {
- Object obj = propertyToWidgetHash.get(propertyName);
- if (obj != null) {
- if (obj instanceof List) {
- List widgets = (List) obj;
- for (int i = 0; i < widgets.size(); i++) {
- currentWidget = (Widget) widgets.get(i);
- synchUIWithModel(propertyName, flag, currentWidget);
- }
- } else {
- currentWidget = (Widget) obj;
- synchUIWithModel(propertyName, flag, currentWidget);
- }
- }
- } finally {
- currentWidget = null;
- }
- }
- });
- }
- }
-
- protected void synchUIWithModel(final String propertyName, final int flag, Widget currentWidget) {
- if (currentWidget != null && currentWidget != currentWidgetFromEvent) {
- //We must hold a copy in a temp variable because setting the widget value
- //may trigger an event that will cause this method to be called again.
- Widget widget = currentWidget;
- try {
- ignoreModifyEvent = true;
- if (currentWidget instanceof Text)
- setWidgetValue(propertyName, flag, (Text) currentWidget);
- else if (currentWidget instanceof Combo) {
- setWidgetValue(propertyName, flag, (Combo) currentWidget);
- } else if (currentWidget instanceof Button)
- setWidgetValue(propertyName, flag, (Button) currentWidget);
- else if (currentWidget instanceof Label)
- setWidgetValue(propertyName, flag, (Label) currentWidget);
- else if (currentWidget instanceof List)
- setWidgetValue(propertyName, flag, (org.eclipse.swt.widgets.List) currentWidget);
- else if (currentWidget instanceof Table)
- setWidgetValue(propertyName, flag, (Table) currentWidget);
- else if (currentWidget instanceof Tree)
- setWidgetValue(propertyName, flag, (Tree) currentWidget);
- } finally {
- ignoreModifyEvent = false;
- }
- //Pass the copy of the currentWidget
- setEnablement((Control) widget, dataModel.isPropertyEnabled(propertyName));
- }
- }
-
- protected void setWidgetValue(String propertyName, int flag, Button button) {
- if ((button.getStyle() & SWT.CHECK) == SWT.CHECK) {
- Object propertyValue = dataModel.getProperty(propertyName);
- if (propertyValue instanceof java.util.List) {
- List value = (List) propertyValue;
- Object buttonValue = widgetToValueHash.get(button);
- boolean exists = value.contains(buttonValue);
- if (button.getSelection() != exists) {
- button.setSelection(exists);
- }
- return;
- }
- }
- }
-
- private class MultipleCheckboxSelectionListener implements SelectionListener {
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.getSource();
- if (currentWidget == button)
- return;
- try {
- currentWidgetFromEvent = button;
- String propertyName = (String) widgetToPropertyHash.get(button);
- Object propertyValue = widgetToValueHash.get(button);
-
- Object contents = dataModel.getProperty(propertyName);
-
- if (contents == null) {
- contents = new ArrayList();
- }
- if (contents instanceof java.util.List) {
- List list = (List) contents;
- if (button.getSelection()) {
- if (!list.contains(propertyValue))
- list.add(propertyValue);
- } else {
- list.remove(propertyValue);
- }
- setProperty(propertyName, list);
- dataModel.notifyPropertyChange(propertyName, DataModelEvent.VALUE_CHG);
- }
- } finally {
- currentWidgetFromEvent = null;
- }
- }
-
-
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- }
-
- public void synchCheckbox(Button checkbox, String textValue, String propertyName, Control[] dependentControls) {
- setCompositeValue(checkbox, textValue);
- synchComposite(checkbox, propertyName, dependentControls);
- if (multipleCheckboxSelectionListener == null) {
- multipleCheckboxSelectionListener = new MultipleCheckboxSelectionListener();
- }
- checkbox.addSelectionListener(multipleCheckboxSelectionListener);
- }
-
- protected void setCompositeValue(Widget widget, Object value) {
- if (widgetToValueHash == null)
- widgetToValueHash = new HashMap();
- widgetToValueHash.put(widget, value);
- }
-
- protected void synchComposite(Widget widget, String propertyName, Control[] depControls) {
- if (null == widgetToPropertyHash)
- widgetToPropertyHash = new HashMap();
- if (propertyToWidgetHash == null)
- propertyToWidgetHash = new HashMap();
- widgetToPropertyHash.put(widget, propertyName);
- Object value = propertyToWidgetHash.get(propertyName);
- List widgets;
- if (value == null || !(value instanceof List)) {
- widgets = new ArrayList();
- } else {
- widgets = (List) value;
- }
- widgets.add(widget);
- propertyToWidgetHash.put(propertyName, widgets);
-
- if (depControls != null) {
- if (widgetToDepControls == null)
- widgetToDepControls = new HashMap();
- widgetToDepControls.put(widget, depControls);
- }
- synchUIWithModel(propertyName, DataModelEvent.VALUE_CHG);
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/SimpleTypedElementSelectionValidator.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/SimpleTypedElementSelectionValidator.java
deleted file mode 100644
index a05cca457..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/SimpleTypedElementSelectionValidator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-
-/**
- * Implementation of a <code>ISelectionValidator</code> to validate the type
- * of an element. Empty selections are not accepted.
- */
-public class SimpleTypedElementSelectionValidator implements ISelectionStatusValidator {
-
- private IStatus fgErrorStatus = new Status(IStatus.ERROR, ServletUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- private IStatus fgOKStatus = new Status(IStatus.OK, ServletUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
-
- private Class[] fAcceptedTypes;
- private boolean fAllowMultipleSelection;
-
- /**
- * @param acceptedTypes
- * The types accepted by the validator
- * @param allowMultipleSelection
- * If set to <code>true</code>, the validator allows
- * multiple selection.
- */
- public SimpleTypedElementSelectionValidator(Class[] acceptedTypes, boolean allowMultipleSelection) {
- org.eclipse.core.runtime.Assert.isNotNull(acceptedTypes);
- fAcceptedTypes = acceptedTypes;
- fAllowMultipleSelection = allowMultipleSelection;
- }
-
- /*
- * @see org.eclipse.ui.dialogs.ISelectionValidator#isValid(java.lang.Object)
- */
- public IStatus validate(Object[] elements) {
- if (isValid(elements)) {
- return fgOKStatus;
- }
- return fgErrorStatus;
- }
-
- private boolean isOfAcceptedType(Object o) {
- for (int i = 0; i < fAcceptedTypes.length; i++) {
- if (fAcceptedTypes[i].isInstance(o)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean isValid(Object[] selection) {
- if (selection.length == 0) {
- return false;
- }
-
- if (!fAllowMultipleSelection && selection.length != 1) {
- return false;
- }
-
- for (int i = 0; i < selection.length; i++) {
- Object o = selection[i];
- if (!isOfAcceptedType(o)) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringArrayTableWizardSectionCallback.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringArrayTableWizardSectionCallback.java
deleted file mode 100644
index e75f6c1a9..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringArrayTableWizardSectionCallback.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.jst.j2ee.internal.wizard.StringArrayTableWizardSection.StringArrayDialogCallback;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Implementation of the <code>StringArrayDialogCallback</code> interface for
- * both "Initialization Parameters" and "URL Mappings" table views.
- */
-public class StringArrayTableWizardSectionCallback implements
- StringArrayDialogCallback {
-
- /**
- * The first text field should not be empty.
- */
- public boolean validate(Text[] texts) {
- if (texts.length > 0) {
- return texts[0].getText().trim().length() > 0;
- }
- return true;
- }
-
- /**
- * Trims the text values.
- */
- public String[] retrieveResultStrings(Text[] texts) {
- int n = texts.length;
- String[] result = new String[n];
- for (int i = 0; i < n; i++) {
- result[i] = texts[i].getText().trim();
- }
- return result;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringMatcher.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringMatcher.java
deleted file mode 100644
index e34304f68..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/StringMatcher.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *
- * Note: this class was copied from org.eclipse.jst.internal.ui.util
- * It has much requested as an API since there are a dozen such copies throughout
- * Eclipse and related projects. (Such as, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=12214)
- * These requests have been rejected since, all users should eventually migrate to use javax.regx
- * counterparts instead.
- *
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import java.util.*;
-
-/**
- * A string pattern matcher. Supports '*' and '?' wildcards.
- */
-public class StringMatcher {
- protected String fPattern;
- protected int fLength; // pattern length
- protected boolean fIgnoreWildCards;
- protected boolean fIgnoreCase;
- protected boolean fHasLeadingStar;
- protected boolean fHasTrailingStar;
- protected String fSegments[]; //the given pattern is split into * separated segments
-
- /* boundary value beyond which we don't need to search in the text */
- protected int fBound= 0;
-
-
- protected static final char fSingleWildCard= '\u0000';
-
- public static class Position {
- int start; //inclusive
- int end; //exclusive
- public Position(int start, int end) {
- this.start= start;
- this.end= end;
- }
- public int getStart() {
- return start;
- }
- public int getEnd() {
- return end;
- }
- }
- /**
- * StringMatcher constructor takes in a String object that is a simple
- * pattern. The pattern may contain '*' for 0 and many characters and
- * '?' for exactly one character.
- *
- * Literal '*' and '?' characters must be escaped in the pattern
- * e.g., "\*" means literal "*", etc.
- *
- * Escaping any other character (including the escape character itself),
- * just results in that character in the pattern.
- * e.g., "\a" means "a" and "\\" means "\"
- *
- * If invoking the StringMatcher with string literals in Java, don't forget
- * escape characters are represented by "\\".
- *
- * @param pattern the pattern to match text against
- * @param ignoreCase if true, case is ignored
- * @param ignoreWildCards if true, wild cards and their escape sequences are ignored
- * (everything is taken literally).
- */
- public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) {
- if (pattern == null)
- throw new IllegalArgumentException();
- fIgnoreCase= ignoreCase;
- fIgnoreWildCards= ignoreWildCards;
- fPattern= pattern;
- fLength= pattern.length();
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
- /**
- * Find the first occurrence of the pattern between <code>start</code)(inclusive)
- * and <code>end</code>(exclusive).
- * @param text the String object to search in
- * @param start the starting index of the search range, inclusive
- * @param end the ending index of the search range, exclusive
- * @return an <code>StringMatcher.Position</code> object that keeps the starting
- * (inclusive) and ending positions (exclusive) of the first occurrence of the
- * pattern in the specified range of the text; return null if not found or subtext
- * is empty (start==end). A pair of zeros is returned if pattern is empty string
- * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
- * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
- */
- public StringMatcher.Position find(String text, int start, int end) {
- if (text == null)
- throw new IllegalArgumentException();
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
- if (end < 0 ||start >= end )
- return null;
- if (fLength == 0)
- return new Position(start, start);
- if (fIgnoreWildCards) {
- int x= posIn(text, start, end);
- if (x < 0)
- return null;
- return new Position(x, x+fLength);
- }
-
- int segCount= fSegments.length;
- if (segCount == 0)//pattern contains only '*'(s)
- return new Position (start, end);
-
- int curPos= start;
- int matchStart= -1;
- int i;
- for (i= 0; i < segCount && curPos < end; ++i) {
- String current= fSegments[i];
- int nextMatch= regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0 )
- return null;
- if(i == 0)
- matchStart= nextMatch;
- curPos= nextMatch + current.length();
- }
- if (i < segCount)
- return null;
- return new Position(matchStart, curPos);
- }
- /**
- * match the given <code>text</code> with the pattern
- * @return true if matched eitherwise false
- * @param text a String object
- */
- public boolean match(String text) {
- return match(text, 0, text.length());
- }
- /**
- * Given the starting (inclusive) and the ending (exclusive) positions in the
- * <code>text</code>, determine if the given substring matches with aPattern
- * @return true if the specified portion of the text matches the pattern
- * @param text a String object that contains the substring to match
- * @param start marks the starting position (inclusive) of the substring
- * @param end marks the ending index (exclusive) of the substring
- */
- public boolean match(String text, int start, int end) {
- if (null == text)
- throw new IllegalArgumentException();
-
- if (start > end)
- return false;
-
- if (fIgnoreWildCards)
- return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength);
- int segCount= fSegments.length;
- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s)
- return true;
- if (start == end)
- return fLength == 0;
- if (fLength == 0)
- return start == end;
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
-
- int tCurPos= start;
- int bound= end - fBound;
- if ( bound < 0)
- return false;
- int i=0;
- String current= fSegments[i];
- int segLength= current.length();
-
- /* process first segment */
- if (!fHasLeadingStar){
- if(!regExpRegionMatches(text, start, current, 0, segLength)) {
- return false;
- } else {
- ++i;
- tCurPos= tCurPos + segLength;
- }
- }
- if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) {
- // only one segment to match, no wildcards specified
- return tCurPos == end;
- }
- /* process middle segments */
- while (i < segCount) {
- current= fSegments[i];
- int currentMatch;
- int k= current.indexOf(fSingleWildCard);
- if (k < 0) {
- currentMatch= textPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- } else {
- currentMatch= regExpPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- }
- tCurPos= currentMatch + current.length();
- i++;
- }
-
- /* process final segment */
- if (!fHasTrailingStar && tCurPos != end) {
- int clen= current.length();
- return regExpRegionMatches(text, end - clen, current, 0, clen);
- }
- return i == segCount ;
- }
-
- /**
- * This method parses the given pattern into segments seperated by wildcard '*' characters.
- * Since wildcards are not being used in this case, the pattern consists of a single segment.
- */
- private void parseNoWildCards() {
- fSegments= new String[1];
- fSegments[0]= fPattern;
- fBound= fLength;
- }
- /**
- * Parses the given pattern into segments seperated by wildcard '*' characters.
- */
- private void parseWildCards() {
- if(fPattern.startsWith("*"))//$NON-NLS-1$
- fHasLeadingStar= true;
- if(fPattern.endsWith("*")) {//$NON-NLS-1$
- /* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar= true;
- }
- }
-
- Vector temp= new Vector();
-
- int pos= 0;
- StringBuffer buf= new StringBuffer();
- while (pos < fLength) {
- char c= fPattern.charAt(pos++);
- switch (c) {
- case '\\':
- if (pos >= fLength) {
- buf.append(c);
- } else {
- char next= fPattern.charAt(pos++);
- /* if it's an escape sequence */
- if (next == '*' || next == '?' || next == '\\') {
- buf.append(next);
- } else {
- /* not an escape sequence, just insert literally */
- buf.append(c);
- buf.append(next);
- }
- }
- break;
- case '*':
- if (buf.length() > 0) {
- /* new segment */
- temp.addElement(buf.toString());
- fBound += buf.length();
- buf.setLength(0);
- }
- break;
- case '?':
- /* append special character representing single match wildcard */
- buf.append(fSingleWildCard);
- break;
- default:
- buf.append(c);
- }
- }
-
- /* add last buffer to segment list */
- if (buf.length() > 0) {
- temp.addElement(buf.toString());
- fBound += buf.length();
- }
-
- fSegments= new String[temp.size()];
- temp.copyInto(fSegments);
- }
- /**
- * @param text a string which contains no wildcard
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int posIn(String text, int start, int end) {//no wild card in pattern
- int max= end - fLength;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(fPattern, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength))
- return i;
- }
-
- return -1;
- }
- /**
- * @param text a simple regular expression that may only contain '?'(s)
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a simple regular expression that may contains '?'
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int regExpPosIn(String text, int start, int end, String p) {
- int plen= p.length();
-
- int max= end - plen;
- for (int i= start; i <= max; ++i) {
- if (regExpRegionMatches(text, i, p, 0, plen))
- return i;
- }
- return -1;
- }
-
-
- protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) {
- while (plen-- > 0) {
- char tchar= text.charAt(tStart++);
- char pchar= p.charAt(pStart++);
-
- /* process wild cards */
- if (!fIgnoreWildCards) {
- /* skip single wild cards */
- if (pchar == fSingleWildCard) {
- continue;
- }
- }
- if (pchar == tchar)
- continue;
- if (fIgnoreCase) {
- if (Character.toUpperCase(tchar) == Character.toUpperCase(pchar))
- continue;
- // comparing after converting to upper case doesn't handle all cases;
- // also compare after converting to lower case
- if (Character.toLowerCase(tchar) == Character.toLowerCase(pchar))
- continue;
- }
- return false;
- }
- return true;
- }
- /**
- * @param text the string to match
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a string that has no wildcard
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int textPosIn(String text, int start, int end, String p) {
-
- int plen= p.length();
- int max= end - plen;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(p, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, p, 0, plen))
- return i;
- }
-
- return -1;
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.java
deleted file mode 100644
index a498a9b04..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2006 BEA Systems, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Konstantin Komissarchik - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
-import org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension;
-import org.eclipse.jdt.ui.wizards.NewElementWizardPage;
-import org.eclipse.jst.j2ee.internal.web.classpath.WebAppLibrariesContainer;
-import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils;
-import org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin;
-import org.eclipse.osgi.util.NLS;
-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.Label;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public class WebAppLibrariesContainerPage
-
- extends NewElementWizardPage
- implements IClasspathContainerPage, IClasspathContainerPageExtension
-
-{
- private IProject ownerProject;
- private String libsProjectName;
- private Combo projectsCombo;
-
- public WebAppLibrariesContainerPage()
- {
- super( "WebAppLibrariesContainerPage" ); //$NON-NLS-1$
-
- setTitle( Resources.pageTitle );
- setDescription( Resources.pageDescription );
- }
-
- public IClasspathEntry getSelection()
- {
- IPath path = new Path( WebAppLibrariesContainer.CONTAINER_ID );
-
- final int index = this.projectsCombo.getSelectionIndex();
- if(index != -1){
- final String selectedProjectName = this.projectsCombo.getItem( index );
-
- if( this.ownerProject == null ||
- ! selectedProjectName.equals( this.ownerProject.getName() ) )
- {
- path = path.append( selectedProjectName );
- }
- }
-
- return JavaCore.newContainerEntry( path );
- }
-
- public void setSelection( final IClasspathEntry cpentry )
- {
- final IPath path = cpentry == null ? null : cpentry.getPath();
-
- if( path == null || path.segmentCount() == 1 )
- {
- if( this.ownerProject != null )
- {
- this.libsProjectName = this.ownerProject.getName();
- }
- }
- else
- {
- this.libsProjectName = path.segment( 1 );
- }
- }
-
- public void createControl( final Composite parent )
- {
- final Composite composite = new Composite( parent, SWT.NONE );
- composite.setLayout( new GridLayout( 2, false ) );
-
- final Label label = new Label( composite, SWT.NONE );
- label.setText( Resources.projectsLabel );
-
- final String[] webProjects = getWebProjects();
-
- this.projectsCombo = new Combo( composite, SWT.READ_ONLY );
- this.projectsCombo.setItems( webProjects );
-
- final int index;
-
- if( this.ownerProject != null )
- {
- index = indexOf( webProjects, this.libsProjectName );
- }
- else
- {
- if( this.projectsCombo.getItemCount() > 0 )
- {
- index = 0;
- }
- else
- {
- index = -1;
- }
- }
-
- if( index != -1 )
- {
- this.projectsCombo.select( index );
- }
-
- final GridData gd = new GridData();
- gd.grabExcessHorizontalSpace = true;
- gd.minimumWidth = 100;
-
- this.projectsCombo.setLayoutData( gd );
-
- setControl( composite );
- }
-
- public boolean finish()
- {
- return true;
- }
-
- public void initialize( final IJavaProject project,
- final IClasspathEntry[] currentEntries )
- {
- this.ownerProject = ( project == null ? null : project.getProject() );
- }
-
- private static String[] getWebProjects()
- {
- try
- {
- final Set projects
- = ProjectFacetsManager.getFacetedProjects( WebFacetUtils.WEB_FACET );
-
- final String[] names = new String[ projects.size() ];
- int i = 0;
-
- for( Iterator itr = projects.iterator(); itr.hasNext(); i++ )
- {
- final IFacetedProject fproj = (IFacetedProject) itr.next();
- names[ i ] = fproj.getProject().getName();
- }
-
- Arrays.sort( names );
-
- return names;
- }
- catch( CoreException e )
- {
- ServletUIPlugin.log( e.getStatus() );
- return new String[ 0 ];
- }
- }
-
- private static int indexOf( final String[] array,
- final String str )
- {
- for( int i = 0; i < array.length; i++ )
- {
- if( array[ i ].equals( str ) )
- {
- return i;
- }
- }
-
- return -1;
- }
-
- private static final class Resources
-
- extends NLS
-
- {
- public static String pageTitle;
- public static String pageDescription;
- public static String projectsLabel;
-
- static
- {
- initializeMessages( WebAppLibrariesContainerPage.class.getName(),
- Resources.class );
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.properties b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.properties
deleted file mode 100644
index 85621ab63..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebAppLibrariesContainerPage.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pageTitle = Web App Libraries
-pageDescription = This container dynamically manages classpath entries for types in the WEB-INF/lib and WEB-INF/classes directories.
-projectsLabel = Project:\
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportPage.java
deleted file mode 100644
index 95716ce5c..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportPage.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPluginIcons;
-import org.eclipse.jst.j2ee.internal.wizard.J2EEModuleExportPage;
-import org.eclipse.jst.servlet.ui.IWebUIContextIds;
-import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class WebComponentExportPage extends J2EEModuleExportPage {
- /**
- * @param model
- * @param pageName
- */
- public WebComponentExportPage(IDataModel model, String pageName, IStructuredSelection selection) {
- super(model, pageName, selection);
- setTitle(WEBUIMessages.WEB_EXPORT_MAIN_PG_TITLE);
- setDescription(WEBUIMessages.WEB_EXPORT_MAIN_PG_DESC);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_EXPORT_WIZARD_BANNER));
- setInfopopID(IWebUIContextIds.WAR_EXPORT_PAGE1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.internal.internal.ui.wizard.J2EEImportPage#getProjectImportLabel()
- */
- protected String getComponentLabel() {
- return J2EEUIMessages.getResourceString(J2EEUIMessages.WEB_PROJ_LBL);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.internal.internal.ui.wizard.J2EEImportPage#getFilterExpression()
- */
- protected String[] getFilterExpression() {
- return new String[]{"*.war"}; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.internal.internal.ui.wizard.J2EEExportPage#isMetaTypeSupported(java.lang.Object)
- */
- protected boolean isMetaTypeSupported(Object o) {
- return o instanceof org.eclipse.jst.j2ee.webapplication.WebApp;
- }
-
- protected String getCompnentID() {
- return "JST_WEB"; //$NON-NLS-1$
- }
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportWizard.java
deleted file mode 100644
index ef21f01b8..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentExportWizard.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.servlet.ui.internal.wizard;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPluginIcons;
-import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportDataModelProvider;
-import org.eclipse.jst.j2ee.internal.wizard.J2EEArtifactExportWizard;
-import org.eclipse.ui.IExportWizard;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * <p>
- * Wizard used to export J2EE Web Application module structures
- * from the Eclipse Workbench to a deployable Web Application
- * Archive *.war file.
- * </p>
- */
-public final class WebComponentExportWizard extends J2EEArtifactExportWizard implements IExportWizard {
-
- /**
- * <p>
- * The default constructor. Creates a wizard with no selection,
- * no model instance, and no operation instance. The model and
- * operation will be created as needed.
- * </p>
- */
- public WebComponentExportWizard() {
- super();
- }
-
- /**
- * <p>
- * The model is used to prepopulate the wizard controls
- * and interface with the operation.
- * </p>
- * @param model The model parameter is used to pre-populate wizard controls and interface with the operation
- */
- public WebComponentExportWizard(IDataModel model) {
- super(model);
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new WebComponentExportDataModelProvider();
- }
- /**
- * <p>
- * Adds the following pages:
- * <ul>
- * <li> {@link WebComponentExportPage} as the main wizard page ({@link #MAIN_PG})
- * </ul>
- * </p>
- */
- public void doAddPages() {
- addPage(new WebComponentExportPage(getDataModel(), MAIN_PG, getSelection()));
- }
-
- /**
- * {@inheritDoc}
- *
- * <p>
- * Sets up the default wizard page image.
- * </p>
- */
- protected void doInit() {
- setDefaultPageImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_EXPORT_WIZARD_BANNER));
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportPage.java
deleted file mode 100644
index 46e9cefb8..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportPage.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 3, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPluginIcons;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.wizard.J2EEModuleImportPage;
-import org.eclipse.jst.servlet.ui.IWebUIContextIds;
-import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-
-/**
- * @author cbridgha
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class WebComponentImportPage extends J2EEModuleImportPage {
- /**
- * @param model
- * @param pageName
- */
- public WebComponentImportPage(IDataModel model, String pageName) {
- super(model, pageName);
- setTitle(WEBUIMessages.WEB_IMPORT_MAIN_PG_TITLE);
- setDescription(WEBUIMessages.WEB_IMPORT_MAIN_PG_DESC);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_IMPORT_WIZARD_BANNER));
- setInfopopID(IWebUIContextIds.WAR_IMPORT_PAGE1);
- }
-
- protected String getFileImportLabel() {
- return WEBUIMessages.WEB_FILE_LBL;
- }
-
- protected String[] getFilterExpression() {
- return new String[]{"*.war"}; //$NON-NLS-1$
- }
-
- protected String getProjectImportLabel() {
- return WEBUIMessages.WEB_PROJECT_LBL;
- }
-
- protected void createAnnotationsStandaloneGroup(Composite composite) {
- // TODO: implement with new import wizards
- // new AnnotationsStandaloneGroup(composite, getWebDataModel(), false);
- }
-
- protected String getModuleFacetID(){
- return J2EEProjectUtilities.DYNAMIC_WEB;
- }
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWebLibsPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWebLibsPage.java
deleted file mode 100644
index 4dda6d494..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWebLibsPage.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties;
-import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPluginIcons;
-import org.eclipse.jst.j2ee.internal.wizard.J2EEImportPage;
-import org.eclipse.jst.j2ee.web.datamodel.properties.IWebComponentImportDataModelProperties;
-import org.eclipse.jst.servlet.ui.IWebUIContextIds;
-import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-
-/**
- * @author cbridgha
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class WebComponentImportWebLibsPage extends J2EEImportPage {
- private Button deselectAllButton;
- private Button selectAllButton;
- protected ArchiveWrapper archiveWrapper;
- public CheckboxTableViewer availableJARsViewer;
- public boolean utilJarSelectionChanged = false;
-
- /**
- * @param model
- * @param pageName
- */
- public WebComponentImportWebLibsPage(IDataModel model, String pageName) {
- super(model, pageName);
- setTitle(WEBUIMessages.WEB_IMPORT_WEB_LIB_PG_TITLE);
- setDescription(WEBUIMessages.WEB_IMPORT_WEB_LIB_PG_DESC);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_IMPORT_WIZARD_BANNER));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizardPage#createTopLevelComposite(org.eclipse.swt.widgets.Composite)
- */
- protected Composite createTopLevelComposite(Composite parent) {
- setInfopopID(IWebUIContextIds.WAR_IMPORT_PAGE2);
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- createAvailableJarsList(composite);
- createButtonsGroup(composite);
- return composite;
- }
-
- /*
- * Updates the enable state of the all buttons
- */
- protected void updateButtonEnablements() {
- utilJarSelectionChanged = true;
- }
-
- protected void createAvailableJarsList(Composite listGroup) {
- availableJARsViewer = CheckboxTableViewer.newCheckList(listGroup, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- GridData gData = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
- gData.widthHint = 200;
- gData.heightHint = 80;
- availableJARsViewer.getControl().setLayoutData(gData);
- AvailableWebLibProvider libsProvider = new AvailableWebLibProvider();
- availableJARsViewer.setContentProvider(libsProvider);
- availableJARsViewer.setLabelProvider(libsProvider);
- availableJARsViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- availableJARCheckStateChanged(event);
- }
- });
- availableJARsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateButtonEnablements();
- }
- });
- TableLayout tableLayout = new TableLayout();
- availableJARsViewer.getTable().setLayout(tableLayout);
- availableJARsViewer.getTable().setHeaderVisible(false);
- availableJARsViewer.getTable().setLinesVisible(false);
-
- model.addListener(new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (event.getPropertyName().equals(IWebComponentImportDataModelProperties.WEB_LIB_ARCHIVES_SELECTED)) {
- availableJARsViewer.setCheckedElements(((List) model.getProperty(IWebComponentImportDataModelProperties.WEB_LIB_ARCHIVES_SELECTED)).toArray());
- }
- }
- });
- }
-
- private void handleDeselectAllButtonPressed() {
- ArrayList emptySelection = new ArrayList(2);
- model.setProperty(IWebComponentImportDataModelProperties.WEB_LIB_ARCHIVES_SELECTED, emptySelection);
- }
-
- private void handleSelectAllButtonPressed() {
- ArrayList allSelection = new ArrayList(2);
- Object selection = null;
- for (int i = 0; (null != (selection = availableJARsViewer.getElementAt(i))); i++) {
- allSelection.add(selection);
- }
- model.setProperty(IWebComponentImportDataModelProperties.WEB_LIB_ARCHIVES_SELECTED, allSelection);
- }
-
- protected void createButtonsGroup(org.eclipse.swt.widgets.Composite parent) {
- Composite buttonGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 4;
- buttonGroup.setLayout(layout);
- buttonGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- selectAllButton = new Button(buttonGroup, SWT.PUSH);
- selectAllButton.setText(WEBUIMessages.WAR_IMPORT_SELECT_ALL_LIBS_BUTTON);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 1;
- gd.heightHint = SWT.DEFAULT;
- gd.widthHint = SWT.DEFAULT;
- selectAllButton.setLayoutData(gd);
- selectAllButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleSelectAllButtonPressed();
- }
- });
-
- deselectAllButton = new Button(buttonGroup, SWT.PUSH);
- deselectAllButton.setText(WEBUIMessages.WAR_IMPORT_DESELECT_ALL_LIBS_BUTTON);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- gd.heightHint = SWT.DEFAULT;
- gd.widthHint = SWT.DEFAULT;
- deselectAllButton.setLayoutData(gd);
- deselectAllButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleDeselectAllButtonPressed();
- }
- });
- }
-
- private void refreshEARFileIfNecessary() {
- if (isEARFileChanged()) {
- archiveWrapper = (ArchiveWrapper) model.getProperty(IJ2EEComponentImportDataModelProperties.ARCHIVE_WRAPPER);
- refresh();
- }
- }
-
- protected void setJARsCompositeEnabled(boolean enabled) {
- availableJARsViewer.getTable().setEnabled(enabled);
- availableJARsViewer.setAllChecked(false);
- availableJARsViewer.setAllGrayed(!enabled);
- selectAllButton.setEnabled(enabled);
- deselectAllButton.setEnabled(enabled);
- }
-
- private void refresh() {
- availableJARsViewer.setInput(archiveWrapper);
- }
-
- public boolean isEARFileChanged() {
- return archiveWrapper != model.getProperty(IJ2EEComponentImportDataModelProperties.ARCHIVE_WRAPPER);
- }
-
- protected void enter() {
- super.enter();
- refreshEARFileIfNecessary();
- }
-
- public void availableJARCheckStateChanged(CheckStateChangedEvent event) {
- model.setProperty(IWebComponentImportDataModelProperties.WEB_LIB_ARCHIVES_SELECTED, getJARsForProjects());
- validatePage();
- }
-
- public List getJARsForProjects() {
- refreshEARFileIfNecessary();
- List result = new ArrayList();
- result.addAll(Arrays.asList(availableJARsViewer.getCheckedElements()));
- return result;
- }
-
- protected boolean isNullOrEmpty(String aString) {
- return aString == null || aString.length() == 0;
- }
-
- protected String[] getValidationPropertyNames() {
- return new String[]{};
- }
-
- protected void restoreWidgetValues() {
- // This page doesn't implement...
- }
-
- public void storeDefaultSettings() {
- // This page doesn't implement...
- }
-
-
-
-}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWizard.java
deleted file mode 100644
index a79f1bcde..000000000
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentImportWizard.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.servlet.ui.internal.wizard;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPluginIcons;
-import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentImportDataModelProvider;
-import org.eclipse.jst.j2ee.internal.wizard.J2EEComponentImportWizard;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.project.facet.IProductConstants;
-import org.eclipse.wst.project.facet.ProductManager;
-
-/**
- * <p>
- * Wizard used to import J2EE Web Application module structures into the Eclipse Workbench from an
- * existing Web Application *.war file.
- * </p>
- */
-public final class WebComponentImportWizard extends J2EEComponentImportWizard {
-
- protected static final String WEB_LIBS_PG = "WEB_LIBS_PG"; //$NON-NLS-1$
-
- /**
- * <p>
- * The default constructor. Creates a wizard with no selection, no model instance, and no
- * operation instance. The model and operation will be created as needed.
- * </p>
- */
- public WebComponentImportWizard() {
- super();
- }
-
- /**
- * <p>
- * The model is used to prepopulate the wizard controls and interface with the operation.
- * </p>
- *
- * @param model
- * The model parameter is used to pre-populate wizard controls and interface with the
- * operation
- */
- public WebComponentImportWizard(IDataModel model) {
- super(model);
- }
-
- /**
- * <p>
- * Adds an {@link WARImportPage} as the main wizard page ({@link #MAIN_PG}).
- * </p>
- */
- public void doAddPages() {
- addPage(new WebComponentImportPage(getDataModel(), MAIN_PG));
- addPage(new WebComponentImportWebLibsPage(getDataModel(), WEB_LIBS_PG));
- }
-
- /**
- * {@inheritDoc}
- *
- * <p>
- * Sets up the dialog window title and default wizard page image.
- * </p>
- */
- public final void doInit() {
- setWindowTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.IMPORT_WIZ_TITLE));
- setDefaultPageImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_IMPORT_WIZARD_BANNER));
- // updateEARToModelFromSelection(getSpecificDataModel());
- }
-
- protected String[] getModuleValidatorStrings() {
- return new String[]{"org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator"}; //$NON-NLS-1$
- }
-
-
- // protected String getFinalPerspectiveID() {
- // // J2EEComponentCreationDataModel projCreationModel =
- // // getSpecificDataModel().getJ2EEModuleCreationDataModel();
- // // return projCreationModel.getStringProperty(ComponentCreationDataModel.FINAL_PERSPECTIVE);
- // return getDataModel().getStringProperty(ComponentCreationDataModel.FINAL_PERSPECTIVE);
- // }
-
- protected IDataModelProvider getDefaultProvider() {
- return new WebComponentImportDataModelProvider();
- }
-
- protected String getFinalPerspectiveID() {
- return ProductManager.getProperty(IProductConstants.FINAL_PERSPECTIVE_WEB);
- }
-}

Back to the top