private static void trace(String msg, Widget menu, MMenu menuModel) { WorkbenchSWTActivator.trace(Policy.MENUS, msg + ": " + menu + ": " //$NON-NLS-1$ //$NON-NLS-2$ + menuModel, null); }
/** * Return the dialog store to cache values into */ protected IDialogSettings getDialogSettings() { IDialogSettings workbenchSettings = WorkbenchSWTActivator.getDefault().getDialogSettings(); IDialogSettings section = workbenchSettings.getSection(DIALOG_SETTING_SECTION_NAME); if (section == null) { section = workbenchSettings.addNewSection(DIALOG_SETTING_SECTION_NAME); } return section; }
protected void initRenderer(AbstractPartRenderer renderer) { renderer.init(context); ContextInjectionFactory.inject(renderer, context); }
void maximize(final MUIElement element) { if (!element.isToBeRendered()) { return; } List<MUIElement> elementsToMinimize = getElementsToMinimize(element); Shell hostShell = (Shell) modelService.getTopLevelWindowFor(element).getWidget(); MWindow win = MinMaxAddonUtil.getWindowFor(element); if (hostShell != null) { FaderAnimationFeedback fader = new FaderAnimationFeedback(hostShell); AnimationEngine engine = new AnimationEngine(win.getContext(), fader, 300); engine.schedule(); } // Restore any currently maximized element restoreMaximizedElement(element, win); for (MUIElement toMinimize : elementsToMinimize) { toMinimize.getTags().add(MINIMIZED); toMinimize.getTags().add(MINIMIZED_BY_ZOOM); } adjustCTFButtons(element); MinMaxAddonUtil.maximizeMinMaxChildrenArea(this, element); }
private boolean getInitialMRUValue(Control control) { boolean result = false; CSSRenderingUtils util = context.get(CSSRenderingUtils.class); if (util == null) return result; CSSValue value = util.getCSSValue(control, "MPartStack", "swt-mru-visible"); //$NON-NLS-1$ //$NON-NLS-2$ if (value == null) { value = util.getCSSValue(control, "MPartStack", "mru-visible"); //$NON-NLS-1$ //$NON-NLS-2$ } if (value == null) return result; return Boolean.parseBoolean(value.getCssText()); }
private void registerE4Support() { if (menuModel.getWidget() == null && menu.getMenu() != null) { MenuService.registerMenu(menu.getMenu().getParent(), menuModel, context); } } // getMenuId() added by Dan Rubel (dan_rubel@instantiations.com)
private static void trace(String msg, Widget menu, MMenu menuModel) { WorkbenchSWTActivator.trace(Policy.DEBUG_MENUS_FLAG, msg + ": " + menu + ": " //$NON-NLS-1$ //$NON-NLS-2$ + menuModel, null); }
void unzoom(final MUIElement element) { MWindow win = MinMaxAddonUtil.getWindowFor(element); Shell hostShell = (Shell) win.getWidget(); if (hostShell != null) { FaderAnimationFeedback fader = new FaderAnimationFeedback(hostShell); AnimationEngine engine = new AnimationEngine(win.getContext(), fader, 300); engine.schedule(); } List<MUIElement> elementsToRestore = getElementsToRestore(element); for (MUIElement toRestore : elementsToRestore) { toRestore.getTags().remove(IPresentationEngine.MINIMIZED_BY_ZOOM); toRestore.getTags().remove(IPresentationEngine.MINIMIZED); } adjustCTFButtons(element); MinMaxAddonUtil.unzoomStackOfMinMaxChildrenArea(this, element); // There are more views available to be active... EPartService partService = win.getContext().get(EPartService.class); partService.requestActivation(); }
protected void initRenderer(AbstractPartRenderer renderer) { renderer.init(context); ContextInjectionFactory.inject(renderer, context); }
private boolean getInitialMRUValue(Control control) { CSSRenderingUtils util = context.get(CSSRenderingUtils.class); if (util == null) { return getMRUValueFromPreferences(); } CSSValue value = util.getCSSValue(control, "MPartStack", "swt-mru-visible"); //$NON-NLS-1$ //$NON-NLS-2$ if (value == null) { value = util.getCSSValue(control, "MPartStack", "mru-visible"); //$NON-NLS-1$ //$NON-NLS-2$ } if (value == null) { return getMRUValueFromPreferences(); } return Boolean.parseBoolean(value.getCssText()); }
private static void trace(String msg, Widget menu, MMenu menuModel) { WorkbenchSWTActivator.trace(Policy.MENUS, msg + ": " + menu + ": " //$NON-NLS-1$ //$NON-NLS-2$ + menuModel, null); }
@Override public void init(IEclipseContext context) { super.init(context); Display.getCurrent().disposeExec(new Runnable() { public void run() { for (Image image : imageMap.values()) { image.dispose(); } } }); }
private static void trace(String msg, Widget menu, MMenu menuModel) { WorkbenchSWTActivator.trace(Policy.DEBUG_MENUS_FLAG, msg + ": " + menu + ": " //$NON-NLS-1$ //$NON-NLS-2$ + menuModel, null); }
@Override public void init(IEclipseContext context) { super.init(context); resUtils = (ISWTResourceUtilities) context.get(IResourceUtilities.class); pinImage = getImageFromURI(pinURI); }
private static void trace(String msg, Widget menu, MMenu menuModel) { WorkbenchSWTActivator.trace(Policy.MENUS, msg + ": " + menu + ": " //$NON-NLS-1$ //$NON-NLS-2$ + menuModel, null); }
public static void trace(String msg, Throwable error) { WorkbenchSWTActivator.trace(Policy.DEBUG_MENUS_FLAG, msg, error); }
private static void trace(String msg, MenuManager menuManager, MMenu menuModel) { WorkbenchSWTActivator.trace(Policy.DEBUG_MENUS_FLAG, msg + ": " + menuManager + ": " + menuManager.getMenu() + ": " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + menuModel, null); }
@Override public void forceFocus(MUIElement element) { if (element.getWidget() instanceof Control) { // Have SWT set the focus Control ctrl = (Control) element.getWidget(); if (!ctrl.isDisposed()) { if (Policy.DEBUG_FOCUS) { WorkbenchSWTActivator.trace(Policy.DEBUG_FOCUS_FLAG, "Force focus for: " + element, null); //$NON-NLS-1$ } ctrl.forceFocus(); } else { if (Policy.DEBUG_FOCUS) { WorkbenchSWTActivator.trace(Policy.DEBUG_FOCUS_FLAG, "Trying to force focus for disposed control: " + element, new IllegalStateException()); //$NON-NLS-1$ } } } else { if (Policy.DEBUG_FOCUS) { WorkbenchSWTActivator.trace(Policy.DEBUG_FOCUS_FLAG, "Trying to force focus for non-control element: " + element, new IllegalStateException()); //$NON-NLS-1$ } } }
@Override public boolean changed(IEclipseContext context) { try { item.setVisible(EvaluationResult.FALSE != exp.evaluate(ec)); } catch (CoreException e) { item.setVisible(false); WorkbenchSWTActivator.trace( "/trace/menus", "VisibleRAT failed", e); //$NON-NLS-1$//$NON-NLS-2$ } return participating; } }
protected Image getImage(String iconURI, LocalResourceManager resourceManager) { Image image = null; if (iconURI != null && iconURI.length() > 0) { ImageDescriptor iconDescriptor = resUtils.imageDescriptorFromURI(URI.createURI(iconURI)); if (iconDescriptor != null) { try { image = resourceManager.createImage(iconDescriptor); } catch (DeviceResourceException e) { iconDescriptor = ImageDescriptor.getMissingImageDescriptor(); image = resourceManager.createImage(iconDescriptor); // as we replaced the failed icon, log the message once. if (Policy.DEBUG_MENUS) { WorkbenchSWTActivator.trace(Policy.DEBUG_MENUS_FLAG, "failed to create image " + iconURI, e); //$NON-NLS-1$ } } } } return image; }