A view is a visual component within a workbench page. It is typically used to
navigate a hierarchy of information (like the workspace), open an editor, or
display properties for the active editor. Modifications made in a view are
saved immediately (in contrast to an editor part, which conforms to a more
elaborate open-save-close lifecycle).
Only one instance of a particular view type may exist within a workbench
page. This policy is designed to simplify part management for a user.
This interface may be implemented directly. For convenience, a base
implementation is defined in ViewPart .
A view is added to the workbench in two steps:
- A view extension is contributed to the workbench registry. This
extension defines the extension id and extension class.
- The view is included in the default layout for a perspective.
Alternatively, the user may open the view from the Perspective menu.
Views implement the IAdaptable interface; extensions are
managed by the platform's adapter manager.
As of 3.4, views may optionally adapt to
ISizeProvider if they have
a preferred size. The default presentation will make a best effort to
allocate the preferred size to a view if it is the only part in a stack. If
there is more than one part in the stack, the constraints will be disabled
for that stack. The size constraints are adjusted for the size of the tab and
border trim. Note that this is considered to be a hint to the presentation,
and not all presentations may honor size constraints.
See Also: IWorkbenchPage.showView See Also: org.eclipse.ui.part.ViewPart See Also: ISizeProvider |