EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.usage.helper]

COVERAGE SUMMARY FOR SOURCE FILE [CreateLoopIterationsEditHelperAdvice.java]

nameclass, %method, %block, %line, %
CreateLoopIterationsEditHelperAdvice.java0%   (0/2)0%   (0/4)0%   (0/86)0%   (0/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CreateLoopIterationsEditHelperAdvice0%   (0/1)0%   (0/2)0%   (0/12)0%   (0/3)
CreateLoopIterationsEditHelperAdvice (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getAfterConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/9)0%   (0/2)
     
class CreateLoopIterationsEditHelperAdvice$10%   (0/1)0%   (0/2)0%   (0/74)0%   (0/18)
CreateLoopIterationsEditHelperAdvice$1 (CreateLoopIterationsEditHelperAdvice,... 0%   (0/1)0%   (0/10)0%   (0/2)
doExecuteWithResult (IProgressMonitor, IAdaptable): CommandResult 0%   (0/1)0%   (0/64)0%   (0/16)

1package de.uka.ipd.sdq.pcm.gmf.usage.helper;
2 
3import org.eclipse.core.commands.ExecutionException;
4import org.eclipse.core.runtime.IAdaptable;
5import org.eclipse.core.runtime.IProgressMonitor;
6import org.eclipse.gmf.runtime.common.core.command.CommandResult;
7import org.eclipse.gmf.runtime.common.core.command.ICommand;
8import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
9import org.eclipse.gmf.runtime.emf.type.core.IElementType;
10import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
11import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
12import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
13import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
14import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
15import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
16import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
17import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
18 
19import de.uka.ipd.sdq.pcm.usagemodel.UsagemodelPackage;
20import de.uka.ipd.sdq.stoex.StoexPackage;
21 
22public class CreateLoopIterationsEditHelperAdvice extends
23                AbstractEditHelperAdvice implements IEditHelperAdvice {
24 
25        /*
26         * (non-Javadoc)
27         * 
28         * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
29         */
30        @Override
31        protected ICommand getAfterConfigureCommand(final ConfigureRequest request) {
32                ConfigureElementCommand confElementReq = new ConfigureElementCommand(request) {
33 
34                        @Override
35                        protected CommandResult doExecuteWithResult(
36                                        IProgressMonitor monitor, IAdaptable info)
37                                        throws ExecutionException {
38 
39                                IElementType elementType = ElementTypeRegistry.getInstance().
40                                                        getType("de.uka.ipd.sdq.pcm.gmf.seff.PCMRandomVariable_9000");
41                                CreateElementRequest createRequest = new CreateElementRequest(request.getElementToConfigure(),elementType);
42                                CreateElementCommand createCommand = new CreateElementCommand(createRequest);
43                                createCommand.execute(monitor, info);
44                                
45                                SetRequest setSpecReq = new SetRequest(createCommand.getNewElement(),
46                                                StoexPackage.eINSTANCE.getRandomVariable_Specification(),
47                                                "1");
48                                SetValueCommand setRndVarCmd = new SetValueCommand(setSpecReq);
49                                setRndVarCmd.execute(monitor, info);
50                                
51                                SetRequest setRequest = new SetRequest(request.getElementToConfigure(), 
52                                                UsagemodelPackage.eINSTANCE.getLoop_LoopIteration_Loop(),
53                                                createCommand.getNewElement());
54                                SetValueCommand cmd = new SetValueCommand(setRequest);
55                                cmd.execute(monitor, info);
56                                
57                                return CommandResult.newOKCommandResult();
58                        }
59                        
60                };
61                return confElementReq;
62        }
63}

[all classes][de.uka.ipd.sdq.pcm.gmf.usage.helper]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov