|
Lines 14-24
Link Here
|
| 14 |
import java.io.InputStream; |
14 |
import java.io.InputStream; |
| 15 |
|
15 |
|
| 16 |
import org.eclipse.core.resources.IFile; |
16 |
import org.eclipse.core.resources.IFile; |
| 17 |
import org.eclipse.core.resources.IWorkspaceRunnable; |
|
|
| 18 |
import org.eclipse.core.resources.ResourcesPlugin; |
| 19 |
import org.eclipse.core.runtime.CoreException; |
17 |
import org.eclipse.core.runtime.CoreException; |
| 20 |
import org.eclipse.core.runtime.IPath; |
18 |
import org.eclipse.core.runtime.IPath; |
| 21 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
|
| 22 |
import org.eclipse.wst.validation.internal.provisional.core.IMessage; |
19 |
import org.eclipse.wst.validation.internal.provisional.core.IMessage; |
| 23 |
import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport; |
20 |
import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport; |
| 24 |
import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage; |
21 |
import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage; |
|
Lines 77-97
Link Here
|
| 77 |
IPath path = file.getLocation(); |
74 |
IPath path = file.getLocation(); |
| 78 |
final String uri = createURIForFilePath(path.toString()); |
75 |
final String uri = createURIForFilePath(path.toString()); |
| 79 |
|
76 |
|
| 80 |
IWorkspaceRunnable op = new IWorkspaceRunnable() |
77 |
try |
| 81 |
{ |
78 |
{ |
| 82 |
public void run(IProgressMonitor progressMonitor) throws CoreException |
79 |
XMLValidator localValidator = XMLValidator.getInstance(); |
| 83 |
{ |
|
|
| 84 |
XMLValidator validator = XMLValidator.getInstance(); |
| 85 |
|
80 |
|
| 86 |
clearMarkers(file); |
81 |
clearMarkers(file); |
| 87 |
XMLValidationReport valreport = null; |
82 |
XMLValidationReport valreport = null; |
| 88 |
if (inputStream != null) |
83 |
if (inputStream != null) |
| 89 |
{ |
84 |
{ |
| 90 |
valreport = validator.validate(uri, inputStream); |
85 |
valreport = localValidator.validate(uri, inputStream); |
| 91 |
} |
86 |
} |
| 92 |
else |
87 |
else |
| 93 |
{ |
88 |
{ |
| 94 |
valreport = validator.validate(uri); |
89 |
valreport = localValidator.validate(uri); |
| 95 |
} |
90 |
} |
| 96 |
|
91 |
|
| 97 |
valoutcome.isValid = valreport.isValid(); |
92 |
valoutcome.isValid = valreport.isValid(); |
|
Lines 107-119
Link Here
|
| 107 |
createMarkers(file, valreport.getValidationMessages()); |
102 |
createMarkers(file, valreport.getValidationMessages()); |
| 108 |
|
103 |
|
| 109 |
file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages()); |
104 |
file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages()); |
| 110 |
} |
|
|
| 111 |
}; |
| 112 |
|
105 |
|
| 113 |
|
106 |
|
| 114 |
try |
|
|
| 115 |
{ |
| 116 |
ResourcesPlugin.getWorkspace().run(op, null); |
| 117 |
// String internalErrorMessage = null; |
107 |
// String internalErrorMessage = null; |
| 118 |
// if (validator.getInternalError() != null) |
108 |
// if (validator.getInternalError() != null) |
| 119 |
// { |
109 |
// { |