use of de.kupzog.ktable.KTableCellResizeListener in project translationstudio8 by heartsome.
the class QAResultViewPart method createTable.
public void createTable() {
table = new KTable(parent, SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL | SWTX.FILL_WITH_LASTCOL | SWT.WRAP);
tableModel = new KtableModel();
table.setModel(tableModel);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
table.setColorRightBorder(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
table.setColorLeftBorder(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
table.setColorTopBorder(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
table.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
locationRow();
}
});
table.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.keyCode == QAConstant.QA_CENTERKEY_1 || e.keyCode == QAConstant.QA_CENTERKEY_2) {
locationRow();
}
}
});
table.addCellResizeListener(new KTableCellResizeListener() {
public void rowResized(int arg0, int arg1) {
tableModel.textRenderer.clearRowHeiMap();
table.redraw();
}
public void columnResized(int arg0, int arg1) {
tableModel.textRenderer.clearRowHeiMap();
table.redraw();
}
});
table.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
tableModel.textRenderer.clearRowHeiMap();
table.redraw();
}
});
table.addMouseWheelListener(new MouseWheelListener() {
public void mouseScrolled(MouseEvent e) {
tableModel.textRenderer.clearRowHeiMap();
table.redraw();
}
});
createPropMenu();
}
Aggregations