本文整理汇总了Java中org.eclipse.gmf.runtime.notation.View.getEAnnotation方法的典型用法代码示例。如果您正苦于以下问题:Java View.getEAnnotation方法的具体用法?Java View.getEAnnotation怎么用?Java View.getEAnnotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gmf.runtime.notation.View
的用法示例。
在下文中一共展示了View.getEAnnotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTreeNodesPositionAnnotation
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
public static void setTreeNodesPositionAnnotation(List<View> viewElements) {
if (viewElements != null) {
for (int index = 0; index < viewElements.size(); index++) {
final View view = viewElements.get(index);
EAnnotation xmiIdAnnotation = view
.getEAnnotation(TREE_LAYOUT_ANNOTATION);
if (xmiIdAnnotation == null) {
xmiIdAnnotation = EcoreFactory.eINSTANCE
.createEAnnotation();
xmiIdAnnotation.setSource(TREE_LAYOUT_ANNOTATION);
}
xmiIdAnnotation.getDetails().put(TREE_NODE_POSITION,
Integer.toString(index));
xmiIdAnnotation.setEModelElement(view);
}
}
}
示例2: getTreeNodeParentView
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
/**
* Returns the parent view of a tree node from the parent view annotation.
*
* @param editPart
* @return
*/
public static View getTreeNodeParentView(View view) {
final EAnnotation xmiIdAnnotation = view
.getEAnnotation(TREE_LAYOUT_ANNOTATION);
if (xmiIdAnnotation != null) {
return (View) view.eResource().getEObject(
xmiIdAnnotation.getDetails().get(TREE_NODE_PARENT_URI));
}
return null;
}
示例3: setTreeNodeParentAnnotation
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
public static void setTreeNodeParentAnnotation(View child, View parent) {
EAnnotation xmiIdAnnotation = child
.getEAnnotation(TREE_LAYOUT_ANNOTATION);
if (xmiIdAnnotation == null) {
xmiIdAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
xmiIdAnnotation.setSource(TREE_LAYOUT_ANNOTATION);
}
xmiIdAnnotation.getDetails().put(TREE_NODE_PARENT_URI,
parent.eResource().getURIFragment(parent));
xmiIdAnnotation.setEModelElement(child);
}