/** * Creates a new table model that renders the specified list with an automatically * generated {@link TableFormat}. It uses JavaBeans and reflection to create * a {@link TableFormat} as specified. This method wraps the source list using * GlazedListsSwing#swingThreadProxyList(EventList). * * <p>Note that classes that will be obfuscated may not work with * reflection. In this case, implement a {@link TableFormat} manually.</p> * * <p>The returned table model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the event dispatch thread.<p> * * @param source the EventList that provides the row objects * @param propertyNames an array of property names in the JavaBeans format. * For example, if your list contains Objects with the methods getFirstName(), * setFirstName(String), getAge(), setAge(Integer), then this array should * contain the two strings "firstName" and "age". This format is specified * by the JavaBeans {@link java.beans.PropertyDescriptor}. * @param columnLabels the corresponding column names for the listed property * names. For example, if your columns are "firstName" and "age", then * your labels might be "First Name" and "Age". * @param writable an array of booleans specifying which of the columns in * your table are writable. * */ public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable) { return eventTableModelWithThreadProxyList(source, GlazedLists.tableFormat(propertyNames, columnLabels, writable)); }
/** * Creates a new table model that renders the specified list with an automatically * generated {@link TableFormat}. It uses JavaBeans and reflection to create * a {@link TableFormat} as specified. While holding a read lock, * this method wraps the source list using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}. * * <p>Note that classes that will be obfuscated may not work with * reflection. In this case, implement a {@link TableFormat} manually.</p> * * <p>The returned table model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the event dispatch thread.<p> * * @param source the EventList that provides the row objects * @param propertyNames an array of property names in the JavaBeans format. * For example, if your list contains Objects with the methods getFirstName(), * setFirstName(String), getAge(), setAge(Integer), then this array should * contain the two strings "firstName" and "age". This format is specified * by the JavaBeans {@link java.beans.PropertyDescriptor}. * @param columnLabels the corresponding column names for the listed property * names. For example, if your columns are "firstName" and "age", then * your labels might be "First Name" and "Age". * @param writable an array of booleans specifying which of the columns in * your table are writable. * */ public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable) { return eventTableModelWithThreadProxyList(source, GlazedLists.tableFormat(propertyNames, columnLabels, writable)); }
/** * Creates a new table model that renders the specified list with an automatically * generated {@link TableFormat}. It uses JavaBeans and reflection to create * a {@link TableFormat} as specified. While holding a read lock, * this method wraps the source list using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}. * * <p>Note that classes that will be obfuscated may not work with * reflection. In this case, implement a {@link TableFormat} manually.</p> * * <p>The returned table model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the event dispatch thread.<p> * * @param source the EventList that provides the row objects * @param propertyNames an array of property names in the JavaBeans format. * For example, if your list contains Objects with the methods getFirstName(), * setFirstName(String), getAge(), setAge(Integer), then this array should * contain the two strings "firstName" and "age". This format is specified * by the JavaBeans {@link java.beans.PropertyDescriptor}. * @param columnLabels the corresponding column names for the listed property * names. For example, if your columns are "firstName" and "age", then * your labels might be "First Name" and "Age". * @param writable an array of booleans specifying which of the columns in * your table are writable. * */ public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable) { return eventTableModelWithThreadProxyList(source, GlazedLists.tableFormat(propertyNames, columnLabels, writable)); }
this.eventTableModel = GlazedListsSwing.eventTableModelWithThreadProxyList(eventList, new NativeLogTableFormat());
this.eventTableModel = GlazedListsSwing.eventTableModelWithThreadProxyList(eventList, new DebugMessageTableFormat());
new TvShowEpisodeChooserModelFilterator()); FilterList<TvShowEpisodeChooserModel> textFilteredEpisodes = new FilterList<>(sortedEpisodes, textMatcherEditor); AdvancedTableModel<TvShowEpisodeChooserModel> episodeTableModel = GlazedListsSwing.eventTableModelWithThreadProxyList(textFilteredEpisodes, new EpisodeTableFormat()); DefaultEventSelectionModel<TvShowEpisodeChooserModel> selectionModel = new DefaultEventSelectionModel<>(textFilteredEpisodes);
/** Installs the GlazedLists integration on the given JXTable. */ private JXTableSupport(JXTable table, EventList<E> eventList, TableFormat<? super E> tableFormat, SortedList<E> sortedList, Object sortingStrategy) { this.table = table; this.tableFormat = tableFormat; // remember table state for restore on uninstall tableMemento = JXTableMemento.create(table); tableMemento.storeStateFrom(table); // set state needed to integrate with Glazed Lists tableMemento.configureStateForGlazedLists(table); // prepare and set TableModel und SelectionModel if (table.getFillsViewportHeight()) { // workaround the problem of repainting issues when this property is // set, because of the known mismatch between ListEvents and TableModelEvents // use another event conversion strategy in this case final Factory<E> eventAdapterFactory = GlazedListsSwing.manyToOneEventAdapterFactory(); tableModel = GlazedListsSwing.eventTableModelWithThreadProxyList(eventList, tableFormat, eventAdapterFactory); } else { // use default event conversion strategy tableModel = GlazedListsSwing.eventTableModelWithThreadProxyList(eventList, tableFormat); } table.setModel(tableModel); selectionModel = GlazedListsSwing.eventSelectionModelWithThreadProxyList(eventList); table.setSelectionModel(selectionModel); // finally install TableComparatorChooser tableComparatorChooser = TableComparatorChooser.<E>install(table, sortedList, sortingStrategy, tableFormat); }
/** Installs the GlazedLists integration on the given JXTable. */ private JXTableSupport(JXTable table, EventList<E> eventList, TableFormat<? super E> tableFormat, SortedList<E> sortedList, Object sortingStrategy) { this.table = table; this.tableFormat = tableFormat; // remember table state for restore on uninstall tableMemento = JXTableMemento.create(table); tableMemento.storeStateFrom(table); // set state needed to integrate with Glazed Lists tableMemento.configureStateForGlazedLists(table); // prepare and set TableModel und SelectionModel tableModel = GlazedListsSwing.eventTableModelWithThreadProxyList(eventList, tableFormat); table.setModel(tableModel); selectionModel = GlazedListsSwing.eventSelectionModelWithThreadProxyList(eventList); table.setSelectionModel(selectionModel); // finally install TableComparatorChooser tableComparatorChooser = TableComparatorChooser.<E>install(table, sortedList, sortingStrategy, tableFormat); }
/** Installs the GlazedLists integration on the given JXTable. */ private JXTableSupport(JXTable table, EventList<E> eventList, TableFormat<? super E> tableFormat, SortedList<E> sortedList, Object sortingStrategy) { this.table = table; this.tableFormat = tableFormat; // remember table state for restore on uninstall tableMemento = JXTableMemento.create(table); tableMemento.storeStateFrom(table); // set state needed to integrate with Glazed Lists tableMemento.configureStateForGlazedLists(table); // prepare and set TableModel und SelectionModel tableModel = GlazedListsSwing.eventTableModelWithThreadProxyList(eventList, tableFormat); table.setModel(tableModel); selectionModel = GlazedListsSwing.eventSelectionModelWithThreadProxyList(eventList); table.setSelectionModel(selectionModel); // finally install TableComparatorChooser tableComparatorChooser = TableComparatorChooser.<E>install(table, sortedList, sortingStrategy, tableFormat); }