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


Java TableViewer.setCellEditors方法代码示例

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


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

示例1: createTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void createTableViewer() {
	ArrayEditor arrayEditor = ((ArrayEditor) cellEditor);

	tableViewer = new TableViewer(table);
	tableViewer.setUseHashlookup(true);
	tableViewer.setColumnProperties(arrayEditor.columnNames);

	// Assign the cell editors to the viewer
	CellEditor[] editors = arrayEditor.getColumnEditors(table);
	tableViewer.setCellEditors(editors);

	// Set the cell modifier for the viewer
	tableViewer.setCellModifier(new ArrayEditorCellModifier(this, tableViewer));
	
	// Set the label provider for the viewer
	tableViewer.setLabelProvider(new ArrayEditorLabelProvider(cellEditor.getStyle()));
	
	// Set the content provider
	tableViewer.setContentProvider(new ArrayEditorContentProvider());
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:ArrayEditorComposite.java

示例2: createTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void createTableViewer() {
	TableEditor tableEditor = ((TableEditor) cellEditor);

	tableViewer = new TableViewer(table);
	tableViewer.setUseHashlookup(true);
	tableViewer.setColumnProperties(tableEditor.columnNames);

	// Assign the cell editors to the viewer
	CellEditor[] editors = tableEditor.getColumnEditors(table);
	tableViewer.setCellEditors(editors);

	// Set the cell modifier for the viewer
	tableViewer.setCellModifier(new TableEditorCellModifier(this, tableViewer));
	
	// Set the label provider for the viewer
	tableViewer.setLabelProvider(new TableEditorLabelProvider());
	
	// Set the content provider
	tableViewer.setContentProvider(new TableEditorContentProvider());
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:TableEditorComposite.java

示例3: setTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public TableViewer setTableViewer(TableViewer tableViewer, Composite composite, String[] prop,
		IStructuredContentProvider iStructuredContentProvider, ITableLabelProvider iTableLabelProvider) {

	tableViewer.setContentProvider(iStructuredContentProvider);

	tableViewer.setColumnProperties(prop);

	tableViewerTable = tableViewer.getTable();

	tableViewerTable.setVisible(true);
	tableViewerTable.setLinesVisible(true);
	tableViewerTable.setHeaderVisible(true);
	createTableColumns(tableViewerTable, prop);
	editors = createCellEditorList(tableViewerTable, prop.length);
	tableViewer.setCellEditors(editors);

	TableViewerEditor.create(tableViewer, new ColumnViewerEditorActivationStrategy(tableViewer),
			ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

	return tableViewer;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:ELTOperationClassDialog.java

示例4: setTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public TableViewer setTableViewer(TableViewer tableViewer, Composite composite, String[] prop,
		IStructuredContentProvider iStructuredContentProvider) {

	tableViewer.setContentProvider(iStructuredContentProvider);

	tableViewer.setColumnProperties(prop);

	tableViewerTable = tableViewer.getTable();

	tableViewerTable.setVisible(true);
	tableViewerTable.setLinesVisible(true);
	tableViewerTable.setHeaderVisible(true);
	createTableColumns(tableViewerTable, prop);
	editors = createCellEditorList(tableViewerTable, prop.length);
	tableViewer.setCellEditors(editors);

	TableViewerEditor.create(tableViewer, new ColumnViewerEditorActivationStrategy(tableViewer),
			ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

	return tableViewer;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:TransformDialog.java

示例5: createTargetTable

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void createTargetTable(Composite container) {
	targetTableViewer = new TableViewer(container, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
	targetTable = targetTableViewer.getTable();
	GridData gd_table_1 = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
	gd_table_1.heightHint = 401;
	
	if(OSValidator.isMac()){
		gd_table_1.widthHint = 363;
	}else{
		gd_table_1.widthHint = 352;
	}
	targetTable.setLayoutData(gd_table_1);

	attachTargetTableListeners();

	targetTableViewer.setContentProvider(new SecondaryColumnKeysContentProvider());
	targetTableViewer.setLabelProvider(new SecondaryColumnKeysLabelProvider());
	targetTableViewer.setInput(propertyList);

	TableColumn targetTableColumnFieldName = new TableColumn(targetTable, SWT.LEFT);
	targetTableColumnFieldName.setText(COLUMNNAME); //$NON-NLS-1$
	TableColumn targetTableColumnSortOrder = new TableColumn(targetTable, SWT.LEFT_TO_RIGHT);
	targetTableColumnSortOrder.setText(SORTORDER); //$NON-NLS-1$

	for (int i = 0, n = targetTable.getColumnCount(); i < n; i++) {
		targetTable.getColumn(i).pack();
	}
	targetTableColumnFieldName.setWidth(175);
	
	if(OSValidator.isMac()){
		targetTableColumnSortOrder.setWidth(128);
	}else{
		targetTableColumnSortOrder.setWidth(116);
	}
	
	targetTable.setHeaderVisible(true);
	targetTable.setLinesVisible(true);

	// enables the tab functionality
	TableViewerEditor.create(targetTableViewer, new ColumnViewerEditorActivationStrategy(targetTableViewer),
			ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

	final CellEditor propertyNameeditor = new TextCellEditor(targetTable);

	ComboBoxViewerCellEditor propertyValueeditor = new ComboBoxViewerCellEditor(targetTable, SWT.READ_ONLY);
	propertyValueeditor.setContentProvider(new ArrayContentProvider());
	propertyValueeditor.setLabelProvider(new LabelProvider());
	propertyValueeditor.setInput(new String[] { Constants.ASCENDING_SORT_ORDER, Constants.DESCENDING_SORT_ORDER, Constants.NONE_SORT_ORDER });

	CellEditor[] editors = new CellEditor[] { propertyNameeditor, propertyValueeditor };

	propertyNameeditor.setValidator(createNameEditorValidator(Messages.EmptyColumnNotification));
	propertyValueeditor.setValidator(createValueEditorValidator(Messages.EmptySortOrderNotification));

	targetTableViewer.setColumnProperties(PROPS);
	targetTableViewer.setCellModifier(new SecondaryColumnKeysWidgetCellModifier(targetTableViewer));
	targetTableViewer.setCellEditors(editors);

	loadProperties(targetTableViewer);
	
	if (propertyList.size() != 0) {
		deleteButton.setEnabled(true);
	}
	if (propertyList.size() >= 2) {
		upButton.setEnabled(true);
		downButton.setEnabled(true);
	}

	dropTarget = new DropTarget(targetTable, DND.DROP_MOVE);
	dropTarget.setTransfer(new Transfer[] { TextTransfer.getInstance() });
	dropTarget.addDropListener(new DropTargetAdapter() {
		public void drop(DropTargetEvent event) {
			for (String fieldName : getformatedData((String) event.data))
					addNewProperty(targetTableViewer, fieldName);
			enableControlButtons();
		}
	});

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:81,代码来源:SecondaryColumnKeysDialog.java


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