Don't clear config listeners on document undo
This commit is contained in:
parent
7ea17b01d2
commit
b2d19181b1
@ -46,7 +46,7 @@ public class ComponentConfigDialog extends JDialog implements ComponentChangeLis
|
|||||||
private RocketComponentConfig configurator = null;
|
private RocketComponentConfig configurator = null;
|
||||||
private boolean isModified = false;
|
private boolean isModified = false;
|
||||||
private final boolean isNewComponent;
|
private final boolean isNewComponent;
|
||||||
protected static boolean clearConfigListeners = true;
|
public static boolean clearConfigListeners = true;
|
||||||
private static String previousSelectedTab = null; // Name of the previous selected tab
|
private static String previousSelectedTab = null; // Name of the previous selected tab
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,6 +277,7 @@ public class RocketComponentConfig extends JPanel {
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
if (preferences.getBoolean(IGNORE_DISCARD_EDITING_WARNING, false)) {
|
if (preferences.getBoolean(IGNORE_DISCARD_EDITING_WARNING, false)) {
|
||||||
|
ComponentConfigDialog.clearConfigListeners = false; // Undo action => config listeners of new component will be cleared
|
||||||
ComponentConfigDialog.disposeDialog();
|
ComponentConfigDialog.disposeDialog();
|
||||||
document.undo();
|
document.undo();
|
||||||
return;
|
return;
|
||||||
@ -291,6 +292,7 @@ public class RocketComponentConfig extends JPanel {
|
|||||||
int resultYesNo = JOptionPane.showConfirmDialog(RocketComponentConfig.this, msg,
|
int resultYesNo = JOptionPane.showConfirmDialog(RocketComponentConfig.this, msg,
|
||||||
trans.get("RocketCompCfg.CancelOperation.title"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
|
trans.get("RocketCompCfg.CancelOperation.title"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
|
||||||
if (resultYesNo == JOptionPane.YES_OPTION) {
|
if (resultYesNo == JOptionPane.YES_OPTION) {
|
||||||
|
ComponentConfigDialog.clearConfigListeners = false; // Undo action => config listeners of new component will be cleared
|
||||||
ComponentConfigDialog.disposeDialog();
|
ComponentConfigDialog.disposeDialog();
|
||||||
document.undo();
|
document.undo();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user