Author: bfitzpat
Date: 2011-12-01 14:23:55 -0500 (Thu, 01 Dec 2011)
New Revision: 36843
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizard.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizardPage.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java
Log:
JBIDE-10199 - Updates to JAX-RS service generation wizards per patch
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java 2011-12-01
18:55:12 UTC (rev 36842)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/RestEasyLibUtils.java 2011-12-01
19:23:55 UTC (rev 36843)
@@ -21,6 +21,9 @@
*/
package org.jboss.tools.ws.creation.core.utils;
+import java.io.File;
+import java.io.FilenameFilter;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -37,6 +40,8 @@
*/
public class RestEasyLibUtils {
+ private static final String REST_EASY = "RestEasy"; //$NON-NLS-1$
+
/**
* Simple check to see if the JBoss WS runtime associated with a project
* actually includes the RESTEasy jars. If so, returns Status.OK_STATUS.
@@ -70,4 +75,36 @@
return Status.OK_STATUS;
}
+ public static IStatus doesRuntimeHaveRootLevelRestEasyDir ( IProject project ) {
+ try {
+ IJavaProject javaProject = JavaCore.create(project);
+ if (javaProject != null) {
+ String path =
+ JBossWSCreationUtils.getJBossWSRuntimeLocation(project.getProject());
+ File runtime = new File(path);
+ if (runtime.exists()) {
+ File parent = runtime.getParentFile();
+ if (parent.exists() && parent.isDirectory()) {
+ File[] restEasyDir = parent.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ if (name.equalsIgnoreCase(REST_EASY)) {
+ return true;
+ }
+ return false;
+ }
+ });
+ if (restEasyDir != null && restEasyDir.length > 0) {
+ return Status.OK_STATUS;
+ } else {
+ return StatusUtils.warningStatus("Root-level RESTeasy directory not found in
runtime location");
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ return StatusUtils.warningStatus("Root-level RESTeasy directory not found in
runtime location");
+ }
+ return Status.OK_STATUS;
+ }
+
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2011-12-01
18:55:12 UTC (rev 36842)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2011-12-01
19:23:55 UTC (rev 36843)
@@ -7,7 +7,8 @@
# END NON-TRANSLATABLE
JBossRSGenerateWizard_RS_Wizard_Window_Title=Generate a Sample RESTful Web Service
-JBossRSGenerateWizardPage_Error_RestEasyJarsNotFoundInRuntime=RESTEasy jars not found in
the runtime associated with the selected project. Make sure RESTEasy is installed and try
again.
+JBossRSGenerateWizardPage_AddJarsIfFoundCheckbox=Add RESTEasy Jars from root runtime
directory
+JBossRSGenerateWizardPage_Error_RestEasyJarsNotFoundInRuntime=RESTEasy jars not found in
the runtime associated with selected project. Verify RE is installed and try again or
check 'Add RESTeasy jars' below if enabled.
JBossRSGenerateWizardPage_Label_Application_Class_Name=Application Class Name:
JBossRSGenerateWizardPage_Page_title=Specify the Dynamic Web Project, service, package
and class name for the sample web service and web service classes.
JBossRSGenerateWizardPage_ServiceName_Tooltip=Name added to the generated annotated
JAX-RS service class as part of the service URI
@@ -72,6 +73,8 @@
Error_JBossWS_GenerateWizard_PackageName_Cannot_Be_Empty=Package name cannot be empty
Error_JBossWS_GenerateWizard_ClassName_Cannot_Be_Empty=Class name cannot be empty
Error_JBossWS_GenerateWizard_NotDynamicWebProject=The project must be a Dynamic Web
Project and contain a web.xml in a right Location
+Error_JBossWS_GenerateWizard_NotDynamicWebProject2=The project must be a Dynamic Web
Project
+Error_JBossWS_GenerateWizard_NoWebXML = The project must contain a web.xml file in the
right Location
Error_JBossWS_GenerateWizard_ClassName_Same=The class name has been used in the web
project.
Error_JBossWS_GenerateWizard_ServiceName_Empty=The Service Name may not be an empty
string.
Error_JBossWS_GenerateWizard_IsOutputFolder=Name conflict with output folder
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2011-12-01
18:55:12 UTC (rev 36842)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2011-12-01
19:23:55 UTC (rev 36843)
@@ -39,6 +39,7 @@
public static String Endorsed;
public static String JBossRSGenerateWizard_RS_Wizard_Window_Title;
+ public static String JBossRSGenerateWizardPage_AddJarsIfFoundCheckbox;
public static String JBossRSGenerateWizardPage_Error_RestEasyJarsNotFoundInRuntime;
public static String JBossRSGenerateWizardPage_Label_Application_Class_Name;
public static String JBossRSGenerateWizardPage_Page_title;
@@ -102,6 +103,8 @@
public static String Error_JBossWS_Runtime_List_Field_Editor_Name_Cannot_Be_Empty;
public static String
Error_JBossWS_Runtime_List_Field_Editor_Inputelement_Must_Be_An_Instance_Of_List;
public static String Error_JBossWS_GenerateWizard_NotDynamicWebProject;
+ public static String Error_JBossWS_GenerateWizard_NotDynamicWebProject2;
+ public static String Error_JBossWS_GenerateWizard_NoWebXML;
public static String Error_JBossWS_GenerateWizard_ClassName_Same;
public static String Error_JBossWS_GenerateWizard_PackageName_Cannot_Be_Empty;
public static String Error_JBossWS_GenerateWizard_ClassName_Cannot_Be_Empty;
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizard.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizard.java 2011-12-01
18:55:12 UTC (rev 36842)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizard.java 2011-12-01
19:23:55 UTC (rev 36843)
@@ -62,6 +62,7 @@
private boolean useDefaultServiceName = true;
private boolean useDefaultClassName = true;
private boolean updateWebXML = true;
+ private boolean addJarsFromRootRuntime = false;
private IStructuredSelection selection;
private IProject project;
@@ -125,7 +126,9 @@
}
}
try {
- new AddRestEasyJarsCommand(model).execute(null, null);
+ if (getAddJarsFromRootRuntime())
+ new AddRestEasyJarsCommand(model).execute(null, null);
+
RSServiceSampleCreationCommand createCommand =
new RSServiceSampleCreationCommand(model);
createCommand.execute(null, null);
@@ -226,6 +229,14 @@
return updateWebXML;
}
+ public boolean getAddJarsFromRootRuntime() {
+ return addJarsFromRootRuntime;
+ }
+
+ public void setAddJarsFromRootRuntime(boolean addJarsFromRootRuntime) {
+ this.addJarsFromRootRuntime = addJarsFromRootRuntime;
+ }
+
public IProject getProject() {
return project;
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizardPage.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizardPage.java 2011-12-01
18:55:12 UTC (rev 36842)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossRSGenerateWizardPage.java 2011-12-01
19:23:55 UTC (rev 36843)
@@ -22,6 +22,7 @@
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -35,6 +36,9 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
import org.jboss.tools.ws.creation.core.utils.RestEasyLibUtils;
@@ -50,6 +54,7 @@
private Text className;
private Text appClassName;
private Button updateWebXML;
+ private Button addJarsIfFound;
protected JBossRSGenerateWizardPage(String pageName) {
super(pageName);
@@ -84,6 +89,7 @@
wizard.setProject(projects.getText());
name.setText(updateDefaultName());
className.setText(updateDefaultClassName());
+ setWebXMLSelectionValueBasedOnProjectFacet();
bHasChanged = true;
setPageComplete(isPageComplete());
}
@@ -134,6 +140,23 @@
}
});
+ addJarsIfFound = new Button(group2, SWT.CHECK);
+ addJarsIfFound.setText(JBossWSUIMessages.JBossRSGenerateWizardPage_AddJarsIfFoundCheckbox);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ addJarsIfFound.setLayoutData(gd);
+ addJarsIfFound.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ wizard.setAddJarsFromRootRuntime(updateWebXML.getSelection());
+ setPageComplete(isPageComplete());
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ setWebXMLSelectionValueBasedOnProjectFacet();
+
Group group3 = new Group(composite, SWT.NONE);
group3.setText(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWizardPage_Class_Group);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -325,6 +348,30 @@
return testName;
}
+ private void setWebXMLSelectionValueBasedOnProjectFacet () {
+ try {
+ IFacetedProject facetProject =
+ ProjectFacetsManager.create(((JBossRSGenerateWizard)this.getWizard()).getProject());
+ IProjectFacetVersion version =
+ facetProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
+ if (version == null) {
+ // then we're not a dynamic web project, do nothing
+ return;
+ }
+ Double versionDouble = Double.valueOf(version.getVersionString());
+ if (versionDouble.doubleValue() == 3 || versionDouble.doubleValue() > 3) {
+ // dynamic web project 3.0, web.xml not needed
+ updateWebXML.setSelection(false);
+ } else if (versionDouble.doubleValue() < 3){
+ // dynamic web project < 3.0
+ updateWebXML.setSelection(true);
+ }
+ } catch (CoreException e1) {
+ // ignore
+ } catch (NumberFormatException nfe) {
+ // ignore
+ }
+ }
private boolean validate() {
ServiceModel model = wizard.getServiceModel();
@@ -340,22 +387,42 @@
return false;
}
+ try {
+ IFacetedProject facetProject =
+ ProjectFacetsManager.create(((JBossRSGenerateWizard)this.getWizard()).getProject());
+ IProjectFacetVersion version =
+ facetProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
+ if (version == null) {
+ // then we're not a dynamic web project
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject2);
+ return false;
+ }
+ } catch (CoreException e1) {
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject2);
+ return false;
+ }
+
// project not a dynamic web project
IFile web = ((JBossRSGenerateWizard) this.getWizard()).getWebFile();
if (web == null || !web.exists()) {
if (updateWebXML.getSelection()) {
- setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
- return false;
+ setMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NoWebXML,
+ DialogPage.WARNING);
+ return true;
}
}
+ IStatus reNoREDirectoryInRuntimeRoot =
RestEasyLibUtils.doesRuntimeHaveRootLevelRestEasyDir(((JBossRSGenerateWizard)
this.getWizard()).getProject());
+ addJarsIfFound.setEnabled(reNoREDirectoryInRuntimeRoot.getSeverity() == IStatus.OK);
+
IStatus reInstalledStatus =
RestEasyLibUtils.doesRuntimeSupportRestEasy(((JBossRSGenerateWizard)
this.getWizard()).getProject());
- if (reInstalledStatus.getSeverity() != IStatus.OK){
- setMessage(JBossWSUIMessages.JBossRSGenerateWizardPage_Error_RestEasyJarsNotFoundInRuntime,
DialogPage.WARNING);
+ if (reInstalledStatus.getSeverity() != IStatus.OK &&
!addJarsIfFound.getSelection()){
+ setMessage(JBossWSUIMessages.JBossRSGenerateWizardPage_Error_RestEasyJarsNotFoundInRuntime,
+ DialogPage.WARNING);
return true;
}
-
+
// no source folder in web project
try {
if
("".equals(JBossWSCreationUtils.getJavaProjectSrcLocation(((JBossRSGenerateWizard)
this.getWizard()).getProject()))) { //$NON-NLS-1$
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java 2011-12-01
18:55:12 UTC (rev 36842)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizard.java 2011-12-01
19:23:55 UTC (rev 36843)
@@ -69,6 +69,7 @@
private boolean useDefaultClassName = true;
private boolean updateWebXML = true;
private boolean isJAXWS = true;
+ private boolean addJarsFromRootRuntime = false;
private IStructuredSelection selection;
private IProject project;
@@ -131,7 +132,8 @@
AbstractDataModelOperation addJarsCommand = null;
AbstractDataModelOperation addClassesCommand = null;
if (!isJAXWS()) {
- addJarsCommand = new AddRestEasyJarsCommand(model);
+ if (getAddJarsFromRootRuntime())
+ addJarsCommand = new AddRestEasyJarsCommand(model);
addClassesCommand = new RSServiceCreationCommand(model);
} else {
addClassesCommand = new ServiceCreationCommand(model);
@@ -259,6 +261,14 @@
return updateWebXML;
}
+ public boolean getAddJarsFromRootRuntime() {
+ return addJarsFromRootRuntime;
+ }
+
+ public void setAddJarsFromRootRuntime(boolean addJarsFromRootRuntime) {
+ this.addJarsFromRootRuntime = addJarsFromRootRuntime;
+ }
+
public void setJAXWS(boolean isJAXWS) {
this.isJAXWS = isJAXWS;
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java 2011-12-01
18:55:12 UTC (rev 36842)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java 2011-12-01
19:23:55 UTC (rev 36843)
@@ -29,6 +29,7 @@
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -43,6 +44,9 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.SelectionDialog;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
import org.jboss.tools.ws.creation.core.utils.RestEasyLibUtils;
@@ -61,6 +65,7 @@
private Text appClassName;
private Text name;
private Button updateWebXML;
+ private Button addJarsIfFound;
private Button btnPackageBrowse;
private Button btnServiceClassBrowse;
private Button btnAppClassBrowse;
@@ -286,6 +291,7 @@
projects.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
wizard.setProject(projects.getText());
+ setWebXMLSelectionValueBasedOnProjectFacet();
bHasChanged = true;
setPageComplete(isPageComplete());
}
@@ -340,6 +346,22 @@
}
});
+ addJarsIfFound = new Button(group, SWT.CHECK);
+ addJarsIfFound.setText(JBossWSUIMessages.JBossRSGenerateWizardPage_AddJarsIfFoundCheckbox);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ addJarsIfFound.setLayoutData(gd);
+ addJarsIfFound.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ wizard.setAddJarsFromRootRuntime(updateWebXML.getSelection());
+ setPageComplete(isPageComplete());
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ setWebXMLSelectionValueBasedOnProjectFacet();
}
private void createImplementationGroup(Composite parent) {
@@ -547,6 +569,31 @@
return validate();
}
+ private void setWebXMLSelectionValueBasedOnProjectFacet () {
+ try {
+ IFacetedProject facetProject =
+ ProjectFacetsManager.create(((JBossWSAnnotatedClassWizard)this.getWizard()).getProject());
+ IProjectFacetVersion version =
+ facetProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
+ if (version == null) {
+ // then we're not a dynamic web project, do nothing
+ return;
+ }
+ Double versionDouble = Double.valueOf(version.getVersionString());
+ if (versionDouble.doubleValue() == 3 || versionDouble.doubleValue() > 3) {
+ // dynamic web project 3.0, web.xml not needed
+ updateWebXML.setSelection(false);
+ } else if (versionDouble.doubleValue() < 3){
+ // dynamic web project < 3.0
+ updateWebXML.setSelection(true);
+ }
+ } catch (CoreException e1) {
+ // ignore
+ } catch (NumberFormatException nfe) {
+ // ignore
+ }
+ }
+
private boolean validate() {
ServiceModel model = wizard.getServiceModel();
if (wizard.isJAXWS()) {
@@ -554,6 +601,8 @@
setErrorMessage(null);
JBossWSGenerateWizardValidator.setServiceModel(model);
+
+ addJarsIfFound.setEnabled(false);
if (!projects.isDisposed() && projects.getText().length() > 0) {
model.setWebProjectName(projects.getText());
@@ -564,11 +613,26 @@
return false;
}
+ try {
+ IFacetedProject facetProject =
+ ProjectFacetsManager.create(((JBossWSAnnotatedClassWizard)this.getWizard()).getProject());
+ if (facetProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET) ==
null) {
+ // then we're not a dynamic web project
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject2);
+ return false;
+ }
+ } catch (CoreException e1) {
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject2);
+ return false;
+ }
+
+ // project not a dynamic web project
IFile web = ((JBossWSAnnotatedClassWizard) this.getWizard()).getWebFile();
if (web == null || !web.exists()) {
if (updateWebXML.getSelection()) {
- setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
- return false;
+ setMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NoWebXML,
+ DialogPage.WARNING);
+ return true;
}
}
@@ -621,18 +685,36 @@
return false;
}
+ try {
+ IFacetedProject facetProject =
+ ProjectFacetsManager.create(((JBossWSAnnotatedClassWizard)this.getWizard()).getProject());
+ if (facetProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET) ==
null) {
+ // then we're not a dynamic web project
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject2);
+ return false;
+ }
+ } catch (CoreException e1) {
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject2);
+ return false;
+ }
+
// project not a dynamic web project
IFile web = ((JBossWSAnnotatedClassWizard) this.getWizard()).getWebFile();
if (web == null || !web.exists()) {
if (updateWebXML.getSelection()) {
- setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
- return false;
+ setMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NoWebXML,
+ DialogPage.WARNING);
+ return true;
}
}
+
+ IStatus reNoREDirectoryInRuntimeRoot =
RestEasyLibUtils.doesRuntimeHaveRootLevelRestEasyDir(
+ ((JBossWSAnnotatedClassWizard) this.getWizard()).getProject());
+ addJarsIfFound.setEnabled(reNoREDirectoryInRuntimeRoot.getSeverity() == IStatus.OK);
IStatus reInstalledStatus =
RestEasyLibUtils.doesRuntimeSupportRestEasy(((JBossWSAnnotatedClassWizard)
this.getWizard()).getProject());
- if (reInstalledStatus.getSeverity() != IStatus.OK){
+ if (reInstalledStatus.getSeverity() != IStatus.OK &&
!addJarsIfFound.getSelection()){
setMessage(JBossWSUIMessages.JBossRSGenerateWizardPage_Error_RestEasyJarsNotFoundInRuntime,
DialogPage.WARNING);
return true;
}