Author: scabanovich
Date: 2011-11-22 19:52:58 -0500 (Tue, 22 Nov 2011)
New Revision: 36553
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.properties
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
JBIDE-10190
https://issues.jboss.org/browse/JBIDE-10190
Migrated validation for web.xml.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.properties 2011-11-23 00:51:59 UTC
(rev 36552)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.properties 2011-11-23 00:52:58 UTC
(rev 36553)
@@ -56,4 +56,5 @@
NavigatorContent_ProjectContentProvider=JBoss Tools Project Content Provider
PreferencePage_Validator = Validation
-PropertiesPage_Validator = Expression Language Validation
\ No newline at end of file
+PropertiesPage_Validator = Expression Language Validation
+PreferencePage_WebXML_Validator = Web XML Validation
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2011-11-23 00:51:59 UTC (rev
36552)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2011-11-23 00:52:58 UTC (rev
36553)
@@ -707,4 +707,31 @@
</contentType>
</proposalComputer>
</extension>
+
+ <extension point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.jboss.tools.common.model.ui"
+
class="org.jboss.tools.jst.web.ui.internal.preferences.WebXMLValidatorPreferencePage"
+ id="org.jboss.tools.jst.web.ui.WebXMLValidatorPreferencePage"
+ name="%PreferencePage_WebXML_Validator">
+ </page>
+ </extension>
+
+ <extension point="org.eclipse.ui.propertyPages">
+ <page
+ name="%PreferencePage_WebXML_Validator"
+ class="org.jboss.tools.jst.web.ui.internal.preferences.WebXMLValidatorPreferencePage"
+ id="org.jboss.tools.jst.web.ui.propertyPages.WebXMLValidatorPreferencePage">
+ <enabledWhen>
+ <and>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <or>
+ <test property="org.eclipse.core.resources.projectNature"
value="org.jboss.tools.jsf.jsfnature"/>
+ </or>
+ </adapt>
+ </and>
+ </enabledWhen>
+ <keywordReference id="org.eclipse.wst.html.ui.webcontent"/>
+ </page>
+ </extension>
</plugin>
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java 2011-11-23
00:52:58 UTC (rev 36553)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.internal.preferences;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock;
+import org.jboss.tools.jst.web.WebModelPlugin;
+import org.jboss.tools.jst.web.ui.WebUiPlugin;
+import org.jboss.tools.jst.web.validation.WebXMLPreferences;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class WebXMLConfigurationBlock extends SeverityConfigurationBlock {
+
+ private static final String SETTINGS_SECTION_NAME =
"WebXMLConfigurationBlock"; //$NON-NLS-1$
+
+ private static SectionDescription SECTION_CLASS_REFERENCES = new SectionDescription(
+ WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_section_classreferences,
+ new String[][]{
+ {WebXMLPreferences.INVALID_EXCEPTION_TYPE,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidExceptionType_label},
+ {WebXMLPreferences.INVALID_SERVLET_CLASS,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidServletClass_label},
+ {WebXMLPreferences.INVALID_FILTER_CLASS,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidFilterClass_label},
+ {WebXMLPreferences.INVALID_LISTENER_CLASS,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidListenerClass_label},
+ {WebXMLPreferences.INVALID_MESSAGE_DESTINATION_TYPE,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidMessageDestinationType_label},
+ {WebXMLPreferences.INVALID_RES_TYPE,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidResType_label},
+ },
+ WebModelPlugin.PLUGIN_ID
+ );
+
+ private static SectionDescription SECTION_RESOURCE_REFERENCES = new SectionDescription(
+ WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_section_resourcereferences,
+ new String[][]{
+ {WebXMLPreferences.INVALID_ERROR_PAGE_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidErrorPageRef_label},
+ {WebXMLPreferences.INVALID_FORM_ERROR_PAGE_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidFormErrorPageRef_label},
+ {WebXMLPreferences.INVALID_FORM_LOGIN_PAGE_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidFormLoginPageRef_label},
+ {WebXMLPreferences.INVALID_JSP_FILE_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidJspFileRef_label},
+ {WebXMLPreferences.INVALID_ICON_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidIconRef_label},
+ {WebXMLPreferences.INVALID_TAGLIB_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidTaglibRef_label},
+ {WebXMLPreferences.INVALID_WELCOME_FILE_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidWelcomeFileRef_label},
+ },
+ WebModelPlugin.PLUGIN_ID
+ );
+
+ private static SectionDescription SECTION_OBJECT_REFERENCES = new SectionDescription(
+ WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_section_objectreferences,
+ new String[][]{
+ {WebXMLPreferences.INVALID_SERVLET_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidServletRef_label},
+ {WebXMLPreferences.INVALID_FILTER_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidFilterRef_label},
+ {WebXMLPreferences.INVALID_ROLE_REF,
WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_pb_invalidRoleRef_label},
+ },
+ WebModelPlugin.PLUGIN_ID
+ );
+
+ private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ SECTION_CLASS_REFERENCES,
+ SECTION_RESOURCE_REFERENCES,
+ SECTION_OBJECT_REFERENCES,
+ };
+
+ private static Key[] getKeys() {
+ ArrayList<Key> keys = new ArrayList<Key>();
+ for (SectionDescription s: ALL_SECTIONS) {
+ s.collectKeys(keys);
+ }
+ keys.add(MAX_NUMBER_OF_PROBLEMS_KEY);
+ return keys.toArray(new Key[0]);
+ }
+
+ private static final Key MAX_NUMBER_OF_PROBLEMS_KEY = getKey(WebModelPlugin.PLUGIN_ID,
SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME);
+
+ @Override
+ protected Key getMaxNumberOfProblemsKey() {
+ return MAX_NUMBER_OF_PROBLEMS_KEY;
+ }
+
+ public WebXMLConfigurationBlock(IStatusChangeListener context,
+ IProject project, IWorkbenchPreferenceContainer container) {
+ super(context, project, getKeys(), container);
+ }
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return ALL_SECTIONS;
+ }
+
+ @Override
+ protected String getCommonDescription() {
+ return WebXMLPreferencesMessages.WebXMLValidatorConfigurationBlock_common_description;
+ }
+
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ return WebUiPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
+ }
+
+ @Override
+ protected String getQualifier() {
+ return WebModelPlugin.PLUGIN_ID;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.java 2011-11-23
00:52:58 UTC (rev 36553)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.internal.preferences;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class WebXMLPreferencesMessages extends NLS {
+ private static final String BUNDLE_NAME = WebXMLPreferencesMessages.class.getName();
+
+ // Validator Preference page
+ public static String WebXMLValidatorConfigurationBlock_common_description;
+
+ // Section Name
+ public static String WebXMLValidatorConfigurationBlock_section_classreferences;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidExceptionType_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidFilterClass_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidListenerClass_label;
+ public static String
WebXMLValidatorConfigurationBlock_pb_invalidMessageDestinationType_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidResType_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidServletClass_label;
+
+ public static String WebXMLValidatorConfigurationBlock_section_resourcereferences;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidErrorPageRef_label;
+ public static String
WebXMLValidatorConfigurationBlock_pb_invalidFormErrorPageRef_label;
+ public static String
WebXMLValidatorConfigurationBlock_pb_invalidFormLoginPageRef_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidJspFileRef_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidIconRef_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidTaglibRef_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidWelcomeFileRef_label;
+
+ public static String WebXMLValidatorConfigurationBlock_section_objectreferences;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidServletRef_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidFilterRef_label;
+ public static String WebXMLValidatorConfigurationBlock_pb_invalidRoleRef_label;
+
+ public static String PREFERENCE_PAGE_WEB_XML_VALIDATOR;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, WebXMLPreferencesMessages.class);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.properties
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.properties 2011-11-23
00:52:58 UTC (rev 36553)
@@ -0,0 +1,37 @@
+##################################################################################
+### Copyright (c) 2009 Red Hat, Inc.
+### Distributed under license by Red Hat, Inc. All rights reserved.
+### This program is 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:
+### Red Hat, Inc. - initial API and implementation
+##################################################################################
+
+WebXMLValidatorConfigurationBlock_common_description=Select the severity level for the
following optional web.xml Validator problems:
+
+##Section Channel ID Ref
+WebXMLValidatorConfigurationBlock_section_classreferences=Class References
+WebXMLValidatorConfigurationBlock_pb_invalidExceptionType_label=Invalid exception type:
+WebXMLValidatorConfigurationBlock_pb_invalidFilterClass_label=Invalid filter class:
+WebXMLValidatorConfigurationBlock_pb_invalidListenerClass_label=Invalid listener class:
+WebXMLValidatorConfigurationBlock_pb_invalidMessageDestinationType_label=Invalid message
destination type:
+WebXMLValidatorConfigurationBlock_pb_invalidResType_label=Invalid res-type:
+WebXMLValidatorConfigurationBlock_pb_invalidServletClass_label=Invalid servlet class:
+
+WebXMLValidatorConfigurationBlock_section_resourcereferences=Resource References
+WebXMLValidatorConfigurationBlock_pb_invalidErrorPageRef_label=Invalid error page:
+WebXMLValidatorConfigurationBlock_pb_invalidFormErrorPageRef_label=Invalid form error
page:
+WebXMLValidatorConfigurationBlock_pb_invalidFormLoginPageRef_label=Invalid form login
page:
+WebXMLValidatorConfigurationBlock_pb_invalidJspFileRef_label=Invalid jsp file:
+WebXMLValidatorConfigurationBlock_pb_invalidIconRef_label=Invalid icon:
+WebXMLValidatorConfigurationBlock_pb_invalidTaglibRef_label=Invalid taglib:
+WebXMLValidatorConfigurationBlock_pb_invalidWelcomeFileRef_label=Invalid welcome file:
+
+WebXMLValidatorConfigurationBlock_section_objectreferences=Object References
+WebXMLValidatorConfigurationBlock_pb_invalidServletRef_label=Invalid servlet reference:
+WebXMLValidatorConfigurationBlock_pb_invalidFilterRef_label=Invalid filter reference:
+WebXMLValidatorConfigurationBlock_pb_invalidRoleRef_label=Invalid role reference:
+
+PREFERENCE_PAGE_WEB_XML_VALIDATOR=Web XML Validator
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLPreferencesMessages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java 2011-11-23
00:52:58 UTC (rev 36553)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.internal.preferences;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.jst.web.WebModelPlugin;
+import org.jboss.tools.jst.web.validation.WebXMLCoreValidator;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class WebXMLValidatorPreferencePage extends SeverityPreferencePage {
+
+ public static final String PREF_ID = WebXMLCoreValidator.PREFERENCE_PAGE_ID;
+ public static final String PROP_ID =
"org.jboss.tools.jst.web.ui.propertyPages.WebXMLValidatorPreferencePage";
//$NON-NLS-1$
+
+ public WebXMLValidatorPreferencePage() {
+ setPreferenceStore(WebModelPlugin.getDefault().getPreferenceStore());
+ setTitle(WebXMLPreferencesMessages.PREFERENCE_PAGE_WEB_XML_VALIDATOR);
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPreferencePageID()
+ */
+ @Override
+ protected String getPreferencePageID() {
+ return PREF_ID;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPropertyPageID()
+ */
+ @Override
+ protected String getPropertyPageID() {
+ return PROP_ID;
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer)
getContainer();
+ fConfigurationBlock = new WebXMLConfigurationBlock(getNewStatusChangedListener(),
getProject(), container);
+
+ super.createControl(parent);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain