本文整理汇总了Java中org.eclipse.swt.widgets.Table.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java Table.setSelection方法的具体用法?Java Table.setSelection怎么用?Java Table.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Table
的用法示例。
在下文中一共展示了Table.setSelection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteRow
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void deleteRow(){
Table table = mappingTableViewer.getTable();
setValueForCellEditor();
int selectionIndex = table.getSelectionIndex();
int[] indexs = table.getSelectionIndices();
if (selectionIndex == -1) {
WidgetUtility.errorMessage("Select Rows to delete");
} else {
table.remove(indexs);
int itemsRemoved=0;
for (int index : indexs) {
mappingTableItemList.remove(index-itemsRemoved);
if(index-itemsRemoved-1 != -1){
table.setSelection(index-itemsRemoved-1);
}else{
table.setSelection(0);
}
itemsRemoved++;
}
mappingTableViewer.refresh();
}
refreshButtonStatus();
}
示例2: deleteRow
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void deleteRow()
{
Table table = mappingTableViewer.getTable();
setValueForCellEditor();
int selectionIndex = table.getSelectionIndex();
int[] indexs = table.getSelectionIndices();
if (selectionIndex == -1) {
WidgetUtility.errorMessage("Select Rows to delete");
} else {
table.remove(indexs);
int itemsRemoved=0;
for (int index : indexs) {
mappingTableItemList.remove(index-itemsRemoved);
if(index-itemsRemoved-1 != -1){
table.setSelection(index-itemsRemoved-1);
}else{
table.setSelection(0);
}
itemsRemoved++;
}
mappingTableViewer.refresh();
}
component.setLatestChangesInSchema(false);
refreshButtonStatus();
}
示例3: addNewItem
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void addNewItem() {
ACL acl = new ACL();
acl.setId(ZooDefs.Ids.ANYONE_ID_UNSAFE);
acl.setPerms(ZooDefs.Perms.ALL);
TableItem newItem = addAclTableItem(acl);
Table table = getTable();
table.setSelection(newItem);
tableSelectionChanged(newItem);
fireOrchestrationChange();
}
示例4: searchInLogs
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void searchInLogs(int side) {
int searchIndex = currentFoundIndex + side;
if (searchIndex < 0 || searchIndex > foundIndexes.size())
return;
currentFoundIndex = searchIndex;
Table table = tableViewer.getTable();
table.setSelection(foundIndexes.get(currentFoundIndex));
table.setFocus();
// Disable "previous" if is the beginning
if (foundIndexes.get(currentFoundIndex) == foundIndexes.get(0))
previousSearch.setEnabled(false);
else
previousSearch.setEnabled(true);
// Disable "next" if is the end
if (foundIndexes.get(currentFoundIndex) == foundIndexes.get(foundIndexes.size() - 1))
nextSearch.setEnabled(false);
else
nextSearch.setEnabled(true);
infoSearch.setText((currentFoundIndex + 1) + "/" + foundIndexes.size());
// To force components resizing if needed
compositeSearch.layout();
}
示例5: mouseAction
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
@Override
public void mouseAction(PropertyDialogButtonBar propertyDialogButtonBar,
ListenerHelper helpers, Event event, Widget... widgets) {
Table table=(Table)widgets[0];
Label label=(Label)event.widget;
Event e = new Event();
e.item = (TableItem) label.getData("_TABLEITEM");
table.setSelection(new TableItem[] { (TableItem) e.item });
table.notifyListeners(SWT.Selection, e);
}