本文整理汇总了Java中org.eclipse.swt.custom.TableCursor类的典型用法代码示例。如果您正苦于以下问题:Java TableCursor类的具体用法?Java TableCursor怎么用?Java TableCursor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableCursor类属于org.eclipse.swt.custom包,在下文中一共展示了TableCursor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endTableEdit
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
protected void endTableEdit(TableCursor tableCursor, ControlEditor editor,
final CommitEditRunnable commitEditRunnable, TableItem row, int column, String newValue) throws Exception {
if (commitEditRunnable == null) {
return;
}
commitEditRunnable.setTableCursor(tableCursor);
commitEditRunnable.setEditor(editor);
commitEditRunnable.setRow(row);
commitEditRunnable.setColumn(column);
commitEditRunnable.setNewValue(newValue);
BusyIndicator.showWhile(row.getDisplay(), commitEditRunnable);
Exception error = commitEditRunnable.getError();
if (error != null) {
throw error;
}
}
示例2: selectAllInTable
import org.eclipse.swt.custom.TableCursor; //导入依赖的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); }
}
示例3: forwardTableTraverse
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
private void forwardTableTraverse(TableViewer debugDataViewer, TableCursor tableCursor){
TableItem previousSelectedTableItem = null;
if(debugDataViewer.getData("SELECTED_ROW_INDEX")!=null){
previousSelectedTableItem = debugDataViewer.getTable().getItem((int) debugDataViewer.getData("SELECTED_ROW_INDEX"));
findColIndex++;
}
Table table = debugDataViewer.getTable();
TableItem[] tableItems = table.getItems();
if(findColIndex == prevColSelection && findRowIndex == prevRowSelection){
findColIndex++;
}
if(findRowIndex < 0){
findRowIndex = 0;
}
for(;findRowIndex<tableItems.length;){
TableItem tableItem = tableItems[findRowIndex];
for(;findColIndex <= table.getColumnCount();findColIndex++){
if(StringUtils.containsIgnoreCase(tableItem.getText(findColIndex), findText.getText())){
if(prevColSelection > 0){
previousSelectedTableItem.setBackground(prevColSelection, Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
}
label.setVisible(false);
table.showItem(tableItem);
table.showColumn(table.getColumn(findColIndex));
tableCursor.setSelection(findRowIndex, findColIndex);
tableCursor.setVisible(false);
tableItem.setBackground(findColIndex, Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex);
debugDataViewer.setData("SEELCTED_COLUMN_INDEX", findColIndex);
prevColSelection = findColIndex;
return;
}
}
findRowIndex++;
findColIndex=1;
if(findRowIndex >= tableItems.length){ findRowIndex = 0;}
}
}
示例4: reverseTableTraverse
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
private void reverseTableTraverse(TableViewer debugDataViewer, TableCursor tableCursor){
TableItem previousSelectedTableItem = null;
if(debugDataViewer.getData("SELECTED_ROW_INDEX")!=null){
previousSelectedTableItem = debugDataViewer.getTable().getItem((int) debugDataViewer.getData("SELECTED_ROW_INDEX"));
findColIndex -= 1;
}
if(findRowIndex < 0){
findRowIndex = debugDataViewer.getTable().getItems().length - 1;
}
Table table = debugDataViewer.getTable();
TableItem[] tableItems = table.getItems();
for(; findRowIndex >=0; findRowIndex--){
TableItem tableItem = tableItems[findRowIndex];
for( ; findColIndex > 0 ;findColIndex--){
if(StringUtils.containsIgnoreCase(tableItem.getText(findColIndex), findText.getText())){
if(prevColSelection > 0){
previousSelectedTableItem.setBackground(prevColSelection, Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
}
label.setVisible(false);
table.showItem(tableItem);
table.showColumn(table.getColumn(findColIndex));
tableCursor.setSelection(findRowIndex, findColIndex);
tableCursor.setVisible(false);
tableItem.setBackground(findColIndex,Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
if(findColIndex<=0){debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex-1);}else{
debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex);
}
debugDataViewer.setData("SEELCTED_COLUMN_INDEX", findColIndex);
prevColSelection = findColIndex;
prevRowSelection = findRowIndex;
return ;
}
}
if(findColIndex <= 0){ findColIndex = table.getColumnCount();}
if(findRowIndex == 0){ findRowIndex = tableItems.length; }
}
}
示例5: create
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
static SelectionAdapter create(Widget widget) {
if (widget instanceof Button) {
return create((Button) widget);
} else if (widget instanceof CCombo) {
return create((CCombo) widget);
} else if (widget instanceof Combo) {
return create((Combo) widget);
} else if (widget instanceof CoolItem) {
return create((CoolItem) widget);
} else if (widget instanceof CTabFolder) {
return create((CTabFolder) widget);
} else if (widget instanceof DateTime) {
return create((DateTime) widget);
} else if (widget instanceof Link) {
return create((Link) widget);
} else if (widget instanceof List) {
return create((List) widget);
} else if (widget instanceof MenuItem) {
return create((MenuItem) widget);
} else if (widget instanceof Sash) {
return create((Sash) widget);
} else if (widget instanceof Scale) {
return create((Scale) widget);
} else if (widget instanceof Slider) {
return create((Slider) widget);
} else if (widget instanceof Spinner) {
return create((Spinner) widget);
} else if (widget instanceof StyledText) {
return create((StyledText) widget);
} else if (widget instanceof TabFolder) {
return create((TabFolder) widget);
} else if (widget instanceof Table) {
return create((Table) widget);
} else if (widget instanceof TableColumn) {
return create((TableColumn) widget);
} else if (widget instanceof TableCursor) {
return create((TableCursor) widget);
} else if (widget instanceof Text) {
return create((Text) widget);
} else if (widget instanceof ToolItem) {
return create((ToolItem) widget);
} else if (widget instanceof ToolTip) {
return create((ToolTip) widget);
} else if (widget instanceof TrayItem) {
return create((TrayItem) widget);
} else if (widget instanceof Tree) {
return create((Tree) widget);
} else if (widget instanceof TreeColumn) {
return create((TreeColumn) widget);
} else if (widget instanceof TreeCursor) {
return create((TreeCursor) widget);
}
throw new IllegalArgumentException("The given widget (" + widget.getClass().getName() + ") is not supported.");
}
示例6: getTablecursor
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
public TableCursor getTablecursor(){
return tableCursor;
}
示例7: editCell
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
/**
* @param tableViewer
* @param cursor
*/
static void editCell(final TableViewer tableViewer, final TableCursor cursor) {
tableViewer.editElement(cursor.getRow().getData(), cursor.getColumn());
// hide cursor only f there is an editor active on the cell
cursor.setVisible(!tableViewer.isCellEditorActive());
}
示例8: getTableCursor
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
/**
* Returns the tableCursor.
*
* @return The tableCursor
*/
public TableCursor getTableCursor() {
return _TableCursor;
}
示例9: setTableCursor
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
/**
* Sets the tableCursor.
*
* @param tableCursor the tableCursor to set
*/
public void setTableCursor(TableCursor tableCursor) {
_TableCursor = tableCursor;
}
示例10: getTableCursor
import org.eclipse.swt.custom.TableCursor; //导入依赖的package包/类
/**
* If usesTableCursor was passed into the constructor then this will return
* the table cursor. Otherwise it will return null.
*/
public TableCursor getTableCursor() {
return cursor;
}