本文整理汇总了Java中org.eclipse.e4.ui.model.application.ui.MUIElement.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java MUIElement.getParent方法的具体用法?Java MUIElement.getParent怎么用?Java MUIElement.getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.ui.model.application.ui.MUIElement
的用法示例。
在下文中一共展示了MUIElement.getParent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getArea
import org.eclipse.e4.ui.model.application.ui.MUIElement; //导入方法依赖的package包/类
private MArea getArea(MPart containerPart) {
MUIElement targetParent = containerPart.getParent();
while (!(targetParent instanceof MArea))
targetParent = targetParent.getParent();
MArea area = (MArea) targetParent;
return area;
}
示例2: setWindowSelectedElement
import org.eclipse.e4.ui.model.application.ui.MUIElement; //导入方法依赖的package包/类
/**
* Recursively sets the active selection to the element until it reaches the
* containing window.
*
* @param element the new selected element
*/
public static void setWindowSelectedElement(MUIElement element) {
MElementContainer<MUIElement> parent = element.getParent();
parent.setSelectedElement(element);
if (!((MUIElement) parent instanceof MWindow))
setWindowSelectedElement(parent);
}
示例3: isSelectedElement
import org.eclipse.e4.ui.model.application.ui.MUIElement; //导入方法依赖的package包/类
/**
* Recursively checks if the active selection of the parent is the <tt>element</tt>,
* until the containing window element is reached. Returns true if the selected
* element is the parameter in the window and false otherwise.
*
* @param element the model element to check
* @return true if the model element is the selected element
* false otherwise
*/
public static boolean isSelectedElement(MUIElement element) {
MElementContainer<MUIElement> parent = element.getParent();
if (parent.getSelectedElement() == element) {
if (!((MUIElement) parent instanceof MWindow))
return isSelectedElement(parent);
else
return true;
}
return false;
}