Quellcode durchsuchen

Switch to using component frames.

Change-Id: Ibbed782aaf570bdac2641842ad4bebbc7e285404
Reviewed-on: http://gerrit.dmdirc.com/2050
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.7rc1
Greg Holmes vor 13 Jahren
Ursprung
Commit
a93906a609

+ 3
- 4
src/com/dmdirc/addons/dcc/DCCPlugin.java Datei anzeigen

@@ -32,10 +32,9 @@ import com.dmdirc.addons.dcc.io.DCC;
32 32
 import com.dmdirc.addons.dcc.io.DCCChat;
33 33
 import com.dmdirc.addons.dcc.io.DCCTransfer;
34 34
 import com.dmdirc.addons.dcc.kde.KFileChooser;
35
-import com.dmdirc.addons.dcc.ui.PlaceholderWindow;
36
-import com.dmdirc.addons.dcc.ui.TransferWindow;
37 35
 import com.dmdirc.addons.ui_swing.SwingController;
38 36
 import com.dmdirc.addons.ui_swing.SwingWindowFactory;
37
+import com.dmdirc.addons.ui_swing.components.frames.ComponentFrame;
39 38
 import com.dmdirc.config.Identity;
40 39
 import com.dmdirc.config.IdentityManager;
41 40
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
@@ -81,10 +80,10 @@ public final class DCCPlugin extends BasePlugin implements ActionListener {
81 80
         final SwingWindowFactory factory = controller.getWindowFactory();
82 81
         factory.registerImplementation(new HashSet<String>(Arrays.asList(
83 82
                 "com.dmdirc.addons.dcc.ui.PlaceholderPanel")),
84
-                PlaceholderWindow.class);
83
+                ComponentFrame.class);
85 84
         factory.registerImplementation(new HashSet<String>(Arrays.asList(
86 85
                 "com.dmdirc.addons.dcc.ui.TransferPanel")),
87
-                TransferWindow.class);
86
+                ComponentFrame.class);
88 87
     }
89 88
 
90 89
     /**

+ 2
- 2
src/com/dmdirc/addons/dcc/PlaceholderContainer.java Datei anzeigen

@@ -24,8 +24,8 @@ package com.dmdirc.addons.dcc;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
-import com.dmdirc.addons.dcc.ui.PlaceholderWindow;
28 27
 import com.dmdirc.addons.ui_swing.SwingController;
28
+import com.dmdirc.addons.ui_swing.components.frames.ComponentFrame;
29 29
 import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
30 30
 import com.dmdirc.config.IdentityManager;
31 31
 import com.dmdirc.plugins.PluginManager;
@@ -47,7 +47,7 @@ public class PlaceholderContainer extends FrameContainer {
47 47
      * @param plugin The plugin which owns this placeholder
48 48
      */
49 49
     public PlaceholderContainer(final DCCPlugin plugin) {
50
-        super("dcc", "DCCs", "DCCs", PlaceholderWindow.class,
50
+        super("dcc", "DCCs", "DCCs", ComponentFrame.class,
51 51
                 IdentityManager.getGlobalConfig(),
52 52
                 Arrays.asList("com.dmdirc.addons.dcc.ui.PlaceholderPanel"));
53 53
 

+ 2
- 2
src/com/dmdirc/addons/dcc/TransferContainer.java Datei anzeigen

@@ -29,7 +29,7 @@ import com.dmdirc.actions.ActionManager;
29 29
 import com.dmdirc.addons.dcc.actions.DCCActions;
30 30
 import com.dmdirc.addons.dcc.io.DCC;
31 31
 import com.dmdirc.addons.dcc.io.DCCTransfer;
32
-import com.dmdirc.addons.dcc.ui.TransferWindow;
32
+import com.dmdirc.addons.ui_swing.components.frames.ComponentFrame;
33 33
 import com.dmdirc.config.IdentityManager;
34 34
 import com.dmdirc.parser.interfaces.Parser;
35 35
 import com.dmdirc.parser.interfaces.callbacks.SocketCloseListener;
@@ -93,7 +93,7 @@ public class TransferContainer extends FrameContainer implements
93 93
             final String title, final String targetNick, final Server server) {
94 94
         super(dcc.getType() == DCCTransfer.TransferType.SEND
95 95
                 ? "dcc-send-inactive" : "dcc-receive-inactive",
96
-                title, title, TransferWindow.class,
96
+                title, title, ComponentFrame.class,
97 97
                 IdentityManager.getGlobalConfig(),
98 98
                 Arrays.asList("com.dmdirc.addons.dcc.ui.TransferPanel"));
99 99
         this.plugin = plugin;

+ 0
- 80
src/com/dmdirc/addons/dcc/ui/EmptyWindow.java Datei anzeigen

@@ -1,80 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.dcc.ui;
24
-
25
-import com.dmdirc.FrameContainer;
26
-import com.dmdirc.addons.ui_swing.SwingController;
27
-import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
28
-import com.dmdirc.commandparser.PopupType;
29
-
30
-import javax.swing.JPopupMenu;
31
-
32
-/**
33
- * Empty Frame.
34
- */
35
-public class EmptyWindow extends TextFrame {
36
-
37
-    /** A version number for this class. */
38
-    private static final long serialVersionUID = 2L;
39
-
40
-    /**
41
-     * Creates a new empty window for the specified UI controller and owner.
42
-     *
43
-     * @param controller The UIController that owns this window
44
-     * @param owner The frame container that owns this window
45
-     */
46
-    public EmptyWindow(final SwingController controller, final FrameContainer owner) {
47
-        super(owner, controller);
48
-        setTextPane(null);
49
-    }
50
-
51
-    /** {@inheritDoc} */
52
-    @Override
53
-    public PopupType getNicknamePopupType() {
54
-        return null;
55
-    }
56
-
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public PopupType getChannelPopupType() {
60
-        return null;
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public PopupType getHyperlinkPopupType() {
66
-        return null;
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public PopupType getNormalPopupType() {
72
-        return null;
73
-    }
74
-
75
-    /** {@inheritDoc} */
76
-    @Override
77
-    public void addCustomPopupItems(final JPopupMenu popupMenu) {
78
-        //Add no custom popup items
79
-    }
80
-}

+ 2
- 1
src/com/dmdirc/addons/dcc/ui/PlaceholderPanel.java Datei anzeigen

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.dcc.ui;
24 24
 
25
+import com.dmdirc.addons.ui_swing.components.frames.SwingFrameComponent;
25 26
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
26 27
 
27 28
 import javax.swing.JPanel;
@@ -33,7 +34,7 @@ import net.miginfocom.swing.MigLayout;
33 34
  *
34 35
  * @since 0.6.6
35 36
  */
36
-public class PlaceholderPanel extends JPanel {
37
+public class PlaceholderPanel extends JPanel implements SwingFrameComponent {
37 38
 
38 39
     /** A version number for this class. */
39 40
     private static final long serialVersionUID = 1L;

+ 0
- 51
src/com/dmdirc/addons/dcc/ui/PlaceholderWindow.java Datei anzeigen

@@ -1,51 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.dcc.ui;
24
-
25
-import com.dmdirc.FrameContainer;
26
-import com.dmdirc.addons.ui_swing.SwingController;
27
-
28
-/**
29
- * A virtually empty window which serves as a top-level placeholder for other
30
- * DCC windows.
31
- *
32
- * @since 0.6.4
33
- */
34
-public class PlaceholderWindow extends EmptyWindow {
35
-
36
-    /** A version number for this class. */
37
-    private static final long serialVersionUID = 1L;
38
-
39
-    /**
40
-     * Creates a new placeholder window for the specified UI controller and owner.
41
-     *
42
-     * @param controller The UIController that owns this window
43
-     * @param owner The frame container that owns this window
44
-     */
45
-    public PlaceholderWindow(final SwingController controller,
46
-            final FrameContainer owner) {
47
-        super(controller, owner);
48
-        add(new PlaceholderPanel());
49
-    }
50
-
51
-}

+ 3
- 2
src/com/dmdirc/addons/dcc/ui/TransferPanel.java Datei anzeigen

@@ -27,6 +27,7 @@ import com.dmdirc.addons.dcc.DCCTransferHandler;
27 27
 import com.dmdirc.addons.dcc.TransferContainer;
28 28
 import com.dmdirc.addons.dcc.io.DCCTransfer;
29 29
 import com.dmdirc.addons.ui_swing.UIUtilities;
30
+import com.dmdirc.addons.ui_swing.components.frames.SwingFrameComponent;
30 31
 import com.dmdirc.logger.ErrorLevel;
31 32
 import com.dmdirc.logger.Logger;
32 33
 import com.dmdirc.parser.interfaces.Parser;
@@ -52,7 +53,7 @@ import net.miginfocom.swing.MigLayout;
52 53
  * @since 0.6.6
53 54
  */
54 55
 public class TransferPanel extends JPanel implements ActionListener,
55
-        SocketCloseListener, DCCTransferHandler {
56
+        SocketCloseListener, DCCTransferHandler, SwingFrameComponent {
56 57
 
57 58
     /** A version number for this class. */
58 59
     private static final long serialVersionUID = 1L;
@@ -78,7 +79,7 @@ public class TransferPanel extends JPanel implements ActionListener,
78 79
     /**
79 80
      * Creates a new transfer window for the specified UI controller and owner.
80 81
      *
81
-     * @param owner The frame container that owns this window
82
+     * @param owner The frame container that owns this frame
82 83
      */
83 84
     public TransferPanel(final FrameContainer owner) {
84 85
         super();

+ 87
- 0
src/com/dmdirc/addons/ui_swing/components/frames/ComponentCreator.java Datei anzeigen

@@ -0,0 +1,87 @@
1
+/*
2
+ * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.addons.ui_swing.components.frames;
24
+
25
+import com.dmdirc.FrameContainer;
26
+import com.dmdirc.addons.ui_swing.SwingController;
27
+import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputField;
28
+import com.dmdirc.addons.ui_swing.textpane.TextPane;
29
+import com.dmdirc.logger.ErrorLevel;
30
+import com.dmdirc.logger.Logger;
31
+import com.dmdirc.ui.core.components.WindowComponent;
32
+import com.dmdirc.util.SimpleInjector;
33
+
34
+import java.util.HashSet;
35
+import java.util.Set;
36
+
37
+import javax.swing.JComponent;
38
+
39
+/**
40
+ * Utility class to create frame components.
41
+ */
42
+public class ComponentCreator {
43
+
44
+    /**
45
+     * Initialises the components specified by the given frame.
46
+     *
47
+     * @param frame Frame to initialise
48
+     * @param controller UI Controller
49
+     * @param owner container
50
+     *
51
+     * @return Set of initialised components
52
+     */
53
+    public Set<JComponent> initFrameComponents(final Object frame,
54
+            final SwingController controller,
55
+            final FrameContainer owner) {
56
+        final SimpleInjector injector = new SimpleInjector();
57
+        final Set<String> names = owner.getComponents();
58
+        final Set<JComponent> components = new HashSet<JComponent>();
59
+
60
+        injector.addParameter(frame);
61
+        injector.addParameter(controller);
62
+        injector.addParameter(controller.getMainFrame());
63
+
64
+        for (String string : names) {
65
+            Object object;
66
+            try {
67
+                Class<?> clazz = null;
68
+                if (string.equals(WindowComponent.INPUTFIELD.getIdentifier())) {
69
+                    clazz = SwingInputField.class;
70
+                } else if (string.equals(WindowComponent.TEXTAREA
71
+                        .getIdentifier())) {
72
+                    clazz = TextPane.class;
73
+                }
74
+                object = injector.createInstance(clazz);
75
+            } catch (IllegalArgumentException ex) {
76
+                object = null;
77
+                Logger.userError(ErrorLevel.HIGH, "Unable to create component: "
78
+                        + ex.getMessage());
79
+            }
80
+            if (object instanceof JComponent) {
81
+                components.add((JComponent) object);
82
+            }
83
+        }
84
+
85
+        return components;
86
+    }
87
+}

+ 12
- 4
src/com/dmdirc/addons/ui_swing/components/frames/ComponentFrame.java Datei anzeigen

@@ -25,6 +25,7 @@ import com.dmdirc.FrameContainer;
25 25
 import com.dmdirc.addons.ui_swing.SwingController;
26 26
 import com.dmdirc.commandparser.PopupType;
27 27
 
28
+import javax.swing.JComponent;
28 29
 import javax.swing.JPopupMenu;
29 30
 
30 31
 import net.miginfocom.swing.MigLayout;
@@ -40,6 +41,10 @@ public class ComponentFrame extends TextFrame {
40 41
      * objects being unserialized with the new class).
41 42
      */
42 43
     private static final long serialVersionUID = 2;
44
+    /** Parent frame container. */
45
+    private final FrameContainer owner;
46
+    /** Parent controller. */
47
+    private final SwingController controller;
43 48
 
44 49
     /**
45 50
      * Creates a new instance of CustomFrame.
@@ -50,7 +55,8 @@ public class ComponentFrame extends TextFrame {
50 55
     public ComponentFrame(final SwingController controller,
51 56
             final FrameContainer owner) {
52 57
         super(owner, controller);
53
-
58
+        this.controller = controller;
59
+        this.owner = owner;
54 60
         initComponents();
55 61
     }
56 62
 
@@ -58,9 +64,11 @@ public class ComponentFrame extends TextFrame {
58 64
      * Initialises components in this frame.
59 65
      */
60 66
     private void initComponents() {
61
-        setLayout(new MigLayout("ins 0, fill, hidemode 3, wrap 1"));
62
-        add(getTextPane(), "grow, push");
63
-        add(getSearchBar(), "growx, pushx");
67
+        setLayout(new MigLayout("fill"));
68
+        for (JComponent comp : new ComponentCreator().initFrameComponents(this,
69
+                controller, owner)) {
70
+            add(comp, "wrap, grow");
71
+        }
64 72
     }
65 73
 
66 74
     /** {@inheritDoc} */

+ 14
- 5
src/com/dmdirc/addons/ui_swing/components/frames/ComponentInputFrame.java Datei anzeigen

@@ -22,11 +22,13 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.frames;
24 24
 
25
+import com.dmdirc.FrameContainer;
25 26
 import com.dmdirc.WritableFrameContainer;
26 27
 import com.dmdirc.addons.ui_swing.SwingController;
27 28
 import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputHandler;
28 29
 import com.dmdirc.commandparser.PopupType;
29 30
 
31
+import javax.swing.JComponent;
30 32
 import javax.swing.JPopupMenu;
31 33
 
32 34
 import net.miginfocom.swing.MigLayout;
@@ -43,6 +45,10 @@ public class ComponentInputFrame extends InputTextFrame {
43 45
      * objects being unserialized with the new class).
44 46
      */
45 47
     private static final long serialVersionUID = 2;
48
+    /** Parent frame container. */
49
+    private final FrameContainer owner;
50
+    /** Parent controller. */
51
+    private final SwingController controller;
46 52
 
47 53
     /**
48 54
      * Creates a new instance of CustomInputFrame.
@@ -55,8 +61,10 @@ public class ComponentInputFrame extends InputTextFrame {
55 61
         super(controller, owner);
56 62
 
57 63
         setInputHandler(new SwingInputHandler(getInputField(),
58
-                owner.getCommandParser(), getContainer()));
64
+                owner.getCommandParser(), owner));
59 65
 
66
+        this.controller = controller;
67
+        this.owner = owner;
60 68
         initComponents();
61 69
     }
62 70
 
@@ -64,10 +72,11 @@ public class ComponentInputFrame extends InputTextFrame {
64 72
      * Initialises components in this frame.
65 73
      */
66 74
     private void initComponents() {
67
-        setLayout(new MigLayout("ins 0, fill, hidemode 3, wrap 1"));
68
-        add(getTextPane(), "grow, push");
69
-        add(getSearchBar(), "growx, pushx");
70
-        add(inputPanel, "growx, pushx");
75
+        setLayout(new MigLayout("fill"));
76
+        for (JComponent comp : new ComponentCreator().initFrameComponents(this,
77
+                controller, owner)) {
78
+            add(comp, "wrap, grow");
79
+        }
71 80
     }
72 81
 
73 82
     /** {@inheritDoc} */

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java Datei anzeigen

@@ -123,7 +123,7 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
123 123
      * Initialises the components for this frame.
124 124
      */
125 125
     private void initComponents() {
126
-        setInputField(new SwingInputField(getController().getMainFrame()));
126
+        setInputField(new SwingInputField(this, getController().getMainFrame()));
127 127
 
128 128
         getInputField().addMouseListener(this);
129 129
 

src/com/dmdirc/addons/dcc/ui/TransferWindow.java → src/com/dmdirc/addons/ui_swing/components/frames/SwingFrameComponent.java Datei anzeigen

@@ -1,5 +1,5 @@
1 1
 /*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3 3
  *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -20,30 +20,9 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package com.dmdirc.addons.dcc.ui;
24
-
25
-import com.dmdirc.FrameContainer;
26
-import com.dmdirc.addons.ui_swing.SwingController;
23
+package com.dmdirc.addons.ui_swing.components.frames;
27 24
 
28 25
 /**
29
- * A window for displaying the progress of DCC transfers.
30
- *
31
- * @since 0.6.4
26
+ * Interface to express how components should be added to the UI.
32 27
  */
33
-public class TransferWindow extends EmptyWindow {
34
-
35
-    /** A version number for this class. */
36
-    private static final long serialVersionUID = 1L;
37
-
38
-    /**
39
-     * Creates a new transfer window for the specified UI controller and owner.
40
-     *
41
-     * @param controller The UIController that owns this window
42
-     * @param owner The frame container that owns this window
43
-     */
44
-    public TransferWindow(final SwingController controller,
45
-            final FrameContainer owner) {
46
-        super(controller, owner);
47
-        add(new TransferPanel(owner));
48
-    }
49
-}
28
+public interface SwingFrameComponent {}

+ 7
- 1
src/com/dmdirc/addons/ui_swing/components/inputfields/SwingInputField.java Datei anzeigen

@@ -24,6 +24,7 @@ package com.dmdirc.addons.ui_swing.components.inputfields;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.UIUtilities;
26 26
 import com.dmdirc.addons.ui_swing.components.colours.ColourPickerDialog;
27
+import com.dmdirc.addons.ui_swing.components.frames.InputTextFrame;
27 28
 import com.dmdirc.config.IdentityManager;
28 29
 import com.dmdirc.ui.IconManager;
29 30
 import com.dmdirc.ui.interfaces.InputField;
@@ -76,9 +77,11 @@ public class SwingInputField extends JComponent implements InputField,
76 77
     /**
77 78
      * Instantiates a new swing input field.
78 79
      *
80
+     * @param textFrame Parent textFrame
79 81
      * @param parentWindow Parent window
80 82
      */
81
-    public SwingInputField(final Window parentWindow) {
83
+    public SwingInputField(final InputTextFrame textFrame,
84
+            final Window parentWindow) {
82 85
         super();
83 86
 
84 87
         this.parentWindow = parentWindow;
@@ -113,6 +116,9 @@ public class SwingInputField extends JComponent implements InputField,
113 116
                 textField.getInputMap(SwingInputField.WHEN_IN_FOCUSED_WINDOW));
114 117
         KeyboardFocusManager.getCurrentKeyboardFocusManager()
115 118
                 .addPropertyChangeListener(this);
119
+
120
+        textFrame.setInputHandler(new SwingInputHandler(this, textFrame
121
+                .getContainer().getCommandParser(), textFrame.getContainer()));
116 122
     }
117 123
 
118 124
     /** {@inheritDoc} */

Laden…
Abbrechen
Speichern