diff options
Diffstat (limited to 'plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse')
20 files changed, 0 insertions, 2350 deletions
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/IWebUIContextIds.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/IWebUIContextIds.java deleted file mode 100644 index 42b3facbc..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/IWebUIContextIds.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui; - -public interface IWebUIContextIds { - - public static final String PLUGIN_SERVLET_UI = "org.eclipse.jst.servlet.ui."; //$NON-NLS-1$ - - public static final String WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_1 = PLUGIN_SERVLET_UI + "srvw1050"; //$NON-NLS-1$ - public static final String WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_2 = PLUGIN_SERVLET_UI + "srvw1100"; //$NON-NLS-1$ - public static final String WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_3 = PLUGIN_SERVLET_UI + "srvw1200"; //$NON-NLS-1$ - - -} diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/actions/ConvertToWebModuleTypeAction.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/actions/ConvertToWebModuleTypeAction.java deleted file mode 100644 index 861d45699..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/actions/ConvertToWebModuleTypeAction.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.eclipse.jst.servlet.ui.internal.actions; - -/* - * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2000, 2002 - All - * Rights Reserved. US Government Users Restricted Rights - Use, duplication or - * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. - */ - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardWorkbenchAction; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.wst.web.internal.operation.IBaseWebNature; - -public class ConvertToWebModuleTypeAction extends AbstractOpenWizardWorkbenchAction { - - IStructuredSelection fSelection = null; - IProject project = null; - IWorkbenchWindow fWindow; - - /** - * ConvertLinksDialog constructor comment. - */ - public ConvertToWebModuleTypeAction() { - super(); - } - - public ConvertToWebModuleTypeAction(IWorkbench workbench, String label, Class[] acceptedTypes) { - super(workbench, label, acceptedTypes, false); - } - - protected Wizard createWizard() { - //TODO: reimplement -/* ConvertToWebComponentTypeWizard wizard = new ConvertToWebComponentTypeWizard(new ConvertWebProjectDataModel()); - WebComponentCreationDataModel model = (WebComponentCreationDataModel) wizard.getModel(); - model.setProperty(EditModelOperationDataModel.PROJECT_NAME, project.getName()); - model.setBooleanProperty(J2EEComponentCreationDataModel.ADD_TO_EAR, true); - - StaticWebNatureRuntime nature; - try { - nature = (StaticWebNatureRuntime) project.getNature(IWebNatureConstants.STATIC_NATURE_ID); - String webContent = nature.getRootPublishableFolder().getName(); - String contextRoot = nature.getContextRoot(); - //model.setProperty(WebComponentCreationDataModel.WEB_CONTENT, webContent); - model.setProperty(WebComponentCreationDataModel.CONTEXT_ROOT, contextRoot); - } catch (CoreException e) { - // TODO Auto-generated catch block - Logger.getLogger().logError(e); - } - - // wizard.setWindowTitle("Convert to Dynamic Web Project"); - - return wizard;*/ - return null; - } - - /** - * Is this a web project? - */ - boolean isAWebProject(IProject aProject) { - if (aProject == null) - return false; - try { - aProject.getNature(IWebNatureConstants.J2EE_NATURE_ID); - } catch (CoreException coe) { - return false; - } - return true; - } - - /** - * make sure a web project is selected. - */ - public boolean isValidProject(IProject aProject) { - if (isAWebProject(aProject)) { - try { - IBaseWebNature nature = (IBaseWebNature) aProject.getNature(IWebNatureConstants.STATIC_NATURE_ID); - if (nature == null) - return false; - return true; - } catch (CoreException e) { - return false; - } - } - - return false; - } - - /** - * selectionChanged method comment. - */ - public void selectionChanged(IAction action, ISelection selection) { - boolean bEnable = false; - if (selection instanceof IStructuredSelection) { - fSelection = (IStructuredSelection) selection; - bEnable = validateSelected(fSelection); - } - ((Action) action).setEnabled(bEnable); - } - - /** - * selectionChanged method comment. - */ - public boolean validateSelected(ISelection selection) { - if (!(selection instanceof IStructuredSelection)) - return false; - - fSelection = (IStructuredSelection) selection; - - Object selectedProject = fSelection.getFirstElement(); - if (!(selectedProject instanceof IProject)) - return false; - - project = (IProject) selectedProject; - return isValidProject(project); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/actions/NewWebComponentAction.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/actions/NewWebComponentAction.java deleted file mode 100644 index bfb80f431..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/actions/NewWebComponentAction.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Created on Apr 1, 2004 - * - * 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.actions; - -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardWorkbenchAction; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin; -import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages; -import org.eclipse.jst.servlet.ui.internal.wizard.WebComponentCreationWizard; -import org.eclipse.ui.IWorkbench; - -public class NewWebComponentAction extends AbstractOpenWizardWorkbenchAction { - - public static String LABEL = WEBUIMessages.WEB_MODULE_WIZ_TITLE; - private static final String ICON = "war_wiz"; //$NON-NLS-1$ - - public NewWebComponentAction() { - super(); - setText(LABEL); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON)); - } - - public NewWebComponentAction(IWorkbench workbench, String label, Class[] activatedOnTypes, boolean acceptEmptySelection) { - super(workbench, label, activatedOnTypes, acceptEmptySelection); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON)); - } - - public NewWebComponentAction(IWorkbench workbench, String label, boolean acceptEmptySelection) { - super(workbench, label, acceptEmptySelection); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON)); - } - - protected Wizard createWizard() { - return new WebComponentCreationWizard(); - } - - protected boolean shouldAcceptElement(Object obj) { - return true; /* NewGroup.isOnBuildPath(obj) && !NewGroup.isInArchive(obj); */ - } - protected String getDialogText() { - return null; - } -} diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/classpath/WebAppContainerPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/classpath/WebAppContainerPage.java deleted file mode 100644 index a0b9a9856..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/classpath/WebAppContainerPage.java +++ /dev/null @@ -1,172 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 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.classpath; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.ui.wizards.IClasspathContainerPage; -import org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension; -import org.eclipse.jdt.ui.wizards.NewElementWizardPage; -import org.eclipse.swt.SWT; -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.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IFlexibleProject; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; - -import org.eclipse.jst.j2ee.internal.web.classpath.WebAppContainer; -import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public class WebAppContainerPage - - extends NewElementWizardPage - implements IClasspathContainerPage, IClasspathContainerPageExtension - -{ - private IProject project; - private IJavaProject jproject; - private String component; - private Label componentLabel; - private Combo componentCombo; - - public WebAppContainerPage() - { - super( resource( "WEB_CONT_NAME" ) ); - - setTitle( resource( "WEB_CONT_PAGE_TITLE" ) ); - setDescription( resource( "WEB_CONT_PAGE_DESCRIPTION" ) ); - - // TODO: Replace with a custom image. - setImageDescriptor( JavaPluginImages.DESC_WIZBAN_ADD_LIBRARY ); - } - - public void initialize( final IJavaProject jproject, - final IClasspathEntry[] cp ) - { - this.jproject = jproject; - this.project = jproject.getProject(); - } - - public IClasspathEntry getSelection() - { - final int sel = this.componentCombo.getSelectionIndex(); - final String cmp = this.componentCombo.getItem( sel ).trim(); - - return WebAppContainer.convert( cmp ); - } - - public void setSelection( final IClasspathEntry cpe ) - { - if( cpe == null ) - { - return; - } - - this.component = WebAppContainer.convert( cpe ); - } - - public void createControl( final Composite parent ) - { - final Composite composite = new Composite( parent, SWT.NONE ); - composite.setLayout( new GridLayout( 1, false ) ); - - this.componentLabel = new Label( composite, SWT.NONE ); - this.componentLabel.setText( resource( "WEB_CONT_PAGE_COMP_LABEL" ) ); - - this.componentCombo = new Combo( composite, SWT.READ_ONLY ); - - final List components = components(); - - for( int i = 0, n = components.size(); i < n; i++ ) - { - final String cmp = (String) components.get( i ); - this.componentCombo.add( cmp + " " ); - - if( this.component != null && this.component.equals( cmp ) ) - { - this.componentCombo.select( i ); - } - } - - setControl( composite ); - } - - public boolean finish() - { - return this.componentCombo.getSelectionIndex() != -1; - } - - private List components() - { - final List used = new ArrayList(); - - try - { - final IClasspathEntry[] cp = this.jproject.getRawClasspath(); - - for( int i = 0; i < cp.length; i++ ) - { - final IClasspathEntry cpe = cp[ i ]; - - if( WebAppContainer.check( cpe ) ) - { - used.add( WebAppContainer.convert( cpe ) ); - } - } - } - catch( JavaModelException e ) - { - // TODO: Handle this. - } - - final List res = new ArrayList(); - - final IFlexibleProject fp - = ComponentCore.createFlexibleProject( this.project ); - - final IVirtualComponent[] components = fp.getComponents(); - - for( int i = 0; i < components.length; i++ ) - { - final IVirtualComponent vc = components[ i ]; - final String cmp = vc.getName(); - - // TODO: Re-enable this check when getComponentTypeId() is implemented. - //if( vc.getComponentTypeId().equals( "jst.web" ) ) - if( ( this.component != null && this.component.equals( cmp ) ) || - ! used.contains( vc.getName() ) ) - { - res.add( vc.getName() ); - } - } - - return res; - } - - private static String resource( final String key ) - { - return WEBUIMessages.getResourceString( key ); - } - -} diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/plugin/ServletUIPlugin.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/plugin/ServletUIPlugin.java deleted file mode 100644 index 31148d897..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/plugin/ServletUIPlugin.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Created on Nov 15, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.servlet.ui.internal.plugin; - -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * @author jlanuti - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class ServletUIPlugin extends AbstractUIPlugin { - - public static final String PLUGIN_ID = "org.eclipse.jst.servlet.ui"; //$NON-NLS-1$ - // The shared instance. - private static ServletUIPlugin plugin; - - /** - * The constructor. - */ - public ServletUIPlugin() { - super(); - plugin = this; - } - - - /** - * Returns the shared instance. - */ - public static ServletUIPlugin getDefault() { - return plugin; - } - - /** - * Returns the workspace instance. - */ - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } -} diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/plugin/WEBUIMessages.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/plugin/WEBUIMessages.java deleted file mode 100644 index 8559fac34..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/plugin/WEBUIMessages.java +++ /dev/null @@ -1,65 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 IBM Corporation and others. All rights reserved. This program and the - * accompanying materials are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation - **************************************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.plugin; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.wst.common.frameworks.internal.Messages; - - -public class WEBUIMessages extends Messages { - - public static final String IMAGE_LOAD_ERROR = "0"; //$NON-NLS-1$ - public static final String WEB_MODULE_WIZ_TITLE = "1"; //$NON-NLS-1$ - public static final String WEB_VERSION_LBL = "2"; //$NON-NLS-1$ - public static final String WEB_PROJECT_MAIN_PG_TITLE = "3"; //$NON-NLS-1$ - public static final String WEB_PROJECT_MAIN_PG_DESC = "4"; //$NON-NLS-1$ - public static final String EJB_PROJECT_LBL = "5"; //$NON-NLS-1$ - public static final String WEB_FILE_LBL = "6"; //$NON-NLS-1$ - public static final String WEB_IMPORT_MAIN_PG_DESC = "7"; //$NON-NLS-1$ - public static final String WEB_IMPORT_MAIN_PG_TITLE = "8"; //$NON-NLS-1$ - public static final String WEB_EXPORT_MAIN_PG_TITLE = "9"; //$NON-NLS-1$ - public static final String WEB_EXPORT_MAIN_PG_DESC = "10"; //$NON-NLS-1$ - public static final String WEB_IMPORT_CONTEXT_ROOT = "11"; //$NON-NLS-1$ - public static final String WEB_CONVERT_MAIN_PG_DESC = "12"; //$NON-NLS-1$ - public static final String WEB_CONVERT_MAIN_PG_TITLE = "13"; //$NON-NLS-1$ - - private static final WEBUIMessages INSTANCE = new WEBUIMessages(); - - - private WEBUIMessages() { - super(); - } - - /** - * Returns the string from the resource bundle, or 'key' if not found. - */ - public static String getResourceString(String key) { - return INSTANCE.doGetResourceString(key); - } - - public static String getResourceString(String key, Object[] args) { - return INSTANCE.doGetResourceString(key, args); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.Messages#initializeBundle() - */ - protected void initializeBundle() { - try { - resourceBundle = ResourceBundle.getBundle("web_ui"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - // Do nothing - } - } - -}
\ No newline at end of file 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 3fc623cd4..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModel; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin; -import org.eclipse.jst.j2ee.internal.web.operations.AddServletOperation; -import org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModel; -import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassWizardPage; -import org.eclipse.jst.servlet.ui.IWebUIContextIds; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel; - -/** - * New servlet wizard - */ -public class AddServletWizard extends NewWebWizard { - private static final String PAGE_ONE = "pageOne"; //$NON-NLS-1$ - private static final String PAGE_TWO = "pageTwo"; //$NON-NLS-1$ - private static final String PAGE_THREE = "pageThree"; //$NON-NLS-1$ - /** - * @param model - */ - public AddServletWizard(NewServletClassDataModel model) { - super(model); - setWindowTitle(IWebWizardConstants.ADD_SERVLET_WIZARD_WINDOW_TITLE); - setDefaultPageImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor("newservlet_wiz")); //$NON-NLS-1$ - } - - public AddServletWizard() { - this(null); - } - - /* (non-Javadoc) - * @see org.eclipse.jem.util.ui.wizard.WTPWizard#createDefaultModel() - */ - protected WTPOperationDataModel createDefaultModel() { - if (model != null) - return model; - model = new NewServletClassDataModel(); - model.setProperty(NewJavaClassDataModel.SUPERCLASS, NewServletClassDataModel.SERVLET_SUPERCLASS); - model.setProperty(NewJavaClassDataModel.INTERFACES, ((NewServletClassDataModel)model).getServletInterfaces()); - - //IProject project = getDefaultWebProject(); - //if (project != null) - // model.setProperty(ArtifactEditOperationDataModel.PROJECT_NAME, project.getName()); - return model; - } - - /* (non-Javadoc) - * @see org.eclipse.jem.util.ui.wizard.WTPWizard#createOperation() - */ - protected WTPOperation createBaseOperation() { - return new AddServletOperation((NewServletClassDataModel)model) ; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.wizard.Wizard#addPages() - */ - public void doAddPages() { - - NewJavaClassWizardPage page1 = new NewJavaClassWizardPage( - (NewServletClassDataModel)model, - PAGE_ONE, - IWebWizardConstants.NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC, - IWebWizardConstants.ADD_SERVLET_WIZARD_PAGE_TITLE, IModuleConstants.JST_WEB_MODULE); - page1.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_2); - addPage(page1); - AddServletWizardPage page2 = new AddServletWizardPage((NewServletClassDataModel) model, PAGE_TWO); - page2.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_1); - addPage(page2); - NewServletClassOptionsWizardPage page3 = new NewServletClassOptionsWizardPage( - (NewServletClassDataModel)model, - PAGE_THREE, - IWebWizardConstants.NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC, - IWebWizardConstants.ADD_SERVLET_WIZARD_PAGE_TITLE); - page3.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_3); - addPage(page3); - } - - /* (non-Javadoc) - * @see org.eclipse.jem.util.ui.wizard.WTPWizard#runForked() - */ - protected boolean runForked() { - return false; - } - - public boolean canFinish() { - NewJavaClassWizardPage firstPage = (NewJavaClassWizardPage)getPage(PAGE_ONE); - AddServletWizardPage secondPage = (AddServletWizardPage)getPage(PAGE_TWO); - - if (firstPage != null && firstPage.isPageComplete() && secondPage.isPageComplete() ) { - return true; - } - return false;//super.canFinish(); - } -}
\ No newline at end of file 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 ddb4165cc..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModel; -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.componentcore.internal.operation.ArtifactEditOperationDataModel; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; -import org.eclipse.wst.common.frameworks.internal.ui.WTPWizardPage; - -/** - * Servlet Wizard Setting Page - */ -public class AddServletWizardPage extends WTPWizardPage { - final static String[] JSPEXTENSIONS = {"jsp"}; //$NON-NLS-1$ - - private Text displayNameText; - - private StringArrayTableWizardSection urlSection; - - public AddServletWizardPage(NewServletClassDataModel model, String pageName) { - super(model, pageName); - setDescription(IWebWizardConstants.ADD_SERVLET_WIZARD_PAGE_DESC); - this.setTitle(IWebWizardConstants.ADD_SERVLET_WIZARD_PAGE_TITLE); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jem.util.ui.wizard.WTPWizardPage#getValidationPropertyNames() - */ - protected String[] getValidationPropertyNames() { - return new String[]{NewServletClassDataModel.DISPLAY_NAME, NewServletClassDataModel.INIT_PARAM, NewServletClassDataModel.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); - new StringArrayTableWizardSection(composite, IWebWizardConstants.INIT_PARAM_LABEL, IWebWizardConstants.ADD_BUTTON_LABEL, - IWebWizardConstants.REMOVE_BUTTON_LABEL, new String[]{IWebWizardConstants.NAME_LABEL, IWebWizardConstants.VALUE_LABEL, IWebWizardConstants.DESCRIPTION_LABEL}, null,// WebPlugin.getDefault().getImage("initializ_parameter"), - model, NewServletClassDataModel.INIT_PARAM); - urlSection = new StringArrayTableWizardSection(composite, IWebWizardConstants.URL_MAPPINGS_LABEL, IWebWizardConstants.ADD_BUTTON_LABEL, IWebWizardConstants.REMOVE_BUTTON_LABEL, - new String[]{IWebWizardConstants.URL_PATTERN_LABEL}, null,// WebPlugin.getDefault().getImage("url_type"), - model, NewServletClassDataModel.URL_MAPPINGS); - displayNameText.setFocus(); - - IStatus projectStatus = validateProjectName(); - if (!projectStatus.isOK()) { - setErrorMessage(projectStatus.getMessage()); - composite.setEnabled(false); - } - return composite; - } - - protected IStatus validateProjectName() { - // check for empty - if (model.getStringProperty(ArtifactEditOperationDataModel.PROJECT_NAME) == null || model.getStringProperty(ArtifactEditOperationDataModel.PROJECT_NAME).trim().length() == 0) { - return WTPCommonPlugin.createErrorStatus(IWebWizardConstants.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(IWebWizardConstants.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$ - urlSection.setInput(input); - } - - }); - synchHelper.synchText(displayNameText, NewServletClassDataModel.DISPLAY_NAME, null); - - // description - Label descLabel = new Label(composite, SWT.LEFT); - descLabel.setText(IWebWizardConstants.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, NewServletClassDataModel.DESCRIPTION, null); - } - - public String getDisplayName() { - return displayNameText.getText(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebComponentTypeWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebComponentTypeWizard.java deleted file mode 100644 index 74d5dbf5f..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebComponentTypeWizard.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jst.j2ee.internal.web.operations.ConvertWebProjectDataModel; -import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages; -import org.eclipse.ui.IWorkbench; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel; - -/* - * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2000, 2002 - All - * Rights Reserved. US Government Users Restricted Rights - Use, duplication or - * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. - */ - -public class ConvertToWebComponentTypeWizard extends WebComponentCreationWizard { - private static final String ConvertToWebModuleTypeWizard = "org.eclipse.jst.servlet.ui.internal.wizard.convertWebProjectTypeWizard"; //$NON-NLS-1$ - - public ConvertToWebComponentTypeWizard(IDataModel dataModel) { - // TODO use flexible project - //super(dataModel); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jem.util.ui.wizard.WTPWizard#createDefaultModel() - */ - //private static final String PAGE_ONE = "page1"; //$NON-NLS-1$ - - protected WTPOperationDataModel createDefaultModel() { - // TODO Auto-generated method stub - return new ConvertWebProjectDataModel(); - } - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.wizard.Wizard#addPages() - */ - public void doAddPages() { - //TODO use flexible project - //addPage(new ConvertToWebModuleTypeWizardPage((WebModuleCreationDataModel) model, PAGE_ONE)); - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wtp.web.ui.wizard.WEBProjectWizard#init(org.eclipse.ui.IWorkbench, - * org.eclipse.jface.viewers.IStructuredSelection) - */ - public void doInit(IWorkbench workbench, IStructuredSelection selection) { - setWindowTitle(WEBUIMessages.getResourceString(WEBUIMessages.WEB_CONVERT_MAIN_PG_TITLE)); //$NON-NLS-1$ - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jem.util.ui.wizard.WTPWizard#prePerformFinish() - */ - protected boolean prePerformFinish() { -/* IProjectDescription desc; - try { - //desc = ((WebComponentCreationDataModel) model).getTargetProject().getDescription(); - //desc.setBuildSpec(new ICommand[0]); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return super.prePerformFinish();*/ - return true; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebComponentTypeWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebComponentTypeWizardPage.java deleted file mode 100644 index 5caf2f470..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/ConvertToWebComponentTypeWizardPage.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Created on Jun 29, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationDataModel; -import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages; -import org.eclipse.swt.widgets.Composite; - -/** - * @author fatty - * - * TODO To change the template for this generated type comment go to Window - - * Preferences - Java - Code Style - Code Templates - */ -public class ConvertToWebComponentTypeWizardPage extends WebComponentCreationWizardPage { - - /** - * @param model - * @param pageName - */ - protected ConvertToWebComponentTypeWizardPage(WebComponentCreationDataModel model, String pageName) { - // TODO use flexible project - //super(model, pageName); - super(null, pageName); - setDescription(WEBUIMessages.getResourceString(WEBUIMessages.WEB_CONVERT_MAIN_PG_DESC)); //$NON-NLS-1$ - setTitle(WEBUIMessages.getResourceString(WEBUIMessages.WEB_CONVERT_MAIN_PG_TITLE)); //$NON-NLS-1$ - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wtp.j2ee.ui.wizard.J2EEProjectCreationPage#createProjectNameGroup(org.eclipse.swt.widgets.Composite) - */ - protected void createProjectNameGroup(Composite parent) { - //super.createProjectNameGroup(parent); - // projectNameGroup.projectNameField.setEnabled(false); - } -}
\ No newline at end of file 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 9e445a6c2..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/IWebWizardConstants.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.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.getResourceString("ADD_SERVLET_WIZARD_WINDOW_TITLE"); //$NON-NLS-1$ - public final static String ADD_SERVLET_WIZARD_PAGE_TITLE = WEBUIMessages.getResourceString("ADD_SERVLET_WIZARD_PAGE_TITLE"); //$NON-NLS-1$ - public final static String ADD_SERVLET_WIZARD_PAGE_DESC = WEBUIMessages.getResourceString("ADD_SERVLET_WIZARD_PAGE_DESC"); //$NON-NLS-1$ - - public final static String DEFAULT_PACKAGE = WEBUIMessages.getResourceString("DEFAULT_PACKAGE"); //$NON-NLS-1$ - public final static String SELECT_CLASS_TITLE = WEBUIMessages.getResourceString("SELECT_CLASS_TITLE"); //$NON-NLS-1$ - public final static String MAP_CLASS_NAME_TO_CLASS_ERROR_MSG = WEBUIMessages.getResourceString("MAP_CLASS_NAME_TO_CLASS_ERROR_MSG"); //$NON-NLS-1$ - public final static String EMPTY_LIST_MSG = WEBUIMessages.getResourceString("EMPTY_LIST_MSG"); //$NON-NLS-1$ - public final static String ADD_LABEL = WEBUIMessages.getResourceString("ADD_LABEL"); //$NON-NLS-1$ - public final static String USE_EXISTING_SERVLET_CLASS = WEBUIMessages.getResourceString("USE_EXISTING_SERVLET_CLASS"); //$NON-NLS-1$ - public final static String INIT_PARAM_LABEL = WEBUIMessages.getResourceString("INIT_PARAM_LABEL"); //$NON-NLS-1$ - public final static String URL_MAPPINGS_LABEL = WEBUIMessages.getResourceString("URL_MAPPINGS_LABEL"); //$NON-NLS-1$ - public final static String CHOOSE_SERVLET_CLASS = WEBUIMessages.getResourceString("CHOOSE_SERVLET_CLASS"); //$NON-NLS-1$ - - // NewServletWizard - public final static String NEW_SERVLET_WIZARD_WINDOW_TITLE = WEBUIMessages.getResourceString("NEW_SERVLET_WIZARD_WINDOW_TITLE"); //$NON-NLS-1$ - public final static String NEW_SERVLET_WIZARD_PAGE_TITLE = WEBUIMessages.getResourceString("NEW_SERVLET_WIZARD_PAGE_TITLE"); //$NON-NLS-1$ - public final static String NEW_SERVLET_WIZARD_PAGE_DESC = WEBUIMessages.getResourceString("NEW_SERVLET_WIZARD_PAGE_DESC"); //$NON-NLS-1$ - public final static String SERVLET_PACKAGE_LABEL = WEBUIMessages.getResourceString("SERVLET_PACKAGE_LABEL"); //$NON-NLS-1$ - public final static String SERVLET_NAME_LABEL = WEBUIMessages.getResourceString("SERVLET_NAME_LABEL"); //$NON-NLS-1$ - - - // common - public final static String ADD_BUTTON_LABEL = WEBUIMessages.getResourceString("ADD_BUTTON_LABEL"); //$NON-NLS-1$ - public final static String REMOVE_BUTTON_LABEL = WEBUIMessages.getResourceString("REMOVE_BUTTON_LABEL"); //$NON-NLS-1$ - public final static String URL_PATTERN_TITLE = WEBUIMessages.getResourceString("URL_PATTERN_TITLE"); //$NON-NLS-1$ - public final static String URL_PATTERN_LABEL = WEBUIMessages.getResourceString("URL_PATTERN_LABEL"); //$NON-NLS-1$ - public final static String FOLDER_LABEL = WEBUIMessages.getResourceString("FOLDER_LABEL"); //$NON-NLS-1$ - public final static String JAVA_PACKAGE_LABEL = WEBUIMessages.getResourceString("JAVA_PACKAGE_LABEL"); //$NON-NLS-1$ - public final static String CLASS_NAME_LABEL = WEBUIMessages.getResourceString("CLASS_NAME_LABEL"); //$NON-NLS-1$ - public final static String SUPERCLASS_LABEL = WEBUIMessages.getResourceString("SUPERCLASS_LABEL"); //$NON-NLS-1$ - public final static String CONTAINER_SELECTION_DIALOG_TITLE = WEBUIMessages.getResourceString("CONTAINER_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$ - public final static String CONTAINER_SELECTION_DIALOG_DESC = WEBUIMessages.getResourceString("CONTAINER_SELECTION_DIALOG_DESC"); //$NON-NLS-1$ - public final static String CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG = WEBUIMessages.getResourceString("CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG"); //$NON-NLS-1$ - public final static String PACKAGE_SELECTION_DIALOG_TITLE = WEBUIMessages.getResourceString("PACKAGE_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$ - public final static String PACKAGE_SELECTION_DIALOG_DESC = WEBUIMessages.getResourceString("PACKAGE_SELECTION_DIALOG_DESC"); //$NON-NLS-1$ - public final static String PACKAGE_SELECTION_DIALOG_MSG_NONE = WEBUIMessages.getResourceString("PACKAGE_SELECTION_DIALOG_MSG_NONE"); //$NON-NLS-1$ - public final static String SUPERCLASS_SELECTION_DIALOG_TITLE = WEBUIMessages.getResourceString("SUPERCLASS_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$ - public final static String SUPERCLASS_SELECTION_DIALOG_DESC = WEBUIMessages.getResourceString("SUPERCLASS_SELECTION_DIALOG_DESC"); //$NON-NLS-1$ - public final static String INTERFACE_SELECTION_DIALOG_TITLE = WEBUIMessages.getResourceString("INTERFACE_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$ - public final static String INTERFACE_SELECTION_DIALOG_DESC = WEBUIMessages.getResourceString("INTERFACE_SELECTION_DIALOG_DESC"); //$NON-NLS-1$ - public final static String INTERFACE_SELECTION_DIALOG_MSG_NONE = WEBUIMessages.getResourceString("INTERFACE_SELECTION_DIALOG_MSG_NONE"); //$NON-NLS-1$ - public final static String JAVA_CLASS_MODIFIERS_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_MODIFIERS_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_INTERFACES_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_INTERFACES_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_METHOD_STUBS_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_METHOD_STUBS_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_PUBLIC_CHECKBOX_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_PUBLIC_CHECKBOX_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_ABSTRACT_CHECKBOX_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_ABSTRACT_CHECKBOX_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_FINAL_CHECKBOX_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_FINAL_CHECKBOX_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_MAIN_CHECKBOX_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_MAIN_CHECKBOX_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_INHERIT_CHECKBOX_LABEL = WEBUIMessages.getResourceString("JAVA_CLASS_INHERIT_CHECKBOX_LABEL"); //$NON-NLS-1$ - public final static String JAVA_CLASS_BROWER_DIALOG_TITLE = WEBUIMessages.getResourceString("JAVA_CLASS_BROWER_DIALOG_TITLE"); //$NON-NLS-1$ - public final static String JAVA_CLASS_BROWER_DIALOG_MESSAGE = WEBUIMessages.getResourceString("JAVA_CLASS_BROWER_DIALOG_MESSAGE"); //$NON-NLS-1$ - - public final static String NAME_LABEL = WEBUIMessages.getResourceString("NAME_LABEL"); //$NON-NLS-1$ - public final static String DESCRIPTION_LABEL = WEBUIMessages.getResourceString("DESCRIPTION_LABEL"); //$NON-NLS-1$ - public final static String VALUE_LABEL = WEBUIMessages.getResourceString("VALUE_LABEL"); //$NON-NLS-1$ - public final static String EMPTY_STRING = ""; //$NON-NLS-1$ - public final static String BROWSE_BUTTON_LABEL = WEBUIMessages.getResourceString("BROWSE_BUTTON_LABEL"); //$NON-NLS-1$ - public static final String REMOVE_BUTTON = WEBUIMessages.getResourceString("REMOVE_BUTTON"); //$NON-NLS-1$ - - public final static String NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC = WEBUIMessages.getResourceString("NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC"); //$NON-NLS-1$ - public final static String NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC = WEBUIMessages.getResourceString("NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC"); //$NON-NLS-1$ - - public final static String ImportWARAction_UI_ = WEBUIMessages.getResourceString("ImportWARAction_UI_"); //$NON-NLS-1$ - public final static String ExportWARAction_UI_ = WEBUIMessages.getResourceString("ExportWARAction_UI_"); //$NON-NLS-1$ - - public final static String NO_WEB_PROJECTS = WEBUIMessages.getResourceString("NO_WEB_PROJECTS"); //$NON-NLS-1$ - - public static final String SERVLETS = WEBUIMessages.getResourceString("SERVLETS"); //$NON-NLS-1$ -}
\ No newline at end of file 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 949ec1108..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/MultiSelectFilteredFileSelectionDialog.java +++ /dev/null @@ -1,663 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -/** - * - */ -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.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.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.util.StringMatcher; -import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; -import org.eclipse.jem.util.logger.proxy.Logger; -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.plugin.J2EEUIPlugin; -import org.eclipse.jst.j2ee.internal.web.providers.WebAppEditResourceHandler; -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.ISelectionStatusValidator; -import org.eclipse.ui.part.PageBook; - -/** - * Insert the type's description here. - * Creation date: (7/30/2001 11:16:36 AM) - * @author: Administrator - */ -public class MultiSelectFilteredFileSelectionDialog extends FilteredFileSelectionDialog implements SelectionListener { - - - private static class PackageRenderer extends LabelProvider { - private final Image PACKAGE_ICON = JavaPluginImages.get(JavaPluginImages.IMG_OBJS_PACKAGE); - - public String getText(Object element) { - IType type = (IType) element; - String p = type.getPackageFragment().getElementName(); - if ("".equals(p)) //$NON-NLS-1$ - p = IWebWizardConstants.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 = JavaPluginImages.get(JavaPluginImages.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 TypedElementSelectionValidator(new Class[] { IFile.class }, allowMultiple); - setValidator(fLocalValidator); - StatusInfo currStatus = new StatusInfo(); - currStatus.setOK(); - updateStatus(currStatus); - fElementRenderer = new TypeRenderer(); - fQualifierRenderer = new PackageRenderer(); - fRunnableContext = J2EEUIPlugin.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("javax.servlet.Servlet"); //$NON-NLS-1$ - // 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 exc) { - Logger.getLogger().logError(exc); - } - } - - /** - * @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()); - } - -}
\ No newline at end of file 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 fab7b6daa..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewServletClassOptionsWizardPage.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModel; -import org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModel; -import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassOptionsWizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -/** - * @author jialin - * - * To change the template for this generated type comment go to Window - - * Preferences - Java - Code Generation - Code and Comments - */ -public class NewServletClassOptionsWizardPage extends NewJavaClassOptionsWizardPage { - protected Button initButton; - protected Button toStringButton; - protected Button getInfoButton; - protected Button doPostButton; - protected Button doPutButton; - protected Button doDeleteButton; - protected Button destroyButton; - protected Button doGetButton; - - public NewServletClassOptionsWizardPage(NewServletClassDataModel model, String pageName, String pageDesc, String pageTitle) { - super(model, pageName, pageDesc, pageTitle); - } - /** - * Create the composite with all the stubs - */ - protected void createStubsComposite(Composite parent) { - Label stubLabel = new Label(parent, SWT.NONE); - stubLabel.setText(IWebWizardConstants.JAVA_CLASS_METHOD_STUBS_LABEL); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.horizontalSpan = 2; - stubLabel.setLayoutData(data); - - Composite buttonCompo = new Composite(parent, SWT.NULL); - buttonCompo.setLayout(new GridLayout()); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - data.horizontalIndent = 15; - buttonCompo.setLayoutData(data); - - constructorButton = new Button(buttonCompo, SWT.CHECK); - constructorButton.setText(IWebWizardConstants.JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL); - synchHelper.synchCheckbox(constructorButton, NewJavaClassDataModel.CONSTRUCTOR, null); - - inheritButton = new Button(buttonCompo, SWT.CHECK); - inheritButton.setText(IWebWizardConstants.JAVA_CLASS_INHERIT_CHECKBOX_LABEL); - synchHelper.synchCheckbox(inheritButton, NewJavaClassDataModel.ABSTRACT_METHODS, null); - inheritButton.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - boolean enable = inheritButton.getSelection(); - initButton.setEnabled(enable); - toStringButton.setEnabled(enable); - getInfoButton.setEnabled(enable); - doPostButton.setEnabled(enable); - doPutButton.setEnabled(enable); - doDeleteButton.setEnabled(enable); - destroyButton.setEnabled(enable); - doGetButton.setEnabled(enable); - } - public void widgetDefaultSelected(SelectionEvent e) { - //Do nothing - } - }); - - Composite comp = new Composite(buttonCompo, SWT.NULL); - GridLayout layout = new GridLayout(3, false); - layout.marginWidth = 0; - layout.makeColumnsEqualWidth = true; - comp.setLayout(layout); - data = new GridData(GridData.FILL_BOTH); - comp.setLayoutData(data); - - initButton = new Button(comp, SWT.CHECK); - initButton.setText("Init"); //$NON-NLS-1$ - synchHelper.synchCheckbox(initButton, NewServletClassDataModel.INIT, null); - - toStringButton = new Button(comp, SWT.CHECK); - toStringButton.setText("toString"); //$NON-NLS-1$ - synchHelper.synchCheckbox(toStringButton, NewServletClassDataModel.TO_STRING, null); - - getInfoButton = new Button(comp, SWT.CHECK); - getInfoButton.setText("getServletInfo"); //$NON-NLS-1$ - synchHelper.synchCheckbox(getInfoButton, NewServletClassDataModel.GET_SERVLET_INFO, null); - - doPostButton = new Button(comp, SWT.CHECK); - doPostButton.setText("doPost"); //$NON-NLS-1$ - synchHelper.synchCheckbox(doPostButton, NewServletClassDataModel.DO_POST, null); - - doPutButton = new Button(comp, SWT.CHECK); - doPutButton.setText("doPut"); //$NON-NLS-1$ - synchHelper.synchCheckbox(doPutButton, NewServletClassDataModel.DO_PUT, null); - - doDeleteButton = new Button(comp, SWT.CHECK); - doDeleteButton.setText("doDelete"); //$NON-NLS-1$ - synchHelper.synchCheckbox(doDeleteButton, NewServletClassDataModel.DO_DELETE, null); - - destroyButton = new Button(comp, SWT.CHECK); - destroyButton.setText("destroy"); //$NON-NLS-1$ - synchHelper.synchCheckbox(destroyButton, NewServletClassDataModel.DESTROY, null); - - doGetButton = new Button(comp, SWT.CHECK); - doGetButton.setText("doGet"); //$NON-NLS-1$ - synchHelper.synchCheckbox(doGetButton, NewServletClassDataModel.DO_GET, null); - } -}
\ No newline at end of file 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 3c4a92c49..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/NewWebWizard.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel; -import org.eclipse.wst.common.frameworks.internal.ui.WTPWizard; - -/** - * @author jlanuti - */ -public abstract class NewWebWizard extends WTPWizard implements INewWizard { - - /** - * @param model - */ - public NewWebWizard(WTPOperationDataModel model) { - super(model); - } - - /** - * Default constructor - */ - public NewWebWizard() { - super(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, - * org.eclipse.jface.viewers.IStructuredSelection) - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - createDefaultModel(); - } - - protected IStructuredSelection getCurrentSelection() { - IWorkbenchWindow window = J2EEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); - if (window != null) { - ISelection selection = window.getSelectionService().getSelection(); - if (selection instanceof IStructuredSelection) { - return (IStructuredSelection) selection; - } - } - return null; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WARExportPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WARExportPage.java deleted file mode 100644 index a4ea97290..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WARExportPage.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * 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.jface.viewers.IStructuredSelection; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEModuleExportDataModel; -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.internal.plugin.WEBUIMessages; - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public class WARExportPage extends J2EEModuleExportPage { - /** - * @param model - * @param pageName - */ - public WARExportPage(J2EEModuleExportDataModel model, String pageName, IStructuredSelection selection) { - super(model, pageName, selection); - setTitle(WEBUIMessages.getResourceString(WEBUIMessages.WEB_EXPORT_MAIN_PG_TITLE)); - setDescription(WEBUIMessages.getResourceString(WEBUIMessages.WEB_EXPORT_MAIN_PG_DESC)); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_EXPORT_WIZARD_BANNER)); - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.ui.wizard.J2EEImportPage#getProjectImportLabel() - */ - protected String getProjectLabel() { - 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; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WARImportPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WARImportPage.java deleted file mode 100644 index b11665f72..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WARImportPage.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * 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.application.internal.operations.J2EEComponentCreationDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEModuleImportDataModel; -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.WebModuleImportDataModel; -import org.eclipse.jst.j2ee.internal.wizard.J2EEModuleImportPage; -import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages; -import org.eclipse.swt.widgets.Composite; - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -public class WARImportPage extends J2EEModuleImportPage { - /** - * @param model - * @param pageName - */ - public WARImportPage(J2EEModuleImportDataModel model, String pageName) { - super(model, pageName); - setTitle(WEBUIMessages.getResourceString(WEBUIMessages.WEB_IMPORT_MAIN_PG_TITLE)); - setDescription(WEBUIMessages.getResourceString(WEBUIMessages.WEB_IMPORT_MAIN_PG_DESC)); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_IMPORT_WIZARD_BANNER)); - - } - - protected String getFileImportLabel() { - return WEBUIMessages.getResourceString(WEBUIMessages.WEB_FILE_LBL); - } - - protected String[] getFilterExpression() { - return new String[]{"*.war"}; //$NON-NLS-1$ - } - - protected J2EEComponentCreationDataModel getNewProjectCreationDataModel() { - return getWebDataModel().getJ2eeArtifactCreationDataModel(); - } - - private WebModuleImportDataModel getWebDataModel() { - return (WebModuleImportDataModel) model; - } - - protected String getProjectImportLabel() { - return WEBUIMessages.getResourceString(WEBUIMessages.EJB_PROJECT_LBL); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.ui.wizard.J2EEModuleImportPage#createAnnotationsStandaloneGroup(org.eclipse.swt.widgets.Composite) - */ - protected void createAnnotationsStandaloneGroup(Composite composite) { - //TODO: implement with new import wizards - //new AnnotationsStandaloneGroup(composite, getWebDataModel(), false); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentCreationWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentCreationWizard.java deleted file mode 100644 index c89359010..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentCreationWizard.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.core.runtime.IExecutableExtension; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModel; -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.WebComponentCreationDataModel; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationDataModelProvider; -import org.eclipse.jst.j2ee.internal.wizard.J2EEComponentCreationWizard; -import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages; -import org.eclipse.ui.INewWizard; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel; - -/** - * <p> - * Wizard used to create J2EE Web module structures in Eclipse Projects. - * </p> - * <p> - * This wizard is not exposed as API to be extended. - * </p> - */ -public class WebComponentCreationWizard extends J2EEComponentCreationWizard implements IExecutableExtension, INewWizard { - - /** - * <p> - * The Wizard ID of the ConnectorModuleCreationWizard. Used for internal purposes and activities management. - * </p> - */ - public static final String WIZARD_ID = WebComponentCreationWizard.class.getName(); - - - /** - * <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 WebComponentCreationWizard() { - 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 WebComponentCreationWizard(IDataModel model) { - super(model); - } - - /** - * {@inheritDoc} - * - * <p> - * Overridden to return a {@link WebProjectCreationDataModel} and defaults - * the value of {@link J2EEModuleCreationDataModelOld#ADD_TO_EAR} to <b>true</b> - * </p> - * - * @return Returns the specific operation data model for the creation of J2EE Web modules - */ - protected WTPOperationDataModel createDefaultModel() { - WebComponentCreationDataModel aModel = new WebComponentCreationDataModel(); - aModel.setBooleanProperty(J2EEComponentCreationDataModel.ADD_TO_EAR, false); - return aModel; - } - /** - * {@inheritDoc} - * - * <p> - * Sets up the dialog window title and default page image. - * </p> - * - */ - protected void doInit() { - setWindowTitle(WEBUIMessages.getResourceString(WEBUIMessages.WEB_MODULE_WIZ_TITLE)); - setDefaultPageImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_PROJECT_WIZARD_BANNER)); - } - - /** - * {@inheritDoc} - * - * <p> - * Adds a {@link JCAProjectCreationPage} as the {@link J2EEComponentCreationWizard#MAIN_PG}. - * </p> - */ - protected void doAddPages() { - WebComponentCreationWizardPage page = new WebComponentCreationWizardPage(getDataModel(), MAIN_PG); - page.setInfopopID("org.eclipse.jst.j2ee.ui.webw1000"); //$NON-NLS-1$ - addPage(page); - super.doAddPages(); - } - - protected IDataModelProvider getDefaultProvider() { - return new WebComponentCreationDataModelProvider(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentCreationWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentCreationWizardPage.java deleted file mode 100644 index e692d957d..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebComponentCreationWizardPage.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.jst.j2ee.application.internal.operations.IAnnotationsDataModel; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPluginIcons; -import org.eclipse.jst.j2ee.internal.wizard.DataModelAnnotationsStandaloneGroup; -import org.eclipse.jst.j2ee.internal.wizard.J2EEComponentCreationWizardPage; -import org.eclipse.jst.j2ee.web.datamodel.properties.IWebComponentCreationDataModelProperties; -import org.eclipse.jst.servlet.ui.internal.plugin.WEBUIMessages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -/** - * - */ -public class WebComponentCreationWizardPage extends J2EEComponentCreationWizardPage implements IWebComponentCreationDataModelProperties{ - - public Text contextRootNameField = null; - public Label contextRootLabel = null; - - private static final int SIZING_TEXT_FIELD_WIDTH = 250; - private DataModelAnnotationsStandaloneGroup annotationsGroup; - - /** - * @param model - * @param pageName - */ - public WebComponentCreationWizardPage(IDataModel model, String pageName) { - super(model, pageName); - setTitle(WEBUIMessages.getResourceString(WEBUIMessages.WEB_PROJECT_MAIN_PG_TITLE)); - setDescription(WEBUIMessages.getResourceString(WEBUIMessages.WEB_PROJECT_MAIN_PG_DESC)); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_PROJECT_WIZARD_BANNER)); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.ui.wizard.J2EEModuleCreationPage#createTopLevelComposite(org.eclipse.swt.widgets.Composite) - */ - protected void addToAdvancedComposite(Composite advanced) { - super.addToAdvancedComposite(advanced); - contextRootLabel = new Label(advanced, SWT.NULL); - contextRootLabel.setText(WEBUIMessages.getResourceString(WEBUIMessages.WEB_IMPORT_CONTEXT_ROOT)); - GridData data = new GridData(); - contextRootLabel.setLayoutData(data); - // set up context root entry field - - contextRootNameField = new Text(advanced, SWT.BORDER); - data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = SIZING_TEXT_FIELD_WIDTH; - contextRootNameField.setLayoutData(data); - synchHelper.synchText(contextRootNameField, CONTEXT_ROOT, new Control[]{contextRootLabel}); - - createAnnotationsGroup(advanced); - } - - private void createAnnotationsGroup(Composite parent) { - annotationsGroup = new DataModelAnnotationsStandaloneGroup(parent, getDataModel(), false, synchHelper); - } - protected String[] getValidationPropertyNames() { - String[] names = super.getValidationPropertyNames(); - String[] allNames = new String[names.length + 2]; - System.arraycopy(names, 0, allNames, 0, names.length); - allNames[names.length] = CONTEXT_ROOT; - allNames[names.length + 1] = IAnnotationsDataModel.USE_ANNOTATIONS; - return allNames; - } - - public void dispose() { - super.dispose(); - if (annotationsGroup != null) - annotationsGroup.dispose(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebModuleExportWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebModuleExportWizard.java deleted file mode 100644 index d47cdc3c5..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebModuleExportWizard.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.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.WebModuleExportDataModel; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebModuleExportOperation; -import org.eclipse.jst.j2ee.internal.wizard.J2EEArtifactExportWizard; -import org.eclipse.ui.IExportWizard; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel; - -/** - * <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 WebModuleExportWizard 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 WebModuleExportWizard() { - 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 WebModuleExportWizard(WebModuleExportDataModel model) { - super(model); - } - - /** - * {@inheritDoc} - * - * <p> - * Overridden to return an {@link EnterpriseApplicationImportDataModel}. - * </p> - * - * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#createDefaultModel() - */ - protected WTPOperationDataModel createDefaultModel() { - return new WebModuleExportDataModel(); - } - - /** - * {@inheritDoc} - * - * <p> - * Returns an {@link WebModuleExportOperation} using the model either - * supplied in the constructor or created from {@link #createDefaultModel()}. - * </p> - * @return Returns the operation to be executed when the Wizard completes. - */ - protected WTPOperation createBaseOperation() { - return new WebModuleExportOperation(getSpecificModel()); - } - - /** - * <p> - * Adds the following pages: - * <ul> - * <li> {@link WARExportPage} as the main wizard page ({@link #MAIN_PG}) - * </ul> - * </p> - */ - public void doAddPages() { - addPage(new WARExportPage(getSpecificModel(), 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)); - } - - private WebModuleExportDataModel getSpecificModel() { - return (WebModuleExportDataModel) getModel(); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebModuleImportWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebModuleImportWizard.java deleted file mode 100644 index e24307ae6..000000000 --- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/WebModuleImportWizard.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.servlet.ui.internal.wizard; - -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEModuleImportDataModel; -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.WebModuleImportDataModel; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebModuleImportOperation; -import org.eclipse.jst.j2ee.internal.wizard.J2EEModuleImportWizard; -import org.eclipse.wst.common.componentcore.internal.operation.ComponentCreationDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel; - -/** - * <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 WebModuleImportWizard extends J2EEModuleImportWizard { - - /** - * <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 WebModuleImportWizard() { - 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 WebModuleImportWizard(WebModuleImportDataModel model) { - super(model); - } - - /** - * <p> - * Overridden to return an {@link WARImportDataModel} and defaults - * the value of {@link J2EEModuleImportDataModel#ADD_TO_EAR} to <b>true</b> - * </p> - * - * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#createDefaultModel() - */ - protected WTPOperationDataModel createDefaultModel() { - WebModuleImportDataModel aModel = new WebModuleImportDataModel(); - aModel.setBooleanProperty(J2EEModuleImportDataModel.ADD_TO_EAR, true); - return aModel; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#createOperation() - */ - protected WTPOperation getImportOperation() { - return new WebModuleImportOperation(getSpecificDataModel()); - } - - /** - * <p> - * Adds an {@link WARImportPage} as the main wizard page ({@link #MAIN_PG}). - * </p> - */ - public void doAddPages() { - addPage(new WARImportPage(getSpecificDataModel(), MAIN_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()); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.ui.wizard.J2EEModuleImportWizard#getModuleValidatorStrings() - */ - protected String[] getModuleValidatorStrings() { - return new String[]{"org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator"}; //$NON-NLS-1$ - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.wizard.J2EEModuleImportWizard#getFinalPerspectiveID() - */ - protected String getFinalPerspectiveID() { - J2EEComponentCreationDataModel projCreationModel = getSpecificDataModel().getJ2EEModuleCreationDataModel(); - return projCreationModel.getStringProperty(ComponentCreationDataModel.FINAL_PERSPECTIVE); - } - - private WebModuleImportDataModel getSpecificDataModel() { - return (WebModuleImportDataModel) getModel(); - } - -}
\ No newline at end of file |