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


Java CheckboxTreeViewer.setLabelProvider方法代碼示例

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


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

示例1: createTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
protected CheckboxTreeViewer createTreeViewer(Composite parent) {
  int style = SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.BORDER
      | SWT.H_SCROLL | SWT.V_SCROLL;
  CheckboxTreeViewer result = new CheckboxTreeViewer(parent, style);
  result.setLabelProvider(new WorkbenchLabelProvider());
  result.setContentProvider(new BaseWorkbenchContentProvider());
  result.setComparator(new NodeWrapperTreeSorter());

  result.addCheckStateListener(new ICheckStateListener() {
    @Override
    public void checkStateChanged(CheckStateChangedEvent event) {
      if (recursiveTreeSelect) {
        tree.setSubtreeChecked(event.getElement(), event.getChecked());
      }
    }
  });

  tree = result;
  return result;
}
 
開發者ID:google,項目名稱:depan,代碼行數:22,代碼來源:CheckNodeTreeView.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() {
        @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

示例3: createTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
/**
 *	Creates this group's tree viewer.
 * @param parent parent composite
 * @param width the width
 * @param height the height
 */
protected void createTreeViewer(Composite parent, int width, int height) {
	Tree tree= new Tree(parent, SWT.CHECK | SWT.BORDER);
	GridData data= new GridData(GridData.FILL_BOTH);
	data.widthHint= width;
	data.heightHint= height;
	tree.setLayoutData(data);

	fTreeViewer= new CheckboxTreeViewer(tree);
	fTreeViewer.setUseHashlookup(true);
	fTreeViewer.setContentProvider(fTreeContentProvider);
	fTreeViewer.setLabelProvider(fTreeLabelProvider);
	fTreeViewer.addTreeListener(this);
	fTreeViewer.addCheckStateListener(this);
	fTreeViewer.addSelectionChangedListener(this);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:22,代碼來源:CheckboxTreeAndListGroup.java

示例4: 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

示例5: createControl

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {

  Composite container = new Composite(parent, SWT.NULL);
  setControl(container);

  checkboxTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);
  Tree tree = checkboxTreeViewer.getTree();
  tree.setBounds(0, 0, 574, 282);

  AttributeSelectionContentProvider adapterContentProvider =
      new AttributeSelectionContentProvider();
  checkboxTreeViewer.setContentProvider(adapterContentProvider);
  checkboxTreeViewer
      .setLabelProvider(new AdapterFactoryLabelProvider(new ReflectiveItemProviderAdapterFactory()));

}
 
開發者ID:atlanmod,項目名稱:emfviews,代碼行數:18,代碼來源:AttributesSelectionPage.java

示例6: 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

示例7: createTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createTreeViewer(Composite container) {
	checkboxTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);
	GridData gd = new GridData(GridData.FILL_BOTH);
	checkboxTreeViewer.getTree().setLayoutData(gd);
	checkboxTreeViewer.setLabelProvider(new TableTreeNodeLabelProvider());
	checkboxTreeViewer.setContentProvider(new TableTreeNodeContentProvider());

}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:9,代碼來源:ImportFromDatabaseWizardPage.java

示例8: 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

示例9: createTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
protected void createTreeViewer(Composite parent, int width, int height)
{
    Tree tree = new Tree(parent, 32);
    GridData data = new GridData(1808);
    data.widthHint = width;
    data.heightHint = height;
    tree.setLayoutData(data);
    fTreeViewer = new CheckboxTreeViewer(tree);
    fTreeViewer.setUseHashlookup(true);
    fTreeViewer.setContentProvider(fTreeContentProvider);
    fTreeViewer.setLabelProvider(fTreeLabelProvider);
    fTreeViewer.addTreeListener(this);
    fTreeViewer.addCheckStateListener(this);
    fTreeViewer.addSelectionChangedListener(this);
}
 
開發者ID:qxo,項目名稱:eclipse-code-lines-plugin,代碼行數:16,代碼來源:CheckboxTreeAndListGroup.java

示例10: createObjectTree

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createObjectTree(Composite container) {
	lblNewLabel = new Label(container, SWT.NONE);
	lblNewLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
	lblNewLabel.setText("Choose: " + getSelectedGenerator().getContentType());

	resourceTree = new CheckboxTreeViewer(container, SWT.BORDER);
	resourceTree.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	resourceTree.setContentProvider(new WorkspaceTreeContentProvider());
	resourceTree.setLabelProvider(new SGenWorkspaceLabelProvider());

	TreePropagatingCheckStateListener checkStateListener = new TreePropagatingCheckStateListener(resourceTree) {
		@Override
		public void checkStateChanged(CheckStateChangedEvent event) {
			super.checkStateChanged(event);
		}
	};
	resourceTree.addCheckStateListener(checkStateListener);
	resourceTree.addDoubleClickListener(new TreeExpandingDoubleClickListener(resourceTree, checkStateListener));
	resourceTree.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
	resourceTree.setFilters(new ViewerFilter[] { new ViewerFilter() {
		@Override
		public boolean select(Viewer viewer, Object parentElement, Object element) {
			// TODO: Filter by common navigator filter instead of supressing
			// '.' prefixed folder
			if (element instanceof IFolder) {
				return !((IFolder) element).getName().startsWith(".");
			}
			return true;
		}
	} });
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:33,代碼來源:SGenWizardPage2.java

示例11: createPackagesTreeViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
/**
 * Create a check box tree viewer for the packages.
 * 
 * @param container
 *            Container in which the tree viewer will be created.
 */
private void createPackagesTreeViewer(Composite container) {
    packagesTreeViewer = new CheckboxTreeViewer(container);
    packagesTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    packagesTreeViewer.setLabelProvider(new PackageLabelProvider());

    packagesTreeContentProvider = new PackagesTreeContentProvider();
    packagesTreeViewer.setContentProvider(packagesTreeContentProvider);

    packagesCheckStateListener = new PackagesCheckStateListener();
    packagesTreeViewer.addCheckStateListener(packagesCheckStateListener);
}
 
開發者ID:kopl,項目名稱:SPLevo,代碼行數:18,代碼來源:PackageScopeDefinitionWizardPage.java

示例12: createLevelViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createLevelViewer( Composite parent )
{
	levelViewer = new CheckboxTreeViewer( parent, SWT.SINGLE | SWT.BORDER );

	GridData gd = new GridData( GridData.FILL_BOTH );
	gd.widthHint = 340;
	gd.heightHint = 250;
	levelViewer.getTree( ).setLayoutData( gd );

	levelViewer.setContentProvider( new CubeContentProvider( ) );
	levelViewer.setLabelProvider( new CubeLabelProvider( ) );
	levelViewer.addCheckStateListener( new ICheckStateListener( ) {

		public void checkStateChanged( CheckStateChangedEvent event )
		{

			LevelHandle item = (LevelHandle) event.getElement( );
			if ( event.getChecked( ) )
			{
				if ( !showLevels.contains( item ) )
					showLevels.add( item );
			}
			else
			{
				if ( showLevels.contains( item ) )
					showLevels.remove( item );
			}

			checkOKButtonStatus( );
		}

	} );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:34,代碼來源:LevelViewDialog.java

示例13: 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

示例14: createControl

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
	Composite container = UI.formComposite(parent);
	setControl(container);
	viewer = new CheckboxTreeViewer(container, SWT.BORDER);
	viewer.setLabelProvider(new Label());
	viewer.setContentProvider(new ContentProvider());
	viewer.setUseHashlookup(true);
	viewer.addCheckStateListener(new SelectionState(this));
	UI.gridData(viewer.getTree(), true, true);
}
 
開發者ID:GreenDelta,項目名稱:olca-app,代碼行數:12,代碼來源:RepositoryImportWizard.java

示例15: createViewer

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createViewer(Composite composite) {
	viewer = new CheckboxTreeViewer(composite, SWT.VIRTUAL | SWT.MULTI
			| SWT.BORDER);
	viewer.setUseHashlookup(true);
	viewer.getTree().setLayoutData(
			new GridData(SWT.FILL, SWT.FILL, true, true));
	viewer.setContentProvider(new NavigationContentProvider());
	viewer.setLabelProvider(new NavigationLabelProvider(false));
	viewer.setSorter(new NavigationSorter());
	viewer.addFilter(new ModelTypeFilter(types));
	viewer.addCheckStateListener(new ModelSelectionState(this, viewer));
	registerInputHandler(composite);
	ColumnViewerToolTipSupport.enableFor(viewer);
}
 
開發者ID:GreenDelta,項目名稱:olca-app,代碼行數:15,代碼來源:ModelSelectionPage.java


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