Class AbstractJFaceTreeRenderer<VELEMENT extends VElement>
- java.lang.Object
-
- org.eclipse.emf.ecp.view.model.common.AbstractRenderer<VELEMENT>
-
- org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer<VELEMENT>
-
- org.eclipse.emf.ecp.view.spi.categorization.swt.AbstractJFaceTreeRenderer<VELEMENT>
-
- Type Parameters:
VELEMENT
- theVElement
- Direct Known Subclasses:
CompositeCategoryJFaceTreeRenderer
,SWTCategorizationElementRenderer
public abstract class AbstractJFaceTreeRenderer<VELEMENT extends VElement> extends AbstractSWTRenderer<VELEMENT>
Abstract class for a tree renderer.- Author:
- Eugen Neufeld
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractJFaceTreeRenderer.TreeTableLabelProvider
The Class TreeTableLabelProvider.
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description AbstractJFaceTreeRenderer(VELEMENT vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsRendererFactory emfFormsRendererFactory)
Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addButtons(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.jface.viewers.TreeSelection treeSelection, java.util.List<org.eclipse.swt.custom.TreeEditor> editors)
Adds the buttons.protected void
addTreeEditor(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.emf.ecore.EObject view, java.util.List<org.eclipse.swt.custom.TreeEditor> editors)
Adds the tree editor.protected org.eclipse.swt.custom.ScrolledComposite
createdEditorPane(org.eclipse.swt.widgets.Composite composite)
Created editor pane.protected org.eclipse.jface.viewers.TreeViewer
createTreeViewer(org.eclipse.swt.widgets.Composite parent)
Creates aTreeViewer
.protected void
dispose()
Disposes all resources used by the renderer.protected abstract VCategorizationElement
getCategorizationElement()
The VCategorizationElement to set the current selection onto.protected abstract org.eclipse.emf.common.util.EList<VAbstractCategorization>
getCategorizations()
The list of categorizations to display in the tree.SWTGridDescription
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.protected AbstractJFaceTreeRenderer.TreeTableLabelProvider
getTreeLabelProvider(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
The TreeTableLabel provider.protected void
initTreeViewer(org.eclipse.jface.viewers.TreeViewer treeViewer)
Inits the tree viewer.protected org.eclipse.swt.widgets.Control
renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent)
Renders the passedVElement
.protected void
setupTreeViewer(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.swt.custom.ScrolledComposite editorComposite)
Configures the passed tree viewer.boolean
showCategorization(VAbstractCategorization categorization)
Reveal the control that renders the givencategorization
.-
Methods inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
applyEnable, applyReadOnly, applyValidation, applyValidation, applyVisible, canReveal, finalizeRendering, getControls, getDefaultFontName, ignoreEnableOnReadOnly, init, isRenderingFinished, postInit, preInit, render, scrollToReveal, scrollToReveal, setControlEnabled
-
Methods inherited from class org.eclipse.emf.ecp.view.model.common.AbstractRenderer
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
-
-
-
-
Constructor Detail
-
AbstractJFaceTreeRenderer
public AbstractJFaceTreeRenderer(VELEMENT vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsRendererFactory emfFormsRendererFactory)
Default constructor.- Parameters:
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- theReportService
emfFormsRendererFactory
- TheEMFFormsRendererFactory
- Since:
- 1.6
-
-
Method Detail
-
getGridDescription
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
Description copied from class:AbstractSWTRenderer
Returns the GridDescription for this Renderer.- Specified by:
getGridDescription
in classAbstractSWTRenderer<VELEMENT extends VElement>
- Parameters:
gridDescription
- the currentSWTGridDescription
- Returns:
- the number of controls per row
-
dispose
protected void dispose()
Disposes all resources used by the renderer. Don't forget to call super.dispose if overwriting this method.- Overrides:
dispose
in classAbstractSWTRenderer<VELEMENT extends VElement>
- See Also:
AbstractSWTRenderer.dispose()
-
renderControl
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
Renders the passedVElement
.- Specified by:
renderControl
in classAbstractSWTRenderer<VELEMENT extends VElement>
- Parameters:
cell
- theGridCell
of the control to renderparent
- theComposite
to render on- Returns:
- the rendered
Control
- Throws:
NoRendererFoundException
- this is thrown when a renderer cannot be foundNoPropertyDescriptorFoundExeption
- this is thrown when no property descriptor can be found- See Also:
org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#renderControl(int, org.eclipse.swt.widgets.Composite, org.eclipse.emf.ecp.view.spi.model.VElement, org.eclipse.emf.ecp.view.spi.context.ViewModelContext)
-
createTreeViewer
protected org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent)
Creates aTreeViewer
. Sub classes can override to influence theTreeViewer
.- Parameters:
parent
- the parentComposite
- Returns:
- a
TreeViewer
- Since:
- 1.14
-
getCategorizations
protected abstract org.eclipse.emf.common.util.EList<VAbstractCategorization> getCategorizations()
The list of categorizations to display in the tree.- Returns:
- the list of
VAbstractCategorization
-
getCategorizationElement
protected abstract VCategorizationElement getCategorizationElement()
The VCategorizationElement to set the current selection onto.- Returns:
- the VCategorizationElement
-
createdEditorPane
protected org.eclipse.swt.custom.ScrolledComposite createdEditorPane(org.eclipse.swt.widgets.Composite composite)
Created editor pane.- Parameters:
composite
- the composite- Returns:
- the created editor composite
-
setupTreeViewer
protected void setupTreeViewer(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.swt.custom.ScrolledComposite editorComposite)
Configures the passed tree viewer.- Parameters:
treeViewer
- theTreeViewer
to configureeditorComposite
- the composite of the editor
-
getTreeLabelProvider
protected AbstractJFaceTreeRenderer.TreeTableLabelProvider getTreeLabelProvider(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
The TreeTableLabel provider.- Parameters:
treeViewer
- theTreeViewer
adapterFactory
- theAdapterFactory
to use- Returns:
- the created
AbstractJFaceTreeRenderer.TreeTableLabelProvider
- Since:
- 1.9
-
initTreeViewer
protected void initTreeViewer(org.eclipse.jface.viewers.TreeViewer treeViewer)
Inits the tree viewer.- Parameters:
treeViewer
- the tree viewer
-
addTreeEditor
protected void addTreeEditor(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.emf.ecore.EObject view, java.util.List<org.eclipse.swt.custom.TreeEditor> editors)
Adds the tree editor.- Parameters:
treeViewer
- the tree viewerview
- the vieweditors
- the list of tree editors
-
addButtons
protected void addButtons(org.eclipse.jface.viewers.TreeViewer treeViewer, org.eclipse.jface.viewers.TreeSelection treeSelection, java.util.List<org.eclipse.swt.custom.TreeEditor> editors)
Adds the buttons.- Parameters:
treeViewer
- the tree viewertreeSelection
- the tree selectioneditors
- the list of tree editors
-
showCategorization
public boolean showCategorization(VAbstractCategorization categorization)
Reveal the control that renders the givencategorization
.- Parameters:
categorization
- a categorization to reveal- Returns:
- whether the
categorization
was successfully revealed - Since:
- 1.22
-
-