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


Java CheckboxTreeViewer.setUseHashlookup方法代碼示例

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


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

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

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

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

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

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

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

示例7: createProjectsTreeControl

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createProjectsTreeControl(final Composite container) {
    treeViewer = new CheckboxTreeViewer(container, TREE_STYLES);
    treeControl = treeViewer.getTree();
    GridDataBuilder.newInstance().fill().grab().hHint(150).applyTo(treeControl);
    treeControl.setHeaderVisible(false);

    projectColumn = new TreeColumn(treeControl, SWT.NONE);
    projectColumn.setText(Messages.getString("GitImportWizardSelectProjectsPage.ProjectColumnName")); //$NON-NLS-1$
    projectColumn.setWidth(300);

    final TreeViewerColumn nameColumnViewer = new TreeViewerColumn(treeViewer, projectColumn);
    nameColumnViewer.setLabelProvider(new ProjectNameLabelProvider());
    nameColumnViewer.setEditingSupport(new ProjectNameEditingSupport(treeViewer));

    pathColumn = new TreeColumn(treeControl, SWT.NONE);
    pathColumn.setText(Messages.getString("GitImportWizardSelectProjectsPage.PathColumnName")); //$NON-NLS-1$
    pathColumn.setWidth(500);

    final TreeViewerColumn pathColumnViewer = new TreeViewerColumn(treeViewer, pathColumn);
    pathColumnViewer.setLabelProvider(new ImportProjectPathLabelProvider());

    treeControl.setHeaderVisible(true);
    treeControl.setSortColumn(projectColumn);
    treeControl.setLinesVisible(true);

    treeViewer.setUseHashlookup(true);
    treeViewer.setContentProvider(new ProjectTreeContentProvider());
    treeViewer.setAutoExpandLevel(2);
    treeViewer.addCheckStateListener(new ProjectCheckStateListener());

    searchForNestedProjectsButton = new Button(container, SWT.CHECK);
    searchForNestedProjectsButton.setText(
        Messages.getString("GitImportWizardSelectProjectsPage.SearchForNestedButtonText")); //$NON-NLS-1$
    GridDataBuilder.newInstance().hGrab().hFill().applyTo(searchForNestedProjectsButton);
    searchForNestedProjectsButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            refresh();

        }
    });
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:43,代碼來源:GitImportWizardSelectProjectsPage.java

示例8: 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.setUseHashlookup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。