org.eclipse.emf.cdo.ui

## Class CDOEditorUtil

- java.lang.Object
- - org.eclipse.emf.cdo.ui.CDOEditorUtil

-     public final class CDOEditorUtil
      extends Object

  Some utility methods to cope with CDOEditor and CDOEditorInput
  Since:
    2.0
  Author:
    Victor Roldan Betancort

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EDITOR_ID`
    `static String` | `TEXT_EDITOR_ID`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CDOEditorInput` | `createCDOEditorInput(CDOView view, String resourcePath, boolean viewOwned)` Returns an implementation of the CDOEditorInput interface.
    `static CDOEditorInput` | `createCDOEditorInputWithEditingDomain(CDOEditorInput input, EditingDomain editingDomain)` Creates a `CDOEditorInput` based on the given `input` that adapts to the `IEditingDomainProvider` interface to provide a particular `editingDomain`.
    `static CDOEditorInput` | `createCDOEditorInputWithEditingDomain(CDOView view, String resourcePath, boolean viewOwned, EditingDomain editingDomain)` Creates a `CDOEditorInput` that adapts to the `IEditingDomainProvider` interface to provide a particular `editingDomain`.
    `static IEditorInput` | `createEditorInput(String editorID, CDOResourceLeaf resource)` Returns an implementation of the IEditorInput interface.
    `static IEditorInput` | `createEditorInput(String editorID, CDOResourceLeaf resource, boolean viewOwned)` Returns an implementation of the IEditorInput interface.
    `static IEditorInput` | `createEditorInput(String editorID, CDOResourceLeaf resource, boolean viewOwned, boolean lobCommitOnSave)`
    `static IEditorReference[]` | `findEditor(IWorkbenchPage page, CDOView view, String resourcePath)` Returns references to possibly opened instances of CDOEditor with certain CDOView and resource
    `static String[]` | `getAllEditorIDs(CDOResourceLeaf resource)`
    `static String` | `getEditorID()`
    `static String` | `getEffectiveEditorID(CDOResourceLeaf resource)`
    `static void` | `openEditor(IWorkbenchPage page, CDOResourceLeaf resource)` Opens the specified resource in CDOEditor
    `static void` | `openEditor(IWorkbenchPage page, CDOView view, String resourcePath)` Opens the specified resource in CDOEditor
    `static void` | `openEditor(IWorkbenchPage page, String editorID, CDOResourceLeaf resource)` Opens the specified resource in CDOEditor
    `static void` | `populateMenu(IMenuManager manager, CDOResourceLeaf resource, IWorkbenchPage page)`
    `static void` | `refreshEditors(IWorkbenchPage page, CDOView view)` Refreshes all editor's viewers that are using certain CDOView.
    `static void` | `setEditorID(String editorID)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EDITOR_ID

          public static final String EDITOR_ID

      Since:
        4.1
      See Also:
        Constant Field Values

    - #### TEXT_EDITOR_ID

          public static final String TEXT_EDITOR_ID

      Since:
        4.4
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getEditorID

          public static String getEditorID()

      Since:
        4.1

    - #### setEditorID

          public static void setEditorID(String editorID)

      Since:
        4.1

    - #### createCDOEditorInput

          public static CDOEditorInput createCDOEditorInput(CDOView view,
                                                            String resourcePath,
                                                            boolean viewOwned)

      Returns an implementation of the CDOEditorInput interface.

    - #### createCDOEditorInputWithEditingDomain

          public static CDOEditorInput createCDOEditorInputWithEditingDomain(CDOEditorInput input,
                                                                             EditingDomain editingDomain)

      Creates a `CDOEditorInput` based on the given `input` that adapts to the `IEditingDomainProvider` interface to provide a particular `editingDomain`.
      Parameters:
        `input` - an editor input to copy
        `editingDomain` - the editing domain to associate with the editor input
      Returns:
        the editing-domain-providing editor input
      Since:
        4.3

    - #### createCDOEditorInputWithEditingDomain

          public static CDOEditorInput createCDOEditorInputWithEditingDomain(CDOView view,
                                                                             String resourcePath,
                                                                             boolean viewOwned,
                                                                             EditingDomain editingDomain)

      Creates a `CDOEditorInput` that adapts to the `IEditingDomainProvider` interface to provide a particular `editingDomain`.
      Parameters:
        `view` - the CDO view of the editor input
        `resourcePath` - the path to the resource to edit
        `viewOwned` - whether the opened editor should assume ownership of the `view`
        `editingDomain` - the editing domain to associate with the editor input
      Returns:
        the editing-domain-providing editor input
      Since:
        4.3

    - #### openEditor

          public static void openEditor(IWorkbenchPage page,
                                        CDOView view,
                                        String resourcePath)

      Opens the specified resource in CDOEditor
      Parameters:
        `page` - The page in which the editor will be opened
        `view` - the CDOView that will be used to access the resource
        `resourcePath` - absolute path to the resource in the repository

    - #### findEditor

          public static IEditorReference[] findEditor(IWorkbenchPage page,
                                                      CDOView view,
                                                      String resourcePath)

      Returns references to possibly opened instances of CDOEditor with certain CDOView and resource
      Parameters:
        `page` - The page where to search for opened editors
        `view` - The editors to find are using the specified CDOView
        `resourcePath` - The editors are editing the CDOResource specified with this path

    - #### populateMenu

          public static void populateMenu(IMenuManager manager,
                                          CDOResourceLeaf resource,
                                          IWorkbenchPage page)

      Since:
        4.2

    - #### getEffectiveEditorID

          public static String getEffectiveEditorID(CDOResourceLeaf resource)

      Since:
        4.2

    - #### getAllEditorIDs

          public static String[] getAllEditorIDs(CDOResourceLeaf resource)

      Since:
        4.2

    - #### createEditorInput

          public static IEditorInput createEditorInput(String editorID,
                                                       CDOResourceLeaf resource,
                                                       boolean viewOwned,
                                                       boolean lobCommitOnSave)

      Since:
        4.4

    - #### createEditorInput

          public static IEditorInput createEditorInput(String editorID,
                                                       CDOResourceLeaf resource,
                                                       boolean viewOwned)

      Returns an implementation of the IEditorInput interface.
      Since:
        4.2

    - #### createEditorInput

          public static IEditorInput createEditorInput(String editorID,
                                                       CDOResourceLeaf resource)

      Returns an implementation of the IEditorInput interface.
      Since:
        4.2

    - #### openEditor

          public static void openEditor(IWorkbenchPage page,
                                        CDOResourceLeaf resource)

      Opens the specified resource in CDOEditor
      Parameters:
        `page` - The page in which the editor will be opened
      Since:
        4.2

    - #### openEditor

          public static void openEditor(IWorkbenchPage page,
                                        String editorID,
                                        CDOResourceLeaf resource)

      Opens the specified resource in CDOEditor
      Parameters:
        `page` - The page in which the editor will be opened
      Since:
        4.2

    - #### refreshEditors

          public static void refreshEditors(IWorkbenchPage page,
                                            CDOView view)

      Refreshes all editor's viewers that are using certain CDOView.
      Parameters:
        `page` - the IWorkbenchPage where CDOEditor is opened
        `view` - instance of CDOView our editors are using

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html