public boolean isSelectionMultiCalques() { return selection_.getSelectionMode()!=TreeSelectionModel.SINGLE_TREE_SELECTION; }
/** Returns the current selection mode, one of * <code>SINGLE_TREE_SELECTION</code>, * <code>CONTIGUOUS_TREE_SELECTION</code> or * <code>DISCONTIGUOUS_TREE_SELECTION</code>. * @since 2.15 * @return selection mode */ public int getSelectionMode () { return tree.getSelectionModel ().getSelectionMode (); }
/** Returns the current selection mode, one of * <code>TreeSelectionModel.SINGLE_TREE_SELECTION</code>, * <code>TreeSelectionModel.CONTIGUOUS_TREE_SELECTION</code> or * <code>TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION</code>. * @since 2.15 * @return selection mode */ public int getSelectionMode() { return tree.getSelectionModel().getSelectionMode(); }
/** Returns the current selection mode, one of * <code>SINGLE_TREE_SELECTION</code>, * <code>CONTIGUOUS_TREE_SELECTION</code> or * <code>DISCONTIGUOUS_TREE_SELECTION</code>. * @since 2.15 * @return selection mode */ public int getSelectionMode () { return tree.getSelectionModel ().getSelectionMode (); }
@Override public int getSelectionMode() { switch (getSelectionModel().getSelectionMode()) { case TreeSelectionModel.CONTIGUOUS_TREE_SELECTION: return ListSelectionModel.SINGLE_INTERVAL_SELECTION; case TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION: return ListSelectionModel.MULTIPLE_INTERVAL_SELECTION; case TreeSelectionModel.SINGLE_TREE_SELECTION: return ListSelectionModel.SINGLE_SELECTION; } return ListSelectionModel.MULTIPLE_INTERVAL_SELECTION; }
@Nullable private String selectionMode(JTree tree) { TreeSelectionModel model = tree.getSelectionModel(); return SELECTION_MODES.get(model.getSelectionMode()); }
return selectionModel.getSelectionMode();