Class TreeMasterDetailComposite
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- org.eclipse.emfforms.spi.swt.treemasterdetail.TreeMasterDetailComposite
-
- All Implemented Interfaces:
org.eclipse.emf.edit.domain.IEditingDomainProvider
,org.eclipse.swt.graphics.Drawable
public class TreeMasterDetailComposite extends org.eclipse.swt.widgets.Composite implements org.eclipse.emf.edit.domain.IEditingDomainProvider
The Class MasterDetailRenderer. It is the base renderer for the editor. It takes any object as input and renders a tree on the left-hand side. When selecting an item in the tree (that is an EObject) EMF-Forms is used to render the detail pane on the right-hand side MasterDetailRenderer implements IEditingDomainProvider to allow Undo/Redo/Copy/Cut/Paste actions to be performed externally. MasterDetailRenderer provides an ISelectionProvider to get the currently selected items in the tree
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addViewModelPropertiesUpdateCallback(ViewModelPropertiesUpdateCallback viewModelPropertiesUpdateCallback)
void
dispose()
java.lang.Object
getCurrentSelection()
Gets the current selection.org.eclipse.emf.edit.domain.EditingDomain
getEditingDomain()
Gets the editing domain.org.eclipse.jface.viewers.ISelectionProvider
getMasterDetailSelectionProvider()
Get the master/detail-aware selection provider.org.eclipse.jface.viewers.TreeViewer
getSelectionProvider()
Deprecated.Use themaster-detail selection provider
, instead}, orrefresh()
to force a refresh of the tree, orselectAndReveal(Object)
to select and reveal some object in my treeboolean
isReadOnly()
Returns whether I am read-only.void
refresh()
Request a refresh of my tree.boolean
registerDetailPanelRenderingFinishedCallback(DetailPanelRenderingFinishedCallback detailPanelRenderingFinishedCallback)
Register a callback that is notified whenever the rendering of a detail panel is finished.boolean
selectAndReveal(java.lang.Object selection)
Select and reveal aselection
in my tree.void
setCache(DetailViewCache cache)
Override the default cache implementation.void
setCache(TreeMasterDetailCache cache)
Deprecated.As of 1.22, use thesetCache(DetailViewCache)
API, insteadvoid
setInput(java.lang.Object input)
Allows to set a different input for the treeviewer.void
setSelection(org.eclipse.jface.viewers.ISelection structuredSelection)
Sets the selection.boolean
unregisterDetailPanelRenderingFinishedCallback(DetailPanelRenderingFinishedCallback detailPanelRenderingFinishedCallback)
Register a callback that is notified whenever the rendering of a detail panel is finished.void
updateDetailPanel(boolean setFocusToDetail)
Updates the detail panel of the tree master detail.-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
-
-
-
-
Method Detail
-
updateDetailPanel
public void updateDetailPanel(boolean setFocusToDetail)
Updates the detail panel of the tree master detail.- Parameters:
setFocusToDetail
-true
if the focus should be moved to the detail panel- Since:
- 1.11
-
dispose
public void dispose()
- Overrides:
dispose
in classorg.eclipse.swt.widgets.Widget
-
getCurrentSelection
public java.lang.Object getCurrentSelection()
Gets the current selection.- Returns:
- the current selection
-
setSelection
public void setSelection(org.eclipse.jface.viewers.ISelection structuredSelection)
Sets the selection.- Parameters:
structuredSelection
- the new selection- Since:
- 1.9
-
getSelectionProvider
@Deprecated public org.eclipse.jface.viewers.TreeViewer getSelectionProvider()
Deprecated.Use themaster-detail selection provider
, instead}, orrefresh()
to force a refresh of the tree, orselectAndReveal(Object)
to select and reveal some object in my treeGets the tree viewer.- Returns:
- the tree viewer (which is a selection provider)
- See Also:
getMasterDetailSelectionProvider()
-
getMasterDetailSelectionProvider
public org.eclipse.jface.viewers.ISelectionProvider getMasterDetailSelectionProvider()
Get the master/detail-aware selection provider.- Returns:
- a selection provider that is aware of the user's focus on either the master tree or the detail view
- Since:
- 1.21
-
refresh
public void refresh()
Request a refresh of my tree.- Since:
- 1.22
-
selectAndReveal
public boolean selectAndReveal(java.lang.Object selection)
Select and reveal aselection
in my tree. If the argument is anUniqueSetting
, then the owner of the setting will be revealed and the control that edits the setting will be revealed and focused (if possible) in the object's detail view.- Parameters:
selection
- the objet to select and reveal- Returns:
true
if theselection
was revealed;false
, otherwise, including the case where the nearest parent object up the tree was revealed instead- Since:
- 1.22
-
getEditingDomain
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
Gets the editing domain.- Specified by:
getEditingDomain
in interfaceorg.eclipse.emf.edit.domain.IEditingDomainProvider
- Returns:
- the editing domain
-
setInput
public void setInput(java.lang.Object input)
Allows to set a different input for the treeviewer.- Parameters:
input
- the new input
-
setCache
@Deprecated public void setCache(TreeMasterDetailCache cache)
Deprecated.As of 1.22, use thesetCache(DetailViewCache)
API, insteadAllows to override the default cache implementation by the provided one.- Parameters:
cache
- TheTreeMasterDetailCache
to use.- Since:
- 1.9
-
setCache
public void setCache(DetailViewCache cache)
Override the default cache implementation.- Parameters:
cache
- theDetailViewCache
to use, ornull
to use no cache- Since:
- 1.22
-
isReadOnly
public boolean isReadOnly()
Returns whether I am read-only.- Returns:
true
if read-only- Since:
- 1.22
- See Also:
TreeMasterDetailSWTBuilder.customizeReadOnly(boolean)
-
addViewModelPropertiesUpdateCallback
public void addViewModelPropertiesUpdateCallback(ViewModelPropertiesUpdateCallback viewModelPropertiesUpdateCallback)
- Parameters:
viewModelPropertiesUpdateCallback
- the callback- Since:
- 1.11
-
registerDetailPanelRenderingFinishedCallback
public boolean registerDetailPanelRenderingFinishedCallback(DetailPanelRenderingFinishedCallback detailPanelRenderingFinishedCallback)
Register a callback that is notified whenever the rendering of a detail panel is finished.- Parameters:
detailPanelRenderingFinishedCallback
- the callback- Returns:
true
if the callback has been added,false
if it was already registered- Since:
- 1.13
-
unregisterDetailPanelRenderingFinishedCallback
public boolean unregisterDetailPanelRenderingFinishedCallback(DetailPanelRenderingFinishedCallback detailPanelRenderingFinishedCallback)
Register a callback that is notified whenever the rendering of a detail panel is finished.- Parameters:
detailPanelRenderingFinishedCallback
- the callback- Returns:
true
if the callback has been removed,false
if it was not registered- Since:
- 1.13
-
-