Package boco.ejb3PlugIn.gui

Examples of boco.ejb3PlugIn.gui.ShowAttributeInListDialog


    }

    ICompilationUnit compilationUnit = field.getCompilationUnit();


    ShowAttributeInListDialog showAttributeInListDialog = new ShowAttributeInListDialog(null);
    showAttributeInListDialog.pack();
    showAttributeInListDialog.setLocationRelativeTo(null);
    showAttributeInListDialog.setVisible(true);
    String order = showAttributeInListDialog.getOrder();

    if (order == null)
      return;

    try
    {
      String newFieldSourceCode = "";
      String oldFieldSourceCode = "";

      // Dal codice esistente rimuove l'annotazione se presente
      StringTokenizer st = new StringTokenizer(field.getSource(),"\n\r\f");
      while (st.hasMoreTokens())
      {
        String token = st.nextToken();
        //System.out.println(".."+token);
       
        if(!token.contains("@ShowAttributeInList"))
        {
          oldFieldSourceCode += token+"\r\n";;
        }
      }     
     
      IType type = compilationUnit.getTypes()[0];

      //Rimuove il campo esistente
      type.getField(field.getElementName()).delete(true, null);

      newFieldSourceCode += "\r\n\r\n@ShowAttributeInList(order=" + order + ", isDefaultOrderingAttribute="+showAttributeInListDialog.isDefaultOrderingAttribute()+", ascending="+showAttributeInListDialog.getMode()+")\r\n";
      newFieldSourceCode += oldFieldSourceCode+"\r\n";   
     
      type.createField("\r\n"+newFieldSourceCode, nextField, true, null);
     
      if(!compilationUnit.getSource().contains("import org.boco.seamwebappgen.annotations.ShowAttributeInList"))
View Full Code Here

TOP

Related Classes of boco.ejb3PlugIn.gui.ShowAttributeInListDialog

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.