|
@@ -0,0 +1,82 @@
|
|
1
|
+/*
|
|
2
|
+ *
|
|
3
|
+ * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
|
|
4
|
+ *
|
|
5
|
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+ * of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+ * in the Software without restriction, including without limitation the rights
|
|
8
|
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+ * copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+ * furnished to do so, subject to the following conditions:
|
|
11
|
+ *
|
|
12
|
+ * The above copyright notice and this permission notice shall be included in
|
|
13
|
+ * all copies or substantial portions of the Software.
|
|
14
|
+ *
|
|
15
|
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+ * SOFTWARE.
|
|
22
|
+ */
|
|
23
|
+
|
|
24
|
+package com.dmdirc.addons.ui_swing.dialogs.prefs;
|
|
25
|
+
|
|
26
|
+import java.awt.Component;
|
|
27
|
+import java.awt.LayoutManager;
|
|
28
|
+
|
|
29
|
+import javax.swing.JPanel;
|
|
30
|
+
|
|
31
|
+/**
|
|
32
|
+ * Creates a new JPanel that prevents components from being removed.
|
|
33
|
+ */
|
|
34
|
+public class NoRemovePanel extends JPanel {
|
|
35
|
+
|
|
36
|
+ /**
|
|
37
|
+ * A version number for this class. It should be changed whenever the
|
|
38
|
+ * class structure is changed (or anything else that would prevent
|
|
39
|
+ * serialized objects being unserialized with the new class).
|
|
40
|
+ */
|
|
41
|
+ private static final long serialVersionUID = 1;
|
|
42
|
+
|
|
43
|
+ /**
|
|
44
|
+ * Creates a new JPanel that prevents components being removed.
|
|
45
|
+ */
|
|
46
|
+ public NoRemovePanel() {
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ /**
|
|
50
|
+ * Creates a new JPanel that prevents components being removed.
|
|
51
|
+ *
|
|
52
|
+ * @param isDoubleBuffered Use double buffering?
|
|
53
|
+ */
|
|
54
|
+ public NoRemovePanel(boolean isDoubleBuffered) {
|
|
55
|
+ super(isDoubleBuffered);
|
|
56
|
+ }
|
|
57
|
+
|
|
58
|
+ /**
|
|
59
|
+ * Creates a new JPanel that prevents components being removed.
|
|
60
|
+ *
|
|
61
|
+ * @param layout Layout manager
|
|
62
|
+ */
|
|
63
|
+ public NoRemovePanel(LayoutManager layout) {
|
|
64
|
+ super(layout);
|
|
65
|
+ }
|
|
66
|
+
|
|
67
|
+ /**
|
|
68
|
+ * Creates a new JPanel that prevents components being removed.
|
|
69
|
+ *
|
|
70
|
+ * @param layout Layout manager
|
|
71
|
+ * @param isDoubleBuffered Use double buffering?
|
|
72
|
+ */
|
|
73
|
+ public NoRemovePanel(LayoutManager layout, boolean isDoubleBuffered) {
|
|
74
|
+ super(layout, isDoubleBuffered);
|
|
75
|
+ }
|
|
76
|
+
|
|
77
|
+ /** {@inheritDoc} */
|
|
78
|
+ @Override
|
|
79
|
+ public void remove(final Component comp) {
|
|
80
|
+ //Ignore
|
|
81
|
+ }
|
|
82
|
+}
|