01: package net.sourceforge.squirrel_sql.fw.completion;
02:
03: import javax.swing.text.JTextComponent;
04: import javax.swing.*;
05:
06: public class TextComponentProvider {
07: private JTextComponent _txtEditor;
08: private JTextComponent _txtFilter;
09:
10: public TextComponentProvider(JTextComponent txtEditor,
11: boolean useOwnFilterTextField) {
12: _txtEditor = txtEditor;
13:
14: if (useOwnFilterTextField) {
15: _txtFilter = new JTextField();
16: _txtFilter.setFont(_txtEditor.getFont());
17: }
18: }
19:
20: JTextComponent getEditor() {
21: return _txtEditor;
22: }
23:
24: JTextComponent getFilter() {
25: if (null != _txtFilter) {
26: return _txtFilter;
27: } else {
28: return _txtEditor;
29: }
30: }
31:
32: public boolean editorEqualsFilter() {
33: return null == _txtFilter;
34: }
35: }
|