diff options
author | kchong | 2010-03-04 03:49:58 +0000 |
---|---|---|
committer | kchong | 2010-03-04 03:49:58 +0000 |
commit | a745d674d11c13a47265f9a5b49002e218b7d480 (patch) | |
tree | 0a8c96009378a0b63f8d849ab4fdaba25b239caf | |
parent | 0e72306725d9dfab4d7f1c94f1b261ee7853563e (diff) | |
download | webtools.webservices-a745d674d11c13a47265f9a5b49002e218b7d480.tar.gz webtools.webservices-a745d674d11c13a47265f9a5b49002e218b7d480.tar.xz webtools.webservices-a745d674d11c13a47265f9a5b49002e218b7d480.zip |
[291954] JAX-RS: Implement JAX-RS Facet - Include lib button unchecked
5 files changed, 34 insertions, 114 deletions
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java index 2cce9479c..a46cfb888 100644 --- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java +++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java @@ -46,4 +46,11 @@ public interface IJAXRSFacetInstallDataModelProperties extends public static final String DEPLOY_IMPLEMENTATION = "IJAXRSFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION"; //$NON-NLS-1$ + public static final String CONFIGURATION_PRESET = "IJAXRSFacetInstallDataModelProperties.CONFIGURATION_PRESET"; //$NON-NLS-1$" + + public static final String SERVER_IRUNTIME = "IJAXRSFacetInstallDataModelProperties.SERVER_IRUNTIME"; //$NON-NLS-1$" + + // Support post-project creation scenario. If WAR is parked in multiple EARs, then we should update all the EARs + public static final String EARPROJECTS = "IJAXRSFacetInstallDataModelProperties.EARPROJECTS"; //$NON-NLS-1$ + } diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java index 2fd1228d7..5e611e317 100644 --- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java +++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2010 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 @@ -11,6 +11,7 @@ * -------- -------- ----------------------------------------------------------- * 20091021 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet * 20091106 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet + * 20100303 291954 kchong@ca.ibm.com - Keith Chong, JAX-RS: Implement JAX-RS Facet *******************************************************************************/ package org.eclipse.jst.ws.jaxrs.core.internal.project.facet; @@ -62,6 +63,9 @@ public class JAXRSFacetInstallDataModelProvider extends names.add(WEBCONTENT_DIR); names.add(LIBRARY_PROVIDER_DELEGATE); names.add(DEPLOY_IMPLEMENTATION); + names.add(CONFIGURATION_PRESET); + names.add(SERVER_IRUNTIME); + names.add(EARPROJECTS); return names; } @@ -90,7 +94,13 @@ public class JAXRSFacetInstallDataModelProvider extends return this.libraryInstallDelegate; } else if (propertyName.equals(DEPLOY_IMPLEMENTATION)) { return Boolean.TRUE; - } + } else if (propertyName.equals(CONFIGURATION_PRESET)) { + return null; + } else if (propertyName.equals(SERVER_IRUNTIME)) { + return null; + } else if (propertyName.equals(EARPROJECTS)) { + return null; + } return super.getDefaultProperty(propertyName); } diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUserLibraryProviderInstallOperationConfig.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUserLibraryProviderInstallOperationConfig.java index 44ba474e4..bd837cd63 100644 --- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUserLibraryProviderInstallOperationConfig.java +++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUserLibraryProviderInstallOperationConfig.java @@ -31,7 +31,7 @@ public class JAXRSUserLibraryProviderInstallOperationConfig extends public void setSharedLibrary(boolean isSharedLibrary) { this.isSharedLibrary = isSharedLibrary; - setIncludeWithApplicationEnabled(!isSharedLibrary); +// setIncludeWithApplicationEnabled(!isSharedLibrary); } public boolean isSharedLibrary() diff --git a/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSFacetInstallPage.java b/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSFacetInstallPage.java index 2eefa6776..f2c19bbba 100644 --- a/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSFacetInstallPage.java +++ b/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSFacetInstallPage.java @@ -57,6 +57,7 @@ import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; import org.eclipse.wst.common.frameworks.datamodel.IDataModel; import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage; import org.eclipse.wst.common.project.facet.core.IFacetedProject; +import org.eclipse.wst.common.project.facet.core.IPreset; import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; import org.eclipse.wst.common.project.facet.core.runtime.internal.BridgedRuntime; @@ -73,30 +74,22 @@ import org.eclipse.wst.server.core.IRuntimeType; public class JAXRSFacetInstallPage extends DataModelWizardPage implements IJAXRSFacetInstallDataModelProperties, IFacetWizardPage { // UI -// private Group servletInfo; - private ServletInformationGroup servletInfoGroup; -// private Label lblJAXRSServletName; -// private Text txtJAXRSServletName; -// private Label lblJAXRSServletClassName; -// private Text txtJAXRSServletClassName; -// private Label lblJAXRSServletURLPatterns; -// private List lstJAXRSServletURLPatterns; -// private Button btnAddPattern; -// private Button btnRemovePattern; private IDialogSettings dialogSettings; private IDataModel webAppDataModel; private String sEARProject = null; private String sWEBProject = null; private String sTargetRuntime = null; + private IRuntime targetRuntime = null; private boolean bAddToEAR = false; private static final String SETTINGS_SERVLET = "servletName"; //$NON-NLS-1$ private static final String SETTINGS_SERVLET_CLASSNAME = "servletClassname"; //$NON-NLS-1$ private static final String SETTINGS_URL_MAPPINGS = "urlMappings"; //$NON-NLS-1$ private static final String SETTINGS_URL_PATTERN = "pattern"; //$NON-NLS-1$ private Composite composite = null; - + private java.util.List<IProject> earProjects = null; + private IPreset selectedPreset = null; private boolean isProjectCreationMode = true; // project creation = true, // add/remove facets mode = // false @@ -150,95 +143,8 @@ public class JAXRSFacetInstallPage extends DataModelWizardPage implements IJAXRS servletInfoGroup = new ServletInformationGroup(composite, SWT.NONE); servletInfoGroup.setDataModel(model); -// servletInfo = new Group(composite, SWT.NONE); -// GridData servletGD = new GridData(GridData.FILL_HORIZONTAL); -// servletInfo.setLayoutData(servletGD); -// servletInfo.setLayout(new GridLayout(3, false)); -// servletInfo.setText(Messages.JAXRSFacetInstallPage_JAXRSServletLabel); -// -// lblJAXRSServletName = new Label(servletInfo, SWT.NONE); -// lblJAXRSServletName -// .setText(Messages.JAXRSFacetInstallPage_JAXRSServletNameLabel); -// lblJAXRSServletName.setLayoutData(new GridData(GridData.BEGINNING)); -// -// txtJAXRSServletName = new Text(servletInfo, SWT.BORDER); -// GridData gd2 = new GridData(GridData.FILL_HORIZONTAL); -// gd2.horizontalSpan = 2; -// txtJAXRSServletName.setLayoutData(gd2); -// -// lblJAXRSServletClassName = new Label(servletInfo, SWT.NONE); -// lblJAXRSServletClassName -// .setText(Messages.JAXRSFacetInstallPage_JAXRSServletClassNameLabel); -// lblJAXRSServletClassName -// .setLayoutData(new GridData(GridData.BEGINNING)); -// -// txtJAXRSServletClassName = new Text(servletInfo, SWT.BORDER); -// GridData gd2c = new GridData(GridData.FILL_HORIZONTAL); -// gd2c.horizontalSpan = 2; -// txtJAXRSServletClassName.setLayoutData(gd2c); -// -// lblJAXRSServletURLPatterns = new Label(servletInfo, SWT.NULL); -// lblJAXRSServletURLPatterns -// .setText(Messages.JAXRSFacetInstallPage_JAXRSURLMappingLabel); -// lblJAXRSServletURLPatterns.setLayoutData(new GridData( -// GridData.BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING)); -// lstJAXRSServletURLPatterns = new List(servletInfo, SWT.BORDER); -// GridData gd3 = new GridData(GridData.FILL_HORIZONTAL); -// gd3.heightHint = convertHeightInCharsToPixels(5); -// lstJAXRSServletURLPatterns.setLayoutData(gd3); -// lstJAXRSServletURLPatterns.addSelectionListener(new SelectionAdapter() { -// public void widgetSelected(SelectionEvent e) { -// btnRemovePattern.setEnabled(lstJAXRSServletURLPatterns -// .getSelectionCount() > 0); -// } -// }); -// -// Composite btnComposite = new Composite(servletInfo, SWT.NONE); -// GridLayout gl = new GridLayout(1, false); -// gl.marginLeft = 0; -// btnComposite.setLayout(gl); -// btnComposite.setLayoutData(new GridData(GridData.END -// | GridData.VERTICAL_ALIGN_FILL)); -// -// btnAddPattern = new Button(btnComposite, SWT.NONE); -// btnAddPattern.setText(Messages.JAXRSFacetInstallPage_Add2); -// btnAddPattern.setLayoutData(new GridData(GridData.FILL_HORIZONTAL -// | GridData.VERTICAL_ALIGN_BEGINNING)); -// btnAddPattern.addSelectionListener(new SelectionAdapter() { -// public void widgetSelected(SelectionEvent e) { -// InputDialog dialog = new InputDialog(getShell(), -// Messages.JAXRSFacetInstallPage_PatternDialogTitle, -// Messages.JAXRSFacetInstallPage_PatternDialogDesc, null, -// new IInputValidator() { -// -// public String isValid(String newText) { -// return isValidPattern(newText); -// } -// -// }); -// dialog.open(); -// if (dialog.getReturnCode() == Window.OK) { -// addItemToList(dialog.getValue(), true); -// } -// } -// }); -// -// btnRemovePattern = new Button(btnComposite, SWT.NONE); -// btnRemovePattern.setText(Messages.JAXRSFacetInstallPage_Remove); -// btnRemovePattern.setLayoutData(new GridData(GridData.FILL_HORIZONTAL -// | GridData.VERTICAL_ALIGN_BEGINNING)); -// btnRemovePattern.setEnabled(false); -// btnRemovePattern.addSelectionListener(new SelectionAdapter() { -// public void widgetSelected(SelectionEvent e) { -// removeItemFromList(lstJAXRSServletURLPatterns.getSelection()); -// btnRemovePattern.setEnabled(false); -// } -// }); - addModificationListeners(); - this.getContainer().getShell().pack(); - return composite; } @@ -246,8 +152,6 @@ public class JAXRSFacetInstallPage extends DataModelWizardPage implements IJAXRS { IDialogSettings root = dialogSettings.getSection(IJAXRSUIConstants.SETTINGS_ROOT); -// initJAXRSCfgCtrlValues(root); - if (!this.isProjectCreationMode) { // We are in add/remove facets mode @@ -366,6 +270,10 @@ public class JAXRSFacetInstallPage extends DataModelWizardPage implements IJAXRS model.setStringProperty(IJAXRSFacetInstallDataModelProperties.WEBPROJECT_NAME, sWEBProject); model.setStringProperty(IJAXRSFacetInstallDataModelProperties.TARGETRUNTIME, sTargetRuntime); model.setBooleanProperty(IJAXRSFacetInstallDataModelProperties.ADD_TO_EAR, bAddToEAR); + + model.setProperty(IJAXRSFacetInstallDataModelProperties.SERVER_IRUNTIME, targetRuntime); + model.setProperty(IJAXRSFacetInstallDataModelProperties.CONFIGURATION_PRESET, selectedPreset); + model.setProperty(IJAXRSFacetInstallDataModelProperties.EARPROJECTS, earProjects); } @@ -388,16 +296,6 @@ public class JAXRSFacetInstallPage extends DataModelWizardPage implements IJAXRS synchHelper.synchList(servletInfoGroup.lstJAXRSServletURLPatterns, SERVLET_URL_PATTERNS, null); } - private String isValidPattern(String value) - { - if (value == null || value.trim().equals("")) //$NON-NLS-1$ - return Messages.JAXRSFacetInstallPage_PatternEmptyMsg; - if (servletInfoGroup.lstJAXRSServletURLPatterns.indexOf(value) >= 0) - return Messages.JAXRSFacetInstallPage_PatternSpecifiedMsg; - - return null; - } - private void loadURLMappingPatterns(IDialogSettings root) { servletInfoGroup.lstJAXRSServletURLPatterns.removeAll(); diff --git a/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSUserLibraryProviderInstallPanel.java b/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSUserLibraryProviderInstallPanel.java index 7875a6eab..5428f8a17 100644 --- a/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSUserLibraryProviderInstallPanel.java +++ b/bundles/org.eclipse.jst.ws.jaxrs.ui/src/org/eclipse/jst/ws/jaxrs/ui/internal/project/facet/JAXRSUserLibraryProviderInstallPanel.java @@ -113,6 +113,7 @@ public class JAXRSUserLibraryProviderInstallPanel extends UserLibraryProviderIns cfg.setSharedLibrary(false); IDataModel model = cfg.getModel(); model.setProperty(IJAXRSFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION, btnDeployJars.getSelection()); + model.setProperty(IJAXRSFacetInstallDataModelProperties.SHAREDLIBRARY, btnSharedLibrary.getSelection()); } }); @@ -126,6 +127,7 @@ public class JAXRSUserLibraryProviderInstallPanel extends UserLibraryProviderIns cfg.setIsDeploy(false); cfg.setSharedLibrary(true); IDataModel model = cfg.getModel(); + model.setProperty(IJAXRSFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION, btnDeployJars.getSelection()); model.setProperty(IJAXRSFacetInstallDataModelProperties.SHAREDLIBRARY, btnSharedLibrary.getSelection()); } }); @@ -134,7 +136,10 @@ public class JAXRSUserLibraryProviderInstallPanel extends UserLibraryProviderIns { public void propertyChanged(final String property, final Object oldValue, final Object newValue) { - copyOnPublishCheckBox.setSelection(cfg.isIncludeWithApplicationEnabled()); + if (oldValue != newValue) + { +// copyOnPublishCheckBox.setSelection(cfg.isIncludeWithApplicationEnabled()); + } } }; |