|
@@ -100,7 +100,7 @@ public final class ActionsManagerDialog extends StandardDialog implements
|
100
|
100
|
/** Group panel. */
|
101
|
101
|
private JPanel groupPanel;
|
102
|
102
|
/** Are we saving? */
|
103
|
|
- private AtomicBoolean saving = new AtomicBoolean(false);
|
|
103
|
+ private final AtomicBoolean saving = new AtomicBoolean(false);
|
104
|
104
|
|
105
|
105
|
/**
|
106
|
106
|
* Creates a new instance of ActionsManagerDialog.
|
|
@@ -322,8 +322,7 @@ public final class ActionsManagerDialog extends StandardDialog implements
|
322
|
322
|
delGroup();
|
323
|
323
|
} else if (e.getSource() == getOkButton() || e.getSource()
|
324
|
324
|
== getCancelButton()) {
|
325
|
|
- if (!saving.get()) {
|
326
|
|
- saving.set(true);
|
|
325
|
+ if (!saving.getAndSet(true)) {
|
327
|
326
|
if (ActionEditorDialog.isOpen()) {
|
328
|
327
|
if (JOptionPane.showConfirmDialog(this,
|
329
|
328
|
"The action editor is currently open, do you want to cotinue and lose any unsaved changes?",
|
|
@@ -367,8 +366,7 @@ public final class ActionsManagerDialog extends StandardDialog implements
|
367
|
366
|
/** {@inheritDoc} */
|
368
|
367
|
@Override
|
369
|
368
|
public boolean save() {
|
370
|
|
- if (!saving.get()) {
|
371
|
|
- saving.set(true);
|
|
369
|
+ if (!saving.getAndSet(true)) {
|
372
|
370
|
if (getText() == null || getText().isEmpty() && !ActionManager.
|
373
|
371
|
getGroups().
|
374
|
372
|
containsKey(getText())) {
|
|
@@ -416,8 +414,7 @@ public final class ActionsManagerDialog extends StandardDialog implements
|
416
|
414
|
/** {@inheritDoc} */
|
417
|
415
|
@Override
|
418
|
416
|
public boolean save() {
|
419
|
|
- if (!saving.get()) {
|
420
|
|
- saving.set(true);
|
|
417
|
+ if (!saving.getAndSet(true)) {
|
421
|
418
|
if (getText() == null || getText().isEmpty()) {
|
422
|
419
|
return false;
|
423
|
420
|
} else {
|