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


Java TreeViewerColumn.getColumn方法代碼示例

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


在下文中一共展示了TreeViewerColumn.getColumn方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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

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

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

示例5: 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));
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:10,代碼來源:DbLockListView.java

示例6: defineColumn_AltitudeUp

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
private void defineColumn_AltitudeUp(final TreeColumnLayout treeLayout) {

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

				final Object element = cell.getElement();

				if (element instanceof TVIWizardCompareTour) {

					final TVIWizardCompareTour tourItem = (TVIWizardCompareTour) element;

					final long value = (long) (tourItem.colAltitudeUp / net.tourbook.ui.UI.UNIT_VALUE_ALTITUDE);
					cell.setText(Long.toString(value));

				} else {

					cell.setText(UI.EMPTY_STRING);
				}
			}
		});

		final TreeColumn tc = tvc.getColumn();
		tc.setText(UI.UNIT_LABEL_ALTITUDE);
		tc.setToolTipText(Messages.tourCatalog_wizard_Column_altitude_up_tooltip);
		treeLayout.setColumnData(tc, new ColumnWeightData(10));
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:29,代碼來源:WizardPage_10_CompareTour.java

示例7: defineColumn_Distance

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
private void defineColumn_Distance(final TreeColumnLayout treeLayout) {

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

				final Object element = cell.getElement();

				if (element instanceof TVIWizardCompareTour) {

					final TVIWizardCompareTour tourItem = (TVIWizardCompareTour) element;

					final float distance = (tourItem.colDistance) / (1000 * net.tourbook.ui.UI.UNIT_VALUE_DISTANCE);

					cell.setText(_nf1.format(distance));

				} else {

					cell.setText(UI.EMPTY_STRING);
				}
			}
		});

		final TreeColumn tc = tvc.getColumn();
		tc.setText(UI.UNIT_LABEL_DISTANCE);
		tc.setToolTipText(Messages.tourCatalog_wizard_Column_distance_tooltip);
		treeLayout.setColumnData(tc, new ColumnWeightData(10));
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:30,代碼來源:WizardPage_10_CompareTour.java

示例8: defineColumn_RecordingTime

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
private void defineColumn_RecordingTime(final TreeColumnLayout treeLayout) {

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

				final Object element = cell.getElement();

				if (element instanceof TVIWizardCompareTour) {

					final TVIWizardCompareTour tourItem = (TVIWizardCompareTour) element;

					final long recordingTime = tourItem.colRecordingTime;

					cell.setText(String.format(//
							Messages.Format_hhmm,
							(recordingTime / 3600),
							((recordingTime % 3600) / 60)));

				} else {

					cell.setText(UI.EMPTY_STRING);
				}
			}
		});

		final TreeColumn tc = tvc.getColumn();

		tc.setText(Messages.tourCatalog_wizard_Column_h);
		tc.setToolTipText(Messages.tourCatalog_wizard_Column_h_tooltip);
		treeLayout.setColumnData(tc, new ColumnWeightData(10));
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:34,代碼來源:WizardPage_10_CompareTour.java

示例9: createTableViewerColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
private TreeViewerColumn createTableViewerColumn(String title, int width, final int colNumber) {
	final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE);
	TreeColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setWidth(width);
	column.setResizable(true);
	column.setMoveable(false);
	return viewerColumn;
}
 
開發者ID:turesheim,項目名稱:eclipse-timekeeper,代碼行數:10,代碼來源:WorkWeekView.java

示例10: createFrameValueColumn

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
private ValueColumn createFrameValueColumn(final TreeViewer treeViewer, final VariableContentProvider contentProvider) {
	final ValueCellLabelProvider valueLabelProvider = new ValueCellLabelProvider(contentProvider);

	final TreeViewerColumn valueColumn = new TreeViewerColumn(treeViewer, SWT.NONE, treeViewer.getTree().getColumnCount());
	valueColumn.getColumn().setWidth(100);
	valueColumn.getColumn().setText("Step ####");
	valueColumn.getColumn().setResizable(false);
	valueColumn.setLabelProvider(valueLabelProvider);
	valueColumn.getColumn().addControlListener(resizeListener);
	valueColumn.getColumn().addSelectionListener(valueColumnSelectedListener);

	return new ValueColumn(valueColumn.getColumn(), valueLabelProvider);
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:14,代碼來源:VariablesView.java

示例11: build

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
/**
 * Builds the column and returns the TreeViewerColumn
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public TreeViewerColumn build() {
	// create column
	TreeViewerColumn viewerColumn = new TreeViewerColumn(builder.getViewer(), style);
	TreeColumn column = viewerColumn.getColumn();
	if (headerText != null) {
		column.setText(headerText);
	}
	column.setMoveable(moveable);
	column.setResizable(resizable);

	// set label provider
	if (cellLabelProvider != null) {
		viewerColumn.setLabelProvider(cellLabelProvider);
	}
	else {
		if (propertyName == null) {
			viewerColumn.setLabelProvider(new ColumnLabelProvider());
		}
		else {
			PropertyDescriptor descriptor = builder.getPropertyDescriptor(propertyName);
			viewerColumn.setLabelProvider(new PropertyCellLabelProvider(descriptor, valueFormatter));
		}
	}

	// set editing support
	if (editingSupport != null) {
		viewerColumn.setEditingSupport(editingSupport);
	}

	return viewerColumn;
}
 
開發者ID:gulliverrr,項目名稱:hestia-engine-dev,代碼行數:36,代碼來源:TreeViewerColumnBuilder.java

示例12: createPartControl

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent){
	parent.setLayout(new GridLayout(1, false));
	Composite composite = new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	TreeColumnLayout tcl_composite = new TreeColumnLayout();
	composite.setLayout(tcl_composite);
	
	treeViewer = new TreeViewer(composite, SWT.BORDER);
	Tree tree = treeViewer.getTree();
	
	TreeViewerColumn treeViewerColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
	TreeColumn trclmnNewColumn = treeViewerColumn.getColumn();
	tcl_composite.setColumnData(trclmnNewColumn, new ColumnWeightData(100));
	trclmnNewColumn.setText("New Column");
	
	treeViewer.setLabelProvider(new KonsultationenTreeLabelProvider());
	treeViewer.setContentProvider(new KonsultationenTreeContentProvider(treeViewer));

	treeViewer.setInput("0");
	treeViewer.addDoubleClickListener(new KonsultationsbelegAnzeigen());
	
	MenuManager menuManager = new MenuManager();
	menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
	tree.setMenu(menuManager.createContextMenu(tree));
	
	getSite().registerContextMenu(menuManager, treeViewer);
	getSite().setSelectionProvider(treeViewer);
	
	Composite composite_1 = new Composite(parent, SWT.NONE);
	composite_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	composite_1.setLayout(new GridLayout(4, false));
	
	Label lblOfflineNachsignaturen = new Label(composite_1, SWT.NONE);
	lblOfflineNachsignaturen.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
	lblOfflineNachsignaturen.setText("Gespeicherte Offline-Nachsignaturen: ");
	
	lblOFFLINENACHSIGNATUREN = new Label(composite_1, SWT.NONE);
	GridData gd_lblOFFLINENACHSIGNATUREN = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gd_lblOFFLINENACHSIGNATUREN.widthHint = 25;
	lblOFFLINENACHSIGNATUREN.setLayoutData(gd_lblOFFLINENACHSIGNATUREN);
	lblOFFLINENACHSIGNATUREN.setText("n/a");
	
	Label lblGespeicherteOfflineKonsultationen = new Label(composite_1, SWT.NONE);
	lblGespeicherteOfflineKonsultationen.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
	lblGespeicherteOfflineKonsultationen.setText("Gespeicherte Offline Konsultationen:");
	
	lblGESPEICHERTEKONSULTATIONEN = new Label(composite_1, SWT.NONE);
	GridData gd_lblGESPEICHERTEKONSULTATIONEN = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gd_lblGESPEICHERTEKONSULTATIONEN.widthHint = 25;
	lblGESPEICHERTEKONSULTATIONEN.setLayoutData(gd_lblGESPEICHERTEKONSULTATIONEN);
	lblGESPEICHERTEKONSULTATIONEN.setText("n/a");
	m_bindingContext = initDataBindings();
}
 
開發者ID:MEDEVIT,項目名稱:ecard,代碼行數:55,代碼來源:KonsultationenView.java

示例13: defineColumn_Opacity

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的package包/類
/**
 * column: marker
 */
private void defineColumn_Opacity(final TreeColumnLayout treeLayout) {

	final TreeViewerColumn tvc = new TreeViewerColumn(_layerViewer, SWT.CENTER);
	final TreeColumn tc = tvc.getColumn();

	tc.setText(Messages.Map3Layer_Viewer_Column_Opacity);
	tc.setToolTipText(Messages.Map3Layer_Viewer_Column_Opacity_Tooltip);

	_opacityEditingSupport = new OpacityEditingSupport(_layerViewer);
	tvc.setEditingSupport(_opacityEditingSupport);

	tvc.setLabelProvider(new CellLabelProvider() {
		@Override
		public void update(final ViewerCell cell) {

			final Object element = cell.getElement();

			if (element instanceof TVIMap3Layer) {

				final TVIMap3Layer layerItem = (TVIMap3Layer) element;

				final float opacity = layerItem.getOpacity();

				final String opacityText;
				if (layerItem.canSetOpacity()) {

					if (layerItem.isLayerVisible) {

						if (opacity == 1.0) {
							opacityText = UI.SYMBOL_FULL_BLOCK;
						} else {
							opacityText = _nf2.format(opacity);
						}
					} else {

						// layer is hidden
						opacityText = UI.EMPTY_STRING;
					}
				} else {

					// opacity cannot be set
					opacityText = OPACITY_CAN_NOT_BE_SET;
				}

				cell.setText(opacityText);
			}
		}
	});
	treeLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(8), false));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:54,代碼來源:Map3LayerUI.java

示例14: createColumns

import org.eclipse.jface.viewers.TreeViewerColumn; //導入方法依賴的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


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