Java 类org.eclipse.ui.dialogs.ContainerCheckedTreeViewer 实例源码

项目:slr-toolkit    文件:TaxonomyCheckboxListView.java   
/**
 * This is a callback that will allow us to create the viewer and initialize
 * it.
 */
@Override
public void createPartControl(Composite parent) {
    Optional<Model> m = ModelRegistryPlugin.getModelRegistry().getActiveTaxonomy();
    contentProvider = new ViewContentProvider(viewer);
    viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(new DefaultEObjectLabelProvider());
    viewer.addCheckStateListener(this);
    viewer.setSorter(null);
    if(m.isPresent()){
        viewer.setInput(m.get());
    }
    viewer.expandAll();

    getSite().setSelectionProvider(viewer);
    // Create the help context id for the viewer's control
    PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "de.tudresden.slr.model.taxonomy.ui.viewer");
    getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);
}
项目:mytourbook    文件:TVIMap3Item.java   
/**
 * @return Returns the tree viewer for the tree items, the viewer is set in the root item of the
 *         tree viewer.
 */
ContainerCheckedTreeViewer getTreeItemViewer() {

    int endlessCounter = 0;

    while (true) {

        final TreeViewerItem parent = getParentItem();

        if (parent instanceof TVIMap3Root) {
            final TVIMap3Root map3Root = (TVIMap3Root) parent;

            return map3Root.getTreeViewer();
        }

        if (endlessCounter++ > 10) {
            return null;
        }
    }
}
项目:mytourbook    文件:TVIMap3Category.java   
public void setCheckState() {

        if (_checkStateNotSet.size() == 0) {
            // nothing to do
            return;
        }


        final ContainerCheckedTreeViewer layerViewer = getTreeItemViewer();
        if (layerViewer != null) {


            // set check state in the viewer
            for (final TVIMap3Layer layerItem : _checkStateNotSet) {
                layerViewer.setChecked(layerItem, layerItem.isLayerVisible);
            }

            // reset
            _checkStateNotSet.clear();
        }
    }
项目:mytourbook    文件:DialogLayerViewerToolTip.java   
public DialogLayerViewerToolTip(final ContainerCheckedTreeViewer propViewer) {

        super(propViewer.getTree());

        _propViewer = propViewer;

        _tree = propViewer.getTree();
        _tree.addDisposeListener(new DisposeListener() {
            @Override
            public void widgetDisposed(final DisposeEvent e) {
                onDispose();
            }
        });

        final Device display = _tree.getDisplay();

        _bgColor = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
        _fgColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
    }
项目:Pydev    文件:OverrideMethodsPage.java   
private void createTreeViewer(Composite treeComp) {
    treeViewer = new ContainerCheckedTreeViewer(treeComp);
    treeViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            processSelectionChange();
        }
    });

    treeViewer.setContentProvider(classProvider);
    treeViewer.setLabelProvider(labelProvider);
    treeViewer.setAutoExpandLevel(2);
    // treeViewer.addFilter(new MethodViewerFilter());
    treeViewer.setUseHashlookup(true);
    treeViewer.setInput("");
    treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0]));
}
项目:Pydev    文件:GeneratePropertiesPage.java   
private void createTreeViewer(Composite treeComp) {
    treeViewer = new ContainerCheckedTreeViewer(treeComp);
    treeViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            getRequestProcsseor().setCheckedElements(treeViewer.getCheckedElements());
            GeneratePropertiesPage.this.getWizard().getContainer().updateButtons();
        }
    });

    treeViewer.setContentProvider(classProvider);
    treeViewer.setLabelProvider(labelProvider);
    treeViewer.setAutoExpandLevel(2);
    treeViewer.setInput("");
    treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0]));
}
项目:Pydev    文件:ConstructorFieldPage.java   
private void createTreeViewer(Composite treeComp) {
    treeViewer = new ContainerCheckedTreeViewer(treeComp);
    treeViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            getRequestProcessor().setCheckedElements(treeViewer.getCheckedElements());
            ConstructorFieldPage.this.getWizard().getContainer().updateButtons();
        }
    });

    treeViewer.setContentProvider(classProvider);
    treeViewer.setLabelProvider(labelProvider);
    treeViewer.setAutoExpandLevel(2);
    treeViewer.setInput("");
    treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0]));
}
项目:ermasterr    文件:CompositeFactory.java   
public static ContainerCheckedTreeViewer createCheckedTreeViewer(final AbstractDialog dialog, final Composite parent, final int height, final int span) {
    final GridData gridData = new GridData();
    gridData.heightHint = height;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalSpan = span;

    final ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    final Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());

    if (dialog != null) {
        viewer.addCheckStateListener(new ICheckStateListener() {

            @Override
            public void checkStateChanged(final CheckStateChangedEvent event) {
                dialog.validate();
            }

        });
    }

    return viewer;
}
项目:ermaster-k    文件:CompositeFactory.java   
public static ContainerCheckedTreeViewer createCheckedTreeViewer(
        final AbstractDialog dialog, Composite parent, int height, int span) {
    GridData gridData = new GridData();
    gridData.heightHint = height;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalSpan = span;

    ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(
            parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());

    if (dialog != null) {
        viewer.addCheckStateListener(new ICheckStateListener() {

            public void checkStateChanged(CheckStateChangedEvent event) {
                dialog.validate();
            }

        });
    }

    return viewer;
}
项目:cppcheclipse    文件:CheckedTreeEditor.java   
/**
 * Returns this field editor's list control.
 * 
 * @param parent
 *            the parent control
 * @return the list control
 */
public Tree createListControl(Composite parent) {
    Tree table = (Tree) getTreeControl();
    if (table == null) {
        listParent = parent;
        treeViewer = new ContainerCheckedTreeViewer(parent, SWT.BORDER | SWT.MULTI
                | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
        table = treeViewer.getTree();
        table.setFont(parent.getFont());
        treeViewer.addCheckStateListener(this);
    } else {
        checkParent(table, parent);
    }
    return table;
}
项目:junit-tools    文件:GroupMethodSelectionView.java   
private CheckboxTreeViewer createTreeViewer(Composite parent) {
checkboxTreeViewer = new ContainerCheckedTreeViewer(parent, SWT.CHECK);

ITreeContentProvider contentProvider = new StandardJavaElementContentProvider(
    true);
checkboxTreeViewer.setContentProvider(contentProvider);

// label provider
ILabelProvider labelProvider = new JavaElementLabelProvider(
    JavaElementLabelProvider.SHOW_DEFAULT
        | JavaElementLabelProvider.SHOW_RETURN_TYPE);
checkboxTreeViewer.setLabelProvider(labelProvider);

return checkboxTreeViewer;
   }
项目:erflute    文件:AbstractSelectImportedObjectDialog.java   
private void createAllObjectGroup(Composite composite) {
    final GridData gridData = new GridData();
    gridData.heightHint = 300;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    final Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
}
项目:erflute    文件:SelectImportedSchemaDialog.java   
private void createAllSchemaGroup(Composite composite) {
    final GridData gridData = new GridData();
    gridData.heightHint = 300;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    final Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
}
项目:ermaster-nhit    文件:CompositeFactory.java   
public static ContainerCheckedTreeViewer createCheckedTreeViewer(
        final AbstractDialog dialog, Composite parent, int height, int span) {
    GridData gridData = new GridData();
    gridData.heightHint = height;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalSpan = span;

    ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(
            parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());

    if (dialog != null) {
        viewer.addCheckStateListener(new ICheckStateListener() {

            public void checkStateChanged(CheckStateChangedEvent event) {
                dialog.validate();
            }

        });
    }

    return viewer;
}
项目:FindBug-for-Domino-Designer    文件:FilterBugsDialog.java   
private ContainerCheckedTreeViewer createTree(Composite parent, int style) {
    final ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(parent, style | SWT.SINGLE | SWT.BORDER
            | SWT.V_SCROLL | SWT.H_SCROLL | SWT.RESIZE) {
        /**
         * Overriden to re-set checked state of elements after filter change
         */
        @Override
        public void refresh(boolean updateLabels) {
            super.refresh(updateLabels);
            setCheckedElements(checkedElements);
        }
    };

    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(labelProvider);
    viewer.setInput(allowedTypes);
    Object[] preselected = getPreselected();
    viewer.setCheckedElements(preselected);
    viewer.addPostSelectionChangedListener(new TreeSelectionChangedListener());
    viewer.getTree().addControlListener(new ControlAdapter() {
        @Override
        public void controlResized(ControlEvent e) {
            updateDescription((IStructuredSelection) viewer.getSelection());
        }
    });
    viewer.addCheckStateListener(new TreeCheckStateListener());
    return viewer;
}
项目:mytourbook    文件:TVIMap3Root.java   
protected ContainerCheckedTreeViewer getTreeViewer() {
    return _treeViewer;
}
项目:mytourbook    文件:TVIMap3Root.java   
public void setTreeViewer(final ContainerCheckedTreeViewer treeViewer) {
    _treeViewer = treeViewer;
}
项目:Eclipse-Postfix-Code-Completion    文件:PullUpMethodPage.java   
private void precheckElements(final ContainerCheckedTreeViewer treeViewer) {
    final IMember[] members= fProcessor.getMembersToMove();
    for (int i= 0; i < members.length; i++) {
        treeViewer.setChecked(members[i], true);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:OverrideMethodDialog.java   
public ContainerCheckedTreeViewer getViewer() {
    return fViewer;
}
项目:Eclipse-Postfix-Code-Completion    文件:OverrideMethodDialog.java   
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
    fViewer= (ContainerCheckedTreeViewer) viewer;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PullUpMethodPage.java   
private void precheckElements(final ContainerCheckedTreeViewer treeViewer) {
    final IMember[] members= fProcessor.getMembersToMove();
    for (int i= 0; i < members.length; i++) {
        treeViewer.setChecked(members[i], true);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:OverrideMethodDialog.java   
public ContainerCheckedTreeViewer getViewer() {
    return fViewer;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:OverrideMethodDialog.java   
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
    fViewer= (ContainerCheckedTreeViewer) viewer;
}
项目:mytourbook    文件:ProfileDropAdapter.java   
ProfileDropAdapter(final DialogMPProfile dialogMPProfile, final ContainerCheckedTreeViewer treeViewer) {

        super(treeViewer);

        fDialogMPProfile = dialogMPProfile;
        fMpViewer = treeViewer;
    }
项目:mytourbook    文件:TVIMapProviderRoot.java   
public TVIMapProviderRoot(  final ContainerCheckedTreeViewer mapProviderViewer,
                            final ArrayList<MPWrapper> mpWrapperList) {

    super(mapProviderViewer);

    _mpWrapperList = mpWrapperList;
}
项目:mytourbook    文件:SlideoutMap3LayerTooltip.java   
public SlideoutMap3LayerTooltip(final ContainerCheckedTreeViewer layerViewer) {

        super(layerViewer.getTree());

        _layerViewer = layerViewer;
        _tree = _layerViewer.getTree();

        final Device display = _tree.getDisplay();

        _bgColor = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
        _fgColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);

        _cursorHand = new Cursor(display, SWT.CURSOR_HAND);

    }
项目:mytourbook    文件:ProfileDropAdapter.java   
ProfileDropAdapter(final DialogMPProfile dialogMPProfile, final ContainerCheckedTreeViewer treeViewer) {

        super(treeViewer);

        fDialogMPProfile = dialogMPProfile;
        fMpViewer = treeViewer;
    }
项目:mytourbook    文件:TVIMapProviderRoot.java   
public TVIMapProviderRoot(  final ContainerCheckedTreeViewer mapProviderViewer,
                            final ArrayList<MPWrapper> mpWrapperList) {

    super(mapProviderViewer);

    _mpWrapperList = mpWrapperList;
}