Exemplo n.º 1
0
  public void readData(final Widget widget) {
    //    HttpServletRequest request = ContextProvider.getRequest();
    //    String parameter = request.getParameter( "JSON" );
    //    if( parameter != null ) {
    //      System.out.println( "#### BEGIN ####");
    //      System.out.println( parameter );
    //      System.out.println( "#### END ####");
    //    }

    Shell shell = (Shell) widget;
    // [if] Preserve the menu bounds before setting the new shell bounds.
    preserveMenuBounds(shell);
    // Important: Order matters, readMode() before readBounds()

    readBounds(shell);
    if (WidgetLCAUtil.wasEventSent(shell, JSConst.EVENT_SHELL_CLOSED)) {
      shell.close();
    }
    processActiveShell(shell);
    processActivate(shell);
    ControlLCAUtil.processMouseEvents(shell);
    ControlLCAUtil.processKeyEvents(shell);
    ControlLCAUtil.processMenuDetect(shell);
    WidgetLCAUtil.processHelp(shell);
  }
Exemplo n.º 2
0
 private static void processWidgetDefaultSelectedEvent(final Tree tree) {
   HttpServletRequest request = ContextProvider.getRequest();
   String eventName = JSConst.EVENT_WIDGET_DEFAULT_SELECTED;
   if (WidgetLCAUtil.wasEventSent(tree, eventName)) {
     String itemId = request.getParameter(eventName + ".item");
     Item treeItem = (Item) WidgetUtil.find(tree, itemId);
     int eventType = SelectionEvent.WIDGET_DEFAULT_SELECTED;
     SelectionEvent event = new SelectionEvent(tree, treeItem, eventType);
     event.stateMask = EventLCAUtil.readStateMask(JSConst.EVENT_WIDGET_SELECTED_MODIFIER);
     event.processEvent();
   }
 }
Exemplo n.º 3
0
 private static void processActiveShell(final Shell shell) {
   if (WidgetLCAUtil.wasEventSent(shell, JSConst.EVENT_SHELL_ACTIVATED)) {
     Shell lastActiveShell = shell.getDisplay().getActiveShell();
     setActiveShell(shell);
     ActivateEvent event;
     if (lastActiveShell != null) {
       event = new ActivateEvent(lastActiveShell, ActivateEvent.DEACTIVATED);
       event.processEvent();
     }
     event = new ActivateEvent(shell, ActivateEvent.ACTIVATED);
     event.processEvent();
   }
 }
Exemplo n.º 4
0
 private static void processWidgetSelectedEvent(final Tree tree) {
   HttpServletRequest request = ContextProvider.getRequest();
   String eventName = JSConst.EVENT_WIDGET_SELECTED;
   if (WidgetLCAUtil.wasEventSent(tree, eventName)) {
     Rectangle bounds = new Rectangle(0, 0, 0, 0);
     String itemId = request.getParameter(eventName + ".item");
     Item treeItem = (Item) WidgetUtil.find(tree, itemId);
     String detailStr = request.getParameter(eventName + ".detail");
     int detail = "check".equals(detailStr) ? SWT.CHECK : SWT.NONE;
     int eventType = SelectionEvent.WIDGET_SELECTED;
     int stateMask = EventLCAUtil.readStateMask(JSConst.EVENT_WIDGET_SELECTED_MODIFIER);
     SelectionEvent event =
         new SelectionEvent(tree, treeItem, eventType, bounds, stateMask, null, true, detail);
     event.processEvent();
   }
 }