ca.odell.glazedlists.swing.GlazedListsSwing Java Examples

The following examples show how to use ca.odell.glazedlists.swing.GlazedListsSwing. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FlatGlazedListsTest.java    From FlatLaf with Apache License 2.0 5 votes vote down vote up
FlatGlazedListsTest() {
	initComponents();

	EventList<Item> itemEventList = new BasicEventList<>();
	itemEventList.add( new Item( "item 1", "item 1b", "January", 123, null ) );
	itemEventList.add( new Item( "item 2", "item 2b", "February", 456, true ) );
	itemEventList.add( new Item( "item 3", null, "March", null, false ) );
	itemEventList.add( new Item( "item 4", null, "April", 234, true ) );
	itemEventList.add( new Item( "item 5", null, "May", null, false ) );
	itemEventList.add( new Item( "item 6", null, "June", null, null ) );
	itemEventList.add( new Item( "item 7", null, "July", null, null ) );
	itemEventList.add( new Item( "item 8", null, "August", null, null ) );
	itemEventList.add( new Item( "item 9", null, "September", null, null ) );
	itemEventList.add( new Item( "item 10", null, "October", null, null ) );
	itemEventList.add( new Item( "item 11", null, "November", null, null ) );
	itemEventList.add( new Item( "item 12", null, "December", null, null ) );

	Comparator<Item> itemComparator = Comparator.comparing( Item::getName );
	SortedList<Item> sortedItems = new SortedList<>( itemEventList, itemComparator );
	AdvancedTableModel<Item> tableModel = GlazedListsSwing.eventTableModelWithThreadProxyList( sortedItems, new ItemTableFormat() );
	itemsTable.setModel( tableModel );
	TableComparatorChooser<Item> tableComparatorChooser = TableComparatorChooser.install(
		itemsTable, sortedItems, TableComparatorChooser.MULTIPLE_COLUMN_MOUSE );
	tableComparatorChooser.appendComparator( 0, 0, false );

	TableComparatorChooser.setIconPath( "resources/windowsxp" );
}
 
Example #2
Source File: EventModels.java    From jeveassets with GNU General Public License v2.0 5 votes vote down vote up
public static <E> EventList<E> createSwingThreadProxyList(EventList<E> source) {
	final EventList<E> result;
	source.getReadWriteLock().readLock().lock();
	try {
		result = GlazedListsSwing.swingThreadProxyList(source);
	} finally {
		source.getReadWriteLock().readLock().unlock();
	}
	return result;
}