本文整理汇总了Java中com.intellij.ui.table.TableView.setRowSelectionInterval方法的典型用法代码示例。如果您正苦于以下问题:Java TableView.setRowSelectionInterval方法的具体用法?Java TableView.setRowSelectionInterval怎么用?Java TableView.setRowSelectionInterval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.table.TableView
的用法示例。
在下文中一共展示了TableView.setRowSelectionInterval方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRemoveAction
import com.intellij.ui.table.TableView; //导入方法依赖的package包/类
private AnActionButtonRunnable getRemoveAction(final TableView<XQueryRunVariable> variablesTable) {
return new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
TableUtil.stopEditing(variablesTable);
final int[] selected = variablesTable.getSelectedRows();
if (selected == null || selected.length == 0) return;
for (int i = selected.length - 1; i >= 0; i--) {
variablesModel.removeRow(selected[i]);
}
for (int i = selected.length - 1; i >= 0; i--) {
int idx = selected[i];
variablesModel.fireTableRowsDeleted(idx, idx);
}
int selection = selected[0];
if (selection >= variablesModel.getRowCount()) {
selection = variablesModel.getRowCount() - 1;
}
if (selection >= 0) {
variablesTable.setRowSelectionInterval(selection, selection);
}
variablesTable.requestFocus();
}
};
}
示例2: getAddAction
import com.intellij.ui.table.TableView; //导入方法依赖的package包/类
private AnActionButtonRunnable getAddAction(final TableView<XQueryRunVariable> variablesTable) {
return new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
XQueryRunVariable newVariable = new XQueryRunVariable();
if (showEditorDialog(newVariable)) {
ArrayList<XQueryRunVariable> newList = new ArrayList<XQueryRunVariable>(variablesModel
.getItems());
newList.add(newVariable);
variablesModel.setItems(newList);
int index = variablesModel.getRowCount() - 1;
variablesModel.fireTableRowsInserted(index, index);
variablesTable.setRowSelectionInterval(index, index);
}
}
};
}
示例3: getUpdateAction
import com.intellij.ui.table.TableView; //导入方法依赖的package包/类
private AnActionButtonRunnable getUpdateAction(final TableView<XQueryRunVariable> variablesTable) {
return new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
final int selectedRow = variablesTable.getSelectedRow();
final XQueryRunVariable selectedVariable = variablesTable.getSelectedObject();
showEditorDialog(selectedVariable);
variablesModel.fireTableDataChanged();
variablesTable.setRowSelectionInterval(selectedRow, selectedRow);
}
};
}