Class TreeMasterDetailSWTRenderer

    • Field Detail

      • DETAIL_KEY

        public static final java.lang.String DETAIL_KEY
        The detail key passed to the view model context.
        See Also:
        Constant Field Values
      • GLOBAL_ADDITIONS

        public static final java.lang.String GLOBAL_ADDITIONS
        Menu separator ID for the group to which additional menu contributions are added in the tree's context menu.
        See Also:
        Constant Field Values
      • ROOT_KEY

        public static final java.lang.String ROOT_KEY
        Context key for the root.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TreeMasterDetailSWTRenderer

        @Inject
        public TreeMasterDetailSWTRenderer​(VTreeMasterDetail vElement,
                                           ViewModelContext viewContext,
                                           ReportService reportService)
        Default Constructor.
        Parameters:
        vElement - the view element to be rendered
        viewContext - The view model context
        reportService - the ReportService to use
        Since:
        1.6
    • Method Detail

      • createSash

        protected org.eclipse.swt.custom.SashForm createSash​(org.eclipse.swt.widgets.Composite parent)
        Creates the sashform for the master detail colums.
        Parameters:
        parent - the parent
        Returns:
        the sash
      • createMasterDetailForm

        protected org.eclipse.swt.widgets.Composite createMasterDetailForm​(org.eclipse.swt.widgets.Composite parent)
        Create the parent of the master detail form.
        Parameters:
        parent - the parent
        Returns:
        the composite
      • createMasterTree

        protected org.eclipse.jface.viewers.TreeViewer createMasterTree​(org.eclipse.swt.widgets.Composite masterPanel)
        Creates the tree viewer for the master.
        Parameters:
        masterPanel - the parent
        Returns:
        the tree viewer
      • hasContextMenu

        protected boolean hasContextMenu()
        Return true if a context menu should be shown in the tree.
        Returns:
        true if a context menu should be shown, false otherwise
      • hasDnDSupport

        protected boolean hasDnDSupport()
        Return true if the tree should support DnD.
        Returns:
        true if DnD should be supported , false otherwise
      • getLabelProvider

        protected org.eclipse.jface.viewers.ILabelProvider getLabelProvider​(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider adapterFactoryLabelProvider)
        Returns the label provider.
        Parameters:
        adapterFactoryLabelProvider - the adaper factory label provider
        Returns:
        the label provider to use for the tree
      • createMasterPanel

        protected org.eclipse.swt.widgets.Composite createMasterPanel​(org.eclipse.swt.custom.SashForm sash)
        Creates the composite for the master panel.
        Parameters:
        sash - the parent
        Returns:
        the composite
      • createHeader

        protected void createHeader​(org.eclipse.swt.widgets.Composite parent)
        Adds the header to a parent composite.
        Parameters:
        parent - the parent
      • createRightPanelContent

        protected org.eclipse.swt.custom.ScrolledComposite createRightPanelContent​(org.eclipse.swt.widgets.Composite parent)
        Creates the composite holding the details.
        Parameters:
        parent - the parent
        Returns:
        the right panel/detail composite
      • getDefaultFontName

        protected java.lang.String getDefaultFontName​(org.eclipse.swt.widgets.Control control)
        Overrides:
        getDefaultFontName in class AbstractSWTRenderer<VTreeMasterDetail>
        Parameters:
        control - The control to derive the default font name from
        Returns:
        String the default font name on the system.
      • readMasterDetailActions

        protected java.util.List<MasterDetailAction> readMasterDetailActions()
        Returns a list of all MasterDetailActions which shall be displayed in the context menu of the master treeviewer.
        Returns:
        the actions
      • manipulateViewContext

        protected void manipulateViewContext​(ViewModelContext viewContext)
        Allows to manipulate the view context for the selected element that is about to be rendered.
        Parameters:
        viewContext - the view context.
      • getDetailContainer

        protected org.eclipse.swt.widgets.Composite getDetailContainer()
        Returns the composite for the detail.
        Returns:
        the composite
      • manipulateSelection

        protected java.lang.Object manipulateSelection​(java.lang.Object treeSelected)
        Allows to manipulate the selection by returning a specific child.
        Parameters:
        treeSelected - the selected element in the tree
        Returns:
        the object that should be used as a selection
      • cleanCustomOnSelectionChange

        protected void cleanCustomOnSelectionChange()
        Gets called after a detail composite was disposed. Allows for further cleanup.
      • relayoutDetail

        protected void relayoutDetail()
        Relayouts the detail composite.
      • reveal

        public boolean reveal​(java.lang.Object object)
        Reveal the given object in my tree.
        Parameters:
        object - an object to reveal
        Returns:
        whether I succeeded in revealing it
        Since:
        1.22
      • getTreePathFor

        public org.eclipse.jface.viewers.TreePath getTreePathFor​(java.lang.Object object)
        Get a path to an in my tree.
        Parameters:
        object - an object in my tree
        Returns:
        a path to it
        Since:
        1.22
      • reveal

        public boolean reveal​(org.eclipse.jface.viewers.TreePath path)
        Reveal the given path in my tree.
        Parameters:
        path - a tree path to reveal
        Returns:
        whether I succeeded in revealing it
        Since:
        1.22
      • hasPath

        public boolean hasPath​(org.eclipse.jface.viewers.TreePath path)
        Query whether the given path exists in my tree.
        Parameters:
        path - a tree path
        Returns:
        whether the path locates an element that exists in my tree
        Since:
        1.22
      • getDetailContext

        public ViewModelContext getDetailContext()
        Obtain the current detail context, if any.
        Returns:
        the view-model context of the details currently being presented, or null if none (usually because there is no selection in the tree)
        Since:
        1.22