public int getSelectionMode() { return mListSelectionModel.getSelectionMode(); }
@Override public int getSelectionMode() { return delegate.getSelectionMode(); }
public int getSelectionMode() { return mListSelectionModel.getSelectionMode(); }
public int getSelectionMode() { return mListSelectionModel.getSelectionMode(); }
@Override public int getSelectionMode() { return delegate.getSelectionMode(); }
@Override public int getSelectionMode() { return delegate.getSelectionMode(); }
public int getSelectionMode() { return delegate.getSelectionMode(); }
/** * Returns the selection mode used by this table's selection model. * <p> * PENDING JW - setter? * * @return the selection mode used by this table's selection model * @see ListSelectionModel#getSelectionMode() */ public int getSelectionMode() { return getSelectionModel().getSelectionMode(); }
/** * Returns the selection mode used by this table's selection model. * <p> * PENDING JW - setter? * * @return the selection mode used by this table's selection model * @see ListSelectionModel#getSelectionMode() */ public int getSelectionMode() { return getSelectionModel().getSelectionMode(); }
/** * Returns the selection mode used by this table's selection model. * <p> * PENDING JW - setter? * * @return the selection mode used by this table's selection model * @see ListSelectionModel#getSelectionMode() */ public int getSelectionMode() { return getSelectionModel().getSelectionMode(); }
/** * Returns the selection mode used by this table's selection model. * <p> * PENDING JW - setter? * * @return the selection mode used by this table's selection model * @see ListSelectionModel#getSelectionMode() */ public int getSelectionMode() { return getSelectionModel().getSelectionMode(); }
/** * Returns the selection mode used by this table's selection model. * <p> * PENDING JW - setter? * * @return the selection mode used by this table's selection model * @see ListSelectionModel#getSelectionMode() */ public int getSelectionMode() { return getSelectionModel().getSelectionMode(); }
public int getSelectionMode() { return table.getSelectionModel().getSelectionMode(); }
public InsettedListSelectionModel(ListSelectionModel aDelegate, LinearInset aInset, InsetContent aInformer) { super(); delegate = aDelegate; inset = aInset; informer = aInformer; delegate.addListSelectionListener(new DelegateListSelectionListener()); inset.addInsetChangeListener(new InsetListener()); setSelectionMode(delegate.getSelectionMode()); }
public ConstrainedListSelectionModel(ListSelectionModel aDelegate, LinearConstraint aConstraint) { super(); constraint = aConstraint; delegate = aDelegate; delegate.addListSelectionListener(new DelegateListSelectionListener()); constraint.addConstraintChangeListener(new ConstraintListener()); setSelectionMode(delegate.getSelectionMode()); }
@Override public void mousePressed(MouseEvent e) { JScrollPane jsp = ((JScrollPane) e.getComponent()); JTable table = (JTable) jsp.getViewport().getView(); if (!e.isShiftDown() || (table.getSelectionModel().getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) { clearSelection(); TableCellEditor tce = table.getCellEditor(); if (tce != null) { tce.stopCellEditing(); } } } });
public Selection(ListSelectionModel sm) { selectionMode = sm.getSelectionMode(); anchor = sm.getAnchorSelectionIndex(); lead = sm.getLeadSelectionIndex(); int min = sm.getMinSelectionIndex(); int max = sm.getMaxSelectionIndex(); int i1 = -1; for (int i = min; i <= max; i++) { if (sm.isSelectedIndex(i)) { if (i1 == -1) { i1 = i; } } else { if (i1 != -1) { intervals.add(new int[] { i1, i}); i1 = -1; } } } if (i1 != -1) { intervals.add(new int[] { i1, max}); } }
private static JTable createRowHeadersTable(final JTable userTable, int startingNumber) { final JTable rowHeadersTable = new JBTable(new RowHeadersTableModel(userTable.getModel().getRowCount(), startingNumber)); // this is where you set the width of the row headers rowHeadersTable.createDefaultColumnsFromModel(); // make the rows look and behave like headers rowHeadersTable.setBackground(rowHeadersTable.getTableHeader().getBackground()); rowHeadersTable.setForeground(rowHeadersTable.getTableHeader().getForeground()); rowHeadersTable.setFont(rowHeadersTable.getTableHeader().getFont()); rowHeadersTable.setRowHeight(userTable.getRowHeight()); rowHeadersTable.getTableHeader().setReorderingAllowed(false); rowHeadersTable.setRowSelectionAllowed(true); rowHeadersTable.setCellSelectionEnabled(true); rowHeadersTable.setFocusable(true); rowHeadersTable.setDragEnabled(true); rowHeadersTable.setSelectionMode(userTable.getSelectionModel().getSelectionMode()); return rowHeadersTable; }
private void selectAll(JList list) { int size = getElementCount(list); if (size > 0) { ListSelectionModel lsm = list.getSelectionModel(); int lead = adjustIndex(lsm.getLeadSelectionIndex(), list); if (lsm.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) { if (lead == -1) { int min = adjustIndex(list.getMinSelectionIndex(), list); lead = (min == -1 ? 0 : min); } list.setSelectionInterval(lead, lead); list.ensureIndexIsVisible(lead); } else { list.setValueIsAdjusting(true); int anchor = adjustIndex(lsm.getAnchorSelectionIndex(), list); list.setSelectionInterval(0, size - 1); // this is done to restore the anchor and lead SwingXUtilities.setLeadAnchorWithoutSelection(lsm, anchor, lead); list.setValueIsAdjusting(false); } } }
private void selectAll(JList list) { int size = getElementCount(list); if (size > 0) { ListSelectionModel lsm = list.getSelectionModel(); int lead = adjustIndex(lsm.getLeadSelectionIndex(), list); if (lsm.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) { if (lead == -1) { int min = adjustIndex(list.getMinSelectionIndex(), list); lead = (min == -1 ? 0 : min); } list.setSelectionInterval(lead, lead); list.ensureIndexIsVisible(lead); } else { list.setValueIsAdjusting(true); int anchor = adjustIndex(lsm.getAnchorSelectionIndex(), list); list.setSelectionInterval(0, size - 1); // this is done to restore the anchor and lead SwingXUtilities.setLeadAnchorWithoutSelection(lsm, anchor, lead); list.setValueIsAdjusting(false); } } }