示例#1
0
 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);
 }
示例#2
0
 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);
   }
 }
示例#3
0
 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);
 }
示例#4
0
 private static Control getActiveControl(final Shell shell) {
   Object adapter = shell.getAdapter(IShellAdapter.class);
   IShellAdapter shellAdapter = (IShellAdapter) adapter;
   Control activeControl = shellAdapter.getActiveControl();
   return activeControl;
 }