Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 62fad89c3bd8f0b2ec99dbfdee48a4ba3a0e9e5b (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*****************************************************************************
 * Copyright (c) 2008 CEA LIST.
 *
 *
 * 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:
 *  Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.stereotype.display.command;

import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.stereotype.display.helper.StereotypeDisplayCommandExecution;
import org.eclipse.papyrus.uml.diagram.common.stereotype.display.helper.StereotypeDisplayUtil;
import org.eclipse.uml2.uml.Stereotype;

/**
 * The Class AddQNAppliedStereotypeToDisplayCommand used to set the list of applied stereotype to
 * display with the qualifiedName.
 */
public class AddAppliedQNStereotypeToDisplayCommand extends RecordingCommand {


	private Stereotype stereotype;

	private View view;
	private TransactionalEditingDomain domain;
	private String depth;

	private static StereotypeDisplayUtil helper = StereotypeDisplayUtil.getInstance();
	private static StereotypeDisplayCommandExecution commandHelper = StereotypeDisplayCommandExecution.getInstance();


	/**
	 * Instantiates a new sets the applied stereotype to display command.
	 *
	 * @param domain
	 *            the domain
	 * @param object
	 *            the object
	 * @param stereotypeList
	 *            the stereotype list
	 */
	public AddAppliedQNStereotypeToDisplayCommand(final TransactionalEditingDomain domain, final View view,
			final Stereotype stereotype, final String depth) {
		super(domain, "Display Stereotype with Qualified Name");
		this.depth = depth;
		this.domain = domain;
		this.view = view;
		this.stereotype = stereotype;
	}


	/**
	 * {@inheritDoc}
	 */
	@Override
	protected void doExecute() {
		View label = helper.getStereotypeLabel(view, stereotype);
		commandHelper.setUserDepth(domain, stereotype, label, "full");

	}

}

Back to the top