use of de.jaret.util.ui.table.renderer.DefaultBorderConfiguration in project translationstudio8 by heartsome.
the class MultiLineListExample method createControls.
/**
* Create the controls that compose the console test.
*
*/
protected void createControls() {
GridLayout gl = new GridLayout();
gl.numColumns = 1;
_shell.setLayout(gl);
GridData gd = new GridData(GridData.FILL_BOTH);
_jt = new JaretTable(_shell, SWT.V_SCROLL);
_jt.setLayoutData(gd);
if (_tableModel == null) {
DefaultJaretTableModel model = new PropListeningTableModel();
model.addRow(new DummyRow("r1", "line 1", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
model.addRow(new DummyRow("r2", "another first line", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
model.addRow(new DummyRow("r3", "and yet another one", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
model.addRow(new DummyRow("r5", "4444444444", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
model.addRow(new DummyRow("r6", "555555555", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
model.addRow(new DummyRow("r7", "6666666666", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
model.addRow(new DummyRow("r8", "7777777777", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
model.addRow(new DummyRow("r9", "88888888888", "line 2 adds more text", true, new Date(), MultiLineListExample.getImageRegistry().get("icon")));
PropCol ct1 = new PropCol("t1", "column 1", "T1");
ct1.setEditable(false);
model.addColumn(ct1);
_tableModel = model;
}
DefaultCellStyle cs = (DefaultCellStyle) _jt.getTableViewState().getCellStyleProvider().getDefaultCellStyle().copy();
cs.setBorderConfiguration(new DefaultBorderConfiguration(0, 0, 0, 0));
_jt.getTableViewState().getCellStyleProvider().setColumnCellStyle(_tableModel.getColumn(0), cs);
_jt.getTableViewState().setRowHeightMode(ITableViewState.RowHeightMode.FIXED);
// has to be replaced
for (int i = 0; i < _tableModel.getRowCount(); i++) {
_jt.getTableViewState().setRowHeight(_tableModel.getRow(i), 60);
}
// _jt.getTableViewState().setColumnResizeMode(ITableViewState.ColumnResizeMode.ALL);
_jt.setHeaderHeight(0);
_jt.registerCellRenderer(_tableModel.getColumn(0), new MultilineListCellRenderer());
_jt.setTableModel(_tableModel);
_jt.getTableViewState().setColumnWidth(_tableModel.getColumn(0), 230);
}
Aggregations