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


Java TableViewerColumn.getColumn方法代碼示例

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


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

示例1: createViewer

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
@Override
protected TableViewer createViewer(final Composite parent, final AbstractColumnLayout columnLayout, final int style) {
	final TableViewer viewer = new TableViewer(parent, style);
	final Table table = viewer.getTable();
	table.setLinesVisible(linesVisible);
	table.setHeaderVisible(headerVisible);

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

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

		columnIndex++;
	}

	return viewer;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:22,代碼來源:TableViewerBuilder.java

示例2: createSourceTable

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private void createSourceTable(SashForm sashForm) {
    avaliableFieldTableViewer = new TableViewer(sashForm, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
	table_1 = avaliableFieldTableViewer.getTable();
	table_1.setLinesVisible(true);
	table_1.setHeaderVisible(true);
	avaliableFieldTableViewer.setContentProvider(new IStructuredContentProvider() {

		@Override
		public Object[] getElements(Object inputElement) {
			return ((List) inputElement).toArray();
		}
	});
	avaliableFieldTableViewer.setInput(schemaFields);

	TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(avaliableFieldTableViewer, SWT.NONE);
	TableColumn tblclmnNewColumn_2 = tableViewerColumn_2.getColumn();
	tblclmnNewColumn_2.setWidth(196);
	tblclmnNewColumn_2.setText(Messages.AVAILABLE_FIELDS_HEADER);
	tableViewerColumn_2.setLabelProvider(new ColumnLabelProvider());

	attachDragListener();
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:ExcelFormattingDialog.java

示例3: createTableColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private TableViewer createTableColumns(Composite tableComposite) {
	TableViewer tableViewer = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION);
	excelFormatterTable = tableViewer.getTable();
	excelFormatterTable.setHeaderVisible(true);
	excelFormatterTable.setLinesVisible(true);
	excelFormatterTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
	TableColumn parameterNameColumn = tableViewerColumn.getColumn();
	parameterNameColumn.setWidth(254);
	parameterNameColumn.setText(Messages.PARAMETER_NAME);
	tableViewerColumn.setLabelProvider(new ParameterNameLabelProvider());

	TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
	TableColumn parameterValueColumn = tableViewerColumn_1.getColumn();
	parameterValueColumn.setWidth(251);
	parameterValueColumn.setText(Messages.PARAMETER_VALUE);
	tableViewerColumn_1.setLabelProvider(new ParameterValueLabelProvider());
	return tableViewer;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:21,代碼來源:HeaderAndDataFormattingDialog.java

示例4: createColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private void createColumns(final TableViewer tableViewer) {
  final String[] titles = { "Icon", "Name", "Small", "Medium", "Large", "Source", "Class" };
  final int[] bounds = { 40, 200, 60, 60, 60, 200, 200 };
  for (int i = 0; i < titles.length; i++) {
    final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    tableViewer.setSorter(new TableViewerSorter(titles));
    viewerColumn.setLabelProvider(new TableCellLabelProvider());
    final TableColumn column = viewerColumn.getColumn();
    column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
    column.setText(titles[i]);
    column.setWidth(bounds[i]);
    column.setResizable(true);
    column.setMoveable(false);
  }
  final Table table = tableViewer.getTable();
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);
}
 
開發者ID:AndreasWBartels,項目名稱:libraries,代碼行數:20,代碼來源:TableViewerFactory.java

示例5: createColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private void createColumns(final TableViewer tableViewer) {
  final String[] titles = { "Relation", "Type", "Name" };
  final int[] bounds = { 120, 100, 200 };
  for (int i = 0; i < titles.length; i++) {
    final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    tableViewer.setSorter(new TableViewerSorter(titles));
    viewerColumn.setLabelProvider(new TableCellLabelProvider());
    final TableColumn column = viewerColumn.getColumn();
    column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
    column.setText(titles[i]);
    column.setWidth(bounds[i]);
    column.setResizable(true);
    column.setMoveable(false);
  }
  final Table table = tableViewer.getTable();
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);

  // Object[] projectsToSelect = openProjects.toArray();
  // IViewPart view = window.getActivePage().showView( "org.eclipse.jdt.ui.PackageExplorer" );
  // view.getSite().getSelectionProvider().setSelection( new StructuredSelection( projectsToSelect ) );

}
 
開發者ID:AndreasWBartels,項目名稱:libraries,代碼行數:25,代碼來源:RelationsTableViewerFactory.java

示例6: createColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private void createColumns(final TableViewer tableViewer) {
  final String[] titles = { "Class" };
  final int[] bounds = { 120, 100, 200 };
  for (int i = 0; i < titles.length; i++) {
    final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    tableViewer.setSorter(new TableViewerSorter(titles));
    viewerColumn.setLabelProvider(new TableCellLabelProvider());
    final TableColumn column = viewerColumn.getColumn();
    column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
    column.setText(titles[i]);
    column.setWidth(bounds[i]);
    column.setResizable(true);
    column.setMoveable(false);
  }
  final Table table = tableViewer.getTable();
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);
}
 
開發者ID:AndreasWBartels,項目名稱:libraries,代碼行數:20,代碼來源:TypesTableViewerFactory.java

示例7: createColumn

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private void createColumn(int idx, int align) {
	TableViewerColumn viewerColumn = new TableViewerColumn(viewer, align, idx);
	viewerColumn.setEditingSupport(new TableEditingSupport(viewer, idx));
	viewerColumn.setLabelProvider(new ColumnLabelProvider() {

		private int col = idx;

		public String getText(Object element) {
			if (element instanceof Row) {
				return ((Row) element).data[col];
			}
			return super.getText(element);
		}
	});

	TableColumn column = viewerColumn.getColumn();
	column.setResizable(true);
	column.setMoveable(true);

	column.setText(tableModel.headers[idx]);

	int width = convertWidthInCharsToPixels(tableModel.colWidths[idx]);
	width = Math.max(width, 50);
	column.setWidth(width);
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:26,代碼來源:TableDialog.java

示例8: createTableViewerColumn

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
protected TableViewerColumn createTableViewerColumn(String title, int width, int alignment, final boolean isNumber) {
	final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
	final TableColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setAlignment(alignment);
	column.setMoveable(true);
	tableColumnLayout.setColumnData(column, new ColumnPixelData(width, true));
	column.setData("isNumber", isNumber);
	column.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
			TableColumn selectedColumn = (TableColumn) e.widget;
			sorter.setColumn(selectedColumn);
		}
	});
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:18,代碼來源:XLogSummaryAbstractDialog.java

示例9: createTableViewerColumn

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment,  boolean resizable, boolean moveable, final boolean isNumber) {
	final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
	final TableColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setAlignment(alignment);
	column.setMoveable(moveable);
	tableColumnLayout.setColumnData(column, new ColumnWeightData(width, 10, resizable));
	column.setData("isNumber", isNumber);
	column.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
			TableColumn selectedColumn = (TableColumn) e.widget;
			sorter.setColumn(selectedColumn);
		}
	});
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:18,代碼來源:AccountListView.java

示例10: defineColumn_Description

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * Column: Description
 */
private void defineColumn_Description(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.CENTER);
	final TableColumn tc = tvc.getColumn();

	tc.setText(Messages.Tour_Marker_Column_Description_ShortCut);
	tc.setToolTipText(Messages.Tour_Marker_Column_Description_Tooltip);
	tvc.setLabelProvider(new CellLabelProvider() {

		@Override
		public void update(final ViewerCell cell) {

			final TourMarker tourMarker = (TourMarker) cell.getElement();
			final String description = tourMarker.getDescription();

			cell.setText(description.length() == 0 ? UI.EMPTY_STRING : UI.SYMBOL_STAR);
		}
	});
	tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(4), false));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:24,代碼來源:DialogMarker.java

示例11: createTableViewerColumn

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment,  boolean resizable, boolean moveable, final boolean isNumber) {
	final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
	final TableColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setAlignment(alignment);
	column.setMoveable(moveable);
	tableColumnLayout.setColumnData(column, new ColumnWeightData(30, width, resizable));
	column.setData("isNumber", isNumber);
	column.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
			sorter.setColumn(column);
		}
	});
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:17,代碼來源:TopView.java

示例12: createTableViewerColumn

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment,  boolean resizable, boolean moveable, final boolean isNumber) {
	final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
	final TableColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setAlignment(alignment);
	column.setMoveable(moveable);
	tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
	column.setData("isNumber", isNumber);
	column.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			TableLabelSorter sorter = (TableLabelSorter) tableViewer.getComparator();
			TableColumn selectedColumn = (TableColumn) e.widget;
			sorter.setColumn(selectedColumn);
		}
	});
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:18,代碼來源:ObjectBatchActiveListView.java

示例13: createTableViewerColumn

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
protected TableViewerColumn createTableViewerColumn(String title, int width, int alignment,  boolean resizable, boolean moveable, final boolean isNumber) {
	final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
	final TableColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setAlignment(alignment);
	column.setMoveable(moveable);
	tableColumnLayout.setColumnData(column, new ColumnWeightData(30, width, resizable));
	column.setData("isNumber", isNumber);
	column.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
			TableColumn selectedColumn = (TableColumn) e.widget;
			sorter.setColumn(selectedColumn);
		}
	});
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:18,代碼來源:AbstractSummaryComposite.java

示例14: defineColumn_OffsetY

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * column: vertical offset
 */
private void defineColumn_OffsetY(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.TRAIL);
	final TableColumn tc = tvc.getColumn();

	tc.setText(Messages.Tour_Marker_Column_vertical_offset);
	tc.setToolTipText(Messages.Tour_Marker_Column_vertical_offset_tooltip);
	tvc.setLabelProvider(new CellLabelProvider() {

		@Override
		public void update(final ViewerCell cell) {

			final TourMarker tourMarker = (TourMarker) cell.getElement();
			cell.setText(Integer.toString(tourMarker.getLabelYOffset()));
		}
	});
	tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(6), false));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:22,代碼來源:DialogMarker.java

示例15: createTableViewerColumn

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment,  boolean resizable, boolean moveable, final boolean isNumber) {
	final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
	final TableColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setAlignment(alignment);
	column.setMoveable(moveable);
	tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
	column.setData("isNumber", isNumber);
	column.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			ColumnLabelSorter sorter = (ColumnLabelSorter) tableViewer.getComparator();
			TableColumn selectedColumn = (TableColumn) e.widget;
			sorter.setColumn(selectedColumn);
		}
	});
	return viewerColumn;
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:18,代碼來源:ObjectClassListView.java


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