Package org.boco.seamwebappgen.annotations

Examples of org.boco.seamwebappgen.annotations.ShowInForm


        if (isShowInForm(fields[j]))
        {
          // Il campo ha una annotazione @ShowInForm

          ShowInForm annotation = fields[j].getAnnotation(ShowInForm.class);

          attr.setImplementationType(annotation.type());

          attr.setOrderInForm(annotation.order());

          attr.setOnCreateIf(annotation.onCreateIf());
          attr.setOnEditIf(annotation.onEditIf());
          attr.setOnDisplayIf(annotation.onDisplayIf());
          attr.setOnDeleteIf(annotation.onDeleteIf());

          attr.setValidatorId(annotation.validatorId());

          attr.setFormFormatOff(annotation.formatOff());
          attr.setListFormatOff(annotation.listFormatOff());
         
          attr.setAjaxEvent(annotation.ajaxEvent());
         
          String ids[] = annotation.idsToRerenderOnAjaxEvent();
          for (int i = 0; i < ids.length; i++)
            attr.addIdToRerenderOnAjaxEvent(ids[i]);


          if (annotation.type() == AttributeImplementationType.TEXTAREA || annotation.type() == AttributeImplementationType.FORMATTEDTEXTAREA)
          {
            if (annotation.columns() == 0)
              throw new MissingColumnsException(beanName, fields[j].getName());

            if (annotation.rows() == 0)
              throw new MissingRowsException(beanName, fields[j].getName());

            attr.setColumns(annotation.columns());
            attr.setRows(annotation.rows());
          }

          if (annotation.type() == AttributeImplementationType.LISTBOX)
          {
            for (int i = 0; i < annotation.labels().length; i++)
            {
              attr.addLabel(annotation.labels()[i]);
            }
          }

          attr.setHelp(annotation.help());
          attr.setRequired(annotation.required());
        }
        else
        {
          attr.setOrderInForm(0);
          attr.setImplementationType(AttributeImplementationType.HIDEINFORM);
        }

        if (isAlternateOrderingAttribute(fields[j]))
        {
          // Il campo ha una annotazione @AlternateOrderingAttribute

          AlternateOrderingAttribute annotation = fields[j].getAnnotation(AlternateOrderingAttribute.class);

          attr.setAlternateOrderingAttribute(annotation.attribute());
        }

        tmp.add(attr);
      }
    }

    // Inserisce i campi di tipo @Transient
    // escludendo getSerialVersionUID

    Method methods[] = cBean.getDeclaredMethods();

    /** Ordinamento degli attributi per nome **/

    java.util.Arrays.sort(methods, new JavaMethodComparator());

    for (int i = 0; i < methods.length; i++)
    {
      if (methods[i].getName().startsWith("get") && !methods[i].getName().equals("getSerialVersionUID") && methods[i].getAnnotation(javax.persistence.Transient.class) != null && methods[i].getAnnotation(ShowTransientInForm.class) != null)
      {
        Attribute attr = new Attribute();

        attr.setName(Utils.makeMethod2Field(methods[i].getName()));
        attr.setType(methods[i].getReturnType().getName());
        attr.setKey(false);

        ShowTransientInForm annotation = methods[i].getAnnotation(ShowTransientInForm.class);

        attr.setImplementationType(AttributeImplementationType.READONLY);
        attr.setOrderInForm(annotation.order());
        attr.setTrans(true);

        tmp.add(attr);
      }
    }
View Full Code Here


          if (isShowInForm(fields[j]))
          {
            // Il campo ha una annotazione @ShowInForm

            ShowInForm annotation = fields[j].getAnnotation(ShowInForm.class);

            attr.setImplementationType(annotation.type());

            attr.setOrderInForm(annotation.order());
            attr.setFormFormatOff(annotation.formatOff());
            attr.setListFormatOff(annotation.listFormatOff());

            if (annotation.type() == AttributeImplementationType.TEXTAREA || annotation.type() == AttributeImplementationType.FORMATTEDTEXTAREA)
            {
              if (annotation.columns() == 0)
                throw new MissingColumnsException(beanName, fields[j].getName());

              if (annotation.rows() == 0)
                throw new MissingRowsException(beanName, fields[j].getName());

              attr.setColumns(annotation.columns());
              attr.setRows(annotation.rows());
            }

            if (annotation.type() == AttributeImplementationType.LISTBOX)
            {
              for (int i = 0; i < annotation.labels().length; i++)
              {
                attr.addLabel(annotation.labels()[i]);
              }
            }
          }
          else
          {
            attr.setOrderInForm(0);
            attr.setImplementationType(AttributeImplementationType.HIDEINFORM);
          }

          if (isAlternateOrderingAttribute(fields[j]))
          {
            // Il campo ha una annotazione @AlternateOrderingAttribute

            AlternateOrderingAttribute annotation = fields[j].getAnnotation(AlternateOrderingAttribute.class);

            attr.setAlternateOrderingAttribute(annotation.attribute());
          }

          Cache.put(beanName, attributeName, attr);
          return attr;
        }
View Full Code Here

        LocalSearchOnAttribute annotation = fields[j].getAnnotation(LocalSearchOnAttribute.class);

        if (fields[j].getAnnotation(ShowInForm.class) != null)
        {
          ShowInForm showAnnotation = fields[j].getAnnotation(ShowInForm.class);

          attr.setImplementationType(showAnnotation.type());

          Vector<String> tmp1 = new Vector<String>();
          tmp1 = new Vector<String>();
          for (int i = 0; i < showAnnotation.labels().length; i++)
          {
            tmp1.add(showAnnotation.labels()[i]);
          }
          attr.setLabels(tmp1);
        }
        else
          attr.setImplementationType(AttributeImplementationType.TEXT);
View Full Code Here

TOP

Related Classes of org.boco.seamwebappgen.annotations.ShowInForm

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.