Package org.cruxframework.crux.core.rebind.screen.widget.declarative

Examples of org.cruxframework.crux.core.rebind.screen.widget.declarative.DeclarativeFactory


      for (String widget : factories)
      {
        try
        {
          Class<?> clientClass = Class.forName(WidgetConfig.getClientClass(library, widget));
          DeclarativeFactory factory = clientClass.getAnnotation(DeclarativeFactory.class);
          if (factory.htmlContainer())
          {
            htmlPanelContainers.add(library+"_"+widget);       
          }
          if (factory.attachToDOM())
          {
            attachableWidgets.add(library+"_"+widget);       
          }
        }
        catch (Exception e)
View Full Code Here


            if (!StringUtils.isEmpty(childAttributes.tagName()))
            {
              parentPath = parentWidget+"_"+childAttributes.tagName();
              if (WidgetCreator.class.isAssignableFrom(childAttributes.type()))
              {
                DeclarativeFactory declarativeFactory = childAttributes.type().getAnnotation(DeclarativeFactory.class);
                if (declarativeFactory != null)
                {
                  referenceWidgetsList.put(parentLibrary+"_"+parentPath,
                      declarativeFactory.library()+"_"+declarativeFactory.id());
                }
              }
              else
              {
                widgetsSubTags.add(parentLibrary+"_"+parentPath);             
View Full Code Here

   */
  private boolean isAttachToDOM(String widgetType)
  {
    if (!attachToDOMfactories.containsKey(widgetType))
    {
      DeclarativeFactory declarativeFactory = getWidgetCreator(widgetType).getClass().getAnnotation(DeclarativeFactory.class);
      attachToDOMfactories.put(widgetType, declarativeFactory.attachToDOM());
    }
    return attachToDOMfactories.get(widgetType);
  }
View Full Code Here

    }
    else
    {
      if ((tagName.length() == 0) && (WidgetCreator.class.isAssignableFrom(type)))
      {
        DeclarativeFactory annot = type.getAnnotation(DeclarativeFactory.class);
        if (annot != null)
        {
          tagName = annot.id();
        }
      }
      out.println("<xs:element name=\""+tagName+"\" minOccurs=\""+attributes.minOccurs()+
          "\" maxOccurs=\""+attributes.maxOccurs()+
          "\" type=\""+getSchemaType(type, library)+"\">");
View Full Code Here

   * @param out
   * @param widgetFactory
   */
  private void generateTypeForFactory(PrintStream out, Class<? extends WidgetCreator<?>> widgetFactory, String library)
  {
    DeclarativeFactory annot = widgetFactory.getAnnotation(DeclarativeFactory.class);
    String elementName = annot.id();

    out.println("<xs:element name=\""+elementName+"\" type=\"T"+elementName+"\">");

    generateDocumentationForTypeFactory(out, annot);
   
View Full Code Here

      this.enumTypes.put(typeName, type);
      return typeName;
    }
    else if (WidgetCreator.class.isAssignableFrom(type))
    {
      DeclarativeFactory annot = type.getAnnotation(DeclarativeFactory.class);
      if (annot != null)
      {
        if (annot.library().equals(library))
        {
          return "T"+annot.id();
        }
        else
        {
          return "_"+annot.library()+":T"+annot.id();
        }
      }
    }
    else if (WidgetChildProcessor.class.isAssignableFrom(type))
    {
View Full Code Here

  /**
   * @return
   */
  public String getWidgetFactoryDeclaration()
  {
    DeclarativeFactory declarativeFactory = getClass().getAnnotation(DeclarativeFactory.class);
    if (declarativeFactory != null)
    {
      return declarativeFactory.library()+"_"+declarativeFactory.id();
    }
    throw new CruxGeneratorException("Error reading viewFactory declaration.");
  }
View Full Code Here

      return factoryClass;
    }

  public String getWidgetDeclarationType()
  {
    DeclarativeFactory declarativeFactory = factoryClass.getAnnotation(DeclarativeFactory.class);
    if (declarativeFactory != null)
    {
      return declarativeFactory.library()+"_"+declarativeFactory.id();
    }
    else
    {
      return null;
    }
View Full Code Here

   *
   * @return
   */
  private Class<?> getWidgetTypeFromClass()
  {
    DeclarativeFactory declarativeFactory = factoryClass.getAnnotation(DeclarativeFactory.class);
    if (declarativeFactory != null)
    {
      return declarativeFactory.targetWidget();
    }
    else
    {
      return null;
    }
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.rebind.screen.widget.declarative.DeclarativeFactory

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.