Package com.citytechinc.cq.component.util

Examples of com.citytechinc.cq.component.util.WidgetConfigHolder


      Class<? extends Annotation> annotationClass = widgetAnnotation.annotationClass();

      Class<? extends WidgetMaker> makerClass = widgetAnnotation.makerClass();
      Class<? extends AbstractWidget> widgetClass = classLoader.loadClass(clazz.getName()).asSubclass(
        AbstractWidget.class);
      WidgetConfigHolder widgetConfig = new WidgetConfigHolder(annotationClass, widgetClass, makerClass,
        widgetAnnotation.xtype(), widgetAnnotation.ranking());

      builtInWidgets.add(widgetConfig);

    }
View Full Code Here


  }

  private static final WidgetMakerContext getWidgetMakerForField(WidgetMakerParameters parameters, int rankingCeiling)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvalidComponentFieldException {

    WidgetConfigHolder widget = getWidgetConfig(parameters, rankingCeiling);

    if (widget != null && widget.hasMakerClass()) {
      return new WidgetMakerContext(widget.getMakerClass(), widget.getXtype());
    }

    if (widget != null && widget.hasXtype()) {
      return new WidgetMakerContext(DefaultWidgetMaker.class, widget.getXtype());
    }

    String xtype = getXTypeForField(parameters);

    if (StringUtils.isEmpty(xtype)) {
View Full Code Here

  public static WidgetConfigHolder getWidgetConfig(WidgetMakerParameters parameters, int rankCeiling)
    throws ClassNotFoundException {

    LogSingleton LOG = LogSingleton.getInstance();

    WidgetConfigHolder highestRankedWidget = null;

    Set<Class<?>> registeredAnnotations = parameters.getWidgetRegistry().getRegisteredAnnotations();

    for (Class<?> curRegisteredAnnotation : registeredAnnotations) {
      LOG.debug("Checking for known annotation " + curRegisteredAnnotation);
      if (parameters.getCtMember().hasAnnotation(curRegisteredAnnotation)) {
        WidgetConfigHolder curPotential = parameters.getWidgetRegistry().getWidgetForAnnotation(
          curRegisteredAnnotation);
        if (rankCeiling < 0 || curPotential.getRanking() < rankCeiling) {
          LOG.debug("Match found in the registry with ranking " + curPotential.getRanking());
          if (highestRankedWidget == null || curPotential.getRanking() > highestRankedWidget.getRanking()) {
            highestRankedWidget = curPotential;
          }
        }
      }
    }
View Full Code Here

      Class<? extends Annotation> annotationClass = widgetAnnotation.annotationClass();

      Class<? extends WidgetMaker> makerClass = widgetAnnotation.makerClass();
      Class<? extends AbstractWidget> widgetClass = classLoader.loadClass(clazz.getName()).asSubclass(
        AbstractWidget.class);
      WidgetConfigHolder widgetConfig = new WidgetConfigHolder(annotationClass, widgetClass, makerClass,
        widgetAnnotation.xtype(), widgetAnnotation.ranking());

      builtInWidgets.add(widgetConfig);

    }
View Full Code Here

TOP

Related Classes of com.citytechinc.cq.component.util.WidgetConfigHolder

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.