Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 164717 Details for
Bug 307922
Ability to remove validators
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Add extension point to remove validator
patch.txt (text/plain), 9.44 KB, created by
Wini Mark
on 2010-04-13 10:08:32 EDT
(
hide
)
Description:
Add extension point to remove validator
Filename:
MIME Type:
Creator:
Wini Mark
Created:
2010-04-13 10:08:32 EDT
Size:
9.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.validation >Index: vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java,v >retrieving revision 1.17 >diff -u -r1.17 ValidatorExtensionReader.java >--- vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java 19 Jan 2009 20:29:42 -0000 1.17 >+++ vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java 13 Apr 2010 13:56:30 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2009 IBM Corporation and others. >+ * Copyright (c) 2007, 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 >@@ -104,6 +104,13 @@ > } > > } >+ >+ for (String removedValidator : getRemovedValidators()){ >+ if (removedValidator != null) { >+ map.remove(removedValidator); >+ } >+ } >+ > return map.values(); > > } >@@ -221,6 +228,22 @@ > } > > /** >+ * Answer the extension point for removing a validator. >+ * >+ * @return list of validator ID or null if no validator will be removed >+ */ >+ private List<String> getRemovedValidators(){ >+ IExtensionRegistry registry = Platform.getExtensionRegistry(); >+ IExtensionPoint extensionPoint = registry.getExtensionPoint(ValidationPlugin.PLUGIN_ID, ExtensionConstants.removedValidatorExtension); >+ List<String> val = new LinkedList<String>(); >+ for (IExtension ext : extensionPoint.getExtensions()){ >+ for (IConfigurationElement validator : ext.getConfigurationElements()){ >+ val.add(validator.getAttribute(ExtensionConstants.RemovedValidator.validatorIDAttr)); >+ } >+ } >+ return val; >+ } >+ /** > * Process a message element for the validator, by creating a MessageCategory for it. > * > * @param ce a MessageCategory element. >Index: vf2/org/eclipse/wst/validation/internal/ExtensionConstants.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ExtensionConstants.java,v >retrieving revision 1.10 >diff -u -r1.10 ExtensionConstants.java >--- vf2/org/eclipse/wst/validation/internal/ExtensionConstants.java 7 Oct 2008 21:02:17 -0000 1.10 >+++ vf2/org/eclipse/wst/validation/internal/ExtensionConstants.java 13 Apr 2010 13:56:30 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 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 >@@ -67,6 +67,10 @@ > /** rules - extension point to declare a validator group */ > String group = "validatorGroup"; //$NON-NLS-1$ > >+ /** removeV2Validator - extension point to remove a V2 validator */ >+ String removedValidatorExtension = "removeV2Validator"; //$NON-NLS-1$ >+ >+ > interface Group { > /* > * The group sub-element for either the validatorGroup or validator >@@ -175,6 +179,10 @@ > String id = "id"; //$NON-NLS-1$ > } > >+ interface RemovedValidator { >+ /** validatorId - the validator ID. The String represents the validator that will be removed */ >+ String validatorIDAttr = "validatorId"; //$NON-NLS-1$ >+ } > /** true */ > String True = "true"; //$NON-NLS-1$ > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/plugin.xml,v >retrieving revision 1.23 >diff -u -r1.23 plugin.xml >--- plugin.xml 21 Apr 2008 19:52:36 -0000 1.23 >+++ plugin.xml 13 Apr 2010 13:56:30 -0000 >@@ -10,7 +10,8 @@ > <extension-point id="validationHelper" name="validationHelper" schema="xsds/validationHelper.exsd"/> > <extension-point id="validatorDelegates" name="%ValidatorDelegates" schema="xsds/validatorDelegates.exsd"/> > <extension-point id="validatorGroup" name="Validator Group" schema="xsds/validatorgroup.exsd"/> >- <extension-point id="exclude" name="Validator Exclusions" schema="xsds/exclude.exsd"/> >+ <extension-point id="exclude" name="Validator Exclusions" schema="xsds/exclude.exsd"/> >+ <extension-point id="removeV2Validator" name="%removeV2Validator" schema="xsds/removeV2Validator.exsd"/> > > <!--============================--> > <!-- Validation Contributions --> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.validation/plugin.properties,v >retrieving revision 1.12 >diff -u -r1.12 plugin.properties >--- plugin.properties 11 Apr 2010 07:09:29 -0000 1.12 >+++ plugin.properties 13 Apr 2010 13:56:30 -0000 >@@ -24,3 +24,4 @@ > Bundle-Vendor.0 = Eclipse Web Tools Platform > > Extension.validator=Validator (Version 2) >+removeV2Validator=Remove V2 Validator >\ No newline at end of file >Index: xsds/removeV2Validator.exsd >=================================================================== >RCS file: xsds/removeV2Validator.exsd >diff -N xsds/removeV2Validator.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ xsds/removeV2Validator.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,123 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.wst.validation" xmlns="http://www.w3.org/2001/XMLSchema"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.wst.validation" id="removeV2Validator" name="Remove V2 Validator"/> >+ </appInfo> >+ <documentation> >+ This is used to remove a V2 validator. By specifying the validator ID, the corresponding validator will be removed as if it hasn't been registered. The removed validator will not be shown in the Preferences page. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appInfo> >+ <meta.element /> >+ </appInfo> >+ </annotation> >+ <complexType> >+ <sequence> >+ <element ref="remove" minOccurs="1" maxOccurs="unbounded"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="remove"> >+ <annotation> >+ <documentation> >+ Define the validator that will be removed. >+ </documentation> >+ </annotation> >+ <complexType> >+ <attribute name="validatorId" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The validator ID that will be removed. >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ WebTools 3.2 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ An example to remove the XSL validator >+ >+<extension >+ point="org.eclipse.wst.validation.removeV2Validator"> >+ <remove >+ validatorId="com.ibm.xtt.xsl.core.xsl"> >+ </remove> >+ </extension> >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiinfo"/> >+ </appInfo> >+ <documentation> >+ Provisional API. >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="implementation"/> >+ </appInfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ Copyright (c) 2010 IBM Corporation and others.<br> >+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 <a >+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >+ </documentation> >+ </annotation> >+ >+</schema>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 307922
:
164717
|
164759