Examples of InvalidComponentFieldException


Examples of com.citytechinc.cq.component.dialog.exception.InvalidComponentFieldException

    }
    if (List.class.isAssignableFrom(type)) {
      ParameterizedType parameterizedType = (ParameterizedType) genericType;
      if (parameterizedType.getActualTypeArguments().length == 0
        || parameterizedType.getActualTypeArguments().length > 1) {
        throw new InvalidComponentFieldException(
          "List dialog property found with a paramaterized type count not equal to 1");
      }
      type = (Class<?>) parameterizedType.getActualTypeArguments()[0];
    }
    return type;
View Full Code Here

Examples of com.citytechinc.cq.component.dialog.exception.InvalidComponentFieldException

        builtFieldWidget.setRanking(dialogProperty.ranking());

        int tabIndex = dialogProperty.tab();

        if (tabIndex < 1 || tabIndex > tabsList.size()) {
          throw new InvalidComponentFieldException("Invalid tab index " + tabIndex + " for field "
            + dialogProperty.fieldName());
        }

        tabsList.get(tabIndex - 1).addElement(builtFieldWidget);
View Full Code Here

Examples of com.citytechinc.cq.component.dialog.exception.InvalidComponentFieldException

        LogSingleton.getInstance().debug("Is Tab? " + curTabbableElement.isTab());

        if (curTabbableElement.isTab()) {
          if (i != 0 || tab.getElements().size() != 1) {
            throw new InvalidComponentFieldException(
              "A Tab dialog element can not be placed inside another tab.");
          }
          curTabbableElement.setTitle(tab.getTitle());
          return curElement;
        }
View Full Code Here

Examples of com.citytechinc.cq.component.dialog.exception.InvalidComponentFieldException

     */
    if (selectionAnnotation != null && selectionAnnotation.options().length > 0) {
      int i = 0;
      for (com.citytechinc.cq.component.annotations.Option curOptionAnnotation : selectionAnnotation.options()) {
        if (StringUtils.isEmpty(curOptionAnnotation.value())) {
          throw new InvalidComponentFieldException(
            "Selection Options specified in the selectionOptions Annotation property must include a non-empty text and value attribute");
        }
        String qtip = null;
        if (StringUtils.isNotEmpty(curOptionAnnotation.qtip())) {
          qtip = curOptionAnnotation.qtip();
        }
        OptionParameters parameters = new OptionParameters();
        parameters.setFieldName(OPTION_FIELD_NAME_PREFIX + (i++));
        parameters.setText(curOptionAnnotation.text());
        parameters.setValue(curOptionAnnotation.value());
        parameters.setQtip(qtip);
        options.add(new Option(parameters));
      }
    }

    /*
     * If options were not specified by the annotation then we check to see
     * if the field is an Enum and if so, the options are pulled from the
     * Enum definition
     */
    else if (getType().isEnum()) {
      int i = 0;
      for (Object curEnumObject : parameters.getClassLoader().loadClass(getType().getName()).getEnumConstants()) {
        Enum<?> curEnum = (Enum<?>) curEnumObject;
        try {
          options.add(buildSelectionOptionForEnum(curEnum, parameters.getClassPool(),
            OPTION_FIELD_NAME_PREFIX + (i++)));
        } catch (SecurityException e) {
          throw new InvalidComponentFieldException("Invalid Enum Field", e);
        } catch (NoSuchFieldException e) {
          throw new InvalidComponentFieldException("Invalid Enum Field", e);
        }
      }
    }

    return options;
View Full Code Here

Examples of com.citytechinc.cq.component.dialog.exception.InvalidComponentFieldException

    }

    String xtype = getXTypeForField(parameters);

    if (StringUtils.isEmpty(xtype)) {
      throw new InvalidComponentFieldException("An xtype could not be determined for the field");
    }

    return new WidgetMakerContext(DefaultWidgetMaker.class, xtype);
  }
View Full Code Here

Examples of com.citytechinc.cq.component.dialog.exception.InvalidComponentFieldException

        builtFieldWidget.setRanking(dialogProperty.ranking());

        int tabIndex = dialogProperty.tab();

        if (tabIndex < 1 || tabIndex > tabsList.size()) {
          throw new InvalidComponentFieldException("Invalid tab index " + tabIndex + " for field "
            + dialogProperty.fieldName());
        }

        tabsList.get(tabIndex - 1).addElement(builtFieldWidget);
View Full Code Here

Examples of com.citytechinc.cq.component.dialog.exception.InvalidComponentFieldException

        LogSingleton.getInstance().debug("Is Tab? " + curTabbableElement.isTab());

        if (curTabbableElement.isTab()) {
          if (i != 0 || tab.getElements().size() != 1) {
            throw new InvalidComponentFieldException(
              "A Tab dialog element can not be placed inside another tab.");
          }
          curTabbableElement.setTitle(tab.getTitle());
          return curElement;
        }
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.