Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0126d9855e2abcf64739ce433cefe4d3168839ef (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
71
/*
 * Copyright (c) 2007 Borland Software Corporation
 * 
 * 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:
 *    bblajer (Borland) - initial API and implementation
 */

«IMPORT "http://www.eclipse.org/gmf/2006/GenModel"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
«IMPORT "http://www.eclipse.org/emf/2002/GenModel"»
«EXTENSION xpt::diagram::policies::ClassNames»

«DEFINE DiagramEditPart FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::copyright FOR editorGen»
package «editPartsPackageName»;

«EXPAND xpt::Common::generatedClassComment»
public class «editPartClassName» «EXPAND supertypes» {
	«EXPAND xpt::diagram::parts::Common::modelIDConstant-»
	«EXPAND xpt::diagram::parts::Common::visualIDConstant-»

	«EXPAND xpt::diagram::parts::Common::ctors-»

	«EXPAND xpt::diagram::parts::Common::declareViewCode-»
	«EXPAND xpt::diagram::parts::Common::registerModel-»
	«EXPAND createEditPolicies-»
	«EXPAND createFigure-»
	«EXPAND xpt::diagram::parts::Common::getAdapter-»
	«EXPAND xpt::diagram::parts::TreeEditPart::getTreeEditPartAdapter-»
	«EXPAND xpt::diagram::parts::Common::getModelChildren-»
	«EXPAND xpt::diagram::parts::refresh::refresher-»
	«EXPAND xpt::diagram::parts::Common::activate-»
	«EXPAND xpt::diagram::parts::Common::deactivate-»
	«EXPAND xpt::diagram::parts::NotationModelRefresher::all-»
	«EXPAND xpt::diagram::parts::LinkNotationModelRefresher::all-»
	«EXPAND xpt::diagram::parts::Common::getTransactionalUpdateManager-»
	«EXPAND xpt::diagram::parts::TreeEditPart::TreeEditPart-»
	«EXPAND additions-»
}
«ENDDEFINE»

«DEFINE supertypes FOR gmfgen::GenDiagram»extends org.eclipse.gef.editparts.AbstractGraphicalEditPart implements org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart«ENDDEFINE»

«DEFINE createFigure FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::generatedMemberComment»
protected org.eclipse.draw2d.IFigure createFigure() {
	org.eclipse.draw2d.IFigure f = new org.eclipse.draw2d.FreeformLayer();
	f.setBorder(new org.eclipse.draw2d.MarginBorder(5));
	f.setLayoutManager(new org.eclipse.draw2d.FreeformLayout());
	return f;
}
«ENDDEFINE»

«DEFINE createEditPolicies FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::generatedMemberComment»
protected void createEditPolicies() {
	installEditPolicy(org.eclipse.gef.EditPolicy.COMPONENT_ROLE, new org.eclipse.gef.editpolicies.RootComponentEditPolicy());
	installEditPolicy(org.eclipse.gef.EditPolicy.LAYOUT_ROLE, new «getLayoutEditPolicyQualifiedClassName()»());
	«EXPAND xpt::diagram::parts::Common::behaviour-»
	«EXPAND xpt::diagram::parts::NotationModelRefresher::installClause-»
	«EXPAND xpt::diagram::parts::LinkNotationModelRefresher::installClause-»
}
«ENDDEFINE»

«DEFINE additions FOR gmfgen::GenDiagram-»
«ENDDEFINE»

Back to the top