本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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); }
}
示例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();
}
示例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);
}
示例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));
}
示例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));
}
示例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());
}
示例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;
}
示例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();
}
});
}
}
示例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;
}
});
}
示例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();
}
}
}
示例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();
}
}
}
示例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());
}
});
}