Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ContainerCheckedTreeViewer


        group.setText(name);
        return group;
    }

    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;
    }
View Full Code Here


   * @param parent
   *          the parent composite
   * @return TreeViewer that shows uses Workbench Content- and LabelProvider
   */
  protected ContainerCheckedTreeViewer createTreeViewer(Composite parent) {
    final ContainerCheckedTreeViewer treeViewer = new ContainerCheckedTreeViewer(parent);

    final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gridData.heightHint = 150;
    treeViewer.getTree().setLayoutData(gridData);

    treeViewer.setContentProvider(new WorkbenchContentProvider());
    treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    treeViewer.setSorter(new WorkbenchViewerSorter());

    return treeViewer;
  }
View Full Code Here

    label.setText(WizardMessages.NewCamelTestWizardPageTwo_methods_tree_label);
    GridData gd = new GridData();
    gd.horizontalSpan = 2;
    label.setLayoutData(gd);

    fInputEndpointsTree = new ContainerCheckedTreeViewer(container, SWT.BORDER);
    gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
    gd.heightHint = 180;
    fInputEndpointsTree.getTree().setLayoutData(gd);

    fInputEndpointsTree.setLabelProvider(new JavaElementLabelProvider());
View Full Code Here

   */
  protected TreeViewer createTreeViewer(Composite parent) {
    // TODO Auto-generated method stub
    Tree tree = new Tree(parent, SWT.CHECK + getTreeStyle());
    tree.setFont(parent.getFont());
    ContainerCheckedTreeViewer treeViewer = new ContainerCheckedTreeViewer(
        tree);
    treeViewer.addCheckStateListener(new ICheckStateListener() {
      public void checkStateChanged(CheckStateChangedEvent e) {
        doCheckStateChanged(e);
      }
    });
    return treeViewer;
View Full Code Here

      fComposite.setLayout(createGridLayout(numColumns, false));

      createLabel(numColumns, fComposite,
          FormatterMessages.WhiteSpaceTabPage_insert_space);

      fTreeViewer = new ContainerCheckedTreeViewer(fComposite, SWT.SINGLE
          | SWT.BORDER | SWT.V_SCROLL);
      fTreeViewer.setContentProvider(new ITreeContentProvider() {
        public Object[] getElements(Object inputElement) {
          return ((Collection) inputElement).toArray();
        }
View Full Code Here

        getRequestProcessor().setInsertionPoint(strategyProvider.get(0).getStrategy());
        insertionPointCmb.getCombo().select(0);
    }

    private void createTreeViewer(Composite treeComp) {
        treeViewer = new ContainerCheckedTreeViewer(treeComp);
        treeViewer.addCheckStateListener(new ICheckStateListener() {
            public void checkStateChanged(CheckStateChangedEvent event) {
                processSelectionChange();
            }
        });
View Full Code Here

        getRequestProcessor().setMethodDestination(strategyProvider.get(0).getStrategy());
        methodInsertionComb.getCombo().select(0);
    }

    private void createTreeViewer(Composite treeComp) {
        treeViewer = new ContainerCheckedTreeViewer(treeComp);
        treeViewer.addCheckStateListener(new ICheckStateListener() {
            public void checkStateChanged(CheckStateChangedEvent event) {
                getRequestProcessor().setCheckedElements(treeViewer.getCheckedElements());
                ConstructorFieldPage.this.getWizard().getContainer().updateButtons();
            }
View Full Code Here

        propertyInsertionComb.getCombo().select(2);

    }

    private void createTreeViewer(Composite treeComp) {
        treeViewer = new ContainerCheckedTreeViewer(treeComp);
        treeViewer.addCheckStateListener(new ICheckStateListener() {
            public void checkStateChanged(CheckStateChangedEvent event) {
                getRequestProcsseor().setCheckedElements(treeViewer.getCheckedElements());
                GeneratePropertiesPage.this.getWizard().getContainer().updateButtons();
            }
View Full Code Here

    setControl(composite);
  }

  private void createResourcesViewer(Composite composite) {
    resourcesViewer = new ContainerCheckedTreeViewer(composite);
    resourcesViewer.setContentProvider(new WorkbenchContentProvider() {
      public Object[] getChildren(Object element) {
        if (element instanceof org.eclipse.core.resources.IContainer) {
          try {
            IResource[] members = ((org.eclipse.core.resources.IContainer) element).members();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.dialogs.ContainerCheckedTreeViewer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.