org.netbeans.swing.outline.Outline.getSelectionModel()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.netbeans.swing.outline.Outline.getSelectionModel()方法的一些代码示例,展示了Outline.getSelectionModel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Outline.getSelectionModel()方法的具体详情如下:
包路径:org.netbeans.swing.outline.Outline
类名称:Outline
方法名:getSelectionModel

Outline.getSelectionModel介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

void setSelection(int idx) {
  getOutline().getSelectionModel().setValueIsAdjusting(false);
  getOutline().scrollRectToVisible(getOutline().getCellRect(idx, 1, true));
  getOutline().getSelectionModel().setSelectionInterval(idx, idx);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

private void showPopup (final MouseEvent e) {
  int row = view.getOutline().rowAtPoint(e.getPoint());
  if (row != -1) {
    boolean makeRowSelected = true;
    int [] selectedrows = view.getOutline().getSelectedRows();
    for (int i = 0; i < selectedrows.length; i++) {
      if (row == selectedrows[i]) {
        makeRowSelected = false;
        break;
      }
    }
    if (makeRowSelected) {
      view.getOutline().getSelectionModel().setSelectionInterval(row, row);
    }
  }
  SwingUtilities.invokeLater(new Runnable() {
    @Override
    public void run() {
      // invoke later so the selection on the table will be set first
      JPopupMenu menu = getPopup();
      if (menu != null) {
        menu.show(view.getOutline(), e.getX(), e.getY());
      }
    }
  });
}

代码示例来源:origin: digital-preservation/droid

@Override
public void valueChanged(ListSelectionEvent event) {
  if (!event.getValueIsAdjusting()) {
    Outline outline = droidContext.getSelectedProfile().getResultsOutline();
    ListSelectionModel m = outline.getSelectionModel();
    if (outline.getSelectedRow() != -1 && m.getMinSelectionIndex() == m.getMaxSelectionIndex()) {
      if (!getSelectedNode().isRoot() && getSelectedNode().getDepth() == 0) {
        populateNode();
      }
    }
  }
}

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

@Override
public void valueChanged(ListSelectionEvent event) {
  if (!event.getValueIsAdjusting()) {
    Outline outline = droidContext.getSelectedProfile().getResultsOutline();
    ListSelectionModel m = outline.getSelectionModel();
    if (outline.getSelectedRow() != -1 && m.getMinSelectionIndex() == m.getMaxSelectionIndex()) {
      if (!getSelectedNode().isRoot() && getSelectedNode().getDepth() == 0) {
        populateNode();
      }
    }
  }
}

相关文章