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


Java TreeColumn.setAlignment方法代碼示例

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


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

示例1: createTreeViewerColumn

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的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

示例2: createPluginColumns

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的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

示例3: createTreeWithUnnamedColumn

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void createTreeWithUnnamedColumn() {
	Tree tree = new Tree(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	tree.setHeaderVisible(true);
	GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL)
			.grab(true, true).applyTo(tree);

	TreeColumn column = new TreeColumn(tree, SWT.NONE);
	column.setWidth(200);
	column.setAlignment(SWT.LEFT);


	for (int i = 0; i < 5; i++) {
		TreeItem treeItem = new TreeItem(tree, 0);
		treeItem.setText(new String[] { "TreeItem" + i,
				Integer.toString(i) });
	}

}
 
開發者ID:xored,項目名稱:q7.quality.mockups,代碼行數:19,代碼來源:RCPTT211_EmptyWindowInAssertionMode.java

示例4: createComponents

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void createComponents(Composite parent)
{
	this.viewer = new TreeViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
	viewer.getTree().setHeaderVisible(true);
	
	TreeColumn nameColumn = new TreeColumn(viewer.getTree(), SWT.LEFT);
	nameColumn.setAlignment(SWT.LEFT);
	nameColumn.setText("Name");
	nameColumn.setWidth(160);
	TreeColumn argsColumn = new TreeColumn(viewer.getTree(), SWT.RIGHT);
	argsColumn.setAlignment(SWT.LEFT);
	argsColumn.setText("Argumente");
	argsColumn.setWidth(100);
	
	viewer.setContentProvider(new FunctionContentProvider());
	viewer.setLabelProvider(new FunctionLabelProvider());
	viewer.setInput(library);
	
	EventHandler handler = new EventHandler();
	viewer.addDoubleClickListener(handler);
}
 
開發者ID:TheWhiteShadow3,項目名稱:cuina,代碼行數:22,代碼來源:FunctionListPanel.java

示例5: createComposite

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * 뷰어가 담길 컴포지트 생성
 * 
 * @param parent
 * @return Composite
 */
public Composite createComposite(final Composite parent) {
    Tree tree = new Tree(parent, SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);

    tree.setLinesVisible(true);
    tree.setHeaderVisible(true);

    String[] strHeadings = { UMLMessage.LABEL_PROPERTY, UMLMessage.LABEL_VALUE };

    TreeColumn propertyTreeColumn = new TreeColumn(tree, SWT.NONE);
    propertyTreeColumn.setWidth(240);
    propertyTreeColumn.setText(strHeadings[0]);
    propertyTreeColumn.setAlignment(SWT.LEFT);
    propertyTreeColumn.setResizable(true);

    TreeColumn valueTreeColumn = new TreeColumn(tree, SWT.NONE);
    valueTreeColumn.setWidth(300);
    valueTreeColumn.setText(strHeadings[1]);
    valueTreeColumn.setAlignment(SWT.LEFT);
    valueTreeColumn.setResizable(true);

    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = 150;
    gridData.horizontalSpan = 2;
    tree.setLayoutData(gridData);

    viewer = new TreeViewer(tree);
    tree.setItemCount(20);

    viewer.setContentProvider(new StereotypePropertyTreeContentProvider());
    viewer.setLabelProvider(new StereotypePropertyTableColumnLabelProvider(this));

    // viewer.setInput(input);
    viewer.addSelectionChangedListener(new StereotypePropertySelectionChangedListener(parent, this));

    return parent;
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:43,代碼來源:StereotypePropertyComposite.java

示例6: createTreeViewerColumn

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的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));
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:10,代碼來源:DbLockListView.java

示例7: create

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Creates the view.
 *
 * @param root
 */
private void create(final Composite root) {

    root.setLayout(new FillLayout());
    
    final Tree tree = new Tree(root, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    tree.setHeaderVisible(true);
    
    treeViewer = new TreeViewer(tree);
    tree.setMenu(new ClipboardHandlerTree(treeViewer).getMenu());
    
    final TreeColumn column1 = new TreeColumn(tree, SWT.LEFT);
    tree.setLinesVisible(true);
    column1.setAlignment(SWT.LEFT);
    column1.setText(Resources.getMessage("PropertiesView.1")); //$NON-NLS-1$
    column1.setWidth(160);
    final TreeColumn column2 = new TreeColumn(tree, SWT.RIGHT);
    column2.setAlignment(SWT.LEFT);
    column2.setText(Resources.getMessage("PropertiesView.2")); //$NON-NLS-1$
    column2.setWidth(100);

    treeViewer.setContentProvider(new OutputContentProvider());
    treeViewer.setLabelProvider(new OutputLabelProvider());

    treeViewer.setInput(roots);
    treeViewer.expandAll();
}
 
開發者ID:arx-deidentifier,項目名稱:arx,代碼行數:32,代碼來源:ViewPropertiesOutput.java

示例8: createPartControl

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void createPartControl(Composite parent) {
	GridData parentData = new GridData(SWT.FILL, SWT.FILL, true, true);
	parent.setLayout(new GridLayout(1, true));
	parent.setLayoutData(parentData);

	Display display = Display.getCurrent();
	parent.setBackground(display.getSystemColor(SWT.COLOR_WHITE));

	Composite searchMenu = new Composite(parent, SWT.BORDER);
	searchMenu.setLayout(new GridLayout(2, false));
	searchMenu.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
			true, false));

	Label searchLabel = new Label(searchMenu, SWT.LEFT);
	searchLabel.setLayoutData(new GridData(SWT.FILL, GridData.CENTER,
			false, false));
	searchLabel.setText("Search: ");

	filterText = new Text(searchMenu, SWT.FILL);
	filterText.setLayoutData(new GridData(SWT.FILL, GridData.CENTER, true,
			false));

	Composite tableViewerComposite = new Composite(parent, SWT.NONE);
	tableViewerComposite.setLayout(new GridLayout(1, true));
	tableViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
			true, true));

	Tree tree = new Tree(tableViewerComposite, SWT.FILL | SWT.H_SCROLL
			| SWT.V_SCROLL);

	treeViewer = new TreeViewer(tree);
	treeViewer.setData("GroupType", GroupType.STATUS);
	treeViewer.getControl().setLayoutData(
			new GridData(SWT.FILL, SWT.FILL, true, true));
	TreeColumn column1 = new TreeColumn(tree, SWT.LEFT);
	tree.setLinesVisible(true);
	column1.setAlignment(SWT.LEFT);
	TreeColumn column2 = new TreeColumn(tree, SWT.RIGHT);
	column2.setAlignment(SWT.LEFT);
	column2.setWidth(50);

	treeContentProvider = new TreeContentProvider(treeViewer);
	treeViewer.setContentProvider(treeContentProvider);
	treeViewer.setLabelProvider(new TableLabelProvider(treeViewer,
			treeContentProvider));
	treeViewer.setInput(getViewSite());
	treeViewer.addFilter(filter);
	treeViewer.setSorter(new Sorter());
	treeViewer.expandAll();

	makeActions();
	setDoubleClickAction();
	createToolbar();
	setSearchListener();

	parent.addControlListener(new ControlAdapter() {
		@Override
		public void controlResized(ControlEvent e) {
			int parentWidth = parent.getSize().x;
			int scrollWidth = 42;
			column1.setWidth(parentWidth - column2.getWidth() - scrollWidth);
		}
	});
}
 
開發者ID:FutureProcessing,項目名稱:RFRunnerPlugin,代碼行數:65,代碼來源:SampleView.java

示例9: createColumns

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void createColumns() {
  GC gc = new GC(getTree().getParent());

  List<Integer> widths = new ArrayList<Integer>();

  for (final IGenericTableColumn c : table.getColumns()) {
    TreeViewerColumn viewerColumn = new TreeViewerColumn(this, SWT.NONE);

    viewerColumn.setLabelProvider(new GenericLabelProvider(c
        .getDataProvider()));

    if (c.getEditable()) {
      viewerColumn.setEditingSupport(c.getEditingSupport(this));
    }

    TreeColumn column = viewerColumn.getColumn();

    if (c.getSortable() && comparator != null) {
      column.addSelectionListener(getSelectionAdapter(column, c));
    }
    column.setText(c.getLabel());
    column.setAlignment(c.getAlignMent());

    int width;
    if (c.getWidth() != -1) {
      width = c.getWidth();
    }
    else if (c.getTextExtent() != null
        && c.getLabel().length() < c.getTextExtent().length()) {
      width = gc.textExtent(c.getTextExtent()).x + 2;
    }
    else {
      width = gc.textExtent(c.getLabel()).x + 2;
    }

    widths.add(width);
    column.setWidth(width);
    column.setResizable(c.getResizable());
  }
  gc.dispose();

  // /* All columns have their prefered width set now calculate percentages */
  // TreeColumnLayout layout = new TreeColumnLayout();
  // for (int i = 0; i < widths.size(); i++) {
  // layout.setColumnData(getTree().getColumns()[i], new ColumnWeightData(
  // widths.get(i), widths.get(i), true));
  // }
  // getTree().getParent().setLayout(layout);
}
 
開發者ID:incentivetoken,項目名稱:offspring,代碼行數:50,代碼來源:GenerericTreeViewer.java

示例10: create

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Creates the view.
 *
 * @param root
 */
private void create(final Composite root) {

    root.setLayout(new FillLayout());
    
    Tree tree = new Tree(root, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    tree.setHeaderVisible(true);
    
    treeViewer = new TreeViewer(tree);
    tree.setMenu(new ClipboardHandlerTree(treeViewer).getMenu());
    
    final TreeColumn column1 = new TreeColumn(tree, SWT.LEFT);
    tree.setLinesVisible(true);
    column1.setAlignment(SWT.LEFT);
    column1.setText(Resources.getMessage("PropertiesView.3")); //$NON-NLS-1$
    column1.setWidth(160);
    final TreeColumn column2 = new TreeColumn(tree, SWT.RIGHT);
    column2.setAlignment(SWT.LEFT);
    column2.setText(Resources.getMessage("PropertiesView.4")); //$NON-NLS-1$
    column2.setWidth(100);
    final TreeColumn column6 = new TreeColumn(tree, SWT.RIGHT);
    column6.setAlignment(SWT.LEFT);
    column6.setText(Resources.getMessage("PropertiesView.5")); //$NON-NLS-1$
    column6.setWidth(100);
    final TreeColumn column7 = new TreeColumn(tree, SWT.RIGHT);
    column7.setAlignment(SWT.LEFT);
    column7.setText(Resources.getMessage("PropertiesView.101")); //$NON-NLS-1$
    column7.setWidth(80);
    final TreeColumn column3 = new TreeColumn(tree, SWT.RIGHT);
    column3.setAlignment(SWT.LEFT);
    column3.setText(Resources.getMessage("PropertiesView.6")); //$NON-NLS-1$
    column3.setWidth(50);
    final TreeColumn column4 = new TreeColumn(tree, SWT.RIGHT);
    column4.setAlignment(SWT.LEFT);
    column4.setText(Resources.getMessage("PropertiesView.7")); //$NON-NLS-1$
    column4.setWidth(50);
    final TreeColumn column5 = new TreeColumn(tree, SWT.RIGHT);
    column5.setAlignment(SWT.LEFT);
    column5.setText(Resources.getMessage("PropertiesView.8")); //$NON-NLS-1$
    column5.setWidth(50);
    final TreeColumn column8 = new TreeColumn(tree, SWT.RIGHT);
    column8.setAlignment(SWT.LEFT);
    column8.setText(Resources.getMessage("PropertiesView.113")); //$NON-NLS-1$
    column8.setWidth(50);
    final TreeColumn column9 = new TreeColumn(tree, SWT.RIGHT);
    column9.setAlignment(SWT.LEFT);
    column9.setText(Resources.getMessage("PropertiesView.126")); //$NON-NLS-1$
    column9.setWidth(50);

    treeViewer.setContentProvider(new InputContentProvider());
    treeViewer.setLabelProvider(new InputLabelProvider());

    treeViewer.setInput(roots);
    treeViewer.expandAll();
}
 
開發者ID:arx-deidentifier,項目名稱:arx,代碼行數:60,代碼來源:ViewPropertiesInput.java


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