Runtime

## org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.util
Class IDEEditorUtil

    java.lang.Object
      org.eclipse.gmf.runtime.diagram.ui.resources.editor.util.EditorUtil
          org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.util.IDEEditorUtil

public class IDEEditorUtil
extends EditorUtil

Diagram utilities for IDE editors

Constructor Summary
`IDEEditorUtil()`

Method Summary
`static IFile` `createAndOpenDiagram(DiagramFileCreator diagramFileCreator, IPath containerPath, java.lang.String fileName, java.io.InputStream initialContents, java.lang.String kind, IWorkbenchWindow dWindow, IProgressMonitor progressMonitor, boolean openEditor, boolean saveDiagram)` Create and open a diagram.
`static DiagramEditPart` `openDiagram(IFile file, IWorkbenchWindow dWindow, boolean saveDiagram, IProgressMonitor progressMonitor)` Opens the diagram in an IEditorPart

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.resources.editor.util.EditorUtil
`createNewDiagramFile, getDefaultDiagramPath, getInitialContents`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### IDEEditorUtil

    public IDEEditorUtil()

Method Detail

### openDiagram

    public static final DiagramEditPart openDiagram(IFile file,
                                                    IWorkbenchWindow dWindow,
                                                    boolean saveDiagram,
                                                    IProgressMonitor progressMonitor)

  Opens the diagram in an IEditorPart

  Parameters:
    `file` - IFile that contains the diagram
    `dWindow` - the workbench window
    `saveDiagram` - true to save the diagram after opening, false to not save it.
    `progressMonitor` - used when opening the diagram. For now, it is only used when the diagram is being saved after opening.
  Returns:
    DiagramEditPart for the diagram opened in an IEditorPart.

### createAndOpenDiagram

    public static IFile createAndOpenDiagram(DiagramFileCreator diagramFileCreator,
                                             IPath containerPath,
                                             java.lang.String fileName,
                                             java.io.InputStream initialContents,
                                             java.lang.String kind,
                                             IWorkbenchWindow dWindow,
                                             IProgressMonitor progressMonitor,
                                             boolean openEditor,
                                             boolean saveDiagram)

  Create and open a diagram.

  Parameters:
    `diagramFileCreator` - that the new diagram is created from.
    `containerPath` - IPath for the container of the diagram file
    `fileName` - String of the name of the diagram
    `initialContents` - initial contents of the new diagram file
    `kind` - String of the kind of diagram to create
    `dWindow` -
    `progressMonitor` - IProgressMonitor to use when creating the new diagram and opening it
    `openEditor` - boolean true to open the editor after creating it, false to not open it after creating it
    `saveDiagram` - boolean true to save the diagram after creating it
  Returns:
    IFile containing the created diagram

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.