本文整理汇总了Java中org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand类的典型用法代码示例。如果您正苦于以下问题:Java ClearAllSelectionsCommand类的具体用法?Java ClearAllSelectionsCommand怎么用?Java ClearAllSelectionsCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClearAllSelectionsCommand类属于org.eclipse.nebula.widgets.nattable.selection.command包,在下文中一共展示了ClearAllSelectionsCommand类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: instanceCellSelected
import org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand; //导入依赖的package包/类
@Override
public void instanceCellSelected(String instanceName, InstanceTable instanceTable) {
System.out.println(instanceName);
ClearAllSelectionsCommand clearCmd=new ClearAllSelectionsCommand();
for(InstanceTable it: instanceTableMap.values()){
if(it!=instanceTable){
it.doCommand(clearCmd);
it.refresh();
}
}
instanceTableCellSelected(instanceName);
}
示例2: goToInsertRow
import org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand; //导入依赖的package包/类
public void goToInsertRow() {
if (table.commitAndCloseActiveCellEditor()) {
table.setFocus();
table.doCommand(new ClearAllSelectionsCommand());
if (gridLayer != null && dataProvider != null) {
int lastRow = dataProvider.getRowCount() - 1;
table.doCommand(new ShowRowInViewportCommand(gridLayer.getBodyLayer().getViewportLayer(), lastRow));
table.doCommand(new SelectCellCommand(gridLayer.getBodyLayer().getSelectionLayer(), 0, lastRow, true, true));
}
}
}
示例3: setSelection
import org.eclipse.nebula.widgets.nattable.selection.command.ClearAllSelectionsCommand; //导入依赖的package包/类
@Override
public void setSelection(ISelection selection){
if (selection instanceof StructuredSelection) {
if(!selection.isEmpty()) {
List<?> list = ((StructuredSelection) selection).toList();
int[] rowIdx = new int[list.size()];
for (int i = 0; i < list.size(); i++) {
rowIdx[i] = dataProvider.indexOfRowObject(list.get(i));
}
natTable.doCommand(new SelectRowsCommand(selectionLayer, 0, rowIdx, false, false, rowIdx[0]));
} else {
natTable.doCommand(new ClearAllSelectionsCommand());
}
}
}