protected void addSpecificImports()

in maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java [57:146]


  protected void addSpecificImports(Set imports,
                                    ComponentBean component)
  {
    imports.add("org.apache.myfaces.trinidad.bean.FacesBean");

    if (_is12)
    {
      imports.add("javax.el.ValueExpression");
    }

    Iterator<PropertyBean> properties = component.properties();
    properties = new FilteredIterator(properties, new TagAttributeFilter());

    while (properties.hasNext())
    {
      PropertyBean property = properties.next();
      String propertyClass = property.getPropertyClass();
      String[] propertyClassParams = property.getPropertyClassParameters();

      imports.add(component.getComponentClass());

      if (GeneratorHelper.isKeyStroke(propertyClass))
      {
        if (_is12)
          imports.add("javax.el.ValueExpression");
        else
          imports.add("javax.faces.el.ValueBinding");
        imports.add("javax.swing.KeyStroke");
      }
      else if (GeneratorHelper.isAWTKeyStroke(propertyClass))
      {
        if (_is12)
          imports.add("javax.el.ValueExpression");
        else
          imports.add("javax.faces.el.ValueBinding");
        imports.add("java.awt.AWTKeyStroke");
      }
      else if (GeneratorHelper.isConverter(propertyClass))
      {
        if (_is12)
          imports.add("javax.el.ValueExpression");
        else
          imports.add("javax.faces.el.ValueBinding");
        imports.add("javax.faces.convert.Converter");
      }
      else if (property.isVirtual())
      {
        if (_is12)
          imports.add("javax.el.ValueExpression");
        else
          imports.add("javax.faces.el.ValueBinding");
        imports.add("org.apache.myfaces.trinidadinternal.taglib.util.VirtualAttributeUtils");
      }
      else if (GeneratorHelper.isColorList(propertyClass, propertyClassParams) ||
               GeneratorHelper.isColor(propertyClass))
      {
        if (_is12)
          imports.add("javax.el.ValueExpression");
        else
          imports.add("javax.faces.el.ValueBinding");
        imports.add("java.text.ParseException");
        imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
      }
      else if (property.isMethodBinding())
      {
        if (_is12)
        {
          imports.add("javax.el.MethodExpression");
          imports.add("org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding");
        }
        else
        {
          imports.add("javax.faces.el.MethodBinding");
        }
      }
      else if (property.isMethodExpression())
      {
        imports.add("javax.el.MethodExpression");
      }
      else if (property.isEnum())
      {
        imports.add(propertyClass);
      }

      if (property.isNoOp())
      {
        imports.add("org.apache.myfaces.trinidad.logging.TrinidadLogger");
      }
    }
  }