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)
TreeViewerBuilderTreeViewer.createTree in interface TreeViewerBuilderparent - the parent compositepublic boolean hasDND()
DNDProviderhasDND in interface DNDProvidertrue if DND will be added, based on the other methods of this interface, or
false if DND should not be addedpublic int getDragOperations()
DNDProviderdrag support for the viewer.getDragOperations in interface DNDProviderpublic org.eclipse.swt.dnd.Transfer[] getDragTransferTypes()
DNDProviderdrag support for the viewer.getDragTransferTypes in interface DNDProvidertransfer typespublic org.eclipse.swt.dnd.DragSourceListener getDragListener(org.eclipse.jface.viewers.TreeViewer treeViewer)
DNDProviderDragSourceListener used to setup the
drag support for the viewer.getDragListener in interface DNDProvidertreeViewer - the treeviewerpublic int getDropOperations()
DNDProviderdrop support for the viewer.getDropOperations in interface DNDProviderpublic org.eclipse.swt.dnd.Transfer[] getDropTransferTypes()
DNDProviderdrop support for the viewer.getDropTransferTypes in interface DNDProvidertransfer typespublic org.eclipse.swt.dnd.DropTargetListener getDropListener(org.eclipse.emf.edit.domain.EditingDomain editingDomain,
org.eclipse.jface.viewers.TreeViewer treeViewer)
DNDProviderDragSourceListener used to setup the
drop support for the viewer.getDropListener in interface DNDProvidereditingDomain - the editing domaintreeViewer - the treeviewerpublic org.eclipse.jface.viewers.IContentProvider getContentProvider()
ContentProviderProvidergetContentProvider in interface ContentProviderProviderpublic org.eclipse.jface.viewers.IBaseLabelProvider getLabelProvider()
LabelProviderProvidergetLabelProvider in interface LabelProviderProviderpublic Optional<org.eclipse.jface.viewers.ILabelDecorator> getLabelDecorator(org.eclipse.jface.viewers.TreeViewer viewer)
LabelDecoratorProviderILabelDecorator to use.getLabelDecorator in interface LabelDecoratorProviderviewer - the TreeViewerpublic org.eclipse.jface.viewers.ViewerFilter[] getViewerFilters()
ViewerFilterProvidergetViewerFilters in interface ViewerFilterProviderpublic org.eclipse.emf.ecore.EObject getInitialSelection(Object input)
InitialSelectionProvidernull if no specific default selection
should be set.getInitialSelection in interface InitialSelectionProviderinput - the inputnullpublic org.eclipse.swt.widgets.Menu getMenu(org.eclipse.jface.viewers.TreeViewer treeViewer,
org.eclipse.emf.edit.domain.EditingDomain editingDomain)
MenuProvidergetMenu in interface MenuProvidertreeViewer - the treeviewereditingDomain - the editing domainpublic void dispose()
Disposeabledispose in interface Disposeablepublic 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 © 2017. All rights reserved.