blob: 297eab2205805528cd403fc0068ecee5ed29eb75 [file] [log] [blame]
/**
* Copyright (c) 2009 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:
* Artem Tikhomirov (Borland) - initial API and implementation
*/
modeltype GMFMAP uses mappings('http://www.eclipse.org/gmf/2006/mappings');
modeltype GMFGEN uses gmfgen('http://www.eclipse.org/gmf/2009/GenModel');
transformation Actions(in mapModel : GMFMAP, inout gmfgenModel : GMFGEN);
main() {
var canvasMapping := mapModel.rootObjects()![GMFMAP::Mapping].diagram;
var genEditor := gmfgenModel.rootObjects()![GMFGEN::GenEditorGenerator];
var diagramContextMenu := genEditor.diagram.map contextMenu();
genEditor.contextMenus += diagramContextMenu;
if genEditor.diagram.generateCreateShortcutAction() then diagramContextMenu.items += object GMFGEN::CreateShortcutAction {} endif;
diagramContextMenu.items += object GMFGEN::LoadResourceAction {};
}
mapping GMFGEN::GenCommonBase::contextMenu() : GMFGEN::GenContextMenu {
result._context := OrderedSet { self };
}