Package org.exoplatform.webui.config

Examples of org.exoplatform.webui.config.Component


   public Component getComponentConfig(Class<?> type, String id)
   {
      String key = type.getName();
      if (id != null)
         key = key + ":" + id;
      Component config = configs_.get(key);
      if (config != null)
         return config;
      try
      {
         Component[] components = annotationToComponents(type);
View Full Code Here


      return new Component[]{};
   }

   private Component toComponentConfig(ComponentConfig annotation, Class<?> clazz) throws Exception
   {
      Component config = new Component();
      if (annotation.id().length() > 0)
         config.setId(annotation.id());

      Class<?> type = annotation.type() == void.class ? clazz : annotation.type();
      config.setType(type.getName());
      if (annotation.template().length() > 0)
         config.setTemplate(annotation.template());
      if (annotation.lifecycle() != void.class)
         config.setLifecycle(annotation.lifecycle().getName());
      if (annotation.decorator().length() > 0)
         config.setDecorator(annotation.decorator());
      config.setInitParams(toInitParams(annotation.initParams()));

      EventConfig[] eventAnnotations = annotation.events();
      ArrayList<Event> events = new ArrayList<Event>();
      for (EventConfig eventAnnotation : eventAnnotations)
      {
         events.add(toEventConfig(eventAnnotation));
      }
      config.setEvents(events);

      EventInterceptorConfig[] eventInterceptorAnnotations = annotation.eventInterceptors();
      ArrayList<EventInterceptor> eventInterceptors = new ArrayList<EventInterceptor>();
      for (EventInterceptorConfig eventAnnotation : eventInterceptorAnnotations)
      {
         eventInterceptors.add(toEventInterceptorConfig(eventAnnotation));
      }
      config.setEventInterceptors(eventInterceptors);

      ValidatorConfig[] validatorAnnotations = annotation.validators();
      ArrayList<Validator> validators = new ArrayList<Validator>();
      for (ValidatorConfig ele : validatorAnnotations)
      {
         validators.add(toValidator(ele));
      }
      config.setValidators(validators);

      return config;
   }
View Full Code Here

   public <S extends UIComponent> S create(Class<S> type, Map<FieldModel<? super S, ?>, ?> state) throws CreateException
   {
      //
      try
      {
         Component config = (Component)getFieldValue("config", state);

         S instance = Util.createObject(type, config != null ? config.getInitParams() : null);

         // Now set state
         for (Map.Entry<FieldModel<? super S, ?>, ?> entry : state.entrySet())
         {
            FieldModel<? super S, ?> fieldModel = entry.getKey();
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.config.Component

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.