private ListSelectionModel getViewSelectionModel() { return list.getSelectionModel(); } /**
private ListSelectionModel getViewSelectionModel() { return list.getSelectionModel(); } /**
private ListSelectionModel getViewSelectionModel() { return list.getSelectionModel(); } /**
private ListSelectionModel getViewSelectionModel() { return list.getSelectionModel(); } /**
public void addListSelectionListener(ListSelectionListener lst){ liste.getSelectionModel().addListSelectionListener(lst); }
/** * widened access for testing... * @return the selection mapper */ protected SelectionMapper getSelectionMapper() { if (selectionMapper == null) { selectionMapper = new DefaultSelectionMapper(filters, getSelectionModel()); } return selectionMapper; }
public void removeListSelectionListener(ListSelectionListener lst){ liste.getSelectionModel().removeListSelectionListener(lst); }
public void clearSelection() { list.getSelectionModel().clearSelection(); }
final JXList list = new JXList(AncientSwingTeam.createNamedColorListModel()); JXTable table = new JXTable(new AncientSwingTeam()); final ColorHighlighter highlighter = new ColorHighlighter( HighlightPredicate.NEVER, Color.YELLOW, null); list.addHighlighter(highlighter); table.addHighlighter(highlighter); ListSelectionListener l = new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; highlighter.setHighlightPredicate( createPredicate(list.getSelectedValue())); } private HighlightPredicate createPredicate(Object selectedValue) { if (selectedValue == null) return HighlightPredicate.NEVER; return new HighlightPredicate.EqualsHighlightPredicate(selectedValue); } }; list.getSelectionModel().addListSelectionListener(l);
/** * {@inheritDoc} <p> * * Overridden to update selectionMapper */ @Override public void setSelectionModel(ListSelectionModel newModel) { super.setSelectionModel(newModel); getSelectionMapper().setViewSelectionModel(getSelectionModel()); }
public void setSelectedIndex(int selectedIndex) { list.getSelectionModel().setSelectionInterval(selectedIndex, selectedIndex); list.scrollRectToVisible(list.getCellBounds(selectedIndex, selectedIndex)); }
public void intervalRemoved(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.removeIndexInterval(e.getIndex0(), e.getIndex1()); } /* Repaint the entire list, from the origin of * the first removed cell, to the bottom of the * component. */ redrawList(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }
public void intervalRemoved(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.removeIndexInterval(e.getIndex0(), e.getIndex1()); } /* Repaint the entire list, from the origin of * the first removed cell, to the bottom of the * component. */ redrawList(); }
public void intervalRemoved(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.removeIndexInterval(e.getIndex0(), e.getIndex1()); } /* Repaint the entire list, from the origin of * the first removed cell, to the bottom of the * component. */ redrawList(); }
liste.getSelectionModel().setSelectionMode(liste.getSelectionModel().SINGLE_SELECTION); liste.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void intervalRemoved(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.removeIndexInterval(e.getIndex0(), e.getIndex1()); } /* Repaint the entire list, from the origin of * the first removed cell, to the bottom of the * component. */ redrawList(); }
public void intervalAdded(ListDataEvent e) { updateLayoutStateNeeded = modelChanged; int minIndex = Math.min(e.getIndex0(), e.getIndex1()); int maxIndex = Math.max(e.getIndex0(), e.getIndex1()); /* Sync the SelectionModel with the DataModel. */ ListSelectionModel sm = list.getSelectionModel(); if (sm != null) { sm.insertIndexInterval(minIndex, maxIndex - minIndex+1, true); } /* Repaint the entire list, from the origin of * the first added cell, to the bottom of the * component. */ redrawList(); }