/** * Create a new {@link EventKTableModel} that uses elements from the * specified {@link EventList} as rows, and the specified {@link TableFormat} * to divide row objects across columns. * * @param table the KTable the model is created for * @param source the {@link EventList} * @param tableFormat provides logic to divide row objects across columns. * If the value implements the {@link KTableFormat} interface, those * methods will be used to provide further details such as cell renderers, * cell editors and row heights. */ public EventKTableModel(KTable table, EventList source, TableFormat tableFormat) { super(table, createProxyList(source, table.getDisplay()), tableFormat); disposeSource = (this.source != source); }
/** * Create a new {@link EventKTableModel} that uses elements from the * specified {@link EventList} as rows, and the specified {@link TableFormat} * to divide row objects across columns. * * @param table the KTable the model is created for * @param source the {@link EventList} * @param tableFormat provides logic to divide row objects across columns. * If the value implements the {@link KTableFormat} interface, those * methods will be used to provide further details such as cell renderers, * cell editors and row heights. */ public EventKTableModel(KTable table, EventList source, TableFormat tableFormat) { super(table, createProxyList(source, table.getDisplay()), tableFormat); disposeSource = (this.source != source); }
/** * Create a new {@link DefaultEventKTableModel} that uses elements from the * specified {@link EventList} as rows, and the specified {@link TableFormat} * to divide row objects across columns. * * <p>The returned model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the SWT event handler thread. * </p> * * @param table the KTable the model is created for * @param source the {@link EventList} * @param tableFormat provides logic to divide row objects across columns. * If the value implements the {@link KTableFormat} interface, those * methods will be used to provide further details such as cell renderers, * cell editors and row heights. */ public static DefaultEventKTableModel eventKTableModelWithThreadProxyList(KTable table, EventList source, TableFormat tableFormat) { final EventList proxySource = GlazedListsSWT.createSwtThreadProxyListWithLock(source, table.getDisplay()); return new DefaultEventKTableModel(table, proxySource, tableFormat, true); } }
/** * Create a new {@link DefaultEventKTableModel} that uses elements from the * specified {@link EventList} as rows, and the specified {@link TableFormat} * to divide row objects across columns. * * <p>The returned model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the SWT event handler thread. * </p> * * @param table the KTable the model is created for * @param source the {@link EventList} * @param tableFormat provides logic to divide row objects across columns. * If the value implements the {@link KTableFormat} interface, those * methods will be used to provide further details such as cell renderers, * cell editors and row heights. */ public static DefaultEventKTableModel eventKTableModelWithThreadProxyList(KTable table, EventList source, TableFormat tableFormat) { final EventList proxySource = GlazedListsSWT.createSwtThreadProxyListWithLock(source, table.getDisplay()); return new DefaultEventKTableModel(table, proxySource, tableFormat, true); } }
/** * Create a new {@link EventKTableModel} that uses elements from the * specified {@link EventList} as rows, and the specified {@link TableFormat} * to divide row objects across columns. * * @param tableFormat provides logic to divide row objects across columns. * If the value implements the {@link KTableFormat} interface, those * methods will be used to provide further details such as cell renderers, * cell editors and row heights. */ public EventKTableModel(KTable table, EventList source, TableFormat tableFormat) { this.table = table; this.swtThreadSource = GlazedListsSWT.swtThreadProxyList(source, table.getDisplay()); // this TableFormat supports KTable directly if(tableFormat instanceof KTableFormat) { this.kTableFormat = (KTableFormat)tableFormat; // adapt a regular TableFormat for use with KTable } else { this.kTableFormat = new TableFormatKTableFormat(tableFormat); } // listen for events on the SWT display thread swtThreadSource.addListEventListener(this); }