use of de.jaret.util.ui.DoubleField in project translationstudio8 by heartsome.
the class DoubleCellEditor method createControl.
/**
* Create and setup the control.
*
* @param table parent for the control
*/
private void createControl(JaretTable table) {
if (_text == null) {
_table = table;
_text = new Text(table, SWT.BORDER | SWT.RIGHT);
_doubleField = new DoubleField();
_doubleField.setText(_text);
_text.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent event) {
if (event.keyCode == SWT.TAB) {
event.doit = false;
stopEditing(true);
_table.forceFocus();
_table.focusRight();
} else if (event.keyCode == SWT.CR) {
event.doit = false;
stopEditing(true);
_table.forceFocus();
_table.focusDown();
} else if (event.keyCode == SWT.ESC) {
event.doit = false;
stopEditing(false);
_column.setValue(_row, _oldVal);
_table.forceFocus();
}
}
public void keyReleased(KeyEvent arg0) {
}
});
_text.addFocusListener(this);
}
}
Aggregations