當前位置: 首頁>>代碼示例>>Java>>正文


Java CheckboxTreeViewer.setInput方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.CheckboxTreeViewer.setInput方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckboxTreeViewer.setInput方法的具體用法?Java CheckboxTreeViewer.setInput怎麽用?Java CheckboxTreeViewer.setInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.CheckboxTreeViewer的用法示例。


在下文中一共展示了CheckboxTreeViewer.setInput方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
/**
 * Creates the tree viewer.
 *
 * @param parent the parent composite
 * @return the tree viewer
 */
protected CheckboxTreeViewer createTreeViewer(Composite parent) {
    fViewer = new CheckboxTreeViewer(parent, SWT.BORDER);

    fViewer.setContentProvider(fContentProvider);
    fViewer.setLabelProvider(fLabelProvider);
    fViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            updateOKStatus();
        }
    });

    fViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
    if (fFilters != null) {
        for (int i = 0; i != fFilters.size(); i++) {
            fViewer.addFilter((ViewerFilter) fFilters.get(i));
        }
    }

    fViewer.setInput(fInput);

    return fViewer;
}
 
開發者ID:iloveeclipse,項目名稱:filesync4eclipse,代碼行數:30,代碼來源:MultipleFolderSelectionDialog.java

示例2: createTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
/**
 * Creates the tree viewer.
 *
 * @param parent the parent composite
 * @return the tree viewer
 */
protected CheckboxTreeViewer createTreeViewer(Composite parent) {
	fViewer = new CheckboxTreeViewer(parent, SWT.BORDER);

	fViewer.setContentProvider(fContentProvider);
	fViewer.setLabelProvider(fLabelProvider);
	fViewer.addCheckStateListener(new ICheckStateListener() {
		public void checkStateChanged(CheckStateChangedEvent event) {
			updateOKStatus();
		}
	});

	fViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
	if (fFilters != null) {
		for (int i = 0; i != fFilters.size(); i++)
			fViewer.addFilter(fFilters.get(i));
	}

	fViewer.setInput(fInput);

	return fViewer;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:28,代碼來源:MultipleFolderSelectionDialog.java

示例3: createDialogArea

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
  this.parent = parent;
  Composite area = (Composite) super.createDialogArea(parent);
  Composite container = new Composite(area, SWT.NONE);
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout = new GridLayout(1, false);
  container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
  container.setLayout(layout);

  treeViewer = new CheckboxTreeViewer(area, SWT.BORDER);

  Tree tree = treeViewer.getTree();
  tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

  treeViewer
      .setLabelProvider(new AdapterFactoryLabelProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer
      .setContentProvider(new AdapterFactoryContentProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer.setInput(modelRoot);
  return area;
}
 
開發者ID:atlanmod,項目名稱:emfviews,代碼行數:25,代碼來源:ModelSelectionDialog.java

示例4: configureTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
/**
 * 트리 뷰어 설정
 * 
 * @param viewer
 *            void
 */
protected void configureTreeViewer(CheckboxTreeViewer viewer) {
    viewer.setUseHashlookup(true);
    viewer.addCheckStateListener(new ICheckStateListener() {
        /**
         * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
         */
        public void checkStateChanged(CheckStateChangedEvent event) {
            treeViewer.setSubtreeChecked(event.getElement(), event.getChecked());
        }
    });

    viewer.setContentProvider(new ProjectItemTreeContentProvider(2));
    viewer.setLabelProvider(new ProjectItemLabelProvider());

    // 트리 뷰어의 경우 탐색기의 최상위 요소인 Model을 입력으로 설정하면
    // Model의 자식 요소부터 트리에 보여 주므로
    // 트리에 최상위 요소인 Model을 보여 주기 위해서는
    // Model을 자식으로 가지는 새로운 요소에다 Model을 설정해서
    // 그 요소를 트리의 입력으로 설정해 줘야 한다.
    ContainerElement container = new ContainerElement();
    container.addChild(rootElement);

    viewer.setInput(container);

    ViewerFilter viewerFilter = new ElementViewerFilter(filterType);
    viewer.addFilter(viewerFilter);
    viewer.setSorter(new NameSorter());
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:35,代碼來源:ProjectItemSelectionDialog.java

示例5: createProcessTree

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createProcessTree(Composite container) {
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayout(new FillLayout());
	UI.gridData(composite, true, true);
	viewer = new CheckboxTreeViewer(composite, SWT.MULTI | SWT.BORDER);
	viewer.setUseHashlookup(true);
	viewer.setContentProvider(new NavigationContentProvider());
	viewer.setLabelProvider(new NavigationLabelProvider(false));
	viewer.setInput(Navigator.getNavigationRoot());
	viewer.addCheckStateListener(new NavigationTreeCheck(viewer));
	viewer.addCheckStateListener(this);
	viewer.addFilter(new NavigationTreeFilter());
	viewer.setSorter(new NavigationSorter());
}
 
開發者ID:GreenDelta,項目名稱:olca-app,代碼行數:15,代碼來源:ExportWizardPage.java

示例6: createDialogArea

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent){
	DisplayPanel panel = new DisplayPanel(parent, fields, 2, 2, new IAction[0]);
	panel.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
	panel.setAutosave(true);
	panel.setObject(vt);
	
	Composite treeComposite = new Composite(parent, SWT.NONE);
	GridLayout gridLayout = new GridLayout(1, false);
	gridLayout.marginLeft = 5;
	treeComposite.setLayout(gridLayout);
	treeComposite.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	
	treeViewer =
		new CheckboxTreeViewer(treeComposite, SWT.FULL_SELECTION | SWT.BORDER | SWT.V_SCROLL);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
	tree.setHeaderVisible(true);
	tree.setLinesVisible(true);
	
	TreeViewerColumn col = new TreeViewerColumn(treeViewer, SWT.NONE);
	col.getColumn().setWidth(225);
	col.getColumn().setText("Impfung gegen Krankheit(en)");
	
	treeViewer.setContentProvider(new DiseaseTreeContentProvider());
	treeViewer.setLabelProvider(new DiseaseTreeLabelProvider());
	treeViewer.setInput(DiseaseDefinitionModel.getDiseaseDefinitions());
	treeViewer.setCheckedElements(loadSelected().toArray());
	
	return panel;
}
 
開發者ID:elexis,項目名稱:elexis-3-base,代碼行數:32,代碼來源:EditVaccinationDialog.java

示例7: createControl

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
  Composite container = new Composite(parent, SWT.NULL);
  setControl(container);
  container.setLayout(new FillLayout(SWT.HORIZONTAL));

  checkboxTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);

  MarkAllInWsContentProvider treeViewerContentProvider = new MarkAllInWsContentProvider();

  checkboxTreeViewer.setLabelProvider(new MarkAllInWsLabelProvider());
  checkboxTreeViewer.setContentProvider(treeViewerContentProvider);
  IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
  for (IProject iProject : projects) {
    if (!iProject.isOpen()) {
      this.closedProjects.add(iProject);
    }
  }
  checkboxTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects());
  checkboxTreeViewer.setGrayedElements(this.closedProjects.toArray());

  checkboxTreeViewer.addCheckStateListener(new ICheckStateListener() {

    @Override
    public void checkStateChanged(CheckStateChangedEvent event) {
      if (event.getChecked()) {
        if (((event.getElement() instanceof IProject)
            && !((IProject) event.getElement()).isOpen())) {
          return;
        }
        checkboxTreeViewer.setSubtreeChecked(event.getElement(), true);
      } else {
        if (((event.getElement() instanceof IProject)
            && !((IProject) event.getElement()).isOpen())) {
          return;
        }
        checkboxTreeViewer.setSubtreeChecked(event.getElement(), false);
      }
      setPageComplete(true);
    }
  });
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:43,代碼來源:MarkAllInWsPage.java

示例8: OptionalExportsControl

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
public OptionalExportsControl(
    final Composite parent,
    final int style,
    final DataProviderCollection dataProviderCollection,
    final DataProviderTreeControl dataProviderTreeControl) {
    super(parent, style);

    final GridLayout layout = new GridLayout(1, false);
    setLayout(layout);

    final Label label = new Label(this, SWT.WRAP);
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    label.setText(Messages.getString("OptionalExportsControl.SummaryLabelText")); //$NON-NLS-1$

    treeViewer = new CheckboxTreeViewer(this, SWT.BORDER);
    treeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    treeViewer.setContentProvider(new ContentProvider());
    treeViewer.setLabelProvider(new LabelProvider());

    treeViewer.setInput(dataProviderCollection);

    treeViewer.setExpandedElements(dataProviderCollection.getSortedCategoriesWithOptionalExportProviders());

    final List checkedElements = new ArrayList();
    final DataCategory[] categories = dataProviderCollection.getSortedCategoriesWithOptionalExportProviders();
    for (int i = 0; i < categories.length; i++) {
        final DataProviderWrapper[] dataProviders =
            dataProviderCollection.getSortedOptionalExportProvidersForCategory(categories[i]);
        for (int j = 0; j < dataProviders.length; j++) {
            if (dataProviders[j].isShouldExport()) {
                checkedElements.add(dataProviders[j]);
            }
        }
    }

    treeViewer.setCheckedElements(checkedElements.toArray());

    treeViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(final CheckStateChangedEvent event) {
            if (event.getElement() instanceof DataCategory) {
                treeViewer.getTree().setRedraw(false);

                final DataCategory category = (DataCategory) event.getElement();
                final DataProviderWrapper[] children =
                    dataProviderCollection.getSortedOptionalExportProvidersForCategory(category);
                for (int i = 0; i < children.length; i++) {
                    children[i].setShouldExport(event.getChecked());
                    treeViewer.setChecked(children[i], event.getChecked());
                }

                treeViewer.getTree().setRedraw(true);
            } else {
                final DataProviderWrapper dataProvider = (DataProviderWrapper) event.getElement();
                dataProvider.setShouldExport(event.getChecked());

                final DataCategory parentCategory = dataProvider.getDataProviderInfo().getCategory();
                final DataProviderWrapper[] siblings =
                    dataProviderCollection.getSortedOptionalExportProvidersForCategory(parentCategory);
                boolean allChildrenChecked = true;
                for (int i = 0; i < siblings.length; i++) {
                    if (!siblings[i].isShouldExport()) {
                        allChildrenChecked = false;
                        break;
                    }
                }
                treeViewer.setChecked(parentCategory, allChildrenChecked);
            }

            dataProviderTreeControl.refresh();
        }
    });
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:75,代碼來源:OptionalExportsControl.java

示例9: createTableViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createTableViewer() {
	tableViewer = new CheckboxTreeViewer(table);
	tableViewer.setUseHashlookup(true);				
	
	TreeViewerColumn cNames = new TreeViewerColumn(tableViewer, SWT.CENTER);		
	cNames.getColumn().setText(Messages.getString("PreviewRowsDialog.LayerTreeViewer.GeometryFields"));	

	TreeViewerColumn cLegend = new TreeViewerColumn(tableViewer, SWT.CENTER);
	cLegend.getColumn().setText(Messages.getString("PreviewRowsDialog.LayerTreeViewer.Legend"));
	cLegend.setEditingSupport(new StyleEditingSupport(tableViewer));
		
	for (int i = 0, n = table.getColumnCount(); i < n; i++) {
		table.getColumn(i).setWidth(200);
	}

	tableViewer.addCheckStateListener(new ICheckStateListener(){
		public void checkStateChanged(CheckStateChangedEvent event) {
			if (event.getElement() instanceof LayerCollection)
		    	((LayerCollection)event.getElement()).setVisible(event.getChecked(),true);
			else if (event.getElement() instanceof Layer){ 
				((Layer)event.getElement()).setVisible(event.getChecked());
				if(event.getChecked()){
					LayerCollection lc = ((Layer)event.getElement()).getLayerCollectionParent();
					if(!lc.isVisible()){
						lc.setVisible(event.getChecked(), false);
						tableViewer.setChecked(lc, event.getChecked());
					}
				}
			}else {	
				Symbolisation sym = (Symbolisation)event.getElement();
				sym.setIsCustom(event.getChecked()); 
				if(event.getChecked()){
					sym.setFeatureStyle(sym.getLastFeatureStyle());		
				}else{
					int usage = sym.getStyleUsage();
					if(usage==Symbolisation.LineStrokeColor||usage==Symbolisation.PointColor||usage==Symbolisation.PolygonFillColor||usage==Symbolisation.PolygonStrokeColor)
						sym.setFeatureStyle((Object)LayerFactory.getDefaultColor());
					else if(usage==Symbolisation.LineStrokeWidth||usage==Symbolisation.PolygonStrokeWidth)
						sym.setFeatureStyle(LayerFactory.DEFAULT_STROKE_WIDTH);
					else if(usage==Symbolisation.Radius)
						sym.setFeatureStyle(LayerFactory.DEFAULT_RADIUS);
					else if(usage==Symbolisation.LineOpacity||usage==Symbolisation.PolygonOpacity||usage==Symbolisation.PointOpacity)
						sym.setFeatureStyle(LayerFactory.DEFAULT_OPACITY);						
				}	
				sym.updateParent();
				tableViewer.refresh();
			}			
		}
	}); 
	tableViewer.setContentProvider(new LayerTreeContentProvider(layerList, tableViewer));
	tableViewer.setLabelProvider(new LayerLabelProvider(tableViewer));
	tableViewer.setInput(layerList);
	tableViewer.setAllChecked(true);
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:55,代碼來源:LayerControl.java


注:本文中的org.eclipse.jface.viewers.CheckboxTreeViewer.setInput方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。