本文整理汇总了Java中org.eclipse.wst.validation.internal.provisional.core.IReporter.displaySubtask方法的典型用法代码示例。如果您正苦于以下问题:Java IReporter.displaySubtask方法的具体用法?Java IReporter.displaySubtask怎么用?Java IReporter.displaySubtask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.wst.validation.internal.provisional.core.IReporter
的用法示例。
在下文中一共展示了IReporter.displaySubtask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateDelta
import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
private void validateDelta(IValidationContext helper, IReporter reporter) {
String[] deltaArray = helper.getURIs();
for (int i = 0; i < deltaArray.length; i++) {
String delta = deltaArray[i];
if (delta == null)
continue;
if (reporter != null) {
IMessage message = new LocalizedMessage(IMessage.LOW_SEVERITY,
delta.substring(1));
reporter.displaySubtask(this, message);
}
IResource resource = getResource(delta);
if (resource == null || !(resource instanceof IFile))
continue;
validateFile(helper, reporter, (IFile) resource, null);
}
}
示例2: validateContainer
import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
private void validateContainer(IValidationContext helper,
IReporter reporter, IContainer container) {
try {
IResource[] resourceArray = container.members(false);
for (int i = 0; i < resourceArray.length; i++) {
IResource resource = resourceArray[i];
if (resource == null || reporter.isCancelled())
continue;
if (resource instanceof IFile) {
IMessage message = new LocalizedMessage(
IMessage.LOW_SEVERITY, resource.getFullPath()
.toString().substring(1));
reporter.displaySubtask(this, message);
validateFile(helper, reporter, (IFile) resource, null);
} else if (resource instanceof IContainer) {
validateContainer(helper, reporter, (IContainer) resource);
}
}
} catch (CoreException ex) {
}
}
示例3: validate
import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
/**
* Validate the given file and use the reporter for the validation messages.
* This method does not perform the validation logic but rather delegates to
* the validate method in subclasses to validate. This method is responsible
* for reporting the messages that result from validation.
*
* @param file
* An IFile to validate.
* @param inputstream
* An InputStream that represents the file. The InputStream may
* be null in which case the files should be validated from the
* IFile.
* @param result
* - The validation result
* @param reporter
* The reporter with which to report validation messages.
* @param context
* The context of the current validation.
*/
private void validate(IFile file, InputStream inputstream,
ValidationResult result, IReporter reporter,
NestedValidatorContext context) {
Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, file
.getFullPath().toString());
reporter.displaySubtask(this, message);
String locationString = null;
if (file.getLocation() != null) {
locationString = file.getLocation().toString();
}
if (locationString == null && file.getLocationURI() != null) {
locationString = file.getLocationURI().toString();
}
if (locationString == null) {
locationString = file.getFullPath().toString();
}
String uri = createURIForFilePath(locationString);
clearMarkers(file, this, reporter);
ValidationReport valreport = null;
if (result == null)
valreport = validate(uri, inputstream, context);
else
valreport = validate(uri, inputstream, context, result);
createMarkers(file, valreport.getValidationMessages(), reporter);
try {
file.setSessionProperty(
ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME,
valreport.getNestedMessages());
} catch (CoreException e) {
System.out.println("Unable to set nested messages property."); //$NON-NLS-1$
}
}