diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project')
14 files changed, 0 insertions, 1256 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.java deleted file mode 100644 index 2fb001f63..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.java +++ /dev/null @@ -1,420 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005, 2009 BEA Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms 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 - * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences - * Milen Manov, milen.manov@sap.com - bugs 248623 - ******************************************************************************/ - -package org.eclipse.jst.j2ee.ui.project.facet; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.layout.GridDataFactory; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ILabelDecorator; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.LabelProviderChangedEvent; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.jst.j2ee.earcreation.IEarFacetInstallDataModelProperties; -import org.eclipse.jst.j2ee.internal.AvailableJ2EEComponentsForEARContentProvider; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.earcreation.DefaultJ2EEComponentCreationDataModelProvider; -import org.eclipse.jst.j2ee.internal.earcreation.IDefaultJ2EEComponentCreationDataModelProperties; -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.DefaultJ2EEComponentCreationWizard; -import org.eclipse.jst.j2ee.internal.wizard.J2EEComponentLabelProvider; -import org.eclipse.jst.j2ee.internal.wizard.J2EEModuleFacetInstallPage; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public class EarFacetInstallPage extends J2EEModuleFacetInstallPage implements IEarFacetInstallDataModelProperties { - - private Button selectAllButton; - private Button deselectAllButton; - private Button newModuleButton; - - private Label moduleProjectsLabel; - private CheckboxTableViewer moduleProjectsViewer; - - private boolean ignoreCheckedState = false; - - private Label contentDirLabel; - private Text contentDir; - - public EarFacetInstallPage() { - super("ear.facet.install.page"); //$NON-NLS-1$ - setTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.EAR_COMPONENT_SECOND_PG_TITLE)); - setDescription(J2EEUIMessages.getResourceString(J2EEUIMessages.EAR_COMPONENT_SECOND_PG_DESC)); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.EAR_WIZ_BANNER)); - } - - @Override - protected String[] getValidationPropertyNames() { - return new String[]{CONTENT_DIR, J2EE_PROJECTS_LIST}; - } - - @Override - protected Composite createTopLevelComposite(Composite parent) { - setInfopopID(IJ2EEUIContextIds.NEW_EAR_ADD_MODULES_PAGE); - - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new GridLayout()); - composite.setLayoutData(gdhfill()); - - createModuleProjectOptions(composite); - createContentDirGroup(composite); - - createGenerateDescriptorControl(composite, J2EEConstants.APPLICATION_DD_SHORT_NAME); - registerFacetVersionChangeListener(); - - Dialog.applyDialogFont(parent); - return composite; - } - - protected int getJ2EEVersion() { - IProjectFacetVersion version = (IProjectFacetVersion)getDataModel().getProperty(FACET_VERSION); - return J2EEVersionUtil.convertVersionStringToInt(version.getVersionString()); - } - - /** - * @param parent - */ - private void createModuleProjectOptions(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new GridLayout(2, false)); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - moduleProjectsLabel = new Label(composite, SWT.NONE); - moduleProjectsLabel.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.J2EE_MODULE_DEPENDENCIES_LABEL)); - GridData gd = gdhfill(); - gd.horizontalSpan = 2; - moduleProjectsLabel.setLayoutData(gd); - - moduleProjectsViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - GridData gData = new GridData(GridData.FILL_BOTH); - gData.widthHint = 200; - gData.heightHint = 80; - moduleProjectsViewer.getControl().setLayoutData(gData); - int j2eeVersion = getJ2EEVersion(); - ILabelDecorator decorator = PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(); - AvailableJ2EEComponentsForEARContentProvider provider = new AvailableJ2EEComponentsForEARContentProvider(null, j2eeVersion, decorator); - moduleProjectsViewer.setContentProvider(provider); - final J2EEComponentLabelProvider labelProvider = new J2EEComponentLabelProvider(provider); - decorator.addListener(new ILabelProviderListener(){ - - public void labelProviderChanged(LabelProviderChangedEvent event) { - if(!moduleProjectsViewer.getTable().isDisposed()){ - moduleProjectsViewer.refresh(true); - } - } - }); - moduleProjectsViewer.setLabelProvider(labelProvider); - setCheckedItemsFromModel(); - - moduleProjectsViewer.addCheckStateListener(new ICheckStateListener() { - public void checkStateChanged(CheckStateChangedEvent event) { - if (!ignoreCheckedState) { - getDataModel().setProperty(J2EE_PROJECTS_LIST, getCheckedJ2EEElementsAsList()); - getDataModel().setProperty(JAVA_PROJECT_LIST, getCheckedJavaProjectsAsList()); - } - } - }); - TableLayout tableLayout = new TableLayout(); - moduleProjectsViewer.getTable().setLayout(tableLayout); - moduleProjectsViewer.getTable().setHeaderVisible(false); - moduleProjectsViewer.getTable().setLinesVisible(false); - moduleProjectsViewer.setSorter(null); - - createButtonsGroup(composite); - } - - /** - * - */ - private void setCheckedItemsFromModel() { - List components = (List) getDataModel().getProperty(J2EE_PROJECTS_LIST); - - TableItem [] items = moduleProjectsViewer.getTable().getItems(); - - List list = new ArrayList(); - - for( int i=0; i< items.length; i++ ){ - Object element = items[i].getData(); - if( element instanceof IVirtualComponent){ - IVirtualComponent comp = (IVirtualComponent)element; - Iterator it = components.iterator(); - while( it.hasNext() ){ - IProject project = (IProject)it.next(); - if( comp.getProject().getName().equals(project.getName()) ){ - list.add(comp); - } - } - } - } - moduleProjectsViewer.setCheckedElements(list.toArray()); - } - - private void refreshModules() { - moduleProjectsViewer.refresh(); - setCheckedItemsFromModel(); - } - - protected List getCheckedJ2EEElementsAsList() { - Object[] elements = moduleProjectsViewer.getCheckedElements(); - List list; - if (elements == null || elements.length == 0) - list = Collections.EMPTY_LIST; - else{ - list = new ArrayList(); - for( int i=0; i< elements.length; i++){ - if( elements[i] instanceof IVirtualComponent ) { - list.add(((IVirtualComponent)elements[i]).getProject()); - } - } - } - return list; - } - - protected List getCheckedJavaProjectsAsList() { - Object[] elements = moduleProjectsViewer.getCheckedElements(); - List list; - if (elements == null || elements.length == 0) - list = Collections.EMPTY_LIST; - else{ - list = new ArrayList(); - for( int i=0; i< elements.length; i++){ - if( elements[i] instanceof IProject ) { - list.add(elements[i]); - } - } - } - return list; - } - - - protected void createButtonsGroup(Composite parent) { - Composite buttonGroup = new Composite(parent, SWT.NONE); - buttonGroup.setLayout(new GridLayout()); - buttonGroup.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); - - selectAllButton = new Button(buttonGroup, SWT.PUSH); - selectAllButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_SELECT)); - selectAllButton.addListener(SWT.Selection, this); - GridDataFactory.defaultsFor( selectAllButton ).applyTo( selectAllButton ); - - deselectAllButton = new Button(buttonGroup, SWT.PUSH); - deselectAllButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_DESELECT)); - deselectAllButton.addListener(SWT.Selection, this); - GridDataFactory.defaultsFor( deselectAllButton ).applyTo( deselectAllButton ); - - new Label(buttonGroup, SWT.NONE); // pad - - newModuleButton = new Button(buttonGroup, SWT.PUSH); - newModuleButton.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_PROJECT_MODULES_PG_NEW)); - newModuleButton.addListener(SWT.Selection, this); - GridDataFactory.defaultsFor( newModuleButton ).applyTo( newModuleButton ); - } - - private void createContentDirGroup(Composite modulesGroup) { - final Composite composite = new Composite(modulesGroup, SWT.NONE); - composite.setLayout(new GridLayout(2, false)); - composite.setLayoutData(gdhfill()); - - this.contentDirLabel = new Label(composite, SWT.NONE); - this.contentDirLabel.setText(Resources.contentDirLabel); - this.contentDirLabel.setLayoutData(new GridData()); - - this.contentDir = new Text(composite, SWT.BORDER); - this.contentDir.setLayoutData(gdhfill()); - - synchHelper.synchText(contentDir, CONTENT_DIR, null); - } - - /** - * @see org.eclipse.swt.widgets.Listener#handleEvent(Event) - */ - @Override - public void handleEvent(Event evt) { - if (evt.widget == selectAllButton) - handleSelectAllButtonPressed(); - else if (evt.widget == deselectAllButton) - handleDeselectAllButtonPressed(); - else if (evt.widget == newModuleButton) - handleNewModuleButtonPressed(); - else - super.handleEvent(evt); - } - - @Override - protected void handleFacetVersionChangedEvent() - { - String fv = model.getStringProperty(FACET_VERSION_STR); - boolean isEAR50OrGreater = J2EEVersionUtil.convertVersionStringToInt(fv) >= J2EEVersionConstants.VERSION_5_0; - this.addDD.setVisible(isEAR50OrGreater); - } - - /** - * - */ - private void handleNewModuleButtonPressed() { - IDataModel aModel = createNewModuleModel(); - DefaultJ2EEComponentCreationWizard wizard = new DefaultJ2EEComponentCreationWizard(aModel); - WizardDialog dialog = new WizardDialog(getShell(), wizard); - dialog.create(); - if (dialog.open() != IDialogConstants.CANCEL_ID) { - IWorkspaceRoot input = ResourcesPlugin.getWorkspace().getRoot(); - moduleProjectsViewer.setInput(input); - setNewModules(aModel); - refreshModules(); - } - } - /** - * @param model - */ - private void setNewModules(IDataModel defaultModel) { - List newComponents = new ArrayList(); - collectNewComponents(defaultModel, newComponents); - List oldComponents = (List) getDataModel().getProperty(J2EE_PROJECTS_LIST); - newComponents.addAll(oldComponents); - getDataModel().setProperty(J2EE_PROJECTS_LIST, newComponents); - } - - private void collectNewComponents(IDataModel defaultModel, List newProjects) { - collectComponents(defaultModel.getNestedModel(IDefaultJ2EEComponentCreationDataModelProperties.NESTED_MODEL_EJB), newProjects); - collectComponents(defaultModel.getNestedModel(IDefaultJ2EEComponentCreationDataModelProperties.NESTED_MODEL_WEB), newProjects); - collectComponents(defaultModel.getNestedModel(IDefaultJ2EEComponentCreationDataModelProperties.NESTED_MODEL_CLIENT), newProjects); - collectComponents(defaultModel.getNestedModel(IDefaultJ2EEComponentCreationDataModelProperties.NESTED_MODEL_JCA), newProjects); - } - private void collectComponents(IDataModel compDM, List newProjects) { - if (compDM != null) { - String projectName = compDM.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME); - if(projectName == null) return; - IProject project = ProjectUtilities.getProject(projectName); - if (project != null && project.exists()) - newProjects.add(project); - } - } - - private IDataModel createNewModuleModel() { - IDataModel defaultModel = DataModelFactory.createDataModel(new DefaultJ2EEComponentCreationDataModelProvider()); - // transfer properties, project name - String projectName = model.getStringProperty(FACET_PROJECT_NAME); - defaultModel.setProperty(IDefaultJ2EEComponentCreationDataModelProperties.PROJECT_NAME, projectName); - // ear component name - String earName = model.getStringProperty(FACET_PROJECT_NAME); - defaultModel.setProperty(IDefaultJ2EEComponentCreationDataModelProperties.EAR_COMPONENT_NAME, earName); - // ear j2ee version - int j2eeVersion = getJ2EEVersion(); - defaultModel.setProperty(IDefaultJ2EEComponentCreationDataModelProperties.J2EE_VERSION, new Integer(j2eeVersion)); - - FacetedProjectWorkingCopy fpwc = (FacetedProjectWorkingCopy)model.getProperty(FACETED_PROJECT_WORKING_COPY); - IRuntime rt = fpwc.getPrimaryRuntime(); - defaultModel.setProperty(IDefaultJ2EEComponentCreationDataModelProperties.FACET_RUNTIME, rt); - - return defaultModel; - } - - /** - * - */ - private void handleDeselectAllButtonPressed() { - ignoreCheckedState = true; - try { - moduleProjectsViewer.setAllChecked(false); - //getDataModel().setProperty(J2EE_COMPONENT_LIST, null); - //IDataModel nestedModel = (IDataModel)getDataModel().getProperty(NESTED_ADD_COMPONENT_TO_EAR_DM); - //(nestedModel).setProperty(AddComponentToEnterpriseApplicationDataModelProvider., getCheckedJ2EEElementsAsList()); - getDataModel().setProperty(J2EE_PROJECTS_LIST, null); - getDataModel().setProperty(JAVA_PROJECT_LIST, null); - } finally { - ignoreCheckedState = false; - } - } - - /** - * - */ - private void handleSelectAllButtonPressed() { - ignoreCheckedState = true; - try { - moduleProjectsViewer.setAllChecked(true); - //getDataModel().setProperty(J2EE_COMPONENT_LIST, getCheckedElementsAsList()); - //IDataModel nestedModel = (IDataModel)getDataModel().getProperty(NESTED_ADD_COMPONENT_TO_EAR_DM); - //(nestedModel).setProperty(AddComponentToEnterpriseApplicationDataModelProvider., getCheckedJ2EEElementsAsList()); - - getDataModel().setProperty(J2EE_PROJECTS_LIST, getCheckedJ2EEElementsAsList()); - getDataModel().setProperty(JAVA_PROJECT_LIST, getCheckedJavaProjectsAsList()); - - } finally { - ignoreCheckedState = false; - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.J2EEWizardPage#enter() - */ - @Override - protected void enter() { - IWorkspaceRoot input = ResourcesPlugin.getWorkspace().getRoot(); - moduleProjectsViewer.setInput(input); - super.enter(); - } - - - private static final class Resources - - extends NLS - { - public static String contentDirLabel; - - static { - initializeMessages(EarFacetInstallPage.class.getName(), Resources.class); - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.properties b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.properties deleted file mode 100644 index 2b4b77c06..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2005 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -contentDirLabel = &Content directory: diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectFirstPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectFirstPage.java deleted file mode 100644 index 1c8ba60d3..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectFirstPage.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.ui.project.facet; - -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds; -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.swt.widgets.Composite; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage; - -public class EarProjectFirstPage extends DataModelFacetCreationWizardPage { - - public EarProjectFirstPage(IDataModel dataModel, String pageName) { - super(dataModel, pageName); - setTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.EAR_COMPONENT_MAIN_PG_TITLE)); - setDescription(J2EEUIMessages.getResourceString(J2EEUIMessages.EAR_COMPONENT_MAIN_PG_DESC)); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.EAR_WIZ_BANNER)); - setInfopopID(IJ2EEUIContextIds.NEW_EAR_WIZARD_P1); - } - - @Override - protected IDialogSettings getDialogSettings() { - return J2EEUIPlugin.getDefault().getDialogSettings(); - } - - @Override - protected String getModuleTypeID() { - return IModuleConstants.JST_EAR_MODULE; - } - - @Override - protected Composite createTopLevelComposite(Composite parent) { - final Composite top = super.createTopLevelComposite(parent); - createWorkingSetGroupPanel(top, new String[] { RESOURCE_WORKING_SET }); - return top; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectWizard.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectWizard.java deleted file mode 100644 index ae391d161..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectWizard.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.ui.project.facet; - -import java.net.URL; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages; -import org.eclipse.jst.j2ee.project.facet.EARFacetProjectCreationDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; -import org.eclipse.wst.project.facet.IProductConstants; -import org.eclipse.wst.project.facet.ProductManager; -import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard; -import org.osgi.framework.Bundle; - -public class EarProjectWizard extends NewProjectDataModelFacetWizard { - - public EarProjectWizard(IDataModel model){ - super(model); - setWindowTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.EAR_COMPONENT_WIZ_TITLE)); - } - - public EarProjectWizard(){ - super(); - setWindowTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.EAR_COMPONENT_WIZ_TITLE)); - } - - @Override - protected IDataModel createDataModel() { - return DataModelFactory.createDataModel(new EARFacetProjectCreationDataModelProvider()); - } - - public void setRuntimeInDataModel(IRuntime runtime){ - model.setProperty(FACET_RUNTIME, runtime); - } - - @Override - protected ImageDescriptor getDefaultPageImageDescriptor() { - final Bundle bundle = Platform.getBundle("org.eclipse.jst.j2ee.ui"); //$NON-NLS-1$ - final URL url = bundle.getEntry("icons/ear-wiz-banner.gif"); //$NON-NLS-1$ - - return ImageDescriptor.createFromURL(url); - } - - @Override - protected IFacetedProjectTemplate getTemplate() { - return ProjectFacetsManager.getTemplate("template.jst.ear"); //$NON-NLS-1$ - } - - @Override - protected IWizardPage createFirstPage() { - return new EarProjectFirstPage(model, "first.page"); //$NON-NLS-1$ - } - - @Override - protected String getFinalPerspectiveID() { - return ProductManager.getProperty(IProductConstants.FINAL_PERSPECTIVE_EAR); - } - - public void setEARName( String earName ){ - model.setProperty(FACET_PROJECT_NAME, earName); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.java deleted file mode 100644 index 1ece7b35d..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.java +++ /dev/null @@ -1,145 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005, 2009 BEA Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms 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 - * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences - ******************************************************************************/ - -package org.eclipse.jst.j2ee.ui.project.facet; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.layout.GridDataFactory; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.jst.j2ee.web.project.facet.IWebFacetInstallDataModelProperties; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public final class EarSelectionPanel implements IWebFacetInstallDataModelProperties - -{ - private final Button addToEar; - private final Combo combo; - private final Button newButton; - private final Label label; - - private final IDataModel model; - private DataModelSynchHelper synchhelper; - - public EarSelectionPanel( final IDataModel model, final Composite parent) - { - this.model = model; - this.synchhelper = new DataModelSynchHelper(model); - - final Group group = new Group( parent, SWT.NONE ); - group.setLayoutData( gdhfill() ); - group.setLayout( new GridLayout( 3, false ) ); - group.setText( Resources.earMemberShip ); - - this.addToEar = new Button( group, SWT.CHECK ); - this.addToEar.setText( Resources.addToEarLabel ); - GridDataFactory.defaultsFor(this.addToEar).span(3, 1).applyTo(this.addToEar); - synchhelper.synchCheckbox(addToEar, ADD_TO_EAR, null); - - label = new Label(group, SWT.NULL); - label.setText(Resources.earProjectLabel); - this.combo = new Combo(group, SWT.NONE); - this.combo.setLayoutData( gdhfill() ); - - this.newButton = new Button( group, SWT.PUSH ); - this.newButton.setText( Resources.newButtonLabel ); - GridDataFactory.defaultsFor(this.newButton).applyTo(this.newButton); - - this.newButton.addSelectionListener( new SelectionAdapter() - { - @Override - public void widgetSelected( final SelectionEvent event ) - { - handleAddButton(); - } - } ); - - synchhelper.synchCombo(combo, EAR_PROJECT_NAME, new Control[]{label, newButton}); - Dialog.applyDialogFont(parent); - } - - private void handleAddButton() - { - final EarProjectWizard wizard = new EarProjectWizard(); - - final WizardDialog dialog - = new WizardDialog( newButton.getShell(), wizard ); - - IRuntime runtime = (IRuntime)model.getProperty(FACET_RUNTIME); - wizard.setRuntimeInDataModel(runtime); - - if( dialog.open() != Window.CANCEL ) - { - model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG); - final String earproj = wizard.getProjectName(); - model.setProperty(EAR_PROJECT_NAME, earproj); - } - } - - private static GridData gdhfill() - { - return new GridData( GridData.FILL_HORIZONTAL ); - } - - public static final GridData gdhspan( final GridData gd, - final int span ) - { - gd.horizontalSpan = span; - return gd; - } - - private static final class Resources - - extends NLS - - { - public static String addToEarLabel; - public static String newButtonLabel; - public static String earProjectLabel; - public static String earMemberShip; - - static - { - initializeMessages( EarSelectionPanel.class.getName(), - Resources.class ); - } - } - - public void dispose() { - if(synchhelper != null){ - synchhelper.dispose(); - synchhelper = null; - } - } - - public String getComboText(){ - return combo.getText(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.properties b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.properties deleted file mode 100644 index 6ae0e5152..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 2005, 2006 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -# SAP AG - adding keyboard shortcuts -############################################################################### -addToEarLabel = &Add project to an EAR -newButtonLabel = New &Project... -earProjectLabel=EAR pr&oject name: -earMemberShip=EAR membership diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.java deleted file mode 100644 index bcc777df1..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.java +++ /dev/null @@ -1,185 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005-2007 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 - ******************************************************************************/ - -package org.eclipse.jst.j2ee.ui.project.facet; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin; -import org.eclipse.osgi.util.NLS; -import org.eclipse.ui.IMarkerResolution; -import org.eclipse.ui.IMarkerResolutionGenerator; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; -import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public final class RuntimeMismatchMarkerResolutions - - implements IMarkerResolutionGenerator - -{ - private static final String ATTR_RUNTIME1 = "runtime1"; //$NON-NLS-1$ - private static final String ATTR_RUNTIME2 = "runtime2"; //$NON-NLS-1$ - private static final String ATTR_MODULE_PROJECT = "moduleProject"; //$NON-NLS-1$ - - public IMarkerResolution[] getResolutions( final IMarker marker ) - { - final List resolutions = new ArrayList( 2 ); - - try - { - final IProject earProject = marker.getResource().getProject(); - final IFacetedProject earFacetedProject = ProjectFacetsManager.create( earProject ); - final IProject modProject = getModuleProject( marker ); - final IFacetedProject modFacetedProject = ProjectFacetsManager.create( modProject ); - - for( Iterator itr = getRuntimes( marker ).iterator(); itr.hasNext(); ) - { - final IRuntime runtime = (IRuntime) itr.next(); - - if( earFacetedProject.isTargetable( runtime ) && - modFacetedProject.isTargetable( runtime ) ) - { - final Resolution resolution - = new Resolution( earFacetedProject, modFacetedProject, runtime ); - - resolutions.add( resolution ); - } - } - } - catch( CoreException e ) - { - J2EEUIPlugin.logError( -1, null, e ); - } - - IMarkerResolution[] array = new IMarkerResolution[ resolutions.size() ]; - resolutions.toArray( array ); - - return array; - } - - private static IProject getModuleProject( final IMarker marker ) - { - final IWorkspace ws = ResourcesPlugin.getWorkspace(); - final String moduleProjectName = marker.getAttribute( ATTR_MODULE_PROJECT, null ); - return ws.getRoot().getProject( moduleProjectName ); - } - - private static List getRuntimes( final IMarker marker ) - { - final List runtimes = new ArrayList(); - - IRuntime r = getRuntimeByName( marker.getAttribute( ATTR_RUNTIME1, null ) ); - if( r != null ) runtimes.add( r ); - - r = getRuntimeByName( marker.getAttribute( ATTR_RUNTIME2, null ) ); - if( r != null ) runtimes.add( r ); - - return runtimes; - } - - private static IRuntime getRuntimeByName( final String name ) - { - if( RuntimeManager.isRuntimeDefined( name ) ) - { - return RuntimeManager.getRuntime( name ); - } - return null; - } - - private static final class Resolution - - implements IMarkerResolution - - { - private final IFacetedProject earProject; - private final IFacetedProject moduleProject; - private final IRuntime runtime; - - public Resolution( final IFacetedProject earProject, - final IFacetedProject moduleProject, - final IRuntime runtime ) - { - this.earProject = earProject; - this.moduleProject = moduleProject; - this.runtime = runtime; - } - - public String getLabel() - { - return NLS.bind( Resources.useSameRuntime, this.runtime.getLocalizedName() ); - } - - public void run( final IMarker marker ) - { - try - { - setRuntime( this.earProject, this.runtime ); - setRuntime( this.moduleProject, this.runtime ); - } - catch( CoreException e ) - { - ErrorDialog.openError( null, Resources.errorDialogTitle, - Resources.errorDialogMessage, e.getStatus() ); - } - } - - private void setRuntime( final IFacetedProject fproj, - final IRuntime runtime ) - - throws CoreException - - { - final IRuntime currentPrimaryRuntime = fproj.getPrimaryRuntime(); - - if( currentPrimaryRuntime != null && - ! currentPrimaryRuntime.getName().equals( runtime.getName() ) ) - { - if( ! fproj.isTargeted( runtime ) ) - { - fproj.addTargetedRuntime( runtime, null ); - } - - fproj.setPrimaryRuntime( runtime, null ); - } - } - } - - private static final class Resources - - extends NLS - - { - public static String useSameRuntime; - public static String errorDialogTitle; - public static String errorDialogMessage; - - static - { - initializeMessages( RuntimeMismatchMarkerResolutions.class.getName(), - Resources.class ); - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.properties b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.properties deleted file mode 100644 index f8b03d64b..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2005, 2007 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -useSameRuntime = Switch both projects to {0} -errorDialogTitle = Error -errorDialogMessage = Failed while applying the quick fix.
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectFirstPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectFirstPage.java deleted file mode 100644 index 29bbeb7dd..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectFirstPage.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.ui.project.facet; - -import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.internal.wizard.J2EEComponentFacetCreationWizardPage; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class UtilityProjectFirstPage extends J2EEComponentFacetCreationWizardPage { - - public UtilityProjectFirstPage(IDataModel dataModel, String pageName) { - super(dataModel, pageName); - setTitle(Resources.pageTitle); - setDescription(Resources.pageDescription); - setInfopopID(IJ2EEUIContextIds.NEW_UTILITY_WIZARD_P1); - } - - private static final class Resources extends NLS { - public static String pageTitle; - public static String pageDescription; - - static { - initializeMessages(UtilityProjectFirstPage.class.getName(), Resources.class); - } - } - - @Override - protected String getModuleFacetID() { - return J2EEProjectUtilities.UTILITY; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectFirstPage.properties b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectFirstPage.properties deleted file mode 100644 index 0a6de07aa..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectFirstPage.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2005 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -pageTitle = Utility Module -pageDescription = Configure utility module settings.
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectWizard.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectWizard.java deleted file mode 100644 index f801445c4..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectWizard.java +++ /dev/null @@ -1,73 +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.j2ee.ui.project.facet; - -import java.net.URL; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages; -import org.eclipse.jst.j2ee.project.facet.UtilityProjectCreationDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.project.facet.IProductConstants; -import org.eclipse.wst.project.facet.ProductManager; -import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard; -import org.osgi.framework.Bundle; - -/** - * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> - */ - -public class UtilityProjectWizard extends NewProjectDataModelFacetWizard { - - public UtilityProjectWizard(IDataModel model) { - super(model); - setWindowTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.JAVAUTIL_COMPONENT_WIZ_TITLE)); - } - - public UtilityProjectWizard(){ - super(); - setWindowTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.JAVAUTIL_COMPONENT_WIZ_TITLE)); - } - - @Override - protected IDataModel createDataModel() { - return DataModelFactory.createDataModel(new UtilityProjectCreationDataModelProvider()); - } - - @Override - protected ImageDescriptor getDefaultPageImageDescriptor() { - final Bundle bundle = Platform.getBundle("org.eclipse.jst.j2ee.ui"); //$NON-NLS-1$ - final URL url = bundle.getEntry("icons/util-wiz-banner.gif"); //$NON-NLS-1$ - return ImageDescriptor.createFromURL(url); - } - - @Override - protected IFacetedProjectTemplate getTemplate() { - return ProjectFacetsManager.getTemplate("template.jst.utility"); //$NON-NLS-1$ - } - - @Override - protected IWizardPage createFirstPage() { - return new UtilityProjectFirstPage(model, "first.page"); //$NON-NLS-1$ - } - - @Override - protected String getFinalPerspectiveID() { - return ProductManager.getProperty(IProductConstants.FINAL_PERSPECTIVE_UTILITY); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientFacetInstallPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientFacetInstallPage.java deleted file mode 100644 index 9ecebbbc8..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientFacetInstallPage.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences - *******************************************************************************/ -package org.eclipse.jst.j2ee.ui.project.facet.appclient; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds; -import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages; -import org.eclipse.jst.j2ee.internal.wizard.J2EEModuleFacetInstallPage; -import org.eclipse.jst.j2ee.project.facet.IAppClientFacetInstallDataModelProperties; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; - -public class AppClientFacetInstallPage extends J2EEModuleFacetInstallPage implements IAppClientFacetInstallDataModelProperties { - - private Button createMainClass; - - public AppClientFacetInstallPage() { - super("appclient.facet.install.page"); //$NON-NLS-1$ - setTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_CLIENT_PROJECT_MAIN_PG_TITLE)); - setDescription(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_CLIENT_SETTINGS)); - } - - @Override - protected String[] getValidationPropertyNames() { - return new String[]{EAR_PROJECT_NAME, CONFIG_FOLDER, CREATE_DEFAULT_MAIN_CLASS}; - } - - @Override - protected Composite createTopLevelComposite(Composite parent) { - setInfopopID(IJ2EEUIContextIds.NEW_APPCLIENT_WIZARD_P3); - final Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new GridLayout(1, false)); - - createMainClass = new Button(composite, SWT.CHECK); - createMainClass.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_CLIENT_CREATE_MAIN)); - synchHelper.synchCheckbox(createMainClass, CREATE_DEFAULT_MAIN_CLASS, null); - - createGenerateDescriptorControl(composite, J2EEConstants.APP_CLIENT_DD_SHORT_NAME); - registerFacetVersionChangeListener(); - - Dialog.applyDialogFont(parent); - return composite; - } - - @Override - protected void handleFacetVersionChangedEvent() - { - final IProjectFacetVersion fv = (IProjectFacetVersion) this.model.getProperty( FACET_VERSION ); - boolean isJEE5OrGreater = J2EEVersionUtil.convertVersionStringToInt(fv.getVersionString()) >= J2EEVersionConstants.JEE_5_0_ID; - this.addDD.setVisible(isJEE5OrGreater); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectFirstPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectFirstPage.java deleted file mode 100644 index b9d0fe42a..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectFirstPage.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.ui.project.facet.appclient; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.jst.common.project.facet.JavaFacetUtils; -import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds; -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.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.internal.wizard.J2EEComponentFacetCreationWizardPage; -import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; -import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; - -public class AppClientProjectFirstPage extends J2EEComponentFacetCreationWizardPage { - - public AppClientProjectFirstPage(IDataModel dataModel, String pageName) { - super(dataModel, pageName); - setTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_CLIENT_PROJECT_MAIN_PG_TITLE)); - setDescription(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_CLIENT_PROJECT_MAIN_PG_DESC)); - setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.APP_CLIENT_PROJECT_WIZARD_BANNER)); - setInfopopID(IJ2EEUIContextIds.NEW_APPCLIENT_WIZARD_P1); - } - - @Override - protected String getModuleFacetID() { - return J2EEProjectUtilities.APPLICATION_CLIENT; - } - - @Override - protected Set<IProjectFacetVersion> getFacetConfiguration( final IProjectFacetVersion primaryFacetVersion ) - { - IRuntime runtime = (IRuntime)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME); - final Set<IProjectFacetVersion> facets = new HashSet<IProjectFacetVersion>( 2 ); - - if(runtime != null) { - facets.addAll(super.getFacetConfiguration(primaryFacetVersion)); - } - else { - facets.add( primaryFacetVersion ); - - if( primaryFacetVersion == IJ2EEFacetConstants.APPLICATION_CLIENT_60) - { - facets.add( JavaFacetUtils.JAVA_60 ); - } - else if(primaryFacetVersion == IJ2EEFacetConstants.APPLICATION_CLIENT_50) - { - facets.add( JavaFacetUtils.JAVA_50 ); - } - else if( primaryFacetVersion == IJ2EEFacetConstants.APPLICATION_CLIENT_14) - { - facets.add( JavaFacetUtils.JAVA_14 ); - } - else if( primaryFacetVersion == IJ2EEFacetConstants.APPLICATION_CLIENT_13 || - primaryFacetVersion == IJ2EEFacetConstants.APPLICATION_CLIENT_12 ) - { - facets.add( JavaFacetUtils.JAVA_13 ); - } - } - return Collections.unmodifiableSet( facets ); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectWizard.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectWizard.java deleted file mode 100644 index 3bd07a0f1..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectWizard.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.ui.project.facet.appclient; - -import java.net.URL; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientFacetProjectCreationDataModelProvider; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages; -import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.project.facet.IProductConstants; -import org.eclipse.wst.project.facet.ProductManager; -import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard; -import org.osgi.framework.Bundle; - -public class AppClientProjectWizard extends NewProjectDataModelFacetWizard { - - public AppClientProjectWizard(IDataModel model) { - super(model); - setWindowTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_CLIENT_PROJECT_WIZ_TITLE)); - } - - public AppClientProjectWizard() { - super(); - setWindowTitle(J2EEUIMessages.getResourceString(J2EEUIMessages.APP_CLIENT_PROJECT_WIZ_TITLE)); - } - - @Override - protected IDataModel createDataModel() { - return DataModelFactory.createDataModel(new AppClientFacetProjectCreationDataModelProvider()); - } - - @Override - protected ImageDescriptor getDefaultPageImageDescriptor() { - final Bundle bundle = Platform.getBundle(J2EEUIPlugin.PLUGIN_ID); - final URL url = bundle.getEntry("icons/full/wizban/appclient_wiz.gif"); //$NON-NLS-1$ - return ImageDescriptor.createFromURL(url); - } - - @Override - protected IFacetedProjectTemplate getTemplate() { - return ProjectFacetsManager.getTemplate("template.jst.appclient"); //$NON-NLS-1$ - } - - @Override - protected IWizardPage createFirstPage() { - return new AppClientProjectFirstPage(model, "first.page"); //$NON-NLS-1$ - } - - @Override - protected String getFinalPerspectiveID() { - return ProductManager.getProperty(IProductConstants.FINAL_PERSPECTIVE_APPCLIENT); - } - -} |