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


Java TableViewer.getTable方法代码示例

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


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

示例1: createTableColumns

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的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

示例2: isExistInTable

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private boolean isExistInTable(TableViewer tableViewer, String text){
  boolean isDataExist = false;
  Table table = tableViewer.getTable();
  TableItem[] tableItems = table.getItems();
  for(int i=0;i<tableItems.length;i++){
	TableItem tableItem = tableItems[i];
	for(int j=1;j <= table.getColumnCount()-1;j++){
		if(StringUtils.containsIgnoreCase(tableItem.getText(j), text)){
			label.setVisible(false);
			isDataExist = true;
			return isDataExist;
		}else{
			label.setVisible(true);
			label.setText(labelText);
			isDataExist =  false;
		}
		
	}
  }
return isDataExist;
 }
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:FindViewDataDialog.java

示例3: addCheckButtonInTable

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void addCheckButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String groupPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.CHECK);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	if(null != buttonSelectionListener){
		button.addSelectionListener(buttonSelectionListener);
	}
	tableItem.setData(columnName, button);
	tableItem.setData(groupPaneName, buttonPane);
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例4: selectAllInTable

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void selectAllInTable(TableViewer debugDataViewer, TableCursor tableCursor){
	Table table = debugDataViewer.getTable();
	TableItem[] tableItems = table.getItems();
	int recordCount = 0;
	
	for(int rowIndex = 0; rowIndex < tableItems.length; rowIndex++){
		TableItem tableItem = tableItems[rowIndex];
		for(int colIndex = 1; colIndex <= table.getColumnCount(); colIndex++){
			if(StringUtils.containsIgnoreCase(tableItem.getText(colIndex), findText.getText())){
				label.setVisible(false);
				tableItem.setBackground(colIndex, Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
				recordCount++;
			}
		}
		findColIndex=1;
	}
	
	findRowIndex = 0;
	findColIndex = 0;
	
	if(recordCount > 0){
		label.setVisible(true);
		label.setText("Match count - " + recordCount);
	}else{ label.setVisible(false); }
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:FindViewDataDialog.java

示例5: createSourceTable

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的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

示例6: initTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private static void initTableViewer(TableViewer tableViewer, ElementTypes elementTypes, Object input,
        IElementBinding elementBinding) {

    IViewerType viewerType = new TableViewerType();

    Table table = tableViewer.getTable();
    Class<?> contentProviderInterfaceType = IStructuredContentProvider.class;
    if ((table.getStyle() & SWT.VIRTUAL) != 0) {
        contentProviderInterfaceType = ILazyContentProvider.class;
    }

    registerTableListeners(table);

    initViewer(tableViewer, elementTypes, input, elementBinding, viewerType, contentProviderInterfaceType);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:16,代码来源:ViewerFactory.java

示例7: initialize

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public void initialize(Composite composite, int defaultOrientation) {
	display = composite.getDisplay();
	composite.addDisposeListener((DisposeListener) this::dispose);
	
	tableViewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.NO_BACKGROUND | SWT.DOUBLE_BUFFERED );
	table = tableViewer.getTable();
	
       GridData gridData = new GridData();
       gridData.verticalAlignment = GridData.FILL;
       gridData.horizontalSpan = 2;
       gridData.grabExcessHorizontalSpace = true;
       gridData.grabExcessVerticalSpace = true;
       gridData.horizontalAlignment = GridData.FILL;
       tableViewer.getControl().setLayoutData(gridData);
	
	tableViewer.setContentProvider((ILazyContentProvider) rowIndex -> tableViewer.replace(contentProvider().getTableEntries().get(rowIndex), rowIndex));
	table.addListener(SWT.Selection, event-> {
		TableItem item = (TableItem) event.item;
		contentProvider().setCursorIndex(contentProvider().getRowIndex((RankedItem<T>) item.getData()));
		handleSelection();
	});
	composite.getShell().addListener(SWT.Resize, event ->  autoAdjustColumnWidths(composite));
	
	// TODO try throttleLast or custom scheduler
	//subjectFilter.debounce(0, TimeUnit.MILLISECONDS).subscribe( filter -> handleRefresh(filter));

}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:28,代码来源:KaviList.java

示例8: applyDrop

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public void applyDrop(final TableViewer tableViewerOpOuter,DragDropOperation dragDropOperation) {
	
	Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
	int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
	DropTarget target = new DropTarget(tableViewerOpOuter.getTable(), operations);
	target.setTransfer(types);
	target.addDropListener(new DradDropUtilityListener(dragDropOperation));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:DragDropUtility.java

示例9: TextCellEditingSupport

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public TextCellEditingSupport(TableViewer viewer, String fName, int type) {
	super(viewer);
	this.viewer = viewer;
	this.fName = fName;
	this.type = type;
	this.editor = new TextCellEditor(viewer.getTable());
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:8,代码来源:VarRecTypesComposite.java

示例10: createMappingTable

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private Table createMappingTable(Composite composite_6) {
	mappingTableViewer = new TableViewer(composite_6, SWT.BORDER
			| SWT.FULL_SELECTION | SWT.MULTI);
	Table table = mappingTableViewer.getTable();
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	gd_table.widthHint = 374;
	table.setLayoutData(gd_table);
	mappingTableViewer.setContentProvider(new ArrayContentProvider());
	ColumnViewerToolTipSupport.enableFor(mappingTableViewer);
	return table;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:LookupMapDialog.java

示例11: setColumnsName

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void setColumnsName (TableViewer tv) {
  for (int i = 0; i < ColumnsConst.COLUMNS.length; i++) {
   TableColumn col = new TableColumn(tv.getTable(), SWT.LEFT );
       col.setText(ColumnsConst.COLUMNS[i]);
       col.setData(new Integer (i));
       col.addSelectionListener(new SelectionAdapter() {
           public void widgetSelected(SelectionEvent event) {
           	TableColumn tc  = (TableColumn)event.getSource();
           	Integer index = (Integer)tc.getData();
               ((PerformanceStatsViewerSorter) tv.getComparator()).doSort(index);
               tv.refresh();
           }
      });
  }
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:16,代码来源:PerformanceView.java

示例12: KeyEditingSupport

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public KeyEditingSupport(TableViewer viewer) {
	super(viewer);

	this.editor = new TextCellEditor(viewer.getTable());
	this.editor.setValidator(new ICellEditorValidator() {
		public String isValid(Object value) {
			if ((value == null) || (String.valueOf(value).trim().length() == 0)
					|| (!ModelProperties.isCustomProperty(String.valueOf(value)))) {
				return "Invalid value";
			}
			return null;
		}
	});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:15,代码来源:CustomProperties.java

示例13: moveRowUp

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void moveRowUp( TableViewer parameterTableViewer ){
	Table table = parameterTableViewer.getTable();
	int[] indexes = table.getSelectionIndices();
	for (int index : indexes) {

		if (index > 0) {
			Collections.swap((List<Parameter>) parameters, index,
					index - 1);
			parameterTableViewer.refresh();

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

示例14: moveRowDown

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void moveRowDown(TableViewer parameterTableViewer){
	Table table = parameterTableViewer.getTable();
	int[] indexes = table.getSelectionIndices();
	for (int i = indexes.length - 1; i > -1; i--) {

		if (indexes[i] < parameters.size() - 1) {
			Collections.swap((List<Parameter>) parameters,
					indexes[i], indexes[i] + 1);
			parameterTableViewer.refresh();

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

示例15: addIn0InputFields

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void addIn0InputFields(Composite inputComposite2) {
	List<FilterProperties> inputIn0PortFieldList = null;
	if (lookupMappingGrid != null) {
		if (lookupMappingGrid.getLookupInputProperties() != null
				&& !lookupMappingGrid.getLookupInputProperties()
				.isEmpty()) {

			inputIn0PortFieldList = lookupMappingGrid
					.getLookupInputProperties().get(0);

		} else {
			inputIn0PortFieldList = new ArrayList<>();
		}
	}
	if (inputPorts != null) {
		inputPorts.add(inputIn0PortFieldList);
		if (inputIn0PortFieldList != null) {
			for (FilterProperties inputField : inputIn0PortFieldList) {
				allInputFields.add(IN0_PREFIX + inputField.getPropertyname());
			}
		}

	}
	TableViewer in0TableViewer = new TableViewer(inputComposite2, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
	in0Table = in0TableViewer.getTable();
	in0Table.setLinesVisible(true);
	in0Table.setHeaderVisible(true);
	in0Table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	in0TableViewer.setContentProvider(new ArrayContentProvider());
	
	TableViewerColumn in0TableViewerColumn = new TableViewerColumn(
			in0TableViewer, SWT.NONE);
	TableColumn in0TblclmnInputFields = in0TableViewerColumn.getColumn();
	in0TblclmnInputFields.setWidth(230);
	in0TblclmnInputFields.setText(IN0_HEADER);

	in0TableViewerColumn.setLabelProvider(new ColumnLabelProvider() {
		@Override
		public String getText(Object element) {
			FilterProperties tableField = (FilterProperties) element;
			return tableField.getPropertyname();
		}
	});
	in0TableViewer.setInput(inputIn0PortFieldList);
	
	Transfer[] in0Types = new Transfer[] { TextTransfer.getInstance() };
	final String in0PortLabel = IN0_PREFIX;
	int in0Operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
	// final Table table = (Table) sourceControl;
	DragSource in0Source = new DragSource(in0Table, in0Operations);
	in0Source.setTransfer(in0Types);
	in0Source.addDragListener(new DragSourceAdapter() {
		public void dragSetData(DragSourceEvent event) {
			// Set the data to be the first selected item's text
			event.data = addDelimeter(in0PortLabel, in0Table.getSelection());
		}
	});
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:59,代码来源:LookupMapDialog.java


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