diff --git a/plugins/org.eclipse.sirius.ui.debug/src/org/eclipse/sirius/ui/debug/SiriusDebugView.java b/plugins/org.eclipse.sirius.ui.debug/src/org/eclipse/sirius/ui/debug/SiriusDebugView.java index d5f1801d5..bf877ce2f 100644 --- a/plugins/org.eclipse.sirius.ui.debug/src/org/eclipse/sirius/ui/debug/SiriusDebugView.java +++ b/plugins/org.eclipse.sirius.ui.debug/src/org/eclipse/sirius/ui/debug/SiriusDebugView.java @@ -41,6 +41,7 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ENamedElement; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.InternalEObject; @@ -84,6 +85,7 @@ import org.eclipse.sirius.diagram.AbsoluteBoundsFilter; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.sequence.SequenceDDiagram; import org.eclipse.sirius.diagram.sequence.business.internal.VerticalPositionFunction; import org.eclipse.sirius.diagram.sequence.business.internal.elements.ISequenceElement; @@ -447,12 +465,79 @@ public class SiriusDebugView extends AbstractDebugView { // addSiriusSelectionAction(); // addExtractExpressionsAction(); // addLoadResourceWithProgressAction(); - addShowPayloadAccessLogAction(); - addClearPayloadAccessLogAction(); - addShowResourceSetTopologyAction(); - addShowAdaptersAction(); - addShowSessionStructureAction(); +// addShowPayloadAccessLogAction(); +// addClearPayloadAccessLogAction(); +// addShowResourceSetTopologyAction(); +// addShowAdaptersAction(); +// addShowSessionStructureAction(); // addShowCrossReferencerMap(); + addDeferredChangeAction(); + addDeferredUnrelatedChangeAction(); + } + + private void addDeferredChangeAction() { + addAction("Deffered Change", new Runnable() { + @Override + public void run() { + EObject current = getCurrentEObject(); + if (current instanceof DSemanticDecorator + && ((DSemanticDecorator) current).getTarget() instanceof ENamedElement) { + final EClass target = (EClass) ((DSemanticDecorator) current).getTarget(); + new Thread(new Runnable() { + public void run() { + try { + Thread.sleep(6000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Session s = new EObjectQuery(target).getSession(); + if (s != null) { + TransactionalEditingDomain ted = s.getTransactionalEditingDomain(); + ted.getCommandStack().execute(new RecordingCommand(ted) { + @Override + protected void doExecute() { + //target.setName(target.getName() + "X"); + target.setInstanceClassName(target.getInstanceClassName() + "X"); + } + }); + } + } + }).start(); + } + } + }); + } + + private void addDeferredUnrelatedChangeAction() { + addAction("Deffered Change (Unrelated)", new Runnable() { + @Override + public void run() { + EObject current = getCurrentEObject(); + if (current instanceof DSemanticDecorator + && ((DSemanticDecorator) current).getTarget() instanceof ENamedElement) { + final EClass target = (EClass) ((DSemanticDecorator) current).getTarget(); + new Thread(new Runnable() { + public void run() { + try { + Thread.sleep(6000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Session s = new EObjectQuery(target).getSession(); + if (s != null) { + TransactionalEditingDomain ted = s.getTransactionalEditingDomain(); + ted.getCommandStack().execute(new RecordingCommand(ted) { + @Override + protected void doExecute() { + target.setAbstract(!target.isAbstract()); + } + }); + } + } + }).start(); + } + } + }); } private void addShowSessionStructureAction() {