org.eclipse.ui.ide.IDE.gotoMarker()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(401)

本文整理了Java中org.eclipse.ui.ide.IDE.gotoMarker()方法的一些代码示例,展示了IDE.gotoMarker()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IDE.gotoMarker()方法的具体详情如下:
包路径:org.eclipse.ui.ide.IDE
类名称:IDE
方法名:gotoMarker

IDE.gotoMarker介绍

[英]Sets the cursor and selection state for the given editor to reveal the position of the given marker. This is done on a best effort basis. If the editor does not provide an IGotoMarker interface (either directly or via IAdaptable.getAdapter), this has no effect.
[中]设置给定编辑器的光标和选择状态,以显示给定标记的位置。这是在尽最大努力的基础上完成的。如果编辑器不提供IGotoMarker接口(直接或通过IAdaptable.getAdapter),则此操作无效。

代码示例

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
public boolean selectReveal(Object object) {
  if (object instanceof IMarker) {
    IDE.gotoMarker(this, (IMarker) object);
    return true;
  }
  return false;
}

代码示例来源:origin: ajermakovics/eclipse-instasearch

public void run() 
  {
    IDE.gotoMarker(editor, selectedMarker);
  }
};

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void gotoMarker(IMarker marker)
{
 setActivePage(SOURCE_PAGE_INDEX);
 IDE.gotoMarker(structuredTextEditor, marker);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui

void gotoMarker(IMarker marker) {
  setActivePage(fSourcePageIndex);
  IDE.gotoMarker(fTextEditor, marker);
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

private static void showWithMarker(IEditorPart editor, IFile file, int offset, int length) {
  try {
    IMarker marker = file.createMarker(NewSearchUI.SEARCH_MARKER);
    HashMap<String, Integer> attributes = new HashMap<>(4);
    attributes.put(IMarker.CHAR_START, Integer.valueOf(offset));
    attributes.put(IMarker.CHAR_END, Integer.valueOf(offset + length));
    marker.setAttributes(attributes);
    IDE.gotoMarker(editor, marker);
    marker.delete();
  } catch (CoreException e) {
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private 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) {
    throw new PartInitException(SearchMessages.JavaSearchResultPage_error_marker, e); 
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException {
  try {
    IMarker marker= file.createMarker(NewSearchUI.SEARCH_MARKER);
    HashMap<String, Integer> 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) {
    throw new PartInitException(SearchMessages.JavaSearchResultPage_error_marker, e);
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException {
  try {
    IMarker marker= file.createMarker(NewSearchUI.SEARCH_MARKER);
    HashMap<String, Integer> attributes= new HashMap<>(4);
    attributes.put(IMarker.CHAR_START, Integer.valueOf(offset));
    attributes.put(IMarker.CHAR_END, Integer.valueOf(offset + length));
    marker.setAttributes(attributes);
    IDE.gotoMarker(editor, marker);
    marker.delete();
  } catch (CoreException e) {
    throw new PartInitException(SearchMessages.JavaSearchResultPage_error_marker, e);
  }
}

代码示例来源:origin: biz.aQute/aQute.bnd

public void gotoMarker(IMarker marker) {
  setActivePage(0);
  IDE.gotoMarker(getEditor(0), marker);
}

代码示例来源:origin: biz.aQute/bnd

public void gotoMarker(IMarker marker) {
  setActivePage(0);
  IDE.gotoMarker(getEditor(0), marker);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.search

private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException {
  IMarker marker= null;
  try {
    marker= file.createMarker(NewSearchUI.SEARCH_MARKER);
    HashMap<String, Integer> attributes= new HashMap<>(4);
    attributes.put(IMarker.CHAR_START, Integer.valueOf(offset));
    attributes.put(IMarker.CHAR_END, Integer.valueOf(offset + length));
    marker.setAttributes(attributes);
    IDE.gotoMarker(editor, marker);
  } catch (CoreException e) {
    throw new PartInitException(SearchMessages.FileSearchPage_error_marker, e);
  } finally {
    if (marker != null)
      try {
        marker.delete();
      } catch (CoreException e) {
        // ignore
      }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.search

private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException {
  IMarker marker= null;
  try {
    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);
  } catch (CoreException e) {
    throw new PartInitException(SearchMessages.FileSearchPage_error_marker, e); 
  } finally {
    if (marker != null)
      try {
        marker.delete();
      } catch (CoreException e) {
        // ignore
      }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.common.ui

private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException {
  IMarker marker= null;
  try {
    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);
  } catch (CoreException e) {
    throw new PartInitException(SearchMessages.FileSearchPage_error_marker, e); 
  } finally {
    if (marker != null)
      try {
        marker.delete();
      } catch (CoreException e) {
        // ignore
      }
  }
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
public void gotoMarker(IMarker marker) {
  IResource resource = marker.getResource();
  InputContext context = fInputContextManager.findContext(resource);
  if (context == null)
    return;
  IFormPage page = getActivePageInstance();
  if (!context.getId().equals(page.getId()))
    page = setActivePage(context.getId());
  IDE.gotoMarker(page, marker);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

@Override
public void run() {
  IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
  if (dwindow == null) {
    return;
  }
  IWorkbenchPage page= dwindow.getActivePage();
  if (page == null) {
    return;
  }
  IStructuredSelection selection= getStructuredSelection();
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  IEditorPart part= null;
  if (input != null) {
    String editorId = fgPresentation.getEditorId(input, breakpoint);
    if (editorId != null) {
      try {
        part= page.openEditor(input, editorId, true, IWorkbenchPage.MATCH_INPUT | IWorkbenchPage.MATCH_ID);
      } catch (PartInitException e) {
        DebugUIPlugin.errorDialog(dwindow.getShell(), ActionMessages.OpenBreakpointMarkerAction_Go_to_Breakpoint_1, ActionMessages.OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2, e); //
      }
    }
  }
  if (part != null) {
    IDE.gotoMarker(part, breakpoint.getMarker());
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

gotoMarker(editor, marker);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

IDE.gotoMarker(result, marker);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

if (file != null) {
  if (selectedMarker.getResource().equals(file)) {
    IDE.gotoMarker(editor, selectedMarker);

相关文章