JXList extends JList { public void setRolloverEnabled(boolean rolloverEnabled) { boolean old = isRolloverEnabled(); if (rolloverEnabled == old) return; if (rolloverEnabled) { rolloverProducer = createRolloverProducer(); rolloverProducer.install(this); getLinkController().install(this); } else { rolloverProducer.release(this); rolloverProducer = null; getLinkController().release(); } firePropertyChange("rolloverEnabled", old, isRolloverEnabled()); } JXList();  JXList(ListModel dataModel);  JXList(Object[] listData);  JXList(Vector<?> listData);  JXList(boolean autoCreateRowSorter);  JXList(ListModel dataModel, boolean autoCreateRowSorter);  JXList(Object[] listData, boolean autoCreateRowSorter);  JXList(Vector<?> listData, boolean autoCreateRowSorter); Searchable getSearchable(); void setSearchable(Searchable searchable); @Override int getNextMatch(String prefix, int startIndex, Bias bias); void setRolloverEnabled(boolean rolloverEnabled); boolean isRolloverEnabled(); @Override Point getPopupLocation(MouseEvent event); Point getPopupTriggerLocation(); boolean getAutoCreateRowSorter(); void setAutoCreateRowSorter(boolean autoCreateRowSorter); RowSorter<? extends ListModel> getRowSorter(); void setRowSorter(RowSorter<? extends ListModel> sorter); void setSortable(boolean sortable); boolean isSortable(); void setSortsOnUpdates(boolean sortsOnUpdates); boolean getSortsOnUpdates(); void setSortOrderCycle(SortOrder... cycle); SortOrder[] getSortOrderCycle(); Comparator<?> getComparator(); void setComparator(Comparator<?> comparator); @SuppressWarnings("unchecked") void setRowFilter(RowFilter<? super R, ? super Integer> filter); @SuppressWarnings("unchecked") RowFilter<?, ?> getRowFilter(); void resetSortOrder(); void toggleSortOrder(); void setSortOrder(SortOrder sortOrder); SortOrder getSortOrder(); Object getElementAt(int viewIndex); @Override Object getSelectedValue(); @Override void setSelectedValue(Object anObject,boolean shouldScroll); @Override Object[] getSelectedValues(); int getElementCount(); int convertIndexToModel(int viewIndex); int convertIndexToView(int modelIndex); @Override void setModel(ListModel model); void setHighlighters(Highlighter... highlighters); Highlighter[] getHighlighters(); void addHighlighter(Highlighter highlighter); void removeHighlighter(Highlighter highlighter); String getStringAt(int row); @Override ListCellRenderer getCellRenderer(); ListCellRenderer getWrappedCellRenderer(); @Override void setCellRenderer(ListCellRenderer renderer); void invalidateCellSizeCache(); @Override void updateUI(); @Override String getUIClassID(); final static String uiClassID; static final String EXECUTE_BUTTON_ACTIONCOMMAND; }
@Test public void testLinkControllerListening() { JXList table = new JXList(); table.setRolloverEnabled(true); assertNotNull("LinkController must be listening", getLinkControllerAsPropertyChangeListener(table, RolloverProducer.CLICKED_KEY)); assertNotNull("LinkController must be listening", getLinkControllerAsPropertyChangeListener(table, RolloverProducer.ROLLOVER_KEY)); assertNotNull("execute button action must be registered", table.getActionMap().get(JXList.EXECUTE_BUTTON_ACTIONCOMMAND)); table.setRolloverEnabled(false); assertNull("LinkController must not be listening", getLinkControllerAsPropertyChangeListener(table, RolloverProducer.CLICKED_KEY )); assertNull("LinkController must be listening", getLinkControllerAsPropertyChangeListener(table, RolloverProducer.ROLLOVER_KEY)); assertNull("execute button action must be de-registered", table.getActionMap().get(JXList.EXECUTE_BUTTON_ACTIONCOMMAND)); }