org.eclipse.ui.ide.IDE类的使用及代码示例

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

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

IDE介绍

[英]Collection of IDE-specific APIs factored out of existing workbench. This class cannot be instantiated; all functionality is provided by static methods and fields.
[中]从现有工作台中分离出来的特定于IDE的API集合。这个类不能被实例化;所有功能都由静态方法和字段提供。

代码示例

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

private IEditorPart showWithoutReuse(IFile file, IWorkbenchPage wbPage, String editorID, boolean activate) throws PartInitException {
  return IDE.openEditor(wbPage, file, editorID, activate);
}

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

public static IEditorDescriptor getEditorDescriptor(String name)
    throws PartInitException {
  return getEditorDescriptor(name, true);

代码示例来源: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: org.eclipse.pde/org.eclipse.pde.api.tools.ui

@Override
  public IStatus runInUIThread(IProgressMonitor monitor) {
    IEditorDescriptor edesc = null;
    try {
      edesc = IDE.getEditorDescriptor(index.getName());
      IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      IDE.openEditor(window.getActivePage(), index.toURI(), edesc.getId(), true);
    } catch (PartInitException e) {
      e.printStackTrace();
    }
    return Status.OK_STATUS;
  }
};

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

editor = openEditor(page, file, activate);
} else {
  editor = page.openEditor(new FileEditorInput(file), editorDesc
  gotoMarker(editor, marker);

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

/**
 * Returns the resolutions for the given marker.
 *
 * @param marker the marker for which to obtain resolutions
 * @return the resolutions for the selected marker
 */
private IMarkerResolution[] getResolutions(IMarker marker) {
  return IDE.getMarkerHelpRegistry().getResolutions(marker);
}

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

return getEditorDescriptor(file.getName(), PlatformUI.getWorkbench()
    .getEditorRegistry(), getDefaultEditor(file,
    determineContentType));

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

defaultEditor = getEditorDescriptor(name, editorReg, defaultEditor);
return overrideDefaultEditorAssociation(name, contentType, defaultEditor);

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

case SWT.Selection:
  if (menuItem.getSelection()) {
    IDE.setDefaultEditor(file, null);
    try {
      openEditor(IDE.getEditorDescriptor(file, true, true), false);
    } catch (PartInitException e) {
      DialogUtil.openError(page.getWorkbenchWindow()

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

/**
 * Save all dirty editors in the workbench that are open on files that may
 * be affected by this operation. Opens a dialog to prompt the user if
 * <code>confirm</code> is true. Return true if successful. Return false
 * if the user has canceled the command. Must be called from the UI thread.
 * @param resources the root resources being operated on
 * @param confirm prompt the user if true
 * @return boolean false if the operation was canceled.
 */
public final boolean saveAllEditors(IResource[] resources, boolean confirm) {
  return IDE.saveAllEditors(resources, confirm);
}

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

public IStatus runInUIThread(IProgressMonitor monitor) {
    IEditorDescriptor edesc = null;
    try {
      edesc = IDE.getEditorDescriptor(index.getName());
      IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      IDE.openEditor(window.getActivePage(), 
          index.toURI(), 
          edesc.getId(), 
          true);
    } catch (PartInitException e) {
      e.printStackTrace();
    }
    return Status.OK_STATUS;
  }
};

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

public static List<IMarkerResolution> getResolutions(IMarker marker) {
 IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(marker);
 List<IMarkerResolution> sortedResolutions = Arrays.asList(resolutions);
 Collections.sort(sortedResolutions,
   Comparator.<IMarkerResolution, Integer> comparing(MavenProblemResolution::getOrder)
     .thenComparing(IMarkerResolution::getLabel));
 return sortedResolutions;
}

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

/**
 * Performs the save of the editor parts returned by getScopedResources
 */
protected void doSave() {
  if(fSaves != null) {
    IDE.saveAllEditors(fSaves, false);
  }
}

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

@Override
  public void run() {
    try {
      IDE.openEditor(activePage, resource, true);
    } catch (PartInitException e) {
      JavaPlugin.log(e);
    }
  }
});

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

/**
 * Opens external file, the editor that is used is based on best guess from
 * file name.
 *
 * @param file
 *            the external file
 */
protected void openExternalFile(File file) {
  try {
    boolean activate = OpenStrategy.activateOnOpen();
    IEditorDescriptor desc = IDE.getEditorDescriptor(file.getName());
    IDE.openEditor(getWorkbenchPage(), file.toURI(), desc.getId(),
        activate);
  } catch (PartInitException e) {
    ErrorDialog.openError(getWorkbenchPage().getWorkbenchWindow()
        .getShell(),
        UIText.OpenWorkingFileAction_openWorkingFileShellTitle, e
            .getMessage(), e.getStatus());
  }
}

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

return getEditorDescriptor(file, true);

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

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

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

public static boolean hasResolutions(IMarker marker) {
  return IDE.getMarkerHelpRegistry().hasResolutions(marker);
 }
}

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

/**
 * Save all dirty editors in the workbench that are open on files that may
 * be affected by this operation. Opens a dialog to prompt the user if
 * <code>confirm</code> is true. Return true if successful. Return false
 * if the user has canceled the command. Must be called from the UI thread.
 * @param resources the root resources being operated on
 * @param confirm prompt the user if true
 * @return boolean false if the operation was canceled.
 */
public final boolean saveAllEditors(IResource[] resources, boolean confirm) {
  return IDE.saveAllEditors(resources, confirm);
}

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

public void run() {
    try {
      IDE.openEditor(activePage, resource, true);
    } catch (PartInitException e) {
      JavaPlugin.log(e);
    }
  }
});

相关文章