# Class WorkbenchViewerSetup

java.lang.Object
org.eclipse.ui.views.WorkbenchViewerSetup

public class WorkbenchViewerSetup extends Object

Configure a `ColumnViewer` to show limited items per parent before showing an ExpandableNode. Limit used is read from preference `IWorkbenchPreferenceConstants.LARGE_VIEW_LIMIT`. Client must call this before `Viewer.setInput(Object)`

Since:
  3.130

## Constructor Summary

Constructors
Constructor
Description
`WorkbenchViewerSetup()`

## Method Summary

Modifier and Type
Method
Description
`static int`
`getItemsLimit()`
Returns the current viewer limit set in the `General` preference page.
`static void`
`setupViewer(ColumnViewer viewer)`
Configure a `ColumnViewer` to show limited items per parent before showing an ExpandableNode.

### Methods inherited from class Object

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

## Constructor Details

### WorkbenchViewerSetup

public WorkbenchViewerSetup()

## Method Details

### getItemsLimit

public static int getItemsLimit()
Returns the current viewer limit set in the `General` preference page.

Returns:
  `IWorkbenchPreferenceConstants.LARGE_VIEW_LIMIT`

### setupViewer

public static void setupViewer(ColumnViewer viewer)
Configure a `ColumnViewer` to show limited items per parent before showing an ExpandableNode. Limit used is read from preference `IWorkbenchPreferenceConstants.LARGE_VIEW_LIMIT`. Client must call this before `Viewer.setInput(Object)`

User can change the viewer limit on preference page any time in the lifetime of the viewer. This setup takes care of refreshing the viewer with the new limit set.

Parameters:
  `viewer` - `ColumnViewer` which has to configured for showing limited items.