public void valueChanged(ListSelectionEvent e) { @SuppressWarnings("unchecked") JList<Edge> edgeList = (JList<Edge>) e.getSource(); Edge selected = (Edge) edgeList.getSelectedValue(); boolean outgoing = (edgeList==outgoingEdges); reactToEdgeSelection( selected, outgoing ); }
public void valueChanged(ListSelectionEvent e) { @SuppressWarnings("unchecked") JList<GraphBuilderAnnotation> theList = (JList<GraphBuilderAnnotation>) e.getSource(); GraphBuilderAnnotation anno = theList.getSelectedValue(); if (anno == null) return; showGraph.drawAnotation(anno); } });
ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (lsm.isSelectionEmpty()) {
public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting() == false) { JList<?> list = (JList<?>) e.getSource(); String selectedValue = (String) list.getSelectedValue(); String oldValue = textComponent.getText(); textComponent.setText(selectedValue); if (!oldValue.equalsIgnoreCase(selectedValue)) { textComponent.selectAll(); textComponent.requestFocus(); } updateSampleFont(); } } }
public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; if (e.getSource() == stateVariablesTable.getSelectionModel()) { int[] rows = stateVariablesTable.getSelectedRows(); if (rows == null || rows.length == 0) { copyButton.setEnabled(false); } else if (rows.length == 1) { copyButton.setEnabled(true); } else { copyButton.setEnabled(true); } } } }
public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; if (e.getSource() == logTable.getSelectionModel()) { int[] rows = logTable.getSelectedRows(); if (rows == null || rows.length == 0) { copyButton.setEnabled(false); expandButton.setEnabled(false); } else if (rows.length == 1) { copyButton.setEnabled(true); LogMessage msg = (LogMessage) logTableModel.getValueAt(rows[0], 0); // TODO: This setting should be injected if (msg.getMessage().length() > getExpandMessageCharacterLimit()) { expandButton.setEnabled(true); } else { expandButton.setEnabled(false); } } else { copyButton.setEnabled(true); expandButton.setEnabled(false); } } } }
@Override public void valueChanged(ListSelectionEvent e) { outgoingEdges.clearSelection(); incomingEdges.clearSelection(); @SuppressWarnings("unchecked") JList<State> theList = (JList<State>)e.getSource(); State st = (State)theList.getSelectedValue(); Edge edge = st.getBackEdge(); reactToEdgeSelection( edge, false ); } });
public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; int index = ((ListSelectionModel) e.getSource()).getMinSelectionIndex(); if (index > -1) { presenter.onPortMappingSelected( table.getPortMapping(index) ); } } }
@Override public void valueChanged(ListSelectionEvent e) { @SuppressWarnings("unchecked") JList<State> theList = (JList<State>)e.getSource(); State st = (State)theList.getSelectedValue(); if(st==null){ return; } DefaultListModel<String> stateListModel = new DefaultListModel<String>(); stateListModel.addElement( "weight:"+st.getWeight() ); stateListModel.addElement( "weightdelta:"+st.getWeightDelta() ); stateListModel.addElement( "bikeRenting:"+st.isBikeRenting() ); stateListModel.addElement( "carParked:"+st.isCarParked() ); stateListModel.addElement( "walkDistance:"+st.getWalkDistance() ); stateListModel.addElement( "elapsedTime:"+st.getElapsedTimeSeconds() ); stateListModel.addElement( "numBoardings:"+st.getNumBoardings() ); outputList.setModel( stateListModel ); lastStateClicked = st; } }
@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); } }
public void valueChanged(ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); int visibleRowIndex = ... // Get the index of the selected row // Convert from the selection index based on the visible items to the // internal index for all elements. int internalRowIndex = tableTexts .convertRowIndexToModel(visibleRowIndex); ... }
jlist.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent event) { if (!event.getValueIsAdjusting()){ JList source = (JList)event.getSource(); String selected = source.getSelectedValue().toString(); } } });
public void valueChanged(ListSelectionEvent e) { if(e.getValueIsAdjusting()) return; final JList list = (JList) e.getSource(); final TestCase value = (TestCase) list.getSelectedValue(); if(value != null) OnTestCaseSelected(value); }
public void valueChanged(ListSelectionEvent event) { if(event.getValueIsAdjusting()) return; final JList list = (JList) event.getSource(); final Rule rule = (Rule) list.getSelectedValue(); if(rule != null) OnSelectRule(rule); } }
ListSelectionListener l = new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { ((JXList) e.getSource()).invalidateCellSizeCache(); } }; list.addListSelectionListener(l);
ListSelectionListener sl = new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { JList candyList = (JList)e.getSource(); if (e.getValueIsAdjusting() == false) { CardLayout.show(infoPanel, (String)candyList.getSelectedValue()); } } };
@Override public void valueChanged(ListSelectionEvent ev) { if (!ev.getValueIsAdjusting() && !updating) { // we don't want the event until its finished if (ev.getSource() == lstDirlist) { onCompilerSetChanged(); } } }
public void valueChanged(ListSelectionEvent e) { JList list = (JList)e.getSource(); int selected = list.getSelectedIndex(); int previous = selected == e.getFirstIndex() ? e.getLastIndex() : e.getFirstIndex(); System.out.println(); System.out.println("Selected:" + selected); System.out.println("Previous:" + previous); }
@Override public void valueChanged(ListSelectionEvent e) { final StackGraphPanel graph = (StackGraphPanel) e.getSource(); final StackFrameNode boxNode = graph.getSelection(); final StackFrameNode parentNode = graph.getSelectionParent(); final String statInfo = boxNode.getStats(parentNode); setModel(boxNode, parentNode, statInfo); }