carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/xpt/diagram/parts/DiagramEditPart.xpt
author cawthron
Fri, 04 Dec 2009 11:06:59 -0600
changeset 422 033392511bf7
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
422
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     1
/*
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     2
 * Copyright (c) 2007 Borland Software Corporation
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     3
 * 
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     4
 * All rights reserved. This program and the accompanying materials
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     5
 * are made available under the terms of the Eclipse Public License v1.0
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     6
 * which accompanies this distribution, and is available at
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     7
 * http://www.eclipse.org/legal/epl-v10.html
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     8
 *
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     9
 * Contributors:
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    10
 *    bblajer (Borland) - initial API and implementation
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    11
 */
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    12
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    13
«IMPORT "http://www.eclipse.org/gmf/2008/GenModel"»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    14
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    15
«IMPORT "http://www.eclipse.org/emf/2002/GenModel"»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    16
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    17
«DEFINE DiagramEditPart FOR gmfgen::GenDiagram-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    18
«EXPAND xpt::Common::copyright FOR editorGen»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    19
package «editPartsPackageName»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    20
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    21
«EXPAND xpt::Common::generatedClassComment»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    22
public class «editPartClassName» «EXPAND supertypes» {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    23
	«EXPAND xpt::diagram::parts::Common::modelIDConstant-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    24
	«EXPAND xpt::diagram::parts::Common::visualIDConstant-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    25
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    26
	«EXPAND xpt::diagram::parts::Common::ctors-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    27
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    28
	«EXPAND xpt::diagram::parts::Common::declareViewCode-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    29
	«EXPAND xpt::diagram::parts::Common::registerModel-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    30
	«EXPAND createEditPolicies-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    31
	«EXPAND createFigure-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    32
	«EXPAND getDragTracker-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    33
	«EXPAND xpt::diagram::parts::Common::getAdapter-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    34
	«EXPAND xpt::diagram::parts::TreeEditPart::getTreeEditPartAdapter-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    35
	«EXPAND xpt::diagram::parts::Common::getModelChildren-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    36
	«EXPAND xpt::diagram::parts::refresh::refresher-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    37
	«EXPAND xpt::diagram::parts::Common::activate-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    38
	«EXPAND xpt::diagram::parts::Common::deactivate-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    39
	«EXPAND xpt::diagram::parts::NotationModelRefresher::all-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    40
	«EXPAND xpt::diagram::parts::LinkNotationModelRefresher::all-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    41
	«EXPAND xpt::diagram::parts::Common::getTransactionalUpdateManager-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    42
	«EXPAND xpt::diagram::parts::TreeEditPart::TreeEditPart-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    43
	«EXPAND additions-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    44
}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    45
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    46
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    47
«DEFINE supertypes FOR gmfgen::GenDiagram»extends org.eclipse.gef.editparts.AbstractGraphicalEditPart implements org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    48
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    49
«DEFINE createFigure FOR gmfgen::GenDiagram-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    50
«EXPAND xpt::Common::generatedMemberComment»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    51
protected org.eclipse.draw2d.IFigure createFigure() {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    52
	org.eclipse.draw2d.IFigure f = new org.eclipse.draw2d.FreeformLayer();
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    53
	f.setBorder(new org.eclipse.draw2d.MarginBorder(5));
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    54
	f.setOpaque(true);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    55
	f.setLayoutManager(new org.eclipse.draw2d.FreeformLayout());
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    56
	return f;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    57
}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    58
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    59
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    60
«DEFINE getDragTracker FOR gmfgen::GenDiagram-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    61
«EXPAND xpt::Common::generatedMemberComment»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    62
public org.eclipse.gef.DragTracker getDragTracker(org.eclipse.gef.Request request) {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    63
	return new org.eclipse.gef.tools.MarqueeDragTracker() {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    64
		protected boolean handleButtonDown(int button) {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    65
			if (super.handleButtonDown(button)) {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    66
				getViewer().setSelection(org.eclipse.jface.viewers.StructuredSelection.EMPTY);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    67
				getViewer().setFocus(null);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    68
				return true;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    69
			}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    70
			return false;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    71
		}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    72
	};
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    73
}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    74
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    75
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    76
«DEFINE createEditPolicies FOR gmfgen::GenDiagram-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    77
«EXPAND xpt::Common::generatedMemberComment»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    78
protected void createEditPolicies() {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    79
	installEditPolicy(org.eclipse.gef.EditPolicy.COMPONENT_ROLE, new org.eclipse.gef.editpolicies.RootComponentEditPolicy());
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    80
	installEditPolicy(org.eclipse.gef.EditPolicy.LAYOUT_ROLE, new «EXPAND xpt::diagram::policies::LayoutEditPolicy::qualifiedClassName»());
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    81
	«EXPAND xpt::diagram::parts::Common::behaviour-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    82
	«EXPAND xpt::diagram::parts::NotationModelRefresher::installClause-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    83
	«EXPAND xpt::diagram::parts::LinkNotationModelRefresher::installClause-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    84
}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    85
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    86
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    87
«DEFINE additions FOR gmfgen::GenDiagram-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    88
«ENDDEFINE»