Package org.eclipse.emf.cdo.ui

## Class CDOItemProvider

- java.lang.Object
- - org.eclipse.jface.viewers.ViewerComparator
  - - org.eclipse.jface.viewers.ViewerSorter
    - - org.eclipse.net4j.util.ui.StructuredContentProvider<INPUT>
      - - org.eclipse.net4j.util.ui.views.ItemProvider<CONTAINER>
        - - org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>
          - - org.eclipse.emf.cdo.ui.CDOItemProvider

- All Implemented Interfaces:
    `java.util.EventListener`, `DelegatingStyledCellLabelProvider.IStyledLabelProvider`, `IBaseLabelProvider`, `IColorProvider`, `IContentProvider`, `IFontProvider`, `ILabelProvider`, `IStructuredContentProvider`, `ITreeContentProvider`, `org.eclipse.net4j.util.event.IListener`

      public class CDOItemProvider
      extends org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>

  Implements multiple functionality related with UI representation of basic CDO concepts on `TreeViewer`-based editors and views.

  For instance, behaves as `content` and `label` provider for concepts such as `CDOSession`, `CDOView`, `CDOResource` and `CDOResourceFolder`. It also providers common context menu action over those elements.

  Author:
    Eike Stepper
  See Also:
    `IContentProvider`, `ILabelProvider`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected static class` | `CDOItemProvider.EditorRegistryListener` | A `listener` on the platform's `editor registry` that fires `label events` from the associated `item provider` when `element` labels need to be updated.

    - ### Nested classes/interfaces inherited from class org.eclipse.net4j.util.ui.views.ContainerItemProvider

      `org.eclipse.net4j.util.ui.views.ContainerItemProvider.AbstractContainerNode, org.eclipse.net4j.util.ui.views.ContainerItemProvider.AbstractNode, org.eclipse.net4j.util.ui.views.ContainerItemProvider.ContainerNode, org.eclipse.net4j.util.ui.views.ContainerItemProvider.ErrorElement, org.eclipse.net4j.util.ui.views.ContainerItemProvider.FixedChildrenNode, org.eclipse.net4j.util.ui.views.ContainerItemProvider.LazyElement, org.eclipse.net4j.util.ui.views.ContainerItemProvider.LeafNode, org.eclipse.net4j.util.ui.views.ContainerItemProvider.Node, org.eclipse.net4j.util.ui.views.ContainerItemProvider.SlowElement`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.net4j.util.ui.views.ContainerItemProvider

      `ERROR_IMAGE, PENDING_COLOR, PENDING_IMAGE`

    - ### Fields inherited from class org.eclipse.net4j.util.ui.views.ItemProvider

      `NO_ELEMENTS`

    - ### Fields inherited from class org.eclipse.jface.viewers.ViewerSorter

      `collator`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CDOItemProvider​(IWorkbenchPage page)` |
    `CDOItemProvider​(IWorkbenchPage page, org.eclipse.net4j.util.ui.views.IElementFilter rootElementFilter)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `compare​(Viewer viewer, java.lang.Object e1, java.lang.Object e2)` |
    `void` | `dispose()` |
    `protected void` | `elementAdded​(java.lang.Object element, java.lang.Object parent)` |
    `void` | `fillBinaryResource​(IMenuManager manager, CDOBinaryResource resource)` |
    `void` | `fillBranch​(IMenuManager manager, CDOBranch branch)` |
    `void` | `fillContextMenu​(IMenuManager manager, ITreeSelection selection)` |
    `boolean` | `fillGenerated​(MenuManager manager, CDOSession session)` |
    `void` | `fillResource​(IMenuManager manager, CDOResource resource)` |
    `void` | `fillResourceFolder​(IMenuManager manager, CDOResourceFolder folder)` |
    `void` | `fillResourceLeaf​(IMenuManager manager, java.lang.Object object)` |
    `void` | `fillResourceNode​(IMenuManager manager, CDOResourceNode node)` |
    `void` | `fillSession​(IMenuManager manager, CDOSession session)` |
    `void` | `fillTextResource​(IMenuManager manager, CDOTextResource resource)` |
    `void` | `fillView​(IMenuManager manager, CDOView view)` |
    `java.lang.Object[]` | `getChildren​(java.lang.Object element)` |
    `protected java.lang.Object[]` | `getChildren​(CDOBranch branch)` |
    `Font` | `getFont​(java.lang.Object obj)` |
    `Color` | `getForeground​(java.lang.Object obj)` |
    `Image` | `getImage​(java.lang.Object obj)` |
    `java.lang.Object` | `getParent​(java.lang.Object element)` |
    `protected ResourceManager` | `getResourceManager()` |
    `java.lang.String` | `getText​(java.lang.Object obj)` |
    `static Image` | `getViewImage​(CDOView view)` |
    `static ImageDescriptor` | `getViewImageDescriptor​(CDOView view)` |
    `protected Image` | `getWorkbenchImage​(java.lang.String name)` |
    `boolean` | `hasChildren​(java.lang.Object element)` |
    `protected boolean` | `hasChildren​(CDOBranch branch)` |
    `boolean` | `isMergeMainBranchWithSession()` |
    `void` | `setMergeMainBranchWithSession​(boolean mergeMainBranchWithSession)` |
    `boolean` | `useFullPath​(java.lang.Object object)` |

    - ### Methods inherited from class org.eclipse.net4j.util.ui.views.ContainerItemProvider

      `addNode, clearNodesCache, connectInput, createContaineNode, createLeafNode, createNode, createSlowElement, createSlowInput, disconnectInput, elementRemoved, executeRunnable, filterRootElement, getContainerChildren, getErrorText, getNode, getNodes, getRoot, getRootElementFilter, getSlowText, handleElementEvent, handleInactiveElement, isComputeChildrenEagerly, isSlow, removeNode`

    - ### Methods inherited from class org.eclipse.net4j.util.ui.views.ItemProvider

      `addListener, fireLabelProviderChanged, fireLabelProviderChanged, fireLabelProviderChanged, getBackground, getElements, getListeners, getStyledText, isLabelProperty, removeListener`

    - ### Methods inherited from class org.eclipse.net4j.util.ui.StructuredContentProvider

      `expandElement, getBoldFont, getDisplay, getInput, getItalicFont, getViewer, inputChanged, notifyEvent, refreshElement, refreshSynced, refreshViewer, revealElement, selectElement, updateLabels`

    - ### Methods inherited from class org.eclipse.jface.viewers.ViewerSorter

      `getCollator`

    - ### Methods inherited from class org.eclipse.jface.viewers.ViewerComparator

      `category, getComparator, isSorterProperty, sort`

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

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

    - ### Methods inherited from interface org.eclipse.jface.viewers.IContentProvider

      `inputChanged`

- - ### Constructor Detail

    - #### CDOItemProvider

          public CDOItemProvider​(IWorkbenchPage page,
                                 org.eclipse.net4j.util.ui.views.IElementFilter rootElementFilter)

    - #### CDOItemProvider

          public CDOItemProvider​(IWorkbenchPage page)

  - ### Method Detail

    - #### dispose

          public void dispose()

      Specified by:
        `dispose` in interface `IBaseLabelProvider`
      Specified by:
        `dispose` in interface `IContentProvider`
      Overrides:
        `dispose` in class `org.eclipse.net4j.util.ui.StructuredContentProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### useFullPath

          public boolean useFullPath​(java.lang.Object object)

      Since:
        4.4

    - #### isMergeMainBranchWithSession

          public boolean isMergeMainBranchWithSession()

      Since:
        4.2

    - #### setMergeMainBranchWithSession

          public void setMergeMainBranchWithSession​(boolean mergeMainBranchWithSession)

      Since:
        4.2

    - #### getChildren

          public java.lang.Object[] getChildren​(java.lang.Object element)

      Specified by:
        `getChildren` in interface `ITreeContentProvider`
      Overrides:
        `getChildren` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### getChildren

          protected java.lang.Object[] getChildren​(CDOBranch branch)

      Since:
        4.2

    - #### hasChildren

          public boolean hasChildren​(java.lang.Object element)

      Specified by:
        `hasChildren` in interface `ITreeContentProvider`
      Overrides:
        `hasChildren` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### hasChildren

          protected boolean hasChildren​(CDOBranch branch)

      Since:
        4.2

    - #### getParent

          public java.lang.Object getParent​(java.lang.Object element)

      Specified by:
        `getParent` in interface `ITreeContentProvider`
      Overrides:
        `getParent` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### getText

          public java.lang.String getText​(java.lang.Object obj)

      Specified by:
        `getText` in interface `ILabelProvider`
      Overrides:
        `getText` in class `org.eclipse.net4j.util.ui.views.ItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### getImage

          public Image getImage​(java.lang.Object obj)

      Specified by:
        `getImage` in interface `DelegatingStyledCellLabelProvider.IStyledLabelProvider`
      Specified by:
        `getImage` in interface `ILabelProvider`
      Overrides:
        `getImage` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### getWorkbenchImage

          protected Image getWorkbenchImage​(java.lang.String name)

      Since:
        4.2

    - #### getResourceManager

          protected ResourceManager getResourceManager()

      Since:
        4.2

    - #### getForeground

          public Color getForeground​(java.lang.Object obj)

      Specified by:
        `getForeground` in interface `IColorProvider`
      Overrides:
        `getForeground` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### getFont

          public Font getFont​(java.lang.Object obj)

      Specified by:
        `getFont` in interface `IFontProvider`
      Overrides:
        `getFont` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### fillContextMenu

          public void fillContextMenu​(IMenuManager manager,
                                      ITreeSelection selection)

      Overrides:
        `fillContextMenu` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`
      Since:
        4.2

    - #### fillSession

          public void fillSession​(IMenuManager manager,
                                  CDOSession session)

      Since:
        4.2

    - #### fillGenerated

          public boolean fillGenerated​(MenuManager manager,
                                       CDOSession session)

      Since:
        4.2

    - #### fillView

          public void fillView​(IMenuManager manager,
                               CDOView view)

      Since:
        4.2

    - #### fillBranch

          public void fillBranch​(IMenuManager manager,
                                 CDOBranch branch)

      Since:
        4.2

    - #### fillResourceNode

          public void fillResourceNode​(IMenuManager manager,
                                       CDOResourceNode node)

      Since:
        4.4

    - #### fillResourceFolder

          public void fillResourceFolder​(IMenuManager manager,
                                         CDOResourceFolder folder)

      Since:
        4.2

    - #### fillResourceLeaf

          public void fillResourceLeaf​(IMenuManager manager,
                                       java.lang.Object object)

      Since:
        4.2

    - #### fillResource

          public void fillResource​(IMenuManager manager,
                                   CDOResource resource)

      Since:
        4.2

    - #### fillTextResource

          public void fillTextResource​(IMenuManager manager,
                                       CDOTextResource resource)

      Since:
        4.2

    - #### fillBinaryResource

          public void fillBinaryResource​(IMenuManager manager,
                                         CDOBinaryResource resource)

      Since:
        4.2

    - #### elementAdded

          protected void elementAdded​(java.lang.Object element,
                                      java.lang.Object parent)

      Overrides:
        `elementAdded` in class `org.eclipse.net4j.util.ui.views.ContainerItemProvider<org.eclipse.net4j.util.container.IContainer<java.lang.Object>>`

    - #### compare

          public int compare​(Viewer viewer,
                             java.lang.Object e1,
                             java.lang.Object e2)

      Overrides:
        `compare` in class `ViewerComparator`
      Since:
        4.2

    - #### getViewImageDescriptor

          public static ImageDescriptor getViewImageDescriptor​(CDOView view)

      Since:
        3.0

    - #### getViewImage

          public static Image getViewImage​(CDOView view)

      Since:
        3.0