Reworked some parts of the MachineContext to make its status clear.
[Mograsim.git] / plugins / net.mograsim.plugin.core / src / net / mograsim / plugin / nature / ProjectContextEvent.java
index 059b3ea..8de9a3c 100644 (file)
@@ -1,5 +1,7 @@
 package net.mograsim.plugin.nature;
 
+import java.util.Optional;
+
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResourceChangeEvent;
 
@@ -49,5 +51,18 @@ public class ProjectContextEvent
                                return null;
                        }
                }
+
+               Optional<MachineContextStatus> getForcedStatus()
+               {
+                       switch (this)
+                       {
+                       case CLOSE:
+                               return Optional.of(MachineContextStatus.CLOSED);
+                       case DELETE:
+                               return Optional.of(MachineContextStatus.DEAD);
+                       default:
+                               return Optional.empty();
+                       }
+               }
        }
 }
\ No newline at end of file