本文整理汇总了Java中org.eclipse.e4.ui.model.application.ui.basic.MStackElement类的典型用法代码示例。如果您正苦于以下问题:Java MStackElement类的具体用法?Java MStackElement怎么用?Java MStackElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MStackElement类属于org.eclipse.e4.ui.model.application.ui.basic包,在下文中一共展示了MStackElement类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOpenedEditors
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
public static HashSet<MPart> getOpenedEditors(){
EModelService modelService = CloudscaleContext.getGlobalContext().get(EModelService.class);
MApplication app = CloudscaleContext.getGlobalContext().get(MApplication.class);
if(modelService == null){
throw new IllegalSelectorException();
}
if(app == null){
throw new IllegalSelectorException();
}
HashSet<MPart> out = new HashSet<MPart>();
MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", app);
for(MStackElement el : stack.getChildren()){
if(el instanceof MPart){
MPart part = (MPart)el;
if(part.getContext() != null){
out.add(part);
}
}
}
return out;
}
示例2: activate
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
@Execute
void activate(final EPartService inPartService,
final EModelService inModelService, final MApplication inApplication) {
// get browser stack
final MPartStack lStack = (MPartStack) inModelService.find(
RelationsConstants.PART_STACK_BROWSERS, inApplication);
final Iterator<MStackElement> lParts = lStack.getChildren().iterator();
// iterate over children
while (lParts.hasNext()) {
final MStackElement lElement = lParts.next();
if (lElement instanceof MPart) {
final MPart lPart = (MPart) lElement;
// activate visible
if (inPartService.isPartVisible(lPart)) {
inPartService.activate(lPart, true);
break;
}
}
}
}
示例3: setActiveTerminology
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
private void setActiveTerminology( EModelService modelService, MApplication application) {
MPartStack stack = (MPartStack) modelService.find(TermSuiteUI.UI_MAIN_PART_STACK, application);
MStackElement element = stack.getSelectedElement();
if(element != null && element instanceof MPart) {
MPart activePart = (MPart) element;
if(activePart.getObject() instanceof TerminologyPart)
updateActiveTerminology((activePart.getContext().get(ETerminology.class)));
}
}
示例4: getPartStack
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
private MPartStack getPartStack(MPart childPart) {
MStackElement stackElement = childPart;
MPartStack newStack = BasicFactoryImpl.eINSTANCE.createPartStack();
newStack.getChildren().add(stackElement);
newStack.setSelectedElement(stackElement);
return newStack;
}
示例5: getOppositePart
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
@Override
public MPart getOppositePart(MPart activePart) {
MPart visiblePart = null;
if (activePart != null) {
// find opposite panel
String oppositePanelId = getPanelId(activePart, PartCopyType.COPY);
MUIElement oppositePanel = modelService.find(oppositePanelId, application);
if (oppositePanel instanceof MPartStack) {
for (MStackElement elem : ((MPartStack) oppositePanel).getChildren()) {
if (elem instanceof MPart) {
MPart part = (MPart) elem;
// get opposite visible part
if (partService.isPartVisible(part)) {
visiblePart = part;
if (log.isDebugEnabled()) {
log.debug("tab number {} - oposite tab number {}", //$NON-NLS-1$
tabService.getTabId(activePart), tabService.getTabId(visiblePart));
}
break;
}
}
}
}
}
return visiblePart;
}
示例6: getOpenedAlternatives
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
public static HashSet<IEditorInputResource> getOpenedAlternatives(){
EModelService modelService = CloudscaleContext.getGlobalContext().get(EModelService.class);
MApplication app = CloudscaleContext.getGlobalContext().get(MApplication.class);
if(modelService == null){
throw new IllegalSelectorException();
}
if(app == null){
throw new IllegalSelectorException();
}
HashSet<IEditorInputResource> out = new HashSet<IEditorInputResource>();
MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", app);
for(MStackElement el : stack.getChildren()){
if(el instanceof MPart){
MPart part = (MPart)el;
if(part.getContext() != null){
IEditorInputResource alternative = part.getContext().get(IEditorInputResource.class);
if(alternative != null){
out.add(alternative);
}
}
}
}
return out;
}
示例7: getStack
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
/**
* Wrap the editor (MPart) up in a new PartStack
* @param apart
* @return the wrapped MPart
*/
private MPartStack getStack(MPart apart, MElementContainer<MUIElement> parent) {
MPartStack result = MBasicFactory.INSTANCE.createPartStack();
MStackElement stackElement = (MStackElement) apart;
parent.getChildren().remove(apart);
result.getChildren().add(stackElement);
result.setSelectedElement(stackElement);
return result;
}
示例8: isViewInsideFastview
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
private static boolean isViewInsideFastview(MPartStack stack, String placeholderId){
if (stack != null) {
for (MStackElement stackElement : stack.getChildren()) {
if (stackElement.getElementId().equals(placeholderId)) {
return true;
}
}
}
return false;
}
示例9: caseStackElement
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
@Override
public Adapter caseStackElement(MStackElement object) {
return createStackElementAdapter();
}
示例10: caseStackElement
import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
/**
* Returns the result of interpreting the object as an instance of '<em>Stack Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Stack Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStackElement(MStackElement object) {
return null;
}