|
@@ -1,113 +0,0 @@
|
1
|
|
-/*
|
2
|
|
- * Copyright (c) 2006-2014 DMDirc Developers
|
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.DMDircMBassador;
|
26
|
|
-import com.dmdirc.FrameContainer;
|
27
|
|
-import com.dmdirc.addons.ui_swing.SwingController;
|
28
|
|
-import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputField;
|
29
|
|
-import com.dmdirc.commandparser.PopupType;
|
30
|
|
-import com.dmdirc.util.URLBuilder;
|
31
|
|
-
|
32
|
|
-import javax.inject.Provider;
|
33
|
|
-import javax.swing.JComponent;
|
34
|
|
-import javax.swing.JPopupMenu;
|
35
|
|
-
|
36
|
|
-import net.miginfocom.swing.MigLayout;
|
37
|
|
-
|
38
|
|
-/**
|
39
|
|
- * A component frame that includes an input field (for use with writable containers).
|
40
|
|
- */
|
41
|
|
-public class ComponentInputFrame extends InputTextFrame {
|
42
|
|
-
|
43
|
|
- /** A version number for this class. */
|
44
|
|
- private static final long serialVersionUID = 2;
|
45
|
|
- /** URL builder to use when making components. */
|
46
|
|
- private final URLBuilder urlBuilder;
|
47
|
|
- /** Parent frame container. */
|
48
|
|
- private final FrameContainer owner;
|
49
|
|
- /** Parent controller. */
|
50
|
|
- private final SwingController controller;
|
51
|
|
- /** The global event bus. */
|
52
|
|
- private final DMDircMBassador eventBus;
|
53
|
|
-
|
54
|
|
- /**
|
55
|
|
- * Creates a new instance of CustomInputFrame.
|
56
|
|
- *
|
57
|
|
- * @param eventBus The global event bus
|
58
|
|
- * @param deps The dependencies required by text frames.
|
59
|
|
- * @param inputFieldProvider The provider to use to create a new input field.
|
60
|
|
- * @param urlBuilder URL builder to use when making components.
|
61
|
|
- * @param owner The frame container that owns this frame
|
62
|
|
- */
|
63
|
|
- public ComponentInputFrame(
|
64
|
|
- final DMDircMBassador eventBus,
|
65
|
|
- final TextFrameDependencies deps,
|
66
|
|
- final Provider<SwingInputField> inputFieldProvider,
|
67
|
|
- final URLBuilder urlBuilder,
|
68
|
|
- final FrameContainer owner) {
|
69
|
|
- super(deps, inputFieldProvider, owner);
|
70
|
|
- this.eventBus = eventBus;
|
71
|
|
- this.controller = deps.controller;
|
72
|
|
- this.urlBuilder = urlBuilder;
|
73
|
|
- this.owner = owner;
|
74
|
|
- initComponents();
|
75
|
|
- }
|
76
|
|
-
|
77
|
|
- /**
|
78
|
|
- * Initialises components in this frame.
|
79
|
|
- */
|
80
|
|
- private void initComponents() {
|
81
|
|
- setLayout(new MigLayout("fill"));
|
82
|
|
- for (JComponent comp : new ComponentCreator()
|
83
|
|
- .initFrameComponents(this, controller, eventBus, urlBuilder, owner)) {
|
84
|
|
- add(comp, "wrap, grow");
|
85
|
|
- }
|
86
|
|
- }
|
87
|
|
-
|
88
|
|
- @Override
|
89
|
|
- public PopupType getNicknamePopupType() {
|
90
|
|
- return null;
|
91
|
|
- }
|
92
|
|
-
|
93
|
|
- @Override
|
94
|
|
- public PopupType getChannelPopupType() {
|
95
|
|
- return null;
|
96
|
|
- }
|
97
|
|
-
|
98
|
|
- @Override
|
99
|
|
- public PopupType getHyperlinkPopupType() {
|
100
|
|
- return null;
|
101
|
|
- }
|
102
|
|
-
|
103
|
|
- @Override
|
104
|
|
- public PopupType getNormalPopupType() {
|
105
|
|
- return null;
|
106
|
|
- }
|
107
|
|
-
|
108
|
|
- @Override
|
109
|
|
- public void addCustomPopupItems(final JPopupMenu popupMenu) {
|
110
|
|
- //Add no custom popup items
|
111
|
|
- }
|
112
|
|
-
|
113
|
|
-}
|