菜单动作

    菜单动作是一个动作事物,如WebControl的动作是httpExecute:

   

    如图httpExecute是一个Java动作,该动作的Java代码是:

    public static void httpExecute(ActionContext actionContext){
     World world = World.getInstance();
        Thing globalCfg = world.getThing("xworker.ide.config.globalConfig");
        String httpServer = null;
        if(globalCfg != null){
         httpServer = globalCfg.getString("httpServer");
        }
        
        if(httpServer == null || "".equals(httpServer)){
           httpServer = "http://localhost:9001/";
        }
        
        Thing currentThing = (Thing) actionContext.get("currentThing");
        String url = httpServer + "do?sc=" + currentThing.getMetadata().getPath();
        
        ActionContext explorerContext = (ActionContext) actionContext.get("explorerContext");
        ActionContainer actions = (ActionContainer) explorerContext.get("actions");
        actions.doAction("openUrl", UtilMap.toMap(new Object[]{"url",url, "name", currentThing}));
    }

 

Copyright ©  2007-2019 XWorker.org  版权所有  沪ICP备08000575号