Package org.eclipse.jface.viewers
package org.eclipse.jface.viewers
Provides a framework for viewers, which are model-based
content adapters for SWT widgets.
Package Specification
A viewer is a model-based adapter on an SWT widget. Each viewer has four parts:This package contains the viewer framework. The viewer framework is an independent JFace module. Using it requires a knowledge of SWT, but does not require familiarity with any of the other JFace modules. The framework consists of abstract base classes for viewers (
- an input - the object that serves as the viewer's model
- a widget - the SWT control through which the viewer's model is displayed
- a content provider - mediates between the model and viewer
- a label provider - maps model objects to displayable labels containing text and/or an image
Viewer
, StructuredViewer
,
AbstractTreeViewer
) together with concrete viewer classes (ListViewer
,
TreeViewer
,
TableViewer
,
TableTreeViewer
, CheckboxTreeViewer
,
and CheckboxTableViewer
),
and various lesser support classes. The concrete structured viewer classes
are ready-to-use and have built-in support for drag-and-drop, filtering
(IViewerFilter
and ViewerFilter
), and sorting (IViewerSorter
and ViewerSorter
); these classes may also be subclassed further
if required.
In general terms, creating a viewer involves the following steps:
- instantiating a viewer on some pre-existing SWT widget,
-
setting the viewer's content provider (an object implementing
IContentProvider
), -
setting the viewer's label provider (an object implementing
ILabelProvider
), - and, finally, setting the viewer's input.
IContentProvider.inputChanged
).
Also, each viewer registers with its label provider for notification of
changes that would affect what the viewer displays (see ILabelProviderListener.stateChanged
).
Note: None of the classes in this package maintain global state.
-
ClassDescriptionAbstract base class for viewers that contain lists of items (such as a combo or list).This is a widget independent class implementors of
Table
like widgets can use to provide a viewer on top of their widget implementations.Abstract base implementation for tree-structure-oriented viewers (trees and table trees).Filter that accepts everything.This implementation ofIStructuredContentProvider
handles the case where the viewer input is an unchanging array or collection of elements.BaseLabelProvider is a default concrete implementation ofIBaseLabelProvider
ProvidesStyledString.Styler
that applies bold style on the given font.Abstract base class for cell editors.Struct-like layout data for cell editors, with reasonable defaults for all fields.The CellLabelProvider is an abstract implementation of a label provider for structured viewers.This class implementation the strategy how the table is navigated using the keyboard.A cell editor that manages a checkbox.A concrete viewer based on an SWTTable
control with checkboxes on each node.A concrete tree-structured viewer based on an SWTTree
control with checkboxes on each node.Event object describing a change to the checked state of a viewer element.A cell editor that manages a color field.The ColumnLabelProvider is the label provider for viewers that have column support such asTreeViewer
andTableViewer
An abstract column layout data describing the information needed (byTableLayout
) to properly lay out a table.Describes the width of a table column in pixels, and whether the column is resizable.The ColumnViewer is the abstract superclass of viewers that have columns (e.g., AbstractTreeViewer and AbstractTableViewer).This is the base for all editor implementations of Viewers.This event is passed on when a cell-editor is going to be activatedParties interested in activation and deactivation of editors extend this class and implement any or all of the methodsThis class is responsible to determine if a cell selection event is triggers an editor activation.This event is fired when an editor deactivatedThe ColumnViewerTooltipSupport is the class that provides tool tips for ColumnViewers.Describes the width of a table column in terms of a weight, a minimum width, and whether the column is resizable.A cell editor that presents a list of items in a combo box.A cell editor that presents a list of items in a combo box.A concrete viewer based either on an SWTCombo
control orCCombo
control.A content viewer is a model-based adapter on a widget which accesses its model by means of a content provider and a label provider.A decorating label provider is a label provider which combines a nested label provider and an optional decorator.ADecoratingStyledCellLabelProvider
is aDelegatingStyledCellLabelProvider
that uses a nestedDelegatingStyledCellLabelProvider.IStyledLabelProvider
to compute styled text label and image and takes aILabelDecorator
to decorate the label.A concrete implementation of theIDecorationContext
interface, suitable for instantiating.ADecorationOverlayIcon
is an image descriptor that can be used to overlay decoration images on to the 4 corner quadrants of a base image.ADelegatingStyledCellLabelProvider
is aStyledCellLabelProvider
that delegates requests for the styled string and the image to aDelegatingStyledCellLabelProvider.IStyledLabelProvider
.Interface marking a label provider that provides styled text labels and images.An abstract cell editor that uses a dialog.Event object describing a double-click.EditingSupport is the abstract superclass of the support for cell editing.A concrete implementation ofFocusCellHighlighter
using by setting the control into owner draw mode and highlighting the currently selected cell.A label provider maps an element of the viewer's model to an optional image and optional text string used to display the element in the viewer's control.Predefined property names used for elements displayed in viewers.A listener which is notified of significant events in the life of a cell editor.An interface for validating a cell editor's input.A cell modifier is used to access the data model from a cell editor in an abstract way.Interface for objects that support elements with a checked state.A listener which is notified of changes to the checked state of items in checkbox viewers.Interface to provide checked and grayed state information about data in trees or tables.The IColorDecorator is an interface for objects that return a color to decorate either the foreground and background colors for displaying an an object.Interface to provide color representation for a given element.A content provider mediates between the viewer's model and the viewer itself.Defines the result of decorating an element.A decoration context provides additional information to a label decorator.A delayed label decorator is a label decorator that may not have a decoration available immediately.A listener which is notified of double-click events on viewers.This interface is used to compare elements in a viewer for equality, and to provide the hash code for an element.Interface for filters.The IFontDecorator is an interface for objects that return a font to decorate an object.Interface to provide font representation for a given element.Adds efficient element indexing support to ILazyContentProvider.Interface common to all objects that provide an input.Interface common to all objects that provide both an input and a selection.A label decorator decorates the label text and image for some element.ExtendsIBaseLabelProvider
with the methods to provide the text and/or image for the label of a given element.A listener which is notified when a label provider's state changes.The ILazyContentProvider is the content provider for table viewers created using the SWT.VIRTUAL flag that only wish to return their contents as they are queried.The ILazyTreeContentProvider is the content provider for tree viewers created using the SWT.VIRTUAL flag that only wish to return their contents as they are queried.The ILazyTreePathContentProvider is a tree path-based content provider for tree viewers created using the SWT.VIRTUAL flag that only wish to return their contents as they are queried.TheILightweightLabelDecorator
is a decorator that decorates using a prefix, suffix and overlay image rather than doing all of the image and text management itself like anILabelDecorator
.A listener which is notified of open events on viewers.Selection provider extension interface to allow providers to notify about post selection changed events.Interface for a selection.A listener which is notified when a viewer's selection changes.Interface common to all objects that provide a selection.An interface to content providers for structured viewers.A selection containing elements.Interface to provide color representation for a given cell within the row for an element in a table.The ITableFontProvider is a font provider that provides fonts to individual cells within tables.ExtendsIBaseLabelProvider
with the methods to provide the text and/or image for each column of a given element.Interface to provide tool tip information for a given element.An interface to content providers for tree-structure-oriented viewers.An interface to content providers for tree-structure-oriented viewers that provides content based on the path of elements in the tree viewer.An extension toILabelProvider
that is given the path of the element being decorated, when it is available.A selection containing tree paths.A listener which is notified when a tree viewer expands or collapses a node.ExtendsIBaseLabelProvider
with the methods to update the label for a given element.The LabelDecorator is an abstract superclass of ILabelDecorators that support IDecorationContext.A label provider implementation which, by default, uses an element'stoString
value for its text andnull
for its image.Event object describing a label provider state change.A concrete viewer based on an SWTList
control.A label provider for instances ofNamedHandlerObject
, which exposes the name as the label.Event object describing an open which may be generated from a selection or default selection event.OwnerDrawLabelProvider is an abstract implementation of a label provider that handles custom draw.Event object describing a selection change.A concrete implementation of theIStructuredSelection
interface, suitable for instantiating.Abstract base implementation for structure-oriented viewers (trees, lists, tables).This class is not part of the public API of JFace.Nothing to see here.AStyledCellLabelProvider
supports styled labels by using owner draw.A mutable string with styled ranges.A styler will be asked to apply its styles to one ore more ranges in theStyledString
.TableColumnViewerLabelProvider is the mapping from the table based providers to the ViewerLabelProvider.A layout for a table.A concrete viewer based on a SWTTable
control.ViewerColumn implementation for TableViewer to enable column-specific label providers and editing support.This is an editor-implementation forTable
This class is responsible to provide the concept of cells forTable
.TableViewerRow is the Table specific implementation of ViewerRowA cell editor that manages a text entry field.TreeViewerLabelProvider is the ViewerLabelProvider that handles TreePaths.Event object describing a tree node being expanded or collapsed.A simple data structure that is useful for implemented tree models.A content provider that expects every element to be aTreeNode
.A tree path denotes a model element in a tree viewer.A viewer sorter that is provided extra context in the form of the path of the parent element of the elements being sorted.A concrete implementation of theITreeSelection
interface, suitable for instantiating.A concrete viewer based on an SWTTree
control.ViewerColumn implementation for TreeViewer to enable column-specific label providers and editing support.This is an editor implementation forTree
This class is responsible to provide the concept of cells forTree
.TreeViewerRow is the Tree implementation of ViewerRow.A viewer is a model-based adapter on a widget.The ViewerCell is the JFace representation of a cell entry in a ViewerRow.Instances of this class represent a column of aColumnViewer
.A viewer comparator is used by aStructuredViewer
to reorder the elements provided by its content provider.This adapter class provides generic drag-and-drop support for a viewer.A viewer filter is used by a structured viewer to extract a subset of elements provided by its content provider.The ViewerLabel is the class that is passed to a viewer to handle updates of labels.ViewerRow is the abstract superclass of the part that represents items in a Table or Tree.Deprecated.
ViewerComparator
instead.