本文整理汇总了Java中com.intellij.ui.table.TableView.getSelectedRow方法的典型用法代码示例。如果您正苦于以下问题:Java TableView.getSelectedRow方法的具体用法?Java TableView.getSelectedRow怎么用?Java TableView.getSelectedRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.table.TableView
的用法示例。
在下文中一共展示了TableView.getSelectedRow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeAction
import com.intellij.ui.table.TableView; //导入方法依赖的package包/类
protected void executeAction(AnActionEvent e) {
List<TreeNodeOnVcsRevision> sel = getSelection();
int selectionSize = sel.size();
if (selectionSize > 1) {
myDiffHandler.showDiffForTwo(myFilePath, sel.get(0).getRevision(), sel.get(sel.size() - 1).getRevision());
}
else if (selectionSize == 1) {
final TableView<TreeNodeOnVcsRevision> flatView = myDualView.getFlatView();
final int selectedRow = flatView.getSelectedRow();
VcsFileRevision revision = getFirstSelectedRevision();
VcsFileRevision previousRevision;
if (selectedRow == (flatView.getRowCount() - 1)) {
// no previous
previousRevision = myBottomRevisionForShowDiff != null ? myBottomRevisionForShowDiff : VcsFileRevision.NULL;
} else {
previousRevision = flatView.getRow(selectedRow + 1).getRevision();
}
if (revision != null) {
myDiffHandler.showDiffForOne(e, myFilePath, previousRevision, revision);
}
}
}
示例2: executeAction
import com.intellij.ui.table.TableView; //导入方法依赖的package包/类
protected void executeAction(AnActionEvent e) {
List<TreeNodeOnVcsRevision> sel = getSelection();
int selectionSize = sel.size();
if (selectionSize > 1) {
List<VcsFileRevision> selectedRevisions = ContainerUtil.sorted(ContainerUtil.map(sel, new Function<TreeNodeOnVcsRevision, VcsFileRevision>() {
@Override
public VcsFileRevision fun(TreeNodeOnVcsRevision treeNode) {
return treeNode.getRevision();
}
}), myRevisionsInOrderComparator);
VcsFileRevision olderRevision = selectedRevisions.get(0);
VcsFileRevision newestRevision = selectedRevisions.get(sel.size() - 1);
myDiffHandler.showDiffForTwo(e.getRequiredData(CommonDataKeys.PROJECT), myFilePath, olderRevision, newestRevision);
}
else if (selectionSize == 1) {
final TableView<TreeNodeOnVcsRevision> flatView = myDualView.getFlatView();
final int selectedRow = flatView.getSelectedRow();
VcsFileRevision revision = getFirstSelectedRevision();
VcsFileRevision previousRevision;
if (selectedRow == (flatView.getRowCount() - 1)) {
// no previous
previousRevision = myBottomRevisionForShowDiff != null ? myBottomRevisionForShowDiff : VcsFileRevision.NULL;
} else {
previousRevision = flatView.getRow(selectedRow + 1).getRevision();
}
if (revision != null) {
myDiffHandler.showDiffForOne(e, e.getRequiredData(CommonDataKeys.PROJECT), myFilePath, previousRevision, revision);
}
}
}
示例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);
}
};
}
示例4: executeAction
import com.intellij.ui.table.TableView; //导入方法依赖的package包/类
protected void executeAction(AnActionEvent e) {
List<TreeNodeOnVcsRevision> sel = getSelection();
int selectionSize = sel.size();
if (selectionSize > 1) {
List<VcsFileRevision> selectedRevisions =
ContainerUtil.sorted(ContainerUtil.map(sel, TreeNodeOnVcsRevision::getRevision), myRevisionsInOrderComparator);
VcsFileRevision olderRevision = selectedRevisions.get(0);
VcsFileRevision newestRevision = selectedRevisions.get(sel.size() - 1);
myDiffHandler.showDiffForTwo(e.getRequiredData(CommonDataKeys.PROJECT), myFilePath, olderRevision, newestRevision);
}
else if (selectionSize == 1) {
final TableView<TreeNodeOnVcsRevision> flatView = myDualView.getFlatView();
final int selectedRow = flatView.getSelectedRow();
VcsFileRevision revision = getFirstSelectedRevision();
VcsFileRevision previousRevision;
if (selectedRow == (flatView.getRowCount() - 1)) {
// no previous
previousRevision = myBottomRevisionForShowDiff != null ? myBottomRevisionForShowDiff : VcsFileRevision.NULL;
}
else {
previousRevision = flatView.getRow(selectedRow + 1).getRevision();
}
if (revision != null) {
myDiffHandler.showDiffForOne(e, e.getRequiredData(CommonDataKeys.PROJECT), myFilePath, previousRevision, revision);
}
}
}