Examples of ActionContextImpl


Examples of gov.nasa.arc.mct.gui.impl.ActionContextImpl

   
    public MCTControlArea(MCTHousing parentHousing) {
        this.parentHousing = parentHousing;
        this.parentHousing.setControlArea(this);

        final ActionContextImpl actionContext = new ActionContextImpl();
        actionContext.setTargetHousing(parentHousing);
        actionContext.setTargetComponent( ((MCTStandardHousing) parentHousing).getWindowComponent() );
        actionContext.addTargetViewComponent(parentHousing.getHousedViewManifestation());
        if (parentHousing.getDirectoryArea() != null) {
            actionContext.addTargetViewComponent(parentHousing.getDirectoryArea().getHousedViewManifestation());
        }
        if (parentHousing.getContentArea() != null) {
            actionContext.addTargetViewComponent(parentHousing.getContentArea().getHousedViewManifestation());
        }
        this.setLayout(new BorderLayout());
    }
View Full Code Here

Examples of gov.nasa.arc.mct.gui.impl.ActionContextImpl

        for (int i = 0; i < standardMenuBar.getMenuCount(); i++) {
            Assert.assertFalse(standardMenuBar.getMenu(i) instanceof EditMenu);
        }

        ActionContextImpl context = new ActionContextImpl();
        context.setTargetHousing(housing);
        context.addTargetViewComponent(housing.getHousedViewManifestation());
        List<ContextAwareMenu> userObjectMenus = standardMenuBar.getUserObjectMenus(context);
        Assert.assertEquals(userObjectMenus.size(), 1);
        Assert.assertTrue(userObjectMenus.get(0) instanceof ObjectsMenu);
       
    }
View Full Code Here

Examples of gov.nasa.arc.mct.gui.impl.ActionContextImpl

            logger.error("View Manifestation count = 0, should be non-zero. MCTPopupOpenerForInspector");
            return;
        }

        // Set action context
        ActionContextImpl context = new ActionContextImpl();
        context.setTargetComponent(viewManifestationSet.iterator().next().getManifestedComponent());
        context.setInspectorComponent(inspector.getCurrentlyShowingComponent());

        context.setTargetHousing((MCTHousing) SwingUtilities.getAncestorOfClass(MCTAbstractHousing.class, viewManifestationSet.iterator().next()));
        for (View viewManifestation: viewManifestationSet) {
            context.addTargetViewComponent(viewManifestation);
        }
        JPopupMenu popupMenu = MenuFactory.createUserObjectPopupMenu(context);
        popupMenu.show((Component) e.getSource(), e.getX(), e.getY());
        popupMenu.validate();
    }
View Full Code Here

Examples of gov.nasa.arc.mct.gui.impl.ActionContextImpl

         * @param e the event.
         * @param mousePressed state of the mouse button.
         */
        private void processPopUpListenerEvent(MouseEvent e, boolean mousePressed) {
            if (e.isPopupTrigger()) {
                ActionContextImpl context = new ActionContextImpl();
                context.setTargetComponent(ownerComponentCanvasManifestation.getManifestedComponent());
                context.setTargetHousing((MCTHousing) SwingUtilities.getAncestorOfClass(MCTAbstractHousing.class,
                        ownerComponentCanvasManifestation));
                JPopupMenu popup = MenuFactory.createViewPopupMenu(context);
                assert popup != null;
                if (!testMode) {
                    popup.show(e.getComponent(), e.getX(), e.getY());
View Full Code Here

Examples of org.zkoss.zest.sys.impl.ActionContextImpl

    if (s == null || s.length() == 0)
      s = request.getServletPath();
    if (pathIgnored(s, _config.getExtensions()))
      return false;

    final ActionContext ac = new ActionContextImpl(request, response,
      _config.getVariableResolver(), _config.getFunctionMapper());
    final ActionDefinition[] defs = _config.getActionDefinitions();
    for (int j = 0; j < defs.length; ++j) {
      final ActionDefinition def = defs[j];
      Object action = null;
      try {
        action = def.getAction(ac);
        if (action != null) {
          request.setAttribute("action", action);
          if (!parameterIgnored(action))
            coerceParameters(ac, action);
          final String result = def.execute(ac, action);
          request.setAttribute("result", result);
          final ViewInfo viewInfo = def.getViewInfo(ac, result);
          if (viewInfo == null)
            throw new ZestException("No information specified for "+action+" under result is "+result+", when handling "+ac.getRequestPath());
          switch (viewInfo.getViewType()) {
          case REDIRECT:
            Https.sendRedirect(_ctx, request, response, viewInfo.getURI(), null, 0);
            break;
          case ERROR:
            final String msg = viewInfo.getErrorMessage();
            if (msg != null)
              response.sendError(viewInfo.getErrorCode(), msg);
            else
              response.sendError(viewInfo.getErrorCode());
          case DONE:
            break;
          default:
            Https.forward(_ctx, request, response, viewInfo.getURI());
            break;
          }
          return true;
        }
      } catch (Throwable ex) {
        try {
          _config.getErrorHandler().onError(ac, action, ex);
        } catch (ServletException t) {
          throw (ServletException)t;
        } catch (IOException t) {
          throw (IOException)t;
        } catch (Throwable t) {
          throw ZestException.Aide.wrap(t, "Failed to handle "+ac.getRequestPath());
        }
      }
    }
    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.