View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

Jai's Resources

Code

public void addProblemMarker(String aMessage, int aLine) {
IFile file = ((IFileEditorInput)getEditorInput()).getFile();
try {
IMarker marker = file.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
marker.setAttribute(IMarker.MESSAGE, aMessage);
marker.setAttribute(IMarker.LINE_NUMBER, aLine);
Position pos = new Position(getDocument().getLineOffset(aLine - 1));
getSourceViewer().getAnnotationModel().addAnnotation(
new MarkerAnnotation(marker), pos);
} catch (Exception e) {
VelocityPlugin.log(e);
}
}
LCC Dream Job.ppt