/** * Check if the element should be removed from the model * * @param element * the element * @return <code>true</code> if it should be removed */ @SuppressWarnings("static-method") protected boolean shouldRemoveWindowFromModel(MWindow element) { return element != null && ((EObject)element).eContainer() instanceof MApplication && element.getTags().contains(TAG_REMOVE_ON_HIDE); }
public void switchPerspective(LightWeightDialogService dialogService, @Named(IServiceConstants.ACTIVE_SHELL) Stage fxWindow, MWindow window, EModelService modelService, GraphicsLoader graphicsLoader, EPartService partService) { if (window.getTags().contains("efx-lightweight-dialogs")) { //$NON-NLS-1$ LwPerspectiveSwitcherDialog dialog = new LwPerspectiveSwitcherDialog(window, modelService, graphicsLoader, partService) {
@Inject @Optional private void subscribeTopicSelectedElementChanged( @UIEventTopic(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT) Event event) { // Ensure that this event is for a MApplication if (!(event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MApplication)) { return; } MWindow win = (MWindow) event.getProperty(UIEvents.EventTags.NEW_VALUE); if ((win == null) || !win.getTags().contains("topLevel")) { //$NON-NLS-1$ return; } win.setToBeRendered(true); if (!(win.getRenderer() == WBWRenderer.this)) { return; } Shell shell = (Shell) win.getWidget(); if (shell.getMinimized()) { shell.setMinimized(false); } shell.setActive(); shell.moveAbove(null); }
public void handleEvent(Event event) { // Ensure that this event is for a MApplication if (!(event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MApplication)) return; MWindow win = (MWindow) event .getProperty(UIEvents.EventTags.NEW_VALUE); if ((win == null) || !win.getTags().contains("topLevel")) //$NON-NLS-1$ return; win.setToBeRendered(true); if (!(win.getRenderer() == WBWRenderer.this)) return; Shell shell = (Shell) win.getWidget(); if (shell.getMinimized()) { shell.setMinimized(false); } shell.setActive(); shell.moveAbove(null); } };
private void attach() { dragElement.getParent().getChildren().remove(dragElement); ((Shell) baseWindow.getWidget()).getDisplay().update(); dragWindow = MBasicFactory.INSTANCE.createWindow(); dragWindow.getTags().add(DragHostId); // define the initial location and size for the window Point cp = ((Shell) baseWindow.getWidget()).getDisplay() .getCursorLocation(); Point size = new Point(200, 200); if (dragElement.getWidget() instanceof Control) { Control ctrl = (Control) dragElement.getWidget(); size = ctrl.getSize(); } else if (dragElement.getWidget() instanceof ToolItem) { ToolItem ti = (ToolItem) dragElement.getWidget(); Rectangle bounds = ti.getBounds(); size = new Point(bounds.width + 3, bounds.height + 3); } dragWindow.setX(cp.x + xOffset); dragWindow.setY(cp.y + yOffset); dragWindow.setWidth(size.x); dragWindow.setHeight(size.y); // add the window as a child of the base window baseWindow.getWindows().add(dragWindow); getShell().layout(getShell().getChildren(), SWT.CHANGED | SWT.DEFER); getShell().setVisible(true); }
private void attach() { dragElement.getParent().getChildren().remove(dragElement); ((Shell) baseWindow.getWidget()).getDisplay().update(); dragWindow = MBasicFactory.INSTANCE.createWindow(); dragWindow.getTags().add(DragHostId); formatModel(dragWindow); // define the initial location and size for the window Point cp = ((Shell) baseWindow.getWidget()).getDisplay() .getCursorLocation(); Point size = new Point(200, 200); if (dragElement.getWidget() instanceof Control) { Control ctrl = (Control) dragElement.getWidget(); size = ctrl.getSize(); } else if (dragElement.getWidget() instanceof ToolItem) { ToolItem ti = (ToolItem) dragElement.getWidget(); Rectangle bounds = ti.getBounds(); size = new Point(bounds.width + 3, bounds.height + 3); } dragWindow.setX(cp.x + xOffset); dragWindow.setY(cp.y + yOffset); dragWindow.setWidth(size.x); dragWindow.setHeight(size.y); // add the window as a child of the base window baseWindow.getWindows().add(dragWindow); getShell().layout(getShell().getChildren(), SWT.CHANGED | SWT.DEFER); getShell().setVisible(true); }
int style = styleOverride == -1 ? SWT.SHELL_TRIM | rtlStyle : styleOverride; wbwShell = new Shell(display, style); wbwModel.getTags().add("topLevel"); //$NON-NLS-1$ } else { int style = SWT.TITLE | SWT.RESIZE | SWT.MAX | SWT.CLOSE | rtlStyle; style = styleOverride == -1 ? style : styleOverride; if (wbwModel.getTags().contains(IPresentationEngine.WINDOW_TOP_LEVEL)) { wbwShell = new Shell(display, style); } else {