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

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

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

IDE.openEditorOnFileStore介绍

[英]Opens an editor on the given IFileStore object.

Unlike the other openEditor methods, this one can be used to open files that reside outside the workspace resource set.

If the page already has an editor open on the target object then that editor is brought to front; otherwise, a new editor is opened.
[中]打开给定IFileStore对象上的编辑器。
与其他openEditor方法不同,此方法可用于打开驻留在工作区资源集之外的文件。
如果页面已经在目标对象上打开了一个编辑器,那么该编辑器将被置于前面;否则,将打开一个新编辑器。

代码示例

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

private void openInEditor(File log) {
    IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(log.getAbsolutePath()));
    if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
      IWorkbenchWindow ww = PDEPlugin.getActiveWorkbenchWindow();
      IWorkbenchPage page = ww.getActivePage();
      try {
        IDE.openEditorOnFileStore(page, fileStore);
      } catch (PartInitException e) {
      }
    }
  }
}

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

public void run() {
  IPath logPath = new Path(fView.getLogFile().getAbsolutePath());
  IFileStore fileStore= EFS.getLocalFileSystem().getStore(logPath);
  if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
    IWorkbenchWindow ww = PDERuntimePlugin.getActiveWorkbenchWindow();
    IWorkbenchPage page = ww.getActivePage();
    try {
      IDE.openEditorOnFileStore(page, fileStore);
    } catch (PartInitException e) {
    }
  }
}

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

public void run() {
  IPath logPath = new Path(fView.getLogFile().getAbsolutePath());
  IFileStore fileStore = EFS.getLocalFileSystem().getStore(logPath);
  if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
    IWorkbenchWindow ww = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow();
    IWorkbenchPage page = ww.getActivePage();
    try {
      IDE.openEditorOnFileStore(page, fileStore);
    } catch (PartInitException e) { // do nothing
    }
  }
}

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

public Object execute(ExecutionEvent event) throws ExecutionException {
    FileNode node = getSelectedNodes(event).get(0);
    IPath path = new Path(node.getObject().getAbsolutePath());

    IFile file = ResourceUtil.getFileForLocation(path);
    if (file == null) {
      IFileStore store = EFS.getLocalFileSystem().getStore(path);
      try {
        IDE.openEditorOnFileStore(getView(event).getSite().getPage(),
            store);
      } catch (PartInitException e) {
        Activator.handleError(
            UIText.RepositoriesView_Error_WindowTitle, e, true);
      }
    } else
      try {
        IDE.openEditor(getView(event).getSite().getPage(), file);
      } catch (PartInitException e) {
        Activator.handleError(
            UIText.RepositoriesView_Error_WindowTitle, e, true);
      }
    return null;
  }
}

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

IWorkbenchPage page =  window.getActivePage();
try {
  IDE.openEditorOnFileStore(page, fileStore);
} catch (PartInitException e) {
  String msg =  NLS.bind(IDEWorkbenchMessages.OpenLocalFileAction_message_errorOnOpen, fileStore.getName());

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

IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(paths[i]));
try {
  IDE.openEditorOnFileStore(page, fileStore);
} catch (PartInitException e) {

相关文章