Class 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
    • Field Summary

      • Fields inherited from class org.eclipse.swt.widgets.Control

        handle
    • 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 the master-detail selection provider, instead}, or refresh() to force a refresh of the tree, or selectAndReveal(Object) to select and reveal some object in my tree
      boolean 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 a selection in my tree.
      void setCache​(DetailViewCache cache)
      Override the default cache implementation.
      void setCache​(TreeMasterDetailCache cache)
      Deprecated.
      As of 1.22, use the setCache(DetailViewCache) API, instead
      void 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • 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 class org.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
      • 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 a selection in my tree. If the argument is an UniqueSetting, 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 the selection 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 interface org.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

        public void setCache​(DetailViewCache cache)
        Override the default cache implementation.
        Parameters:
        cache - the DetailViewCache to use, or null to use no cache
        Since:
        1.22
      • 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