{
//Shell shell = new Shell();
try
{
BeanDialog beanDialog = new BeanDialog(javaProject.getProject().getLocation().toOSString());
beanDialog.pack();
beanDialog.setLocationRelativeTo(null);
beanDialog.setVisible(true);
if (!beanDialog.isCancelled())
{
String beanName = Utils.makeFirstLetterUpperCase(beanDialog.getBeanName());
String sourceCode = "/*****************************************************************************\r\n";
sourceCode += "* Copyright (c) 2006 - 2008 Fabrizio Boco <fabboco@users.sourceforge.net> *\r\n";
sourceCode += "* *\r\n";
sourceCode += "* This file is generated with SeamWebAppGen. *\r\n";
sourceCode += "* *\r\n";
sourceCode += "* This library is free software; you can redistribute it and/or *\r\n";
sourceCode += "* modify it under the terms of the GNU Library General Public *\r\n";
sourceCode += "* License as published by the Free Software Foundation; either *\r\n";
sourceCode += "* version 2 of the License, or (at your option) any later version. *\r\n";
sourceCode += "* *\r\n";
sourceCode += "* This library is distributed in the hope that it will be useful, *\r\n";
sourceCode += "* but WITHOUT ANY WARRANTY; without even the implied warranty of *\r\n";
sourceCode += "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\r\n";
sourceCode += "* GNU Library General Public License for more details. *\r\n";
sourceCode += "* *\r\n";
sourceCode += "* You should have received a copy of the GNU Library General Public *\r\n";
sourceCode += "* License along with this library; see the file COPYING.LIB. If not, *\r\n";
sourceCode += "* write to the Free Software Foundation, Inc., 59 Temple Place, *\r\n";
sourceCode += "* Suite 330, Boston, MA 02111-1307, USA *\r\n";
sourceCode += "* *\r\n";
sourceCode += "******************************************************************************/\r\n";
sourceCode += "\r\n\r\n";
sourceCode += "/**\r\n";
sourceCode += "- $" + "Header: $\r\n";
sourceCode += "- $" + "Author: $\r\n";
sourceCode += "- $" + "Revision: $\r\n";
sourceCode += "- $" + "Date: $\r\n";
sourceCode += "\r\n\r\n";
sourceCode += "- $" + "Log: $\r\n";
sourceCode += "**/\r\n";
sourceCode += "\r\n\r\n";
sourceCode += "package " + packageFragment.getElementName() + ";\r\n";
sourceCode += "\r\n";
sourceCode += "\r\n";
sourceCode += "import javax.persistence.Entity;\r\n";
sourceCode += "import javax.persistence.Table;\r\n";
sourceCode += "import javax.persistence.Transient;\r\n";
sourceCode += "import javax.persistence.Id;\r\n";
sourceCode += "import javax.persistence.GeneratedValue;\r\n";
sourceCode += "import javax.persistence.GenerationType;\r\n";
sourceCode += "import java.io.Serializable;\r\n";
sourceCode += "import org.jboss.seam.annotations.Name;\r\n";
sourceCode += "import org.jboss.seam.annotations.Scope;\r\n";
sourceCode += "import static org.jboss.seam.ScopeType.CONVERSATION;\r\n";
sourceCode += "import org.boco.seamwebappgen.annotations.Security;\r\n";
sourceCode += "import org.boco.seamwebappgen.annotations.ShowList;\r\n";
sourceCode += "import org.boco.seamwebappgen.annotations.IgnoreBean;\r\n";
sourceCode += "import org.boco.seamwebappgen.annotations.IgnoreBeanManager;\r\n";
sourceCode += "import org.boco.seamwebappgen.annotations.IgnorePrintListForm;\r\n";
sourceCode += "import org.boco.seamwebappgen.annotations.IgnorePrintForm;\r\n";
sourceCode += "\r\n";
sourceCode += "\r\n";
sourceCode += "@Entity\r\n";
sourceCode += "@Name(\"" + Utils.makeFirstLetterLowerCase(beanName) + "\")\r\n";
sourceCode += "@Scope(CONVERSATION)\r\n";
sourceCode += "@Table(name = \"" + beanName + "\")\r\n";
sourceCode += Utils.makeShowListAnnotation(beanDialog).replace(" = ", "=").replace(", ", ",");
sourceCode += Utils.makeSecurityAnnotation(beanDialog).replace(" = ", "=").replace(", ", ",");
if (beanDialog.ignoreBean())
{
sourceCode += "@IgnoreBean()\r\n";
}
if (beanDialog.ignoreBeanManager())
{
sourceCode += "@IgnoreBeanManager()\r\n";
}
if (beanDialog.ignoreBeanLists())
{
sourceCode += "@IgnoreBeanLists()\r\n";
}
if (beanDialog.ignoreBeanLists())
{
sourceCode += "@IgnoreBeanLists()\r\n";
}
if (beanDialog.ignorePrintForm())
{
sourceCode += "@IgnorePrintForm()\r\n";
}
if (beanDialog.ignorePrintList())
{
sourceCode += "@IgnorePrintListForm()\r\n";
}
sourceCode += "public class " + beanName + " implements Serializable\r\n";
sourceCode += "{\r\n";