Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4e2e290bd516d93fbd413db52050daa66ca2ce4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*****************************************************************************
 * Copyright (c) 2016 CEA LIST and others.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   J�r�mie TATIBOUET (CEA LIST) - Initial API and implementation
 *   S�bastien REVOL (CEA LIST) - Initial API and implementation
 *   Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
 *   
 *****************************************************************************/

package org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.intermediateactions;

import org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.AbstractActionPinUpdater;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.OutputPin;
import org.eclipse.uml2.uml.ReadSelfAction;
import org.eclipse.uml2.uml.UMLFactory;

/**
 * 
 * Pin of ReadSelfAction should be create and update automatically
 * 
 */
public class ReadSelfActionPinUpdater extends AbstractActionPinUpdater<ReadSelfAction> {

	/**
	 * @see org.eclipse.papyrus.uml.diagram.activity.edit.utils.updater.IPinUpdater#updatePins(org.eclipse.uml2.uml.ActivityNode)
	 *
	 * @param node
	 */
	@Override
	public void updatePins(ReadSelfAction node) {
		// 1] create the result pin
		// the type of the result output pin is the "context"
		if (node != null) {
			node.setName("this");
			OutputPin result = UMLFactory.eINSTANCE.createOutputPin();
			result.setName("result");
			result.setLower(1);
			result.setUpper(1);
			Activity container = node.getActivity();
			if (container != null) {
				result.setType(container.getContext());
			}
			node.setResult(result);
		}
	}

}

Back to the top