Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 62742d5d2b49126f13764b9397c07432a88de597 (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
/*****************************************************************************
 * Copyright (c) 2009 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.parts;

import java.util.Collections;
import java.util.List;

import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.part.ICustomDiagramUpdater;

/**
 * <pre>
 * This class provides a custom implementation for the method 
 * resolving the semantic children of a Property (as viewed in a
 * structured classifier) in {@link UMLDiagramUpdater}.
 * </pre>
 */
public class PropertyDiagramUpdater implements ICustomDiagramUpdater {

	/**
	 * <pre>
	 * The original generated method of {@link UMLDiagramUpdater} class is kept commented below.
	 * 
	 * In the CompositeStructure Diagram, Port may be shown graphically attached to 
	 * a Property. This is only possible if the Property is typed by the StructuredClassifier
	 * that owns the Port.
	 * 
	 * In order to implement this in GMF, the Port is declared as an affixed child for both
	 * StructuredClassifier and Property, but as the Port is not contained by Property, the 
	 * Property related getSemanticChildren is not generated properly. 
	 * 
	 * FIXME : Not sure whether the {@link UMLDiagramUpdater} class is really needed by Papyrus
	 * 
	 * {@inheritDoc}
	 * </pre>
	 */
	public List<?> getSemanticChildren(View view) {

		return Collections.EMPTY_LIST;

		// if (!view.isSetElement()) {
		// return Collections.EMPTY_LIST;
		// }
		//
		// Property modelElement = (Property) view.getElement();
		// List<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
		// for (Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
		// Property childElement = (Property) it.next();
		// int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
		// if (visualID == PortEditPart.VISUAL_ID) {
		// result.add(new UMLNodeDescriptor(childElement, visualID));
		// continue;
		// }
		// }
		// return result;
	}
}

Back to the top