Examples of HandlerDefinition


Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

      @HandlerOutput(name="values", type=String.class)
  })
    public static Object invokeHandler(HandlerContext handlerCtx) {
  // First find the HandlerDefinition
  String handlerName = (String) handlerCtx.getInputValue("handler");
  HandlerDefinition handlerDef = LayoutDefinitionManager.getGlobalHandlerDefinition(handlerName);
  if (handlerDef == null) {
      throw new IllegalArgumentException("Handler '" + handlerName
        + "' not found!");
  }

  // Before working with the new Handler, save the old Handler...
  com.sun.jsftemplating.layout.descriptors.handler.Handler oldHandler =
    handlerCtx.getHandler();

  // Create the Handler to invoke...
  com.sun.jsftemplating.layout.descriptors.handler.Handler handler =
      new com.sun.jsftemplating.layout.descriptors.handler.Handler(handlerDef);

  // Now try to get the inputs / outputs
  List<String> outputNames = new ArrayList<String>();
  String args = (String) handlerCtx.getInputValue("args");
  StringTokenizer tok = new StringTokenizer(args, ",");
  String nvp, name, value;
    Object val = null;
  int colon;
  while (tok.hasMoreTokens()) {
      // Get the NVP...
      nvp = tok.nextToken();
      colon = nvp.indexOf(':');
      if (colon == -1) {
    throw new IllegalArgumentException(
        "Handler I/O name:value must be separated by a ':'!");
      }
      name = nvp.substring(0, colon).trim();
      value = nvp.substring(colon+1).trim();

      // URL decode 'value'...
      try {
    value = URLDecoder.decode(value, "UTF-8");
      } catch (UnsupportedEncodingException ex) {
    throw new IllegalArgumentException(
        "Unable to decode value, this is not normal!", ex);
      }

      // See if it is an input...
      if (handlerDef.getInputDef(name) != null) {
        // It's an input...
            if (value.startsWith("{") && value.endsWith("}")) {
                Object t = parseString(value.substring(1, (value.length()) - 1));
                val = t;
            } else {
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

      @HandlerOutput(name="values", type=String.class)
  })
    public static Object invokeHandler(HandlerContext handlerCtx) {
  // First find the HandlerDefinition
  String handlerName = (String) handlerCtx.getInputValue("handler");
  HandlerDefinition handlerDef = LayoutDefinitionManager.getGlobalHandlerDefinition(handlerName);
  if (handlerDef == null) {
      throw new IllegalArgumentException("Handler '" + handlerName
        + "' not found!");
  }

  // Before working with the new Handler, save the old Handler...
  com.sun.jsftemplating.layout.descriptors.handler.Handler oldHandler =
    handlerCtx.getHandler();

  // Create the Handler to invoke...
  com.sun.jsftemplating.layout.descriptors.handler.Handler handler =
      new com.sun.jsftemplating.layout.descriptors.handler.Handler(handlerDef);

  // Now try to get the inputs / outputs
  List<String> outputNames = new ArrayList<String>();
  String args = (String) handlerCtx.getInputValue("args");
  StringTokenizer tok = new StringTokenizer(args, ",");
  String nvp, name, value;
    Object val = null;
  int colon;
  while (tok.hasMoreTokens()) {
      // Get the NVP...
      nvp = tok.nextToken();
      colon = nvp.indexOf(':');
      if (colon == -1) {
    throw new IllegalArgumentException(
        "Handler I/O name:value must be separated by a ':'!");
      }
      name = nvp.substring(0, colon).trim();
      value = nvp.substring(colon+1).trim();

      // URL decode 'value'...
      try {
    value = URLDecoder.decode(value, "UTF-8");
      } catch (UnsupportedEncodingException ex) {
    throw new IllegalArgumentException(
        "Unable to decode value, this is not normal!", ex);
      }

      // See if it is an input...
      if (handlerDef.getInputDef(name) != null) {
        // It's an input...
            if (value.startsWith("{") && value.endsWith("}")) {
                Object t = parseString(value.substring(1, (value.length()) - 1));
                val = t;
            } else {
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
View Full Code Here

Examples of com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition

    public static void addHandler(HandlerContext handlerCtx) {
  String id = (String) handlerCtx.getInputValue("id");
  String desc = (String) handlerCtx.getInputValue("desc");
  String cls = (String) handlerCtx.getInputValue("class");
  String meth = (String) handlerCtx.getInputValue("method");
  HandlerDefinition def = new HandlerDefinition(id);
  def.setHandlerMethod(cls, meth);
  if (desc != null) {
      def.setDescription(desc);
  }
  LayoutDefinitionManager.addGlobalHandlerDefinition(def);
    }
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.