Search in sources :

Example 6 with IProjectRepositoryNode

use of org.talend.repository.model.nodes.IProjectRepositoryNode in project tdi-studio-se by Talend.

the class AbstractVersionManagementProjectSettingPage method addRepositoryTreeViewer.

/**
     * repository tree viewer.
     */
private void addRepositoryTreeViewer(Composite leftComposite) {
    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.widthHint = 210;
    gridData.heightHint = 400;
    leftComposite.setLayoutData(gridData);
    RepoCommonViewerProvider provider = RepoCommonViewerProvider.CHECKBOX;
    treeViewer = (CheckboxRepositoryTreeViewer) provider.createViewer(leftComposite);
    IProjectRepositoryNode projectRepositoryNode = provider.getProjectRepositoryNode();
    processItems(versionObjects, (RepositoryNode) projectRepositoryNode);
    addMenuAction(treeViewer.getTree());
    // filter
    treeViewer.addFilter(new ViewerFilter() {

        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
            RepositoryNode node = (RepositoryNode) element;
            return filterRepositoryNode(node);
        }
    });
    // event
    treeViewer.addCheckStateListener(checkStateListener);
    treeViewer.addTreeListener(new ITreeViewerListener() {

        @Override
        public void treeCollapsed(TreeExpansionEvent event) {
        //
        }

        @Override
        public void treeExpanded(TreeExpansionEvent event) {
        // refreshCheckedTreeView();
        }
    });
    expandSomeNodes(projectRepositoryNode);
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) GridData(org.eclipse.swt.layout.GridData) ITreeViewerListener(org.eclipse.jface.viewers.ITreeViewerListener) CheckboxRepositoryTreeViewer(org.talend.repository.viewer.ui.viewer.CheckboxRepositoryTreeViewer) Viewer(org.eclipse.jface.viewers.Viewer) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ItemVersionObject(org.talend.repository.model.ItemVersionObject) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IProjectRepositoryNode(org.talend.repository.model.nodes.IProjectRepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) RepoCommonViewerProvider(org.talend.repository.viewer.ui.provider.RepoCommonViewerProvider) IProjectRepositoryNode(org.talend.repository.model.nodes.IProjectRepositoryNode) TreeExpansionEvent(org.eclipse.jface.viewers.TreeExpansionEvent)

Aggregations

IRepositoryNode (org.talend.repository.model.IRepositoryNode)6 IProjectRepositoryNode (org.talend.repository.model.nodes.IProjectRepositoryNode)6 ProjectRepositoryNode (org.talend.core.repository.model.ProjectRepositoryNode)5 RepositoryNode (org.talend.repository.model.RepositoryNode)5 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)4 Item (org.talend.core.model.properties.Item)3 IContentProvider (org.eclipse.jface.viewers.IContentProvider)2 TableItem (org.eclipse.swt.widgets.TableItem)2 NavigatorContentServiceContentProvider (org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider)2 Property (org.talend.core.model.properties.Property)2 RepositoryObject (org.talend.core.model.repository.RepositoryObject)2 ItemVersionObject (org.talend.repository.model.ItemVersionObject)2 File (java.io.File)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 IPath (org.eclipse.core.runtime.IPath)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Path (org.eclipse.core.runtime.Path)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1