|
@@ -61,8 +61,12 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
61
|
61
|
private ActionConditionsPanel conditions;
|
62
|
62
|
/** Substitutions panel. */
|
63
|
63
|
private ActionSubstitutionsPanel substitutions;
|
|
64
|
+ /** Advanced panel. */
|
|
65
|
+ private ActionAdvancedPanel advanced;
|
64
|
66
|
/** Show substitutions button. */
|
65
|
67
|
private JButton showSubstitutions;
|
|
68
|
+ /** Show advanced button. */
|
|
69
|
+ private JButton showAdvanced;
|
66
|
70
|
/** Is the name valid? */
|
67
|
71
|
private boolean nameValid = false;
|
68
|
72
|
/** Are the triggers valid? */
|
|
@@ -183,6 +187,7 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
183
|
187
|
response.setEnabled(action != null);
|
184
|
188
|
conditions.setEnabled(action != null);
|
185
|
189
|
substitutions.setVisible(false);
|
|
190
|
+ advanced.setVisible(false);
|
186
|
191
|
|
187
|
192
|
triggersValid = action != null;
|
188
|
193
|
conditionsValid = true;
|
|
@@ -197,6 +202,8 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
197
|
202
|
conditions.setActionTrigger(action.getTriggers()[0]);
|
198
|
203
|
conditions.setConditions(action.getConditions());
|
199
|
204
|
conditions.setConditionTree(action.getRealConditionTree());
|
|
205
|
+ advanced.setActionEnabled(action.isEnabled());
|
|
206
|
+ advanced.setConcurrencyGroup(action.getConcurrencyGroup());
|
200
|
207
|
}
|
201
|
208
|
}
|
202
|
209
|
|
|
@@ -208,12 +215,15 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
208
|
215
|
response = new ActionResponsePanel();
|
209
|
216
|
conditions = new ActionConditionsPanel();
|
210
|
217
|
substitutions = new ActionSubstitutionsPanel();
|
|
218
|
+ advanced = new ActionAdvancedPanel();
|
211
|
219
|
showSubstitutions = new JButton("Show Substitutions");
|
|
220
|
+ showAdvanced = new JButton("Show Advanced Options");
|
212
|
221
|
}
|
213
|
222
|
|
214
|
223
|
/** Adds the listeners. */
|
215
|
224
|
private void addListeners() {
|
216
|
225
|
showSubstitutions.addActionListener(this);
|
|
226
|
+ showAdvanced.addActionListener(this);
|
217
|
227
|
getOkButton().addActionListener(this);
|
218
|
228
|
getCancelButton().addActionListener(this);
|
219
|
229
|
|
|
@@ -232,8 +242,10 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
232
|
242
|
add(triggers, "grow, w 50%");
|
233
|
243
|
add(response, "grow, pushy, w 50%");
|
234
|
244
|
add(substitutions, "spanx, grow, push");
|
235
|
|
- add(showSubstitutions, "left, sgx button, split 3, spanx 2");
|
236
|
|
- add(getLeftButton(), "right, sgx button, gapleft push");
|
|
245
|
+ add(advanced, "spanx, grow, push");
|
|
246
|
+ add(showSubstitutions, "left, sgx button, split 2");
|
|
247
|
+ add(showAdvanced, "left, sgx button");
|
|
248
|
+ add(getLeftButton(), "right, sgx button, gapleft push, split");
|
237
|
249
|
add(getRightButton(), "right, sgx button");
|
238
|
250
|
}
|
239
|
251
|
|
|
@@ -249,6 +261,10 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
249
|
261
|
showSubstitutions.setText(substitutions.isVisible() ? "Hide Substitutions"
|
250
|
262
|
: "Show Substitutions");
|
251
|
263
|
pack();
|
|
264
|
+ } else if (e.getSource().equals(showAdvanced)) {
|
|
265
|
+ advanced.setVisible(!advanced.isVisible());
|
|
266
|
+ showAdvanced.setText(advanced.isVisible() ? "Hide Advanced Options"
|
|
267
|
+ : "Show Advanced Options");
|
252
|
268
|
} else if (e.getSource().equals(getOkButton())) {
|
253
|
269
|
save();
|
254
|
270
|
dispose();
|
|
@@ -281,9 +297,12 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
281
|
297
|
conditions.getConditions();
|
282
|
298
|
conditions.getConditionTree();
|
283
|
299
|
if (action == null) {
|
284
|
|
- new Action(group, name.getActionName(), triggers.getTriggers(),
|
285
|
|
- response.getResponse(), conditions.getConditions(),
|
286
|
|
- conditions.getConditionTree(), response.getFormatter());
|
|
300
|
+ final Action newAction = new Action(group, name.getActionName(),
|
|
301
|
+ triggers.getTriggers(), response.getResponse(),
|
|
302
|
+ conditions.getConditions(), conditions.getConditionTree(),
|
|
303
|
+ response.getFormatter());
|
|
304
|
+ newAction.setConcurrencyGroup(advanced.getConcurrencyGroup());
|
|
305
|
+ newAction.setEnabled(advanced.isActionEnabled());
|
287
|
306
|
} else {
|
288
|
307
|
action.setName(name.getActionName());
|
289
|
308
|
action.setConditionTree(conditions.getConditionTree());
|
|
@@ -291,6 +310,8 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
291
|
310
|
action.setNewFormat(response.getFormatter());
|
292
|
311
|
action.setResponse(response.getResponse());
|
293
|
312
|
action.setTriggers(triggers.getTriggers());
|
|
313
|
+ action.setConcurrencyGroup(advanced.getConcurrencyGroup());
|
|
314
|
+ action.setEnabled(advanced.isActionEnabled());
|
294
|
315
|
action.save();
|
295
|
316
|
}
|
296
|
317
|
}
|
|
@@ -309,6 +330,7 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
|
309
|
330
|
response.setEnabled((Boolean) evt.getNewValue());
|
310
|
331
|
conditions.setEnabled((Boolean) evt.getNewValue());
|
311
|
332
|
substitutions.setEnabled((Boolean) evt.getNewValue());
|
|
333
|
+ advanced.setEnabled((Boolean) evt.getNewValue());
|
312
|
334
|
|
313
|
335
|
substitutions.setType(triggers.getPrimaryTrigger());
|
314
|
336
|
conditions.setActionTrigger(triggers.getPrimaryTrigger());
|