public void handleEvent(Event event) { minimizedElement.getTags().remove(IPresentationEngine.MINIMIZED); partService.activate(selectedPart); } });
public void handleEvent(Event event) { if (event.character == SWT.ESC) { showStack(false); partService.requestActivation(); } } };
private boolean hidePart(MPart part, boolean save, boolean confirm, boolean force, boolean local) { if (!partService.getParts().contains(part)) { if (local) { return false; if (partService.savePart(part, confirm)) { partService.hidePart(part, force); return true; partService.hidePart(part, force); return true; partService.hidePart(part, force); return true; partService.hidePart(part, force); return true;
if (saveHandler != null) { final List<MPart> toPrompt = new ArrayList<>(others); toPrompt.retainAll(partService.getDirtyParts()); partService.hidePart(other); if (partService.savePart(otherPart, true)) partService.hidePart(otherPart);
restoreItem.addListener(SWT.Selection, event -> { minimizedElement.getTags().remove(IPresentationEngine.MINIMIZED); partService.activate(selectedPart); }); MenuItem closeItem = new MenuItem(trimStackMenu, SWT.NONE); closeItem.setText(Messages.TrimStack_CloseText); closeItem.addListener(SWT.Selection, event -> partService.hidePart(selectedPart));
public void widgetSelected(SelectionEvent e) { ToolItem toolItem = (ToolItem) e.widget; MUIElement uiElement = (MUIElement) toolItem.getData(); // Clicking on the already showing item ? NOTE: the selection will already have been // turned off by the time the event arrives if (!toolItem.getSelection()) { partService.requestActivation(); showStack(false); return; } if (uiElement instanceof MPart) { partService.activate((MPart) uiElement); } else if (uiElement instanceof MPerspective) { uiElement.getParent().setSelectedElement(uiElement); } showStack(true); }
public void handleEvent(Event event) { partService.hidePart(selectedPart); } });
private void unsplitPart(MCompositePart compositePart) { if (compositePart == null) { return; } List<MPart> innerElements = ms.findElements(compositePart, null, MPart.class, null); if (innerElements.size() < 3) { return; } MPart originalEditor = innerElements.get(1); // '0' is the composite part // Close the cloned editor *before* removing it from the model MPart clonedEditor = innerElements.get(2); clonedEditor.setToBeRendered(false); MElementContainer<MUIElement> compParent = compositePart.getParent(); int index = compParent.getChildren().indexOf(compositePart); compParent.getChildren().remove(compositePart); originalEditor.getParent().getChildren().remove(originalEditor); compParent.getChildren().add(index, originalEditor); if (ps.getActivePart() == originalEditor) { ps.activate(null); } ps.activate(originalEditor); }
partService.showPart(((EditorReference) editorReferences[0]).getModel(), PartState.VISIBLE); partService.showPart(editor, PartState.VISIBLE); if (activate) { partService.activate(editor); } else { updateActiveEditorSources(editor); MPart editor = partService.createPart(CompatibilityEditor.MODEL_ELEMENT_ID); editor.getTags().add(editorId); EditorReference ref = createEditorReferenceForPart(editor, input, editorId, editorState); partService.showPart(editor, PartState.VISIBLE); partService.activate(editor); } else { updateActiveEditorSources(editor);
partService.activate((MPart) curSel); } else if (curSel instanceof MPlaceholder) { MPlaceholder ph = (MPlaceholder) curSel; if (ph.getRef() instanceof MPart) { partService.activate((MPart) ph.getRef()); List<MPart> parts = modelService.findElements(area, null, MPart.class, null); for (MPart part : parts) { if (partService.isPartVisible(part)) { partToActivate = part; break; partService.activate(partToActivate); if (ph.getRef() instanceof MPart) { MPart part = (MPart) ph.getRef(); partService.activate(part);
matchFlags); if (existingEditors.length == 0) { MPart editor = partService.createPart(CompatibilityEditor.MODEL_ELEMENT_ID); references[i] = createEditorReferenceForPart(editor, curInput, curEditorID, null); partService.activate(editorToActivate);
@Override protected void okPressed() { if (this.perspectiveToOpen != null) { super.okPressed(); this.partService.switchPerspective(this.perspectiveToOpen); } } }
private MPart showPart(int mode, MPart part) { switch (mode) { case VIEW_ACTIVATE: partService.showPart(part, PartState.ACTIVATE); if (part.getObject() instanceof CompatibilityView) { CompatibilityView compatibilityView = (CompatibilityView) part.getObject(); MPart activePart = partService.getActivePart(); if (activePart == null) { partService.showPart(part, PartState.ACTIVATE); if (part.getObject() instanceof CompatibilityView) { CompatibilityView compatibilityView = (CompatibilityView) part.getObject(); MUIElement activePartParent = activePlaceholder == null ? activePart .getParent() : activePlaceholder.getParent(); partService.showPart(part, PartState.CREATE); if (part.getCurSharedRef() == null || part.getCurSharedRef().getParent() != activePartParent) { partService.bringToTop(part); partService.showPart(part, PartState.CREATE);
@Override public boolean savePart(MPart part, boolean confirm) { return getActiveWindowService().savePart(part, confirm); }
@Override public IWorkbenchPart getActivePart() { if (partService == null) { return null; } MPart part = partService.getActivePart(); return getWorkbenchPart(part); }
@Override public boolean saveAll(boolean confirm) { return getActiveWindowService().saveAll(confirm); }
/** * See IWorkbenchPage. */ @Override public boolean isPartVisible(IWorkbenchPart part) { MPart mpart = findPart(part); return mpart == null ? false : partService.isPartVisible(mpart); }
@Override public void widgetSelected(SelectionEvent e) { ToolItem toolItem = (ToolItem) e.widget; MUIElement uiElement = (MUIElement) toolItem.getData(); // Clicking on the already showing item ? NOTE: the selection will already have been // turned off by the time the event arrives if (!toolItem.getSelection()) { partService.requestActivation(); showStack(false); return; } if (uiElement instanceof MPart) { partService.activate((MPart) uiElement); } else if (uiElement instanceof MPerspective) { uiElement.getParent().setSelectedElement(uiElement); } showStack(true); }
@Override public void hidePart(MPart part, boolean force) { getActiveWindowService().hidePart(part, force); }