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 35539 Details for
Bug 129953
Exploit New Validation Framework
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]
Patch to exploit the new validation framework
xml-patch (text/plain), 4.79 KB, created by
Gary Karasiuk
on 2006-03-01 10:05:08 EST
(
hide
)
Description:
Patch to exploit the new validation framework
Filename:
MIME Type:
Creator:
Gary Karasiuk
Created:
2006-03-01 10:05:08 EST
Size:
4.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.xml.ui >Index: src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/xml/plugins/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java,v >retrieving revision 1.4 >diff -u -r1.4 ValidateAction.java >--- src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java 10 Nov 2005 05:30:14 -0000 1.4 >+++ src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java 28 Feb 2006 21:25:59 -0000 >@@ -14,11 +14,8 @@ > import java.io.InputStream; > > import org.eclipse.core.resources.IFile; >-import org.eclipse.core.resources.IWorkspaceRunnable; >-import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; >-import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.wst.validation.internal.provisional.core.IMessage; > import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport; > import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage; >@@ -77,21 +74,19 @@ > IPath path = file.getLocation(); > final String uri = createURIForFilePath(path.toString()); > >- IWorkspaceRunnable op = new IWorkspaceRunnable() >+ try > { >- public void run(IProgressMonitor progressMonitor) throws CoreException >- { >- XMLValidator validator = XMLValidator.getInstance(); >+ XMLValidator localValidator = XMLValidator.getInstance(); > > clearMarkers(file); > XMLValidationReport valreport = null; > if (inputStream != null) > { >- valreport = validator.validate(uri, inputStream); >+ valreport = localValidator.validate(uri, inputStream); > } > else > { >- valreport = validator.validate(uri); >+ valreport = localValidator.validate(uri); > } > > valoutcome.isValid = valreport.isValid(); >@@ -107,13 +102,8 @@ > createMarkers(file, valreport.getValidationMessages()); > > file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages()); >- } >- }; > > >- try >- { >- ResourcesPlugin.getWorkspace().run(op, null); > // String internalErrorMessage = null; > // if (validator.getInternalError() != null) > // { >Index: src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/xml/plugins/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java,v >retrieving revision 1.5 >diff -u -r1.5 Validator.java >--- src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java 10 Nov 2005 05:30:14 -0000 1.5 >+++ src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java 28 Feb 2006 21:25:59 -0000 >@@ -19,6 +19,9 @@ > > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.jobs.ISchedulingRule; > import org.eclipse.osgi.util.NLS; > import org.eclipse.wst.validation.internal.core.Message; > import org.eclipse.wst.validation.internal.core.ValidationException; >@@ -26,8 +29,9 @@ > import org.eclipse.wst.validation.internal.provisional.core.IMessage; > import org.eclipse.wst.validation.internal.provisional.core.IReporter; > import org.eclipse.wst.validation.internal.provisional.core.IValidationContext; >-import org.eclipse.wst.validation.internal.provisional.core.IValidator; >+import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob; > import org.eclipse.wst.xml.ui.internal.XMLUIMessages; >+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin; > > /** > * A validator to plug the XML validator into the validation framework. >@@ -35,7 +39,7 @@ > * @author Craig Salter, IBM > * @author Lawrence Mandel, IBM > */ >-public class Validator implements IValidator >+public class Validator implements IValidatorJob > { > class LocalizedMessage extends Message { > private String _message = null; >@@ -203,4 +207,19 @@ > { > // Nothing to do. > } >+ >+public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException { >+ try { >+ validate(helper, reporter); >+ } >+ catch (Exception e) >+ { >+ return new Status(IStatus.ERROR, XMLUIPlugin.ID, 0, "Exception encountered during XML validation", e); >+ } >+ return Status.OK_STATUS; >+} >+ >+public ISchedulingRule getSchedulingRule(IValidationContext helper) { >+ return null; >+} > }
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 129953
: 35539