Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Anderson2014-03-06 18:55:11 +0000
committerCarl Anderson2014-03-06 18:55:11 +0000
commita2cd6e1bd58b3eca146a89e949bf713cf8b1eff6 (patch)
tree12c1804e130f76e6a3050cefda22e5abfb0a0821 /plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui
parent886ce66eb90cdf6543cbbb53d7d9de6fc47ced52 (diff)
downloadwebtools.javaee-a2cd6e1bd58b3eca146a89e949bf713cf8b1eff6.tar.gz
webtools.javaee-a2cd6e1bd58b3eca146a89e949bf713cf8b1eff6.tar.xz
webtools.javaee-a2cd6e1bd58b3eca146a89e949bf713cf8b1eff6.zip
[426504] Update New Servlet and Filter wizards to support async optionv201403061900
Diffstat (limited to 'plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui')
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/plugin/WEBUIMessages.java1
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java28
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java81
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java29
-rw-r--r--plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/IWebWizardConstants.java1
5 files changed, 119 insertions, 21 deletions
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
index f34c07561..6814cbed5 100644
--- 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
@@ -39,6 +39,7 @@ public class WEBUIMessages extends NLS {
public static String ADD_SERVLET_WIZARD_PAGE_TITLE;
public static String ADD_FILTER_WIZARD_WINDOW_TITLE;
public static String ADD_FILTER_WIZARD_PAGE_TITLE;
+ public static String ASYNC_SUPPORT_LABEL;
public static String JAVA_CLASS_MAIN_CHECKBOX_LABEL;
public static String EMPTY_LIST_MSG;
public static String ExportWARAction_UI_;
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java
index 79ca1aea6..c6cc7907e 100644
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java
+++ b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddFilterWizardPage.java
@@ -12,6 +12,7 @@ package org.eclipse.jst.servlet.ui.internal.wizard;
import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.FILTER_MAPPINGS;
import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.INIT_PARAM;
+import static org.eclipse.jst.j2ee.internal.web.operations.INewFilterClassDataModelProperties.ASYNC_SUPPORT;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DESCRIPTION;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DISPLAY_NAME;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
@@ -33,10 +34,12 @@ import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactE
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties;
import org.eclipse.jst.j2ee.internal.wizard.StringArrayTableWizardSection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
@@ -54,6 +57,7 @@ public class AddFilterWizardPage extends DataModelWizardPage {
private Text displayNameText;
FilterMappingsArrayTableWizardSection mappingSection;
+ private Button asyncSupportCheckBox;
public AddFilterWizardPage(IDataModel model, String pageName) {
super(model, pageName);
@@ -103,6 +107,9 @@ public class AddFilterWizardPage extends DataModelWizardPage {
displayNameText.setFocus();
+ createAsyncSupportGroup(composite);
+
+
IStatus projectStatus = validateProjectName();
if (!projectStatus.isOK()) {
setErrorMessage(projectStatus.getMessage());
@@ -140,6 +147,16 @@ public class AddFilterWizardPage extends DataModelWizardPage {
descText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(descText, DESCRIPTION, null);
}
+
+
+ private void createAsyncSupportGroup(Composite composite){
+ asyncSupportCheckBox = new Button(composite, SWT.CHECK);
+ asyncSupportCheckBox.setText(IWebWizardConstants.ASYNC_SUPPORT_LABEL);
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ data.horizontalSpan = 3;
+ asyncSupportCheckBox.setLayoutData(data);
+ synchHelper.synchCheckbox(asyncSupportCheckBox, ASYNC_SUPPORT, null);
+ }
public String getDisplayName() {
return displayNameText.getText();
@@ -157,4 +174,15 @@ public class AddFilterWizardPage extends DataModelWizardPage {
return true;
}
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ String javaEEVersion = model.getStringProperty(INewServletClassDataModelProperties.JAVA_EE_VERSION);
+ if("3.0".equals(javaEEVersion) || "3.1".equals(javaEEVersion)){ //$NON-NLS-1$ //$NON-NLS-2$
+ asyncSupportCheckBox.setVisible(true);
+ }
+ else
+ asyncSupportCheckBox.setVisible(false);
+ }
+
}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java
index 12d8119fe..13fac9025 100644
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java
+++ b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddListenerWizardPage.java
@@ -50,6 +50,8 @@ public class AddListenerWizardPage extends DataModelWizardPage {
private static final Image IMG_INTERFACE = JavaPluginImages.get(JavaPluginImages.IMG_OBJS_INTERFACE);
protected ServletDataModelSyncHelper synchHelper2;
+ private Button changeSessionID, asyncListener;
+ private Label changeSessionIDIconLabel, changeSessionIDInterfaceLabel, asyncListenerIconLabel, asyncListenerInterfaceLabel;
public AddListenerWizardPage(IDataModel model, String pageName) {
super(model, pageName);
@@ -131,16 +133,10 @@ public class AddListenerWizardPage extends DataModelWizardPage {
QUALIFIED_HTTP_SESSION_BINDING_LISTENER,
INTERFACES);
- String javaEEVersion = model.getStringProperty(INewServletClassDataModelProperties.JAVA_EE_VERSION);
- if("3.1".equals(javaEEVersion)){ //$NON-NLS-1$
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_OBJECT_SESSION_ID,
- QUALIFIED_HTTP_SESSION_ID_LISTENER,
- INTERFACES);
- }
-
-
-
+ createEventListenerRow(group,
+ ADD_LISTENER_WIZARD_OBJECT_SESSION_ID,
+ QUALIFIED_HTTP_SESSION_ID_LISTENER,
+ INTERFACES);
}
private void createServletRequestEvents(Composite parent) {
@@ -156,14 +152,11 @@ public class AddListenerWizardPage extends DataModelWizardPage {
QUALIFIED_SERVLET_REQUEST_ATTRIBUTE_LISTENER,
INTERFACES);
- String javaEEVersion = model.getStringProperty(INewServletClassDataModelProperties.JAVA_EE_VERSION);
- if("3.1".equals(javaEEVersion)){ //$NON-NLS-1$
- createEventListenerRow(group,
- ADD_LISTENER_WIZARD_ASYNC_EVENTS,
- QUALIFIED_SERVLET_REQUEST_ASYNC_EVENT_LISTENER,
- INTERFACES);
- }
-
+ createEventListenerRow(group,
+ ADD_LISTENER_WIZARD_ASYNC_EVENTS,
+ QUALIFIED_SERVLET_REQUEST_ASYNC_EVENT_LISTENER,
+ INTERFACES);
+
}
@@ -178,9 +171,21 @@ public class AddListenerWizardPage extends DataModelWizardPage {
}
private void createEventListenerRow(Composite parent, String event, String listener, String property) {
- createCheckbox(parent, event, listener, property);
- createInterfaceIcon(parent);
- createInterfaceLabel(parent, listener);
+ if (listener.equals(QUALIFIED_HTTP_SESSION_ID_LISTENER)){
+ changeSessionID = createCheckbox(parent, event, listener, property);
+ changeSessionIDIconLabel = createInterfaceIcon(parent);
+ changeSessionIDInterfaceLabel = createInterfaceLabel(parent, listener);
+ }
+ else if (listener.equals(QUALIFIED_SERVLET_REQUEST_ASYNC_EVENT_LISTENER)){
+ asyncListener = createCheckbox(parent, event, listener, property);
+ asyncListenerIconLabel = createInterfaceIcon(parent);
+ asyncListenerInterfaceLabel = createInterfaceLabel(parent, listener);
+ }
+ else{
+ createCheckbox(parent, event, listener, property);
+ createInterfaceIcon(parent);
+ createInterfaceLabel(parent, listener);
+ }
}
private Button createCheckbox(Composite parent, String text, String value, String property) {
@@ -265,5 +270,39 @@ public class AddListenerWizardPage extends DataModelWizardPage {
synchHelper2.synchUIWithModel(INTERFACES, DataModelEvent.VALUE_CHG);
model.notifyPropertyChange(INTERFACES, DataModelEvent.VALUE_CHG);
}
+
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ String javaEEVersion = model.getStringProperty(INewServletClassDataModelProperties.JAVA_EE_VERSION);
+ if("3.1".equals(javaEEVersion)){ //$NON-NLS-1$
+ setServlet31ListenersVisible(true);
+ }
+ else{
+ setServlet31ListenersVisible(false);
+ }
+ }
+
+
+ private void setServlet31ListenersVisible(boolean visible){
+ changeSessionID.setVisible(visible);
+ changeSessionIDIconLabel.setVisible(visible);
+ changeSessionIDInterfaceLabel.setVisible(visible);
+ asyncListener.setVisible(visible);
+ asyncListenerIconLabel.setVisible(visible);
+ asyncListenerInterfaceLabel.setVisible(visible);
+
+ if (!visible){
+ List interfaces = (List) model.getProperty(INTERFACES);
+ if (interfaces != null){
+ //remove any selected interfaces
+ interfaces.remove(QUALIFIED_HTTP_SESSION_ID_LISTENER);
+ interfaces.remove(QUALIFIED_SERVLET_REQUEST_ASYNC_EVENT_LISTENER);
+ synchHelper2.synchUIWithModel(INTERFACES, DataModelEvent.VALUE_CHG);
+ model.notifyPropertyChange(INTERFACES, DataModelEvent.VALUE_CHG);
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java
index 83fdc45ae..9df611ad2 100644
--- 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
@@ -14,6 +14,7 @@ package org.eclipse.jst.servlet.ui.internal.wizard;
import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.INIT_PARAM;
import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.URL_MAPPINGS;
+import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.ASYNC_SUPPORT;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DESCRIPTION;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DISPLAY_NAME;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
@@ -45,12 +46,14 @@ import java.util.List;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties;
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.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
@@ -67,6 +70,7 @@ public class AddServletWizardPage extends DataModelWizardPage {
private Text displayNameText;
private StringArrayTableWizardSection urlSection;
+ private Button asyncSupportCheckBox;
public AddServletWizardPage(IDataModel model, String pageName) {
super(model, pageName);
@@ -130,6 +134,10 @@ public class AddServletWizardPage extends DataModelWizardPage {
urlSection.setInput(input);
displayNameText.setFocus();
+
+ createAsyncSupportGroup(composite);
+
+
IStatus projectStatus = validateProjectName();
if (!projectStatus.isOK()) {
setErrorMessage(projectStatus.getMessage());
@@ -178,6 +186,16 @@ public class AddServletWizardPage extends DataModelWizardPage {
descText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(descText, DESCRIPTION, null);
}
+
+
+ private void createAsyncSupportGroup(Composite composite){
+ asyncSupportCheckBox = new Button(composite, SWT.CHECK);
+ asyncSupportCheckBox.setText(IWebWizardConstants.ASYNC_SUPPORT_LABEL);
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ data.horizontalSpan = 3;
+ asyncSupportCheckBox.setLayoutData(data);
+ synchHelper.synchCheckbox(asyncSupportCheckBox, ASYNC_SUPPORT, null);
+ }
public String getDisplayName() {
return displayNameText.getText();
@@ -195,4 +213,15 @@ public class AddServletWizardPage extends DataModelWizardPage {
return true;
}
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ String javaEEVersion = model.getStringProperty(INewServletClassDataModelProperties.JAVA_EE_VERSION);
+ if("3.0".equals(javaEEVersion) || "3.1".equals(javaEEVersion)){ //$NON-NLS-1$ //$NON-NLS-2$
+ asyncSupportCheckBox.setVisible(true);
+ }
+ else
+ asyncSupportCheckBox.setVisible(false);
+ }
+
}
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
index e534e0a77..218c7f04d 100644
--- 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
@@ -29,6 +29,7 @@ public interface IWebWizardConstants {
public final static String INIT_PARAM_LABEL = WEBUIMessages.INIT_PARAM_LABEL;
public final static String URL_MAPPINGS_TITLE = WEBUIMessages.URL_MAPPINGS_TITLE;
public final static String URL_MAPPINGS_LABEL = WEBUIMessages.URL_MAPPINGS_LABEL;
+ public final static String ASYNC_SUPPORT_LABEL = WEBUIMessages.ASYNC_SUPPORT_LABEL;
public final static String CHOOSE_SERVLET_CLASS = WEBUIMessages.CHOOSE_SERVLET_CLASS;
// NewServletWizard

Back to the top