Package org.openfaces.component.table

Examples of org.openfaces.component.table.SummaryFunction$Calculator


      {IsLocalProxyFactoryInterceptor.singleton, new NotToBeInvokedInterceptor()};
      PojiProxy handler = new PojiProxy(KEY, null, interceptors);
      Class<?>[] interfaces = new Class<?>[]
      {Calculator.class};
      // create the proxy
      Calculator calculator = (Calculator) Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, handler);
      // register with dispatcher too, since the IsLocalProxyFactoryInterceptor
      // looks for the key in the dispatcher
      Dispatcher.singleton.registerTarget(KEY, new CalculatorImpl());

      try
      {
         int result = calculator.add(1, 2);
         logger.info("Successfully invoked method. Result = " + result);
         Assert.assertEquals("Incorrect result from calculator", result, 3);
      }
      catch (IllegalInvocationException iie)
      {
View Full Code Here


        String functionStr = getPropertyValue(propertyName);
        if (functionStr == null) return;

        if (setAsValueExpressionIfPossible(component, propertyName, functionStr)) return;

        SummaryFunction fn = ApplicationParams.getSummaryFunctionByName(functionStr);
        if (fn != null)
            component.getAttributes().put(propertyName, fn);
        else
            throw new FacesException("Invalid value of the " + propertyName + " attribute. No such standard function with " +
                "the following name is available or registered in the application: \"" + functionStr + "\"");
View Full Code Here

    public Map<String, SummaryFunction> getCustomFieldsToDefaultFunctions() {
        if (customFieldsToDefaultFunctions == null) {
            customFieldsToDefaultFunctions = new HashMap<String, SummaryFunction>();
            for (String prefix : CUSTOM_FIELD_PREFIXES) {
                for (String suffix : CUSTOM_FIELD_SUFFIXES) {
                    SummaryFunction function = !prefix.equals("string") && !prefix.equals("boolean")
                            ? (
                            suffix.equals("0") ? new SumFunction() :
                                    suffix.equals("1") ? new MinFunction() :
                                            suffix.equals("2") ? new MaxFunction() : null
                    )
View Full Code Here

TOP

Related Classes of org.openfaces.component.table.SummaryFunction$Calculator

Copyright © 2018 www.massapicom. 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.