From 75ebf41374917462da4c8a3985e35feaf09c6e39 Mon Sep 17 00:00:00 2001 From: Christian Femers Date: Mon, 14 Oct 2019 22:40:00 +0200 Subject: [PATCH] Allow to add nature and configure in one step --- .../plugin/nature/AddMograsimNatureHandler.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/AddMograsimNatureHandler.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/AddMograsimNatureHandler.java index aa5d5d61..900fc9df 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/AddMograsimNatureHandler.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/AddMograsimNatureHandler.java @@ -85,4 +85,20 @@ public class AddMograsimNatureHandler extends AbstractHandler return status; } + + /** + * Adds Mograsim nature on a project + * + * @param project to have Mograsim nature + * @return + */ + public static IStatus addNatureAndConfigure(IProject project, String machineId) throws CoreException + { + IStatus result = addNature(project); + if (result.getSeverity() > IStatus.INFO) + return result; + MachineContext mc = ProjectMachineContext.getMachineContextOf(project); + mc.setMachineId(machineId); + return result; + } } \ No newline at end of file -- 2.17.1