Package com.iizigo.editor
Class CommonViewerEx
- All Implemented Interfaces:
IViewerToolTip
,IInputProvider
,IInputSelectionProvider
,IPostSelectionProvider
,ISelectionProvider
- Direct Known Subclasses:
FilteredCommonViewer
A little extended Common Viewer for 3.8+/4.2+ Eclipse and drag-drop enhancement.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.viewers.StructuredViewer
StructuredViewer.ColorAndFontCollector, StructuredViewer.ColorAndFontCollectorWithProviders
Field Summary
Fields inherited from class org.eclipse.jface.viewers.AbstractTreeViewer
ALL_LEVELS, NO_EXPAND
Fields inherited from class org.eclipse.jface.viewers.Viewer
WIDGET_DATA_KEY
Constructor Summary
ConstructorDescriptionCommonViewerEx
(Composite parent, int style) Creates the common viewer.CommonViewerEx
(Composite parent, int style, int flags) Creates the common viewer.Method Summary
Modifier and TypeMethodDescriptionvoid
addFlagsListener
(IProviderFlagsChangeListener listener) Adds a label or content provider to be informed of changes.int
Gets the flags for label and content providers.getViewerRow
(Point point) Returns the viewer row at the given widget-relative coordinates.protected void
init()
Initializes the content provider, label provider, and drag and drop support.void
Removes a label or content provider to be informed of changes.void
setProviderFlags
(int flags) Sets the flags for label and content providers.Methods inherited from class org.eclipse.ui.navigator.CommonViewer
add, createDragAdapter, createDropAdapter, createFrameList, dispose, doUpdateItem, getCommonNavigator, getFrameList, getMapper, getNavigatorContentService, getSelection, handleDispose, handleDoubleSelect, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hookControl, initDragAndDrop, internalRefresh, mapElement, refresh, refresh, remove, removeWithoutRefresh, setMapper, setSelection, setSelectionToWidget, setSorter, toString, unmapAllElements, unmapElement, update
Methods inherited from class org.eclipse.jface.viewers.TreeViewer
addTreeListener, assertContentProviderType, createViewerEditor, disassociate, doGetColumnCount, editElement, getChild, getChildren, getColumnViewerOwner, getControl, getExpanded, getItemAt, getItemCount, getItemCount, getItems, getLabelProvider, getParentElement, getParentItem, getRawChildren, getSelection, getTree, getViewerRowFromItem, handleTreeCollapse, handleTreeExpand, internalAdd, internalInitializeTree, internalRefreshStruct, isExpandable, newItem, remove, removeAll, replace, setChildCount, setContentProvider, setExpanded, setHasChildren, setSelection, showItem, updatePlus
Methods inherited from class org.eclipse.jface.viewers.AbstractTreeViewer
add, addSelectionListener, addTreeListener, associate, buildLabel, collapseAll, collapseToLevel, contains, createChildren, createTreeItem, doFindInputItem, doFindItem, doUpdateItem, doUpdateItem, expandAll, expandAll, expandToLevel, expandToLevel, expandToLevel, expandToLevel, fireTreeCollapsed, fireTreeExpanded, getAutoExpandLevel, getAutoExpandOnSingleChildLevels, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getNextItem, getPreviousItem, getSelectionFromWidget, getSortedChildren, getStructuredSelection, getTreePathFromItem, getVisibleExpandedElements, indexForElement, inputChanged, insert, internalCollapseToLevel, internalExpand, internalExpandToLevel, internalFindItems, internalGetWidgetToSelect, internalIsInputOrEmptyPath, internalRefresh, internalRefresh, internalRemove, internalRemove, isSameSelection, labelProviderChanged, remove, remove, removeTreeListener, reveal, scrollDown, scrollUp, setAutoExpandLevel, setAutoExpandOnSingleChildLevels, setExpandedElements, setExpandedState, setExpandedStateWithAutoExpandOnSingleChild, setExpandedTreePaths, setExpandPreCheckFilters, setSelectionToWidget, updateChildren
Methods inherited from class org.eclipse.jface.viewers.ColumnViewer
applyEditorValue, cancelEditing, checkBusy, firePostSelectionChanged, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getItem, getLabelProvider, hookEditingSupport, isBusy, isCellEditorActive, isExpandableNode, setBusy, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, setDisplayIncrementally, setLabelProvider, triggerEditorActivationEvent, updateSelection
Methods inherited from class org.eclipse.jface.viewers.StructuredViewer
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertElementsNotNull, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getRoot, getSorter, handleInvalidSelection, hasFilters, internalUpdate, needsRefilter, preservingSelection, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setUseHashlookup, testFindItem, testFindItems, unmapElement, update, updateItem, usingElementMap
Methods inherited from class org.eclipse.jface.viewers.ContentViewer
getContentProvider, getInput
Methods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, setData, setSelection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider
addSelectionChangedListener, removeSelectionChangedListener, setSelection
Constructor Details
CommonViewerEx
Creates the common viewer.- Parameters:
parent
- Parent composite.style
- SWT style for tree control.
CommonViewerEx
Creates the common viewer.- Parameters:
parent
- Parent composite.style
- SWT style for tree control.flags
- The presentation flags, from INavigatorPresentation.
Method Details
init
protected void init()Initializes the content provider, label provider, and drag and drop support. Should not be called by clients -- this method is invoked when the constructor is invoked.- Overrides:
init
in classCommonViewer
setProviderFlags
public void setProviderFlags(int flags) Sets the flags for label and content providers.getProviderFlags
public int getProviderFlags()Gets the flags for label and content providers.getViewerRow
Returns the viewer row at the given widget-relative coordinates. Overridden to make public. As it's for tooltip support this will work just fine.- Specified by:
getViewerRow
in interfaceIViewerToolTip
- Overrides:
getViewerRow
in classColumnViewer
- Parameters:
point
- The widget-relative coordinates of the viewer row.- Returns:
- ViewerRow the row or
null
if no row is found at the given coordinates.