Java Code Examples for org.eclipse.emf.ecore.util.EcoreUtil.delete()

The following are Jave code examples for showing how to use delete() of the org.eclipse.emf.ecore.util.EcoreUtil class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: gemoc-studio-modeldebugging   File: ThreadUtils.java   View Source Code Vote up 5 votes
/**
 * Notify popping the {@link Thread#getTopStackFrame() top stack frame} of the given {@link Thread}.
 * 
 * @param thread
 *            the {@link Thread}
 * @return the popped {@link StackFrame}
 */
public static StackFrame popStackFrameReply(Thread thread) {
	final StackFrame res;
	if (ThreadUtils.canPopFrame(thread)) {
		final StackFrame topStackFrame = thread.getTopStackFrame();
		thread.setTopStackFrame(topStackFrame.getParentFrame());
		EcoreUtil.delete(topStackFrame); // TODO optimize with cross referencer
		res = topStackFrame;
	} else {
		throw new IllegalStateException(
				"can't pop a stack frame when the debug target is not connected or the thread is not suspended.");
	}
	return res;
}
 
Example 2
Project: Tarski   File: TraceManager.java   View Source Code Vote up 5 votes
public boolean deleteEObject(String sigType, String relativeObjectURI)
    throws IOException, TraceException {
  EObject eObject = findEObject(sigType, relativeObjectURI);
  if (eObject != null) {
    Resource eResource = eObject.eResource();
    EcoreUtil.delete(eObject);
    eResource.save(null);
    return true;
  }
  return false;
}
 
Example 3
Project: OCCI-Studio   File: DesignServices.java   View Source Code Vote up 4 votes
public void deleteElement(EObject eo) {
	EcoreUtil.delete(eo);
}
 
Example 4
Project: gemoc-studio-modeldebugging   File: ThreadUtils.java   View Source Code Vote up 3 votes
/**
 * Notify the deletion of the {@link Variable} with the given {@link Variable#getName() name} in the given
 * {@link Thread}.
 * 
 * @param thread
 *            the {@link Thread}
 * @param name
 *            the {@link Variable#getName() variable name}
 */
public static void deleteVariableReply(Thread thread, String name) {
	final Variable variable = getVariable(thread, name);
	if (variable != null) {
		EcoreUtil.delete(variable); // TODO optimize with a cross referencer
	}
}