Esempio n. 1
0
 private static void showWithMarker(IEditorPart editor, IFile file, int offset, int length)
     throws PartInitException {
   try {
     IMarker marker = file.createMarker(NewSearchUI.SEARCH_MARKER);
     HashMap attributes = new HashMap(4);
     attributes.put(IMarker.CHAR_START, new Integer(offset));
     attributes.put(IMarker.CHAR_END, new Integer(offset + length));
     marker.setAttributes(attributes);
     IDE.gotoMarker(editor, marker);
     marker.delete();
   } catch (CoreException e) {
   }
 }
 /*
  * (non-Javadoc) Method declared on IEditorPart
  */
 public void gotoMarker(IMarker marker) {
   setActivePage(0);
   IDE.gotoMarker(getEditor(0), marker);
 }