/** * 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. * * <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. * To do this programmatically, use {@link SwingUtilities#invokeAndWait(Runnable)} and * wrap the source list (or some part of the source list's pipeline) using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}.</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> eventTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable) { return eventTableModel(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. * * <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. * To do this programmatically, use {@link SwingUtilities#invokeAndWait(Runnable)} and * wrap the source list (or some part of the source list's pipeline) using * GlazedListsSwing#swingThreadProxyList(EventList).</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> eventTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable) { return eventTableModel(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. * * <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. * To do this programmatically, use {@link SwingUtilities#invokeAndWait(Runnable)} and * wrap the source list (or some part of the source list's pipeline) using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}.</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> eventTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable) { return eventTableModel(source, GlazedLists.tableFormat(propertyNames, columnLabels, writable)); }
SortedList<Issue> sortedIssues = new SortedList<Issue>(textFilteredIssues, null); EventList<Issue> issueProxyList = GlazedListsSwing.swingThreadProxyList(sortedIssues); TableModel tableModel = GlazedListsSwing.eventTableModel(issueProxyList, new IssueTableFormat()); ListSelectionModel selectionModel = GlazedListsSwing.eventSelectionModel(issueProxyList);
SortedList<Issue> sortedIssues = new SortedList<Issue>(textFilteredIssues, null); EventList<Issue> issueProxyList = GlazedListsSwing.swingThreadProxyList(sortedIssues); TableModel tableModel = GlazedListsSwing.eventTableModel(issueProxyList, new IssueTableFormat()); ListSelectionModel selectionModel = GlazedListsSwing.eventSelectionModel(issueProxyList);
SortedList<Issue> sortedIssues = new SortedList<Issue>(textFilteredIssues, null); EventList<Issue> issueProxyList = GlazedListsSwing.swingThreadProxyList(sortedIssues); TableModel tableModel = GlazedListsSwing.eventTableModel(issueProxyList, new IssueTableFormat()); ListSelectionModel selectionModel = GlazedListsSwing.eventSelectionModel(issueProxyList);
SortedList<Issue> sortedIssues = new SortedList<Issue>(textFilteredIssues, null); EventList<Issue> issueProxyList = GlazedListsSwing.swingThreadProxyList(sortedIssues); TableModel tableModel = GlazedListsSwing.eventTableModel(issueProxyList, new IssueTableFormat()); ListSelectionModel selectionModel = GlazedListsSwing.eventSelectionModel(issueProxyList);