diff --git a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/.ratings b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/.ratings index 4e2a8782dcd01a1927efbb33ae2411f72c1ee545..8d7135ba7290eb3ba9dd20179a65d5ae08da086a 100644 --- a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/.ratings +++ b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/.ratings @@ -1,5 +1,5 @@ CompositionUtils.java 34c0a191bd0fb4176c94b4d61abb5c88a679d5e8 GREEN -EMFResourceUtils.java 979d0e1f4f66a2b3e715d2da0ebef6493f547fd7 GREEN +EMFResourceUtils.java cce1077c902e76d701412c6538dd15d6cafb4763 YELLOW EcoreSerializerBase.java 0a0c2969d793d2e68094c55c8f7b0a662ef6e5d5 GREEN EcoreUtils.java 18416b5c214410a02eb35596fd807a1cc27d6b35 GREEN ExtensionPointUtils.java 7ce63242b49eb9a7cd4eaadd223f5ebce1dfd75b GREEN diff --git a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java index 979d0e1f4f66a2b3e715d2da0ebef6493f547fd7..cce1077c902e76d701412c6538dd15d6cafb4763 100644 --- a/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java +++ b/org.fortiss.tooling.kernel/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java @@ -15,6 +15,7 @@ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.utils; +import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace; import static org.fortiss.tooling.kernel.utils.LoggingUtils.error; import java.io.IOException; @@ -23,6 +24,7 @@ import java.util.Map; import org.conqat.lib.commons.collections.Pair; import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; @@ -175,4 +177,14 @@ public final class EMFResourceUtils { } return null; } + + /** Refresh the workspace. */ + public static void refreshWorkspace() { + try { + // refresh the workspace + getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null); + } catch(Exception e) { + error(ToolingKernelActivator.getDefault(), "Cannot refresh workspace!", e); + } + } }