当前位置: 首页>>代码示例>>Java>>正文


Java TableView.getSelectedRow方法代码示例

本文整理汇总了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);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:FileHistoryPanelImpl.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:FileHistoryPanelImpl.java

示例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);
        }
    };
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:13,代码来源:VariablesPanel.java

示例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);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:31,代码来源:FileHistoryPanelImpl.java


注:本文中的com.intellij.ui.table.TableView.getSelectedRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。