예제 #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;
 }