1 | public JTextField getJTextField() {↵ | | 1 | public JTextField getJTextField() {↵
|
2 | _textComponent = new RestorableJTextField();↵ | | 2 | _textComponent = new RestorableJTextField();↵
|
|
3 | ↵ | | 3 | ↵
|
4 | // special handling of operations while editing this data type↵ | | 4 | // special handling of operations while editing this data type↵
|
5 | ((RestorableJTextField)_textComponent).addKeyListener(new KeyTextHandler());↵ | | 5 | ((RestorableJTextField)_textComponent).addKeyListener(new KeyTextHandler());↵
|
|
6 | //↵ | | |
|
7 | ↵ | | 6 | ↵
|
| | | 7 | //↵
|
8 | // handle mouse events for double-click creation of popup dialog.↵ | | 8 | // handle mouse events for double-click creation of popup dialog.↵
|
9 | // This happens only in the JTextField, not the JTextArea, so we can↵ | | 9 | // This happens only in the JTextField, not the JTextArea, so we can↵
|
10 | // make this an inner class within this method rather than a separate↵ | | 10 | // make this an inner class within this method rather than a separate↵
|
11 | // inner class as is done with the KeyTextHandler class.↵ | | 11 | // inner class as is done with the KeyTextHandler class.↵
|
12 | //↵ | | |
|
13 | ↵ | | 12 | //↵
|
14 | ((RestorableJTextField)_textComponent).addMouseListener(new MouseAdapter()↵ | | 13 | ((RestorableJTextField)_textComponent).addMouseListener(new MouseAdapter()↵
|
15 | {↵ | | |
|
16 | ↵ | | 14 | {↵
|
17 | public void mousePressed(MouseEvent evt)↵ | | 15 | public void mousePressed(MouseEvent evt)↵
|
18 | {↵ | | |
|
19 | ↵ | | 16 | {↵
|
20 | if (evt.getClickCount() == 2)↵ | | 17 | if (evt.getClickCount() == 2)↵
|
21 | {↵ | | |
|
22 | ↵ | | 18 | {↵
|
23 | MouseEvent tableEvt = SwingUtilities.convertMouseEvent(↵ | | 19 | MouseEvent tableEvt = SwingUtilities.convertMouseEvent(↵
|
24 | (RestorableJTextField)DataTypeDouble.this._textComponent,↵ | | 20 | (RestorableJTextField)DataTypeShort.this._textComponent,↵
|
25 | evt, DataTypeDouble.this._table);↵ | | 21 | evt, DataTypeShort.this._table);↵
|
26 | CellDataPopup.showDialog(DataTypeDouble.this._table,↵ | | 22 | CellDataPopup.showDialog(DataTypeShort.this._table,↵
|
27 | DataTypeDouble.this._colDef, tableEvt, true);↵ | | 23 | DataTypeShort.this._colDef, tableEvt, true);↵
|
28 | }↵ | | |
|
29 | }↵ | | |
|
30 | ↵ | | 24 | }↵
|
| | | 25 | }↵
|
31 | }); // end of mouse listener↵ | | 26 | }); // end of mouse listener↵
|
|
32 | return (JTextField)_textComponent;↵ | | 27 | return (JTextField)_textComponent;↵
|
33 | | | 28 |
|