private static void preserveMenuBounds(final Shell shell) { Object adapter = shell.getAdapter(IShellAdapter.class); IShellAdapter shellAdapter = (IShellAdapter) adapter; Rectangle menuBounds = shellAdapter.getMenuBounds(); IWidgetAdapter widgetAdapter = WidgetUtil.getAdapter(shell); widgetAdapter.preserve(PROP_SHELL_MENU_BOUNDS, menuBounds); }
private static void setActiveControl(final Shell shell, final Widget widget) { if (EventUtil.isAccessible(widget)) { Object adapter = shell.getAdapter(IShellAdapter.class); IShellAdapter shellAdapter = (IShellAdapter) adapter; shellAdapter.setActiveControl((Control) widget); } }
private static void readBounds(final Shell shell) { Rectangle bounds = WidgetLCAUtil.readBounds(shell, shell.getBounds()); Object adapter = shell.getAdapter(IShellAdapter.class); IShellAdapter shellAdapter = (IShellAdapter) adapter; shellAdapter.setBounds(bounds); }
private static Control getActiveControl(final Shell shell) { Object adapter = shell.getAdapter(IShellAdapter.class); IShellAdapter shellAdapter = (IShellAdapter) adapter; Control activeControl = shellAdapter.getActiveControl(); return activeControl; }