Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d450f8939577344cb459b8606a8143b5d65b2095 (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
/*****************************************************************************
 * Copyright (c) 2009-2011 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:
 *  Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.uml.diagram.composite.custom.edit.parts;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.uml2.uml.Connector;

/**
 * Replacement edit part for Connector multiplicity source label.
 */
public class ConnectorMultiplicitySourceEditPart extends org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConnectorMultiplicitySourceEditPart {

	/**
	 * Constructor.
	 */
	public ConnectorMultiplicitySourceEditPart(View view) {
		super(view);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public EObject resolveSemanticElement() {
		if(super.resolveSemanticElement() instanceof Connector) {
			Connector connector = (Connector)super.resolveSemanticElement();
			if(connector.getEnds().size() == 2) {
				return connector.getEnds().get(0);
			}
		}

		return null;
	}
}

Back to the top