|
@@ -25,8 +25,9 @@ package com.dmdirc.addons.ui_swing.components.inputfields;
|
25
|
25
|
import com.dmdirc.addons.ui_swing.components.colours.ColourPickerDialog;
|
26
|
26
|
import com.dmdirc.config.IdentityManager;
|
27
|
27
|
import com.dmdirc.ui.interfaces.InputField;
|
28
|
|
-import java.awt.KeyboardFocusManager;
|
29
|
28
|
|
|
29
|
+import java.awt.KeyboardFocusManager;
|
|
30
|
+import java.awt.Window;
|
30
|
31
|
import java.awt.event.ActionEvent;
|
31
|
32
|
import java.awt.event.ActionListener;
|
32
|
33
|
import java.beans.PropertyChangeEvent;
|
|
@@ -50,17 +51,21 @@ public class TextPaneInputField extends JEditorPane implements InputField,
|
50
|
51
|
* objects being unserialized with the new class).
|
51
|
52
|
*/
|
52
|
53
|
private static final long serialVersionUID = 1;
|
|
54
|
+ /** Parent window. */
|
|
55
|
+ private final Window parentWindow;
|
53
|
56
|
/** Colour picker. */
|
54
|
57
|
protected ColourPickerDialog colourPicker;
|
55
|
58
|
|
56
|
59
|
/**
|
57
|
60
|
* Creates a new text pane input field.
|
|
61
|
+ *
|
|
62
|
+ * @param parentWindow Parent window, can be null
|
58
|
63
|
*/
|
59
|
|
- public TextPaneInputField() {
|
|
64
|
+ public TextPaneInputField(final Window parentWindow) {
|
60
|
65
|
super();
|
61
|
|
-
|
62
|
66
|
KeyboardFocusManager.getCurrentKeyboardFocusManager()
|
63
|
67
|
.addPropertyChangeListener(this);
|
|
68
|
+ this.parentWindow = parentWindow;
|
64
|
69
|
}
|
65
|
70
|
|
66
|
71
|
/** {@inheritDoc} */
|
|
@@ -68,7 +73,7 @@ public class TextPaneInputField extends JEditorPane implements InputField,
|
68
|
73
|
public void showColourPicker(final boolean irc, final boolean hex) {
|
69
|
74
|
if (IdentityManager.getGlobalConfig().getOptionBool("general",
|
70
|
75
|
"showcolourdialog")) {
|
71
|
|
- colourPicker = new ColourPickerDialog(irc, hex);
|
|
76
|
+ colourPicker = new ColourPickerDialog(irc, hex, parentWindow);
|
72
|
77
|
colourPicker.addActionListener(new ActionListener() {
|
73
|
78
|
|
74
|
79
|
@Override
|