From: Christian Femers Date: Mon, 14 Oct 2019 20:40:00 +0000 (+0200) Subject: Allow to add nature and configure in one step X-Git-Url: https://mograsim.net/gitweb/?p=Mograsim.git;a=commitdiff_plain;h=75ebf41374917462da4c8a3985e35feaf09c6e39 Allow to add nature and configure in one step --- 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