public class DefaultTreeViewerCustomization extends Object implements TreeViewerCustomization
TreeViewerCustomization
.Constructor and Description |
---|
DefaultTreeViewerCustomization()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
org.eclipse.jface.viewers.TreeViewer |
createTree(org.eclipse.swt.widgets.Composite parent)
This method is called to create the
TreeViewer . |
void |
customizeMenu(Collection<MasterDetailAction> rightClickActions)
Sets the right click actions of the menu.
|
void |
customizeMenu(CreateElementCallback createElementCallback)
Sets the
CreateElementCallback . |
void |
customizeMenu(DeleteActionBuilder deleteActionBuilder)
Sets the delete action.
|
void |
dispose()
Disposes the element.
|
protected org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider |
getAdapterFactoryContentProvider()
Returns the
AdapterFactoryContentProvider . |
protected org.eclipse.emf.edit.provider.ComposedAdapterFactory |
getComposedAdapterFactory()
Gives access to the composed adapter factory.
|
org.eclipse.jface.viewers.IContentProvider |
getContentProvider()
Creates the content provider added to the treeviewer.
|
org.eclipse.swt.dnd.DragSourceListener |
getDragListener(org.eclipse.jface.viewers.TreeViewer treeViewer)
Returns the
DragSourceListener used to setup the
drag support for the viewer. |
int |
getDragOperations()
Returns the drag operations bits used to setup the
drag support for the viewer. |
org.eclipse.swt.dnd.Transfer[] |
getDragTransferTypes()
Returns the drag transfer types used to setup the
drag support for the viewer. |
org.eclipse.swt.dnd.DropTargetListener |
getDropListener(org.eclipse.emf.edit.domain.EditingDomain editingDomain,
org.eclipse.jface.viewers.TreeViewer treeViewer)
Returns the
DragSourceListener used to setup the
drop support for the viewer. |
int |
getDropOperations()
Returns the drag operations bits used to setup the
drop support for the viewer. |
org.eclipse.swt.dnd.Transfer[] |
getDropTransferTypes()
Returns the drag transfer types used to setup the
drop support for the viewer. |
org.eclipse.emf.ecore.EObject |
getInitialSelection(Object input)
Called to set the initial selection on the tree.
|
Optional<org.eclipse.jface.viewers.ILabelDecorator> |
getLabelDecorator(org.eclipse.jface.viewers.TreeViewer viewer)
Returns the
ILabelDecorator to use. |
org.eclipse.jface.viewers.IBaseLabelProvider |
getLabelProvider()
Creates the label provider added to the treeviewer.
|
org.eclipse.swt.widgets.Menu |
getMenu(org.eclipse.jface.viewers.TreeViewer treeViewer,
org.eclipse.emf.edit.domain.EditingDomain editingDomain)
Returns the menu which will be added to the tree.
|
org.eclipse.jface.viewers.ViewerFilter[] |
getViewerFilters()
Creates the viewer filters added to the treeviewer.
|
boolean |
hasDND()
Whether DND support should be added to the tree.
|
void |
setContentProvider(ContentProviderProvider contentProvider)
Sets the content provider provider.
|
void |
setDragAndDrop(DNDProvider dnd)
Sets the d&d support.
|
void |
setInitialSelection(InitialSelectionProvider selection)
Sets the initial selection provider.
|
void |
setLabelDecorator(LabelDecoratorProvider decorator)
Sets the label decorator provider.
|
void |
setLabelProvider(LabelProviderProvider labelProvider)
Sets the label provider provider.
|
void |
setMenu(MenuProvider menu)
Sets the menu provider.
|
void |
setTree(TreeViewerBuilder tree)
Sets the tree builder.
|
void |
setViewerFilters(ViewerFilterProvider filters)
Sets the viewer filter provider.
|
public DefaultTreeViewerCustomization()
protected org.eclipse.emf.edit.provider.ComposedAdapterFactory getComposedAdapterFactory()
protected org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider getAdapterFactoryContentProvider()
AdapterFactoryContentProvider
.public org.eclipse.jface.viewers.TreeViewer createTree(org.eclipse.swt.widgets.Composite parent)
TreeViewerBuilder
TreeViewer
.createTree
in interface TreeViewerBuilder
parent
- the parent composite
public boolean hasDND()
DNDProvider
hasDND
in interface DNDProvider
true
if DND will be added, based on the other methods of this interface, or
false
if DND should not be addedpublic int getDragOperations()
DNDProvider
drag support
for the viewer.getDragOperations
in interface DNDProvider
public org.eclipse.swt.dnd.Transfer[] getDragTransferTypes()
DNDProvider
drag support
for the viewer.getDragTransferTypes
in interface DNDProvider
transfer types
public org.eclipse.swt.dnd.DragSourceListener getDragListener(org.eclipse.jface.viewers.TreeViewer treeViewer)
DNDProvider
DragSourceListener
used to setup the
drag support
for the viewer.getDragListener
in interface DNDProvider
treeViewer
- the treeviewerpublic int getDropOperations()
DNDProvider
drop support
for the viewer.getDropOperations
in interface DNDProvider
public org.eclipse.swt.dnd.Transfer[] getDropTransferTypes()
DNDProvider
drop support
for the viewer.getDropTransferTypes
in interface DNDProvider
transfer types
public org.eclipse.swt.dnd.DropTargetListener getDropListener(org.eclipse.emf.edit.domain.EditingDomain editingDomain, org.eclipse.jface.viewers.TreeViewer treeViewer)
DNDProvider
DragSourceListener
used to setup the
drop support
for the viewer.getDropListener
in interface DNDProvider
editingDomain
- the editing domaintreeViewer
- the treeviewerpublic org.eclipse.jface.viewers.IContentProvider getContentProvider()
ContentProviderProvider
getContentProvider
in interface ContentProviderProvider
public org.eclipse.jface.viewers.IBaseLabelProvider getLabelProvider()
LabelProviderProvider
getLabelProvider
in interface LabelProviderProvider
public Optional<org.eclipse.jface.viewers.ILabelDecorator> getLabelDecorator(org.eclipse.jface.viewers.TreeViewer viewer)
LabelDecoratorProvider
ILabelDecorator
to use.getLabelDecorator
in interface LabelDecoratorProvider
viewer
- the TreeViewer
public org.eclipse.jface.viewers.ViewerFilter[] getViewerFilters()
ViewerFilterProvider
getViewerFilters
in interface ViewerFilterProvider
public org.eclipse.emf.ecore.EObject getInitialSelection(Object input)
InitialSelectionProvider
null
if no specific default selection
should be set.getInitialSelection
in interface InitialSelectionProvider
input
- the inputnull
public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
MenuProvider
getMenu
in interface MenuProvider
treeViewer
- the treeviewereditingDomain
- the editing domainpublic void dispose()
Disposeable
dispose
in interface Disposeable
public void setContentProvider(ContentProviderProvider contentProvider)
contentProvider
- the content providerpublic void setDragAndDrop(DNDProvider dnd)
dnd
- the dndpublic void setLabelProvider(LabelProviderProvider labelProvider)
labelProvider
- the providerpublic void setLabelDecorator(LabelDecoratorProvider decorator)
decorator
- the providerpublic void setMenu(MenuProvider menu)
menu
- the providerpublic void customizeMenu(Collection<MasterDetailAction> rightClickActions)
rightClickActions
- the actionspublic void customizeMenu(CreateElementCallback createElementCallback)
CreateElementCallback
.createElementCallback
- the callbackpublic void customizeMenu(DeleteActionBuilder deleteActionBuilder)
deleteActionBuilder
- the builderpublic void setInitialSelection(InitialSelectionProvider selection)
selection
- the providerpublic void setTree(TreeViewerBuilder tree)
tree
- the tree builderpublic void setViewerFilters(ViewerFilterProvider filters)
filters
- the providerCopyright © 2018. All rights reserved.