Browse Source

work on issue 1027: New Actions Editor UI

git-svn-id: http://svn.dmdirc.com/trunk@4029 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Gregory Holmes 16 years ago
parent
commit
4b35605396

+ 22
- 3
src/com/dmdirc/ui/swing/dialogs/actioneditor/ActionTriggersListPanel.java View File

@@ -105,7 +105,6 @@ public class ActionTriggersListPanel extends JPanel {
105 105
             if (getComponentCount() == 0) {
106 106
                 add(new TextLabel("No triggers."));
107 107
             }
108
-            getLayout().layoutContainer(this);
109 108
             setVisible(true);
110 109
         }
111 110
     }
@@ -146,11 +145,11 @@ public class ActionTriggersListPanel extends JPanel {
146 145
             return triggers;
147 146
         }
148 147
     }
149
-    
148
+
150 149
     public ActionType getTrigger(final int index) {
151 150
         return triggers.get(index);
152 151
     }
153
-    
152
+
154 153
     public int getTriggerCount() {
155 154
         synchronized (triggers) {
156 155
             return triggers.size();
@@ -189,4 +188,24 @@ public class ActionTriggersListPanel extends JPanel {
189 188
             listener.triggerRemoved(type);
190 189
         }
191 190
     }
191
+
192
+    /** {@inheritDoc} */
193
+    @Override
194
+    public void setEnabled(final boolean enabled) {
195
+        SwingUtilities.invokeLater(new Runnable() {
196
+
197
+            /** {@inheritDoc} */
198
+            @Override
199
+            public void run() {
200
+                if (enabled) {
201
+                    layoutComponents();
202
+                } else {
203
+                    setVisible(false);
204
+                    removeAll();
205
+                    add(new TextLabel("No triggers."));
206
+                    setVisible(true);
207
+                }
208
+            }
209
+        });
210
+    }
192 211
 }

+ 8
- 2
src/com/dmdirc/ui/swing/dialogs/actioneditor/ActionTriggersPanel.java View File

@@ -122,16 +122,22 @@ public class ActionTriggersPanel extends JPanel implements ActionListener,
122 122
                 ((ActionTypeModel) trigger.getModel()).removeAllElements();
123 123
 
124 124
                 if (triggerList.getTriggerCount() == 0) {
125
-                    System.out.println("all");
126 125
                     ((ActionTypeModel) trigger.getModel()).setTypeGroup(ActionManager.getTypeGroups());
127 126
                     return;
128 127
                 }
129 128
 
130
-                System.out.println("typed");
131 129
                 for (ActionType thisType : ActionManager.getCompatibleTypes(triggerList.getTrigger(0))) {
132 130
                     ((ActionTypeModel) trigger.getModel()).addElement(thisType);
133 131
                 }
134 132
             }
135 133
         });
136 134
     }
135
+    
136
+    /** {@inheritDoc} */
137
+    @Override
138
+    public void setEnabled(final boolean enabled) {
139
+        triggerList.setEnabled(enabled);
140
+        trigger.setEnabled(enabled);
141
+        add.setEnabled(enabled);
142
+    }
137 143
 }

Loading…
Cancel
Save