| /* |
| * Copyright (c) 2007, 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: |
| * Alexander Shatalin (Borland) - initial API and implementation |
| */ |
| |
| «IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'» |
| |
| «DEFINE ShortcutPropertyTester FOR gmfgen::GenDiagram-» |
| «EXPAND xpt::Common::copyright FOR editorGen-» |
| package «editorGen.editor.packageName»; |
| |
| «EXPAND xpt::Common::generatedClassComment» |
| public class «shortcutPropertyTesterClassName» extends org.eclipse.core.expressions.PropertyTester { |
| |
| «EXPAND attributes-» |
| |
| «EXPAND test-» |
| |
| «EXPAND additions-» |
| } |
| «ENDDEFINE» |
| |
| «DEFINE attributes FOR gmfgen::GenDiagram-» |
| «EXPAND xpt::Common::generatedMemberComment» |
| protected static final String SHORTCUT_PROPERTY = "isShortcut"; «EXPAND xpt::Common::nonNLS» |
| «ENDDEFINE» |
| |
| «DEFINE test FOR gmfgen::GenDiagram-» |
| «EXPAND xpt::Common::generatedMemberComment» |
| public boolean test(Object receiver, String method, Object[] args, Object expectedValue) { |
| if (false == receiver instanceof org.eclipse.gmf.runtime.notation.View) { |
| return false; |
| } |
| org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) receiver; |
| if (SHORTCUT_PROPERTY.equals(method)) { |
| org.eclipse.emf.ecore.EAnnotation annotation = view.getEAnnotation("Shortcut"); «EXPAND xpt::Common::nonNLS» |
| if (annotation != null) { |
| return «EXPAND xpt::editor::VisualIDRegistry::modelID».equals(annotation.getDetails().get("modelID")); «EXPAND xpt::Common::nonNLS» |
| } |
| } |
| return false; |
| } |
| «ENDDEFINE» |
| |
| «DEFINE additions FOR gmfgen::GenDiagram-» |
| «ENDDEFINE» |