public class GalleryTreeViewer
extends org.eclipse.jface.viewers.AbstractTreeViewer
Gallery
control.
This class is not intended to be subclassed outside the viewer framework. It is designed to be instantiated with a pre-existing Nebula Gallery control and configured with a domain-specific content provider, label provider, element filter (optional), and element sorter (optional).
SWT.VIRTUAL is currently unsupported
THIS VIEWER SHOULD BE CONSIDERED AS ALPHA
Constructor | Description |
---|---|
GalleryTreeViewer(Gallery gallery) |
Creates a gallery viewer on the given gallery control.
|
GalleryTreeViewer(org.eclipse.swt.widgets.Composite parent) |
Creates a gallery viewer on a newly-created gallery control under the
given parent.
|
GalleryTreeViewer(org.eclipse.swt.widgets.Composite parent,
int style) |
Creates a gallery viewer on a newly-created gallery control under the
given parent.
|
Modifier and Type | Method | Description |
---|---|---|
void |
editElement(java.lang.Object element,
int column) |
|
org.eclipse.swt.widgets.Control |
getControl() |
|
Gallery |
getGallery() |
Returns this gallery viewer's gallery.
|
void |
remove(java.lang.Object parentOrTreePath,
int index) |
Removes the element at the specified index of the parent.
|
void |
setAutoExpandLevel(int level) |
|
void |
setChildCount(java.lang.Object elementOrTreePath,
int count) |
For a GalleryViewer with a gallery with the VIRTUAL style bit set, set
the number of children of the given element or tree path.
|
void |
setContentProvider(org.eclipse.jface.viewers.IContentProvider provider) |
Gallery expects contents to have exactly 2 levels of hierarchy, with
groups as the root elements and image thumbnails as direct children of
the groups.
|
add, add, addTreeListener, collapseAll, collapseToLevel, expandAll, expandToLevel, expandToLevel, getAutoExpandLevel, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getSelection, getStructuredSelection, getVisibleExpandedElements, insert, isExpandable, remove, remove, remove, removeTreeListener, reveal, scrollDown, scrollUp, setExpandedElements, setExpandedState, setExpandedTreePaths, setExpandPreCheckFilters
applyEditorValue, cancelEditing, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getLabelProvider, isBusy, isCellEditorActive, refresh, refresh, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, setLabelProvider, update
getContentProvider, getInput, getLabelProvider
addSelectionChangedListener, removeSelectionChangedListener, setSelection
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, getComparator, getComparer, getFilters, getSorter, refresh, refresh, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setSelection, setSorter, setUseHashlookup, testFindItem, testFindItems, update
public GalleryTreeViewer(org.eclipse.swt.widgets.Composite parent)
MULTI, V_SCROLL,
and BORDER
. The viewer has no
input, no content provider, a default label provider, no sorter, and no
filters.parent
- the parent controlpublic GalleryTreeViewer(org.eclipse.swt.widgets.Composite parent, int style)
parent
- the parent controlstyle
- the SWT style bits used to create the gallery.public GalleryTreeViewer(Gallery gallery)
gallery
- the gallery controlpublic void setAutoExpandLevel(int level)
setAutoExpandLevel
in class org.eclipse.jface.viewers.AbstractTreeViewer
public void setContentProvider(org.eclipse.jface.viewers.IContentProvider provider)
Gallery expects contents to have exactly 2 levels of hierarchy, with groups as the root elements and image thumbnails as direct children of the groups. This method accepts ITreeContentProvider and ITreePathContentProvider as-is, and relies on the providers to return contents with the correct structure.
This method also accepts IStructuredContentProvider and wraps it in a FlatTreeContentProvider with an empty string as the root node. If you need a different root node, construct your own FlatTreeContentProvider and pass it here. If you want the Gallery to suppress the collapsable group header, call
getGallery().setGroupRenderer(new NoGroupRenderer());
setContentProvider
in class org.eclipse.jface.viewers.AbstractTreeViewer
public org.eclipse.swt.widgets.Control getControl()
getControl
in class org.eclipse.jface.viewers.Viewer
public Gallery getGallery()
public void setChildCount(java.lang.Object elementOrTreePath, int count)
elementOrTreePath
- the element, or tree pathcount
- public void remove(java.lang.Object parentOrTreePath, int index)
parentOrTreePath
- the parent element, the input element, or a tree path to the
parent elementindex
- child indexpublic void editElement(java.lang.Object element, int column)
editElement
in class org.eclipse.jface.viewers.ColumnViewer