当前位置: 首页>>代码示例>>Java>>正文


Java TreeViewerColumn类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.TreeViewerColumn的典型用法代码示例。如果您正苦于以下问题:Java TreeViewerColumn类的具体用法?Java TreeViewerColumn怎么用?Java TreeViewerColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TreeViewerColumn类属于org.eclipse.jface.viewers包,在下文中一共展示了TreeViewerColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createViewer

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
@Override
protected TreeViewer createViewer(final Composite parent, final AbstractColumnLayout columnLayout,
		final int style) {
	final TreeViewer viewer = new TreeViewer(parent, virual ? (style | VIRTUAL) : style);
	final Tree tree = viewer.getTree();
	tree.setLinesVisible(linesVisible);
	tree.setHeaderVisible(headerVisible);

	int columnIndex = 0;
	for (final String columnLabel : columnLabels) {

		final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, NONE);
		final TreeColumn column = viewerColumn.getColumn();
		columnLayout.setColumnData(column, createColumnLayoutData(columnIndex));
		column.setText(columnLabel);
		column.setMoveable(moveable);

		columnIndex++;
	}

	return viewer;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:TreeViewerBuilder.java

示例2: createColumn3

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private void createColumn3() 
	{
		TreeColumn column = new TreeColumn(_viewer.getTree(), SWT.LEFT);
//		column.setText("Step");
		TreeViewerColumn viewerColumn = new TreeViewerColumn(_viewer, column);
		viewerColumn.setLabelProvider(
			new ColumnLabelProvider()
			{
				@Override
				public String getText(Object element) 
				{
					String result = "";
					if (element instanceof IExecutionEngine)
					{					
						IExecutionEngine engine = (IExecutionEngine)element;
						result = String.format("%d", engine.getEngineStatus().getNbLogicalStepRun());
					}
					return result;
				}			
			});
	}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:22,代码来源:EnginesStatusView.java

示例3: createColumns

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private void createColumns(TreeViewer viewer) {

		viewer.setColumnProperties(new String[] { "Name", "Value"});
		ColumnViewerToolTipSupport.enableFor(viewer);

		TreeViewerColumn nameColumn = new TreeViewerColumn(viewer, SWT.LEFT, 0);
		nameColumn.getColumn().setText("Name");
		nameColumn.getColumn().setWidth(200);
		nameColumn.setLabelProvider(new ColumnLabelProvider() {
			@Override
			public String getText(Object element) {
				INamedNode node = (INamedNode)element;
				return node.getDisplayName();
			}
		});
		nameColumn.setEditingSupport(new NameEditingSupport(this));

		TreeViewerColumn valueColumn = new TreeViewerColumn(viewer, SWT.LEFT, 1);
		valueColumn.getColumn().setText("Value");
		valueColumn.getColumn().setWidth(300);
		valueColumn.setLabelProvider(new DelegatingStyledCellLabelProvider(new ControlValueLabelProvider(cservice, this)));
		valueColumn.setEditingSupport(new ControlEditingSupport(viewer, cservice, controlViewerMode));
	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:24,代码来源:ControlTreeViewer.java

示例4: createColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private TreeViewerColumn createColumn(final Property<?> property) {
	TreeViewerColumn column1 = new TreeViewerColumn(viewer, property.getRange().equals(String.class) ? SWT.LEFT : SWT.RIGHT);
	column1.setLabelProvider(new DelegatingStyledCellLabelProvider(new TermLabelProvider(property, viewerConfig)));
	column1.getColumn().setMoveable(true);
	column1.getColumn().setData(property);
	column1.getColumn().setText(property.getPropertyName());
	column1.getColumn().setToolTipText(String.format("%s%n%s", property.getPropertyName(), property.getDescription()));
	if(property instanceof TermProperty && property.isNumeric()) {
		column1.getColumn().addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				/*
				 * Good link to Sort examples
				 * 
				 * http://www.programcreek.com/java-api-examples/index.php?api=org.eclipse.jface.viewers.TreeViewerColumn
				 */
				updateSortingProperty(property);
			}
		});
	}
	layout.setColumnData(column1.getColumn(), getRecommendedSize(property));
	return column1;
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:24,代码来源:TerminologyPart.java

示例5: addAliasColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private void addAliasColumn(String namespace) {

        TreeViewerColumn aliasColumn = new TreeViewerColumn(commandsTreeTable, SWT.NONE);
        aliasColumn.getColumn().setText(namespace);

        aliasColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(Object element) {
                CommandInfo cmd = (CommandInfo) element;
                if (cmd.getAbstract()) {
                    // show a blank line if the command is abstract
                    return "";
                }
                List<NamedObjectId> aliases = cmd.getAliasList();
                for (NamedObjectId aliase : aliases) {
                    if (aliase.getNamespace().equals(namespace))
                        return aliase.getName();
                }
                return "";
            }
        });
        tcl.setColumnData(aliasColumn.getColumn(), new ColumnPixelData(COLUMN_WIDTH));
    }
 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:24,代码来源:AddToStackWizardPage1.java

示例6: createTreeViewerColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private TreeViewerColumn createTreeViewerColumn(String title, int width, int alignment,  boolean resizable, boolean moveable, final boolean isNumber) {
	final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE);
	final TreeColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setAlignment(alignment);
	column.setMoveable(moveable);
	columnLayout.setColumnData(column, new ColumnPixelData(width, resizable));
	column.setData("isNumber", isNumber);
	column.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			TreeLabelSorter sorter = (TreeLabelSorter) viewer.getComparator();
			TreeColumn selectedColumn = (TreeColumn) e.widget;
			sorter.setColumn(selectedColumn);
		}
	});
	return viewerColumn;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:18,代码来源:DigestTableView.java

示例7: defineColumn_Date

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private void defineColumn_Date(final TreeColumnLayout treeLayout) {

		final TreeViewerColumn tvc = new TreeViewerColumn(_tourViewer, SWT.LEAD);
		tvc.setLabelProvider(new CellLabelProvider() {
			@Override
			public void update(final ViewerCell cell) {

				final Object element = cell.getElement();

				if (element instanceof TVIWizardCompareYear) {
					cell.setText(((TVIWizardCompareYear) element).treeColumn);
				} else if (element instanceof TVIWizardCompareMonth) {
					cell.setText(((TVIWizardCompareMonth) element).treeColumn);
				} else if (element instanceof TVIWizardCompareTour) {
					cell.setText(((TVIWizardCompareTour) element).treeColumn);
				} else {
					cell.setText(UI.EMPTY_STRING);
				}
			}
		});

		final TreeColumn tc = tvc.getColumn();
		tc.setText(Messages.tourCatalog_wizard_Column_tour);
		treeLayout.setColumnData(tc, new ColumnPixelData(convertWidthInCharsToPixels(20)));
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:WizardPage_10_CompareTour.java

示例8: postConstruct

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
@PostConstruct
public void postConstruct(Composite parent) {

	ResourceManager resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);

	TreeViewer viewer = new TreeViewer(parent);
	viewer.setContentProvider(new TreeContentProvider());
	viewer.getTree().setHeaderVisible(true);
	viewer.getTree().setLinesVisible(true);
	viewer.getTree().setFont(resourceManager.createFont(FontDescriptor.createFrom("Arial", 32, SWT.ITALIC)));

	TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE);
	viewerColumn.getColumn().setWidth(300);
	viewerColumn.getColumn().setText("Names");
	viewerColumn.setLabelProvider(new ColumnLabelProvider());

	viewer.setInput(new String[] { "Simon Scholz", "Lars Vogel", "Dirk Fauth", "Wim Jongman", "Tom Schindl" });

	GridLayoutFactory.fillDefaults().generateLayout(parent);
}
 
开发者ID:vogellacompany,项目名称:codeexamples-eclipse,代码行数:21,代码来源:TableViewerFontSize.java

示例9: askForColumnPrefixes

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private void askForColumnPrefixes()
{
	// filter empty lines...
	InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(), "Column name prefix filters",
			"Enter a comma separated list of prefix filters to apply on column names", prefixFiltersString, null);

	if (dlg.open() == Dialog.OK)
	{
		computePrefixFilterList(dlg.getValue());

		for (IPluginModelBase p : columnsCache.keySet())
		{
			TreeViewerColumn tc = columnsCache.get(p);
			String newTitle = getColumnName(p);
			if (!tc.getColumn().isDisposed() && !tc.getColumn().getText().equals(newTitle))
			{
				tc.getColumn().setText(newTitle);
				tc.getColumn().pack();
			}
		}
		tv.refresh();
	}
}
 
开发者ID:opcoach,项目名称:E34MigrationTooling,代码行数:24,代码来源:MigrationStatsE4View.java

示例10: createPluginColumns

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private void createPluginColumns(IPluginModelBase pm)
{
	// Add columns in the tree one column per selected plugin.
	// Create the first column for the key
	TreeViewerColumn col = new TreeViewerColumn(tv, SWT.NONE);
	TreeColumn swtCol = col.getColumn();
	swtCol.setText(getColumnName(pm));
	swtCol.setAlignment(SWT.CENTER);
	PluginDataProvider labelProvider = new PluginDataProvider();

	labelProvider.setPlugin(pm);
	col.setLabelProvider(labelProvider);
	swtCol.setToolTipText(pm.getBundleDescription().getName());
	swtCol.pack();

	columnsCache.put(pm, col);
}
 
开发者ID:opcoach,项目名称:E34MigrationTooling,代码行数:18,代码来源:MigrationStatsE4View.java

示例11: createColumns

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private void createColumns() {
		TreeViewerColumn propertyColumn = new TreeViewerColumn(treeViewer, SWT.None);
		propertyColumn.getColumn().setText("Test Spec");
		propertyColumn.getColumn().setWidth(400);
//		propertyColumn.setLabelProvider(new AnalysisResultLabelProvider(Column.PROPERTY, treeViewer));
		propertyColumn.setLabelProvider(new TestCaseGeneratorResultLabelProvider(Column.PROPERTY, treeViewer));

		TreeViewerColumn resultColumn = new TreeViewerColumn(treeViewer, SWT.None);
		resultColumn.getColumn().setText("Result");
//		resultColumn.setLabelProvider(new AnalysisResultLabelProvider(Column.RESULT));
		resultColumn.setLabelProvider(new TestCaseGeneratorResultLabelProvider(Column.RESULT));
		
		TreeColumnLayout layout = new TreeColumnLayout();
		composite.setLayout(layout);
		layout.setColumnData(propertyColumn.getColumn(), new ColumnWeightData(2));
		layout.setColumnData(resultColumn.getColumn(), new ColumnWeightData(1));
	}
 
开发者ID:smaccm,项目名称:smaccm,代码行数:18,代码来源:TcgResultTree.java

示例12: VaccinationEffectCheckboxTreeViewer

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
public VaccinationEffectCheckboxTreeViewer(Composite parent, int style,
	String initialCheckedElements){
	super(parent, style);
	
	this.initialCheckedElements =
		(initialCheckedElements != null) ? initialCheckedElements : StringConstants.EMPTY;
		
	GridData gd_tree = new GridData(SWT.FILL, SWT.TOP, true, false);
	gd_tree.heightHint = 200;
	getTree().setLayoutData(gd_tree);
	getTree().setHeaderVisible(false);
	getTree().setLinesVisible(true);
	
	TreeViewerColumn col = new TreeViewerColumn(this, SWT.NONE);
	col.getColumn().setWidth(225);
	
	setContentProvider(new DiseaseTreeContentProvider());
	setLabelProvider(new DiseaseTreeLabelProvider());
	setInput(DiseaseDefinitionModel.getDiseaseDefinitions());
	setCheckStateProvider(this);
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:22,代码来源:VaccinationEffectCheckboxTreeViewer.java

示例13: createTreeViewerColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private TreeViewerColumn createTreeViewerColumn(String name, int width) {
	TreeViewerColumn column = new TreeViewerColumn(treeViewer, SWT.CENTER);
	column.getColumn().setText(name);			
	column.getColumn().setResizable(true);
	column.getColumn().setWidth(width);
	return column;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:8,代码来源:AvroSchemaEditorDebugView.java

示例14: createTreeViewerColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
private TreeViewerColumn createTreeViewerColumn(String name, int width, int style) {
	TreeViewerColumn column = new TreeViewerColumn(treeViewer, style);
	column.getColumn().setText(name);			
	column.getColumn().setResizable(true);
	column.getColumn().setWidth(width);
	return column;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:8,代码来源:SchemaRegistryView.java

示例15: createTreeViewerColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //导入依赖的package包/类
protected TreeViewerColumn createTreeViewerColumn(TreeViewer treeViewer, String title, int width, boolean resizable, int style) {
	TreeViewerColumn column = new TreeViewerColumn(treeViewer, style);
	column.getColumn().setText(title);			
	column.getColumn().setResizable(resizable);
	column.getColumn().setWidth(width);
	return column;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:8,代码来源:SchemaViewer.java


注:本文中的org.eclipse.jface.viewers.TreeViewerColumn类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。