diff options
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/propsheet/LabelProvider.xtend')
-rw-r--r-- | plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/propsheet/LabelProvider.xtend | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/propsheet/LabelProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/propsheet/LabelProvider.xtend deleted file mode 100644 index 4a89c0aa92c..00000000000 --- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/propsheet/LabelProvider.xtend +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2007, 2010, 2013 Borland Software Corporation and others - * - * 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 - * Michael Golubev (Montages) - #386838 - migrate to Xtend2 - */ -package aspects.xpt.propsheet - -import aspects.xpt.Common -import aspects.xpt.editor.VisualIDRegistry -import aspects.xpt.providers.ElementTypes -import com.google.inject.Inject -import com.google.inject.Singleton -import org.eclipse.gmf.codegen.gmfgen.GenPropertySheet - -@Singleton class LabelProvider extends xpt.propsheet.LabelProvider { - @Inject extension Common; - - @Inject ElementTypes xptElementTypes; - @Inject VisualIDRegistry visualId; - - override def unwrapMethods(GenPropertySheet it) ''' - «generatedMemberComment» - private Object unwrap(Object element) { - if (element instanceof org.eclipse.jface.viewers.IStructuredSelection) { - return ((org.eclipse.jface.viewers.IStructuredSelection) element).getFirstElement(); - } - return element; - } - - «generatedMemberComment» - private org.eclipse.gmf.runtime.notation.View getView(Object element) { - if (element instanceof org.eclipse.gmf.runtime.notation.View) { - return (org.eclipse.gmf.runtime.notation.View) element; - } - if (element instanceof org.eclipse.core.runtime.IAdaptable) { - return (org.eclipse.gmf.runtime.notation.View) - ((org.eclipse.core.runtime.IAdaptable) element).getAdapter(org.eclipse.gmf.runtime.notation.View.class); - } - return null; - } - - «generatedMemberComment» - private org.eclipse.gmf.runtime.emf.type.core.IElementType getElementType(org.eclipse.gmf.runtime.notation.View view) { - // For intermediate views climb up the containment hierarchy to find the one associated with an element type. - while (view != null) { - String vid = «visualId.qualifiedClassName(editorGen.diagram)».getVisualID(view); - org.eclipse.gmf.runtime.emf.type.core.IElementType etype = - «xptElementTypes.qualifiedClassName(editorGen.diagram)».getElementType(vid); - if (etype != null) { - return etype; - } - view = view.eContainer() instanceof org.eclipse.gmf.runtime.notation.View ? - (org.eclipse.gmf.runtime.notation.View) view.eContainer() : null; - } - return null; - } - ''' - -} |