if (lsm.isSelectionEmpty()) {
@Override public void valueChanged(ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (!lsm.isSelectionEmpty()) { Object o = xpathResults.get(lsm.getMinSelectionIndex()); if (o instanceof Node) { codeEditorPane.select((Node) o); } } } }
/** @see ListSelectionListener **/ public void valueChanged(ListSelectionEvent aEvent) { //Ignore extra messages. if (aEvent.getValueIsAdjusting()) { return; } final ListSelectionModel lsm = (ListSelectionModel) aEvent.getSource(); if (lsm.isSelectionEmpty()) { mDetails.setText("Nothing selected"); } else { final int selectedRow = lsm.getMinSelectionIndex(); final EventDetails e = mModel.getEventDetails(selectedRow); final Object[] args = { new Date(e.getTimeStamp()), e.getPriority(), escape(e.getThreadName()), escape(e.getNDC()), escape(e.getCategoryName()), escape(e.getLocationDetails()), escape(e.getMessage()), escape(getThrowableStrRep(e)) }; mDetails.setText(FORMATTER.format(args)); mDetails.setCaretPosition(0); } }
if (lsm.isSelectionEmpty()) {
/** @see ListSelectionListener **/ public void valueChanged(ListSelectionEvent aEvent) { //Ignore extra messages. if (aEvent.getValueIsAdjusting()) { return; } final ListSelectionModel lsm = (ListSelectionModel) aEvent.getSource(); if (lsm.isSelectionEmpty()) { mDetails.setText("Nothing selected"); } else { final int selectedRow = lsm.getMinSelectionIndex(); final EventDetails e = mModel.getEventDetails(selectedRow); final Object[] args = { new Date(e.getTimeStamp()), e.getPriority(), escape(e.getThreadName()), escape(e.getNDC()), escape(e.getCategoryName()), escape(e.getLocationDetails()), escape(e.getMessage()), escape(getThrowableStrRep(e)) }; mDetails.setText(FORMATTER.format(args)); mDetails.setCaretPosition(0); } }
public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { if (selModelRecent.isSelectionEmpty()) { firePropertyChange(KenaiDialogDescriptor.PROP_SELECTION_VALID, null, Boolean.FALSE); } else { firePropertyChange(KenaiDialogDescriptor.PROP_SELECTION_VALID, null, Boolean.TRUE); } } } });
public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { if (selModelRecent.isSelectionEmpty()) { firePropertyChange(KenaiDialogDescriptor.PROP_SELECTION_VALID, null, Boolean.FALSE); } else { firePropertyChange(KenaiDialogDescriptor.PROP_SELECTION_VALID, null, Boolean.TRUE); } } } });
public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (!lsm.isSelectionEmpty()) { // If user clicks a payment request enable the the delete button, otherwise disable it updateDeleteRequestButton(); } } } }
@Override public void tableChanged(TableModelEvent arg0) { // select first movie if nothing is selected ListSelectionModel selectionModel = tableMovies.getSelectionModel(); if (selectionModel.isSelectionEmpty() && movieTableModel.getRowCount() > 0) { selectionModel.setSelectionInterval(0, 0); } if (selectionModel.isSelectionEmpty() && movieTableModel.getRowCount() == 0) { resultSelectionModel.setSelectedResult(null); } } });
/** * Delete selection in tree, if a table row has been selected. * * @param event */ public void valueChanged(ListSelectionEvent event) { if (! ((ListSelectionModel)event.getSource()).isSelectionEmpty()) m_tree.clearSelection(); }
@Override public void valueChanged(ListSelectionEvent e) { ListSelectionModel source = (ListSelectionModel) e.getSource(); uiModel.setAddEnabled(!source.isSelectionEmpty()); } });
private void updateAllActions() { if (allList.isEnabled()) { boolean nonVide = allListModel.getList() != null && allListModel.getList().length > 0; addAllAction.setEnabled(nonVide); addAction.setEnabled(nonVide && !allList.getSelectionModel().isSelectionEmpty()); } if (selectedList.isEnabled()) { boolean nonVide = selectedListModel.getList() != null && selectedListModel.getList().length > 0; removeAllAction.setEnabled(nonVide); removeAction.setEnabled(nonVide && !selectedList.getSelectionModel().isSelectionEmpty()); } }
public void updateCst() { Variable v = null; if (!cstSelected_.isSelectionEmpty()) { v = (Variable) cstModel_.getElementAt(cstSelected_.getMaxSelectionIndex()); } updateTxt(v); }
public void valueChanged(final ListSelectionEvent _e) { final ListSelectionModel rowModel = table_.getSelectionModel(); if (rowModel.isSelectionEmpty()) { ch_.setColor(null); } final int row = rowModel.getLeadSelectionIndex(); final int col = table_.getColumnModel().getSelectionModel().getLeadSelectionIndex(); final Color c = model_.getColor(row, col); ch_.setColor(c); }
private void setEventMsg() { ListSelectionModel l = tNotif.getSelectionModel(); if (!l.isSelectionEmpty()) { int index = l.getMinSelectionIndex(); String s1 = (String) model.getValueAt(index, 0); String s2 = (String) model.getValueAt(index, 1); String s3 = (String) model.getValueAt(index, 2); eventForm.setData(s1, s2, s3); } }
@Override public void valueChanged(ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (!lsm.isSelectionEmpty()) { Object o = xpathResults.get(lsm.getMinSelectionIndex()); if (o instanceof Node) { codeEditorPane.select((Node) o); } } } }
private void setEventMsg() { ListSelectionModel l = tNotif.getSelectionModel(); if (!l.isSelectionEmpty()) { int index = l.getMinSelectionIndex(); String s1 = (String) model.getValueAt(index, 0); String s2 = (String) model.getValueAt(index, 1); String s3 = (String) model.getValueAt(index, 2); String s4 = (String) model.getValueAt(index, 3); eventForm.setData(s1, s2, s3, s4); } }
public void valueChanged(final ListSelectionEvent _e) { final boolean empty = common_.isSelectionEmpty(); final int idx = empty ? -1 : common_.getLeadSelectionIndex(); for (int i = targets_.length - 1; i >= 0; i--) { if (empty) { targets_[i].getTimeListSelectionModel().clearSelection(); } else { targets_[i].getTimeListSelectionModel().setSelectionInterval(idx, idx); } } }
private void updateEnabled() { if ( listSelectionModel.isSelectionEmpty() ) { setEnabled( false ); } else if ( listSelectionModel.getMaxSelectionIndex() == ( tableModel.getBulkDataSize() - 1 ) ) { // already the last entry ... setEnabled( false ); } else { setEnabled( true ); } }
/** * Defines an <code>Action</code> object with a default description string and default icon. */ private AddSelectionAction( final ListSelectionModel selectionModel ) { this.selectionModel = selectionModel; putValue( Action.SMALL_ICON, Messages.getInstance().getIcon( "Icons.ForwardArrow" ) ); putValue( Action.SHORT_DESCRIPTION, Messages.getInstance().getString( "ArrayCellEditorDialog.AddRow" ) ); selectionModel.addListSelectionListener( this ); setEnabled( selectionModel.isSelectionEmpty() == false ); }