Skip navigation links
org.eclipse.nebula.widgets.treemapper

Class TreeMapper<M,L,R>

    • Method Detail

      • setContentProviders

        public void setContentProviders(org.eclipse.jface.viewers.ITreeContentProvider leftContentProvider,
                                        org.eclipse.jface.viewers.ITreeContentProvider rightTreeContentProvider)
        Set the content providers for both trees. Both tree provides MUST HAVE their ITreeContentProvider.getParent(Object) method implemeneted.
        Parameters:
        leftContentProvider - An ITreeContentProvider that node are instances of the L type parameter.
        rightTreeContentProvider - An ITreeContentProvider that node are instances of the R type parameter.
      • setLabelProviders

        public void setLabelProviders(org.eclipse.jface.viewers.IBaseLabelProvider leftLabelProvider,
                                      org.eclipse.jface.viewers.IBaseLabelProvider rightLabelProvider)
      • setInput

        public void setInput(java.lang.Object leftTreeInput,
                             java.lang.Object rightTreeInput,
                             java.util.List<M> mappings)
        Sets the input of the widget.
        Parameters:
        leftTreeInput - The input for left TreeViewer
        rightTreeInput - The input for right TreeViewer
        mappings - The list containing the mapping. It will be used as a working copy and then MODIFIED by the tree mapper. If you don't want to pass a modifiable list, then pass a copy of the default mapping list, and prefer using TreeMapperaddNewMappingListener(INewMappingListener) and INewMappingListener to track the creation of mapping.
      • performMappingByDrop

        protected void performMappingByDrop(org.eclipse.jface.viewers.TreeViewer sourceTreeViewer,
                                            org.eclipse.jface.viewers.ISelection sourceData,
                                            org.eclipse.jface.viewers.TreeViewer targetTreeViewer,
                                            org.eclipse.swt.widgets.TreeItem targetTreeItem,
                                            int direction)
        Parameters:
        targetTreeViewer -
        data -
        widget -
      • getControl

        public org.eclipse.swt.custom.SashForm getControl()
        Returns:
      • addSelectionChangedListener

        public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
        Specified by:
        addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
      • getSelection

        public org.eclipse.jface.viewers.IStructuredSelection getSelection()
        Specified by:
        getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
        See Also:
        ISelectionProvider.getSelection()
      • removeSelectionChangedListener

        public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
        Specified by:
        removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
        See Also:
        ISelectionProvider.removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
      • setSelection

        public void setSelection(org.eclipse.jface.viewers.ISelection selection)
        Specified by:
        setSelection in interface org.eclipse.jface.viewers.ISelectionProvider
        See Also:
        ISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
      • fireMappingSelection

        protected void fireMappingSelection(M mapping,
                                            LinkFigure arrowFigure)
        Parameters:
        mapping -
        arrowFigure -
      • addNewMappingListener

        public void addNewMappingListener(INewMappingListener<M> listener)
        Parameters:
        iNewMappingListener -
      • fireMouseExited

        protected void fireMouseExited(M mapping,
                                       LinkFigure arrowFigure)
        Parameters:
        mapping -
        arrowFigure -
      • fireMouseEntered

        protected void fireMouseEntered(M mapping,
                                        LinkFigure arrowFigure)
        Parameters:
        mapping -
        arrowFigure -
      • getLeftTreeViewer

        public org.eclipse.jface.viewers.TreeViewer getLeftTreeViewer()
        Returns:
      • getRightTreeViewer

        public org.eclipse.jface.viewers.TreeViewer getRightTreeViewer()
        Returns:
      • refresh

        public void refresh()
        Refresh the widget by resetting the setInput value