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<Object>>
org.eclipse.emf.cdo.ui.CDOItemProvider

All Implemented Interfaces:
  `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<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`

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.IListener

`org.eclipse.net4j.util.event.IListener.NotifierAware`

## 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

Modifier and Type
Method
Description
`int`
`compare(Viewer viewer, Object e1, Object e2)`
`void`
`dispose()`
`protected void`
`elementAdded(Object element, 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, 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)`
`Object[]`
`getChildren(Object element)`
`protected Object[]`
`getChildren(CDOBranch branch)`
`Font`
`getFont(Object obj)`
`Color`
`getForeground(Object obj)`
`Image`
`getImage(Object obj)`
`Object`
`getParent(Object element)`
`protected ResourceManager`
`getResourceManager()`
`String`
`getText(Object obj)`
`static Image`
`getViewImage(CDOView view)`
`static ImageDescriptor`
`getViewImageDescriptor(CDOView view)`
`protected Image`
`getWorkbenchImage(String name)`
`boolean`
`hasChildren(Object element)`
`protected boolean`
`hasChildren(CDOBranch branch)`
`boolean`
`isMergeMainBranchWithSession()`
`void`
`setMergeMainBranchWithSession(boolean mergeMainBranchWithSession)`
`boolean`
`useFullPath(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, pendingColor, pendingImage, 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 Details

### CDOItemProvider

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

### CDOItemProvider

public CDOItemProvider(IWorkbenchPage page)

## Method Details

### 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<Object>>`

### useFullPath

public boolean useFullPath(Object object)

Since:
  4.4

### isMergeMainBranchWithSession

public boolean isMergeMainBranchWithSession()

Since:
  4.2

### setMergeMainBranchWithSession

public void setMergeMainBranchWithSession(boolean mergeMainBranchWithSession)

Since:
  4.2

### getChildren

public Object[] getChildren(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<Object>>`

### getChildren

protected Object[] getChildren(CDOBranch branch)

Since:
  4.2

### hasChildren

public boolean hasChildren(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<Object>>`

### hasChildren

protected boolean hasChildren(CDOBranch branch)

Since:
  4.2

### getParent

public Object getParent(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<Object>>`

### getText

public String getText(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<Object>>`

### getImage

public Image getImage(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<Object>>`

### getWorkbenchImage

protected Image getWorkbenchImage(String name)

Since:
  4.2

### getResourceManager

protected ResourceManager getResourceManager()

Since:
  4.2

### getForeground

public Color getForeground(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<Object>>`

### getFont

public Font getFont(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<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<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, 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(Object element, Object parent)

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

### compare

public int compare(Viewer viewer, Object e1, 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