Added "Renumber On Paste" option in the "Config" menu

This commit is contained in:
bancika
2020-03-25 20:55:06 +01:00
parent e429f65ed2
commit ec0d2a686c
8 changed files with 19 additions and 10 deletions
@@ -411,7 +411,7 @@ public class ActionFactory {
presenter.loadProjectFromFile(file.getAbsolutePath());
// Grab all components and paste them into the main
// presenter
plugInPort.pasteComponents(presenter.getCurrentProject().getComponents(), false);
plugInPort.pasteComponents(presenter.getCurrentProject().getComponents(), false, false);
// Cleanup components in the temp presenter, don't need
// them anymore
presenter.selectAll(0);
@@ -1107,7 +1107,7 @@ public class ActionFactory {
try {
List<IDIYComponent<?>> components =
(List<IDIYComponent<?>>) clipboard.getData(ComponentTransferable.listFlavor);
plugInPort.pasteComponents(cloneComponents(components), false);
plugInPort.pasteComponents(cloneComponents(components), false, ConfigurationManager.getInstance().readBoolean(Presenter.RENUMBER_ON_PASTE_KEY, true));
} catch (Exception ex) {
LOG.error("Coule not paste.", ex);
}
@@ -94,6 +94,9 @@ public class ConfigPlugin implements IPlugIn {
swingUI.injectMenuAction(
ActionFactory.getInstance().createConfigAction(plugInPort, "Outline Mode", IPlugInPort.OUTLINE_KEY, false),
CONFIG_MENU);
swingUI.injectMenuAction(
ActionFactory.getInstance().createConfigAction(plugInPort, "Renumber On Paste", IPlugInPort.RENUMBER_ON_PASTE_KEY, true),
CONFIG_MENU);
swingUI.injectMenuAction(
ActionFactory.getInstance().createConfigAction(plugInPort, "Show Rulers", IPlugInPort.SHOW_RULERS_KEY, true),
CONFIG_MENU);