Sunteți pe pagina 1din 45

package com.yash.ejpm.plugin.

view; import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import java.awt.CardLayout; java.awt.Color; java.awt.Component; java.awt.Desktop; java.awt.image.BufferedImage; java.io.File; java.io.IOException; java.net.MalformedURLException; java.sql.Connection; java.sql.SQLException; java.util.ArrayList; java.util.LinkedList; java.util.List; java.util.Map; java.util.Set; java.util.TreeMap; javax.imageio.ImageIO; javax.swing.DefaultListModel; javax.swing.JCheckBox; javax.swing.JComboBox; javax.swing.JComponent; javax.swing.JFileChooser; javax.swing.JFrame; javax.swing.JLabel; javax.swing.JOptionPane; javax.swing.JTable; javax.swing.JTextField; javax.swing.JWindow; javax.swing.ListSelectionModel; javax.swing.SwingConstants; javax.swing.UIManager; javax.swing.UnsupportedLookAndFeelException; javax.swing.event.ListSelectionEvent; javax.swing.event.ListSelectionListener; javax.swing.filechooser.FileNameExtensionFilter; javax.swing.table.DefaultTableModel; javax.swing.table.TableCellRenderer; javax.swing.table.TableColumn;

import test.SplashScreen; import import import import import import import import import import import import import import import import com.yash.ejpm.plugin.component.DomainClassChangeIfNewColumn; com.yash.ejpm.plugin.component.GenerateBasicXML; com.yash.ejpm.plugin.component.GenerateDataMapperInterface; com.yash.ejpm.plugin.component.GenerateDomainClass; com.yash.ejpm.plugin.component.GenerateDomainNameHbmIfNewColumnXML; com.yash.ejpm.plugin.component.GenerateDomainNameHbmXML; com.yash.ejpm.plugin.component.GenerateFinderInterface; com.yash.ejpm.plugin.component.GenerateFormMapper; com.yash.ejpm.plugin.component.GenerateMapperClass; com.yash.ejpm.plugin.component.GenerateProviderInterface; com.yash.ejpm.plugin.component.GenerateServiceClass; com.yash.ejpm.plugin.component.GenerateServiceContextClass; com.yash.ejpm.plugin.component.GenerateServiceInterface; com.yash.ejpm.plugin.component.GenerateSubPersistanceHibernateXML; com.yash.ejpm.plugin.component.GenerateSubPersistencXML; com.yash.ejpm.plugin.component.GenerateSubPersistenceMappersHibernateXML;

import import import import import import import import import import import import import import import import import import import import import import import import import import

com.yash.ejpm.plugin.component.GenerateSubServiceDomainNameXML; com.yash.ejpm.plugin.component.GenerateSubServiceXML; com.yash.ejpm.plugin.jdbc.JDBCConnectionUtils; com.yash.ejpm.plugin.jdbc.JDBCDatabaseInformation; com.yash.ejpm.plugin.resource.GetBundle; com.yash.ejpm.plugin.util.BasicXMLUtils; com.yash.ejpm.plugin.util.IfcCommonLiterals; com.yash.ejpm.plugin.util.StringUtils; com.yash.ejpm.plugin.web.FormClassChangeIfNewColumn; com.yash.ejpm.plugin.web.GenerateActionClass; com.yash.ejpm.plugin.web.GenerateActionUtilityClass; com.yash.ejpm.plugin.web.GenerateApplicationConextLocalXML; com.yash.ejpm.plugin.web.GenerateApplicationNameLoggerPropertiesFile; com.yash.ejpm.plugin.web.GenerateApplicationNamePropertiesFile; com.yash.ejpm.plugin.web.GenerateApplicationRegistryClass; com.yash.ejpm.plugin.web.GenerateApplicationThreadLocalRegistryClass; com.yash.ejpm.plugin.web.GenerateConnectionManagerPropertiesFile; com.yash.ejpm.plugin.web.GenerateFormClass; com.yash.ejpm.plugin.web.GenerateHttpSessionClass; com.yash.ejpm.plugin.web.GenerateIndexJspFile; com.yash.ejpm.plugin.web.GenerateServletContextListenerClass; com.yash.ejpm.plugin.web.GenerateStrutsConfigXML; com.yash.ejpm.plugin.web.GenerateSubApplicationXML; com.yash.ejpm.plugin.web.GenerateSubViewXML; com.yash.ejpm.plugin.web.GenerateWebXML; com.yash.ejpm.plugin.web.GenerateWelcomeJspFile;

public class MainFrame extends javax.swing.JFrame { private private private private private private private private private private private private private private private private private private private private private private private private private private private private private private static final long serialVersionUID = 1L; javax.swing.JPanel ChooseServicePanel; javax.swing.JPanel ConnectionParameterPanel; javax.swing.JPanel WorkspaceConfigurationPanel; javax.swing.JPanel WorkspaceConfigurationPanelCenter; javax.swing.JButton backButton; javax.swing.JPanel buttonPanel; javax.swing.JButton componentBrowse; javax.swing.JTextField componentPathProject; javax.swing.JTextField connectionURLField; javax.swing.JList databaseList; javax.swing.JTextField databaseTestField; javax.swing.JPanel displayPanel; javax.swing.JComboBox driverVersionList; javax.swing.JButton finishButton; javax.swing.JTextField hostTextField; javax.swing.JTextField schemaTestField; javax.swing.JMenuBar jMenuBar1; javax.swing.JLabel jLabel1; javax.swing.JLabel jLabel10; javax.swing.JLabel jLabel11; javax.swing.JLabel jLabel12; javax.swing.JLabel jLabel13; javax.swing.JLabel jLabel14; javax.swing.JLabel jLabel15; javax.swing.JLabel jLabel2; javax.swing.JLabel jLabel3; javax.swing.JLabel jLabel4; javax.swing.JLabel jLabel5; javax.swing.JLabel jLabel6;

private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton jarBrowser; private javax.swing.JButton nextButton; private javax.swing.JPasswordField paswordField; private javax.swing.JTextField portField; private javax.swing.JTextField rootPackageName; private javax.swing.JButton testConnection; private javax.swing.JLabel title1; private javax.swing.JTextField usernameField; private javax.swing.JButton webBrowse; private javax.swing.JTextField webProjectPath; private javax.swing.JTable jTable1; private javax.swing.JSeparator jSeparator1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JCheckBox checkStateful; private javax.swing.JLabel webWarning; private javax.swing.JLabel componentWarning; private javax.swing.JLabel driverClass; private javax.swing.JTextField driverClassNameOtherField; private javax.swing.JButton jarBrowserOther; private javax.swing.JLabel tableHeading; private javax.swing.JLabel tableWarning; private javax.swing.JButton helpButton; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; private javax.swing.JMenuItem jMenuItem6; private boolean readOnlyFlag; private Integer rowCount; private boolean tableColor=false; private GenerateBasicXML generateBasicXML=null; private javax.swing.JProgressBar progressBar; int process=0; private java.util.List<Boolean> serviceType=new ArrayList<Boolean>();; private java.util.List<String> domainList=new ArrayList<String>(); String fileName =""; public boolean flagConnection = false; private javax.swing.JLabel jLabel17; Object[][] object=null; Map<String, List<String>> map=null; Set<String> keys =null; Map<String, List<String>> pataMap =null; Integer size; String[] values={""}; List<String> list = null; private String passwordValue = ""; public String driverClassName=null; List<String> tableNames=null; public public public public String serverType=""; String selectedDriver=null; Connection con=null; int buttonState = 0;

List<String> listOne=null; private String selectedDriverVersion="" ; private List<String> newTablesList=null; private List<String> columnchangeTablesList=null; private List<String> existingTablesList=null; private int instanceCounter=0; private StringUtils stringUtils=null; Map<String, String> tableNameAsDatabase; private BasicXMLUtils basicXMLUtils=null; private JDBCDatabaseInformation jDBCDatabaseInformation=null; private LoadDriver loadDriver=null; BufferedImage splashImage = null; /** Creates new form MainFrame */ public MainFrame() { initComponents(); } /** This method is called from within the constructor to * initialize the form. */ private void initComponents() { displayPanel = new javax.swing.JPanel(); WorkspaceConfigurationPanel = new javax.swing.JPanel(); WorkspaceConfigurationPanelCenter = new javax.swing.JPanel(); title1 = new javax.swing.JLabel(); webProjectPath = new javax.swing.JTextField(); componentPathProject = new javax.swing.JTextField(); schemaTestField = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); rootPackageName = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); tableHeading = new javax.swing.JLabel(); tableWarning = new javax.swing.JLabel(); webBrowse = new javax.swing.JButton(); componentBrowse = new javax.swing.JButton(); ConnectionParameterPanel = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); webWarning = new javax.swing.JLabel(); componentWarning = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); testConnection = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); driverVersionList = new javax.swing.JComboBox(); databaseTestField = new javax.swing.JTextField(); portField = new javax.swing.JTextField(); connectionURLField = new javax.swing.JTextField();

hostTextField = new javax.swing.JTextField(); usernameField = new javax.swing.JTextField(); jarBrowser = new javax.swing.JButton(); paswordField = new javax.swing.JPasswordField(); driverClassNameOtherField = new javax.swing.JTextField(); driverClass = new javax.swing.JLabel(); ChooseServicePanel = new javax.swing.JPanel(); buttonPanel = new javax.swing.JPanel(); backButton = new javax.swing.JButton(); nextButton = new javax.swing.JButton(); finishButton = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jMenuItem5 = new javax.swing.JMenuItem(); jMenuItem6 = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); jMenuItem4 = new javax.swing.JMenuItem(); jTable1 = new javax.swing.JTable(); jSeparator1 = new javax.swing.JSeparator(); jScrollPane2 = new javax.swing.JScrollPane(); jarBrowserOther = new javax.swing.JButton(); progressBar = new javax.swing.JProgressBar(0,100); progressBar.setVisible(false); this.setLocation(155, 100);//Set the location of form basicXMLUtils = new BasicXMLUtils(); jDBCDatabaseInformation=new JDBCDatabaseInformation(); stringUtils = new StringUtils(); helpButton = new javax.swing.JButton(); tableNames=new ArrayList<String>(); readOnlyFlag=false; tableNameAsDatabase=new TreeMap<String, String>(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_ CLOSE); //setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C LOSE); //setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C LOSE);f setTitle("EJPM 2.0 Plugin");//Set the title loadDriver=new LoadDriver();

BufferedImage image = null; try { image = ImageIO.read( this.getClass().getResource(IfcCommonLit erals.ICON_IMAGE_PATH)); } catch (IOException e) { } this.setIconImage(image);

displayPanel.setName("displayPanel"); displayPanel.setLayout(new java.awt.CardLayout()); ReadXMLData.dataBaseMetaData(); map= ReadXMLData.getDriverVerionData(); keys = map.keySet(); size = keys.size(); pataMap = ReadXMLData.getPathData(); WorkspaceConfigurationPanel.setName("WorkspaceConfigurationPanel "); WorkspaceConfigurationPanelCenter.setName("WorkspaceConfiguratio nPanelCenter"); title1.setFont(new java.awt.Font("Tahoma", 1, 14)); title1.setText(GetBundle.getName("application.workspacewindow.la bel.title")); title1.setName("title1"); webProjectPath.setName("webProjectPath"); componentPathProject.setName("componentPathProject"); jLabel1.setText(GetBundle.getName("application.workspacewindow.l abel.webprojectpath")); jLabel1.setName("jLabel1"); jLabel2.setText(GetBundle.getName("application.workspacewindow.l abel.componentprojectpath")); jLabel2.setName("jLabel2"); rootPackageName.setToolTipText("Please enter package name,defaul t package name is \"com.deere.u90945.*;\""); rootPackageName.setName("rootPackageName"); jLabel3.setText(GetBundle.getName("application.workspacewindow.l abel.package")); jLabel3.setName("jLabel3"); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); jLabel4.setText(GetBundle.getName("application.workspacewindow.l abel.hint")); jLabel4.setName("jLabel4"); webBrowse.setText(GetBundle.getName("application.buttons.button. browse")); webBrowse.setToolTipText("Application path browse button for web project"); webBrowse.setName("webBrowse"); webBrowse.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e vt) { webBrowseActionPerformed(evt); } }); componentBrowse.setText(GetBundle.getName("application.buttons.b utton.browse")); componentBrowse.setToolTipText("Application path browse button f or component project"); componentBrowse.setName("componentBrowse"); componentBrowse.addActionListener(new java.awt.event.ActionListe ner() { public void actionPerformed(java.awt.event.ActionEvent e vt) { componentBrowseActionPerformed(evt); } }); webWarning.setForeground(new java.awt.Color(255, 0, 0)); webWarning.setName("webWarning");

componentWarning.setForeground(new java.awt.Color(255, 0, 0)); componentWarning.setName("componentWarning"); jLabel17.setFont(new java.awt.Font("Tahoma", 1, 11)); jLabel17.setText(GetBundle.getName("application.workspacewindow. label.warning")); jLabel17.setName("jLabel17"); javax.swing.GroupLayout WorkspaceConfigurationPanelCenterLayout = new javax.swing.GroupLayout(WorkspaceConfigurationPanelCenter); WorkspaceConfigurationPanelCenter.setLayout(WorkspaceConfigurati onPanelCenterLayout); WorkspaceConfigurationPanelCenterLayout.setHorizontalGroup( WorkspaceConfigurationPanelCenterLayout.createPa rallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAI LING, WorkspaceConfigurationPanelCenterLayout.createSequentialGroup() .addContainerGap(172, Short.MAX_ VALUE) .addComponent(title1) .addGap(290, 290, 290)) .addGroup(WorkspaceConfiguration PanelCenterLayout.createSequentialGroup() .addGap(32, 32, 32) .addGroup(Worksp aceConfigurationPanelCenterLayout.createParallelGroup(javax.swing.GroupLayout.Al ignment.LEADING) .addComponent(jLabel17) .addGroup(WorkspaceConfigurationPanelCenterLayout.createSequentialGroup() .addGroup(WorkspaceConfigurationPanelCenterLayout.createParallelGroup(javax.swin g.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent(jLabel3)) .addGap(60, 60, 60) .addGroup(WorkspaceConfigurationPanelCenterLayout.createParallelGroup(javax.swin g.GroupLayout.Alignment.LEADING, false) .addComponent(componentPathProject, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(webProjectPath, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax .swing.GroupLayout.PREFERRED_SIZE) .addComponent(rootPackageName, javax.swing.GroupLayout.PREFERRED_SIZE, 167, java x.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(WorkspaceConfigurationPanelCenterLayout.createParallelGroup(javax.swin g.GroupLayout.Alignment.LEADING, false) .addComponent(componentBrowse, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax

.swing.GroupLayout.PREFERRED_SIZE) .addComponent(webBrowse, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing .GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel4) .addGroup(WorkspaceConfigurationPanelCenterLayout.createParallelGroup(javax.swin g.GroupLayout.Alignment.TRAILING, false) .addComponent(webWarning, javax.swing.GroupLayout.Alignment.LEADING, javax.swing .GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE ) .addComponent(componentWarning, javax.swing.GroupLayout.Alignment.LEADING, javax .swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX _VALUE))) .addGap(153, 153, 153)) ); WorkspaceConfigurationPanelCenterLayout.linkSize(javax.swing.Swi ngConstants.HORIZONTAL, new java.awt.Component[] {componentPathProject, rootPack ageName, webProjectPath}); WorkspaceConfigurationPanelCenterLayout.linkSize(javax.swing.Swi ngConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3, jLa bel4}); WorkspaceConfigurationPanelCenterLayout.linkSize(javax.swing.Swi ngConstants.HORIZONTAL, new java.awt.Component[] {componentBrowse, webBrowse}); WorkspaceConfigurationPanelCenterLayout.setVerticalGroup( WorkspaceConfigurationPanelCenterLayout.createPa rallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(WorkspaceConfigurationPanelCenterLayou t.createSequentialGroup() .addGap(26, 26, 26) .addComponent(title1) .addGap(113, 113, 113) .addGroup(WorkspaceConfiguration PanelCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE ) .addComponent(we bProjectPath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DE FAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jL abel1) .addComponent(we bBrowse)) .addGap(18, 18, 18) .addGroup(Worksp aceConfigurationPanelCenterLayout.createParallelGroup(javax.swing.GroupLayout.Al ignment.BASELINE) .addComponent(jLabel2) .addComponent(componentPathProject, javax.swing.GroupLayout.PREFERRED_SIZE, java x.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(componentBrowse))

.addGap(18, 18, 18) .addGroup(WorkspaceConfigurationPanelCenterLayout.createParallelGroup(javax.swin g.GroupLayout.Alignment.BASELINE) .addComponent(rootPackageName, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax .swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addGap(18, 18, 18) .addComponent(jLabel4) .addGap(14, 14, 14) .addComponent(jLabel17) .addGap(18, 18, 18) .addComponent(webWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swin g.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(componentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 17, java x.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(83, Short.MAX_VALUE)) ); javax.swing.GroupLayout WorkspaceConfigurationPanelLayout = new javax.swing.GroupLayout(WorkspaceConfigurationPanel); WorkspaceConfigurationPanel.setLayout(WorkspaceConfigurationPane lLayout); WorkspaceConfigurationPanelLayout.setHorizontalGroup( WorkspaceConfigurationPanelLayout.createParallel Group(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(WorkspaceConfigurationPanelCenter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Sho rt.MAX_VALUE) ); WorkspaceConfigurationPanelLayout.setVerticalGroup( WorkspaceConfigurationPanelLayout.createParallel Group(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(WorkspaceConfigurationPanelCenter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Sho rt.MAX_VALUE) ); displayPanel.add(WorkspaceConfigurationPanel, "card2"); ConnectionParameterPanel.setName("ConnectionParameterPanel"); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); jLabel5.setText(GetBundle.getName("application.connectionwindow. label.title")); jLabel5.setName("jLabel5"); jLabel6.setText(GetBundle.getName("application.connectionwindow. label.info")); jLabel6.setName("jLabel6"); jLabel7.setText(GetBundle.getName("application.connectionwindow. label.selectdatabase")); jLabel7.setName("jLabel7");

jScrollPane1.setName("jScrollPane1"); DefaultListModel databaseListModel = new DefaultListModel(); Object[] objects = keys.toArray(); for(int i = 0; i < objects.length; i++) { databaseListModel.addElement(objects[i].toString()); } databaseListModel.addElement(IfcCommonLiterals.DATABASE_OTHER); databaseList = new javax.swing.JList(databaseListModel); databaseList.setSelectionMode(javax.swing.ListSelectionModel.SIN GLE_SELECTION); databaseList.setToolTipText("List of database server"); databaseList.setName("databaseList"); databaseList.addListSelectionListener(new javax.swing.event.List SelectionListener() { public void valueChanged(javax.swing.event.ListSelection Event evt) { databaseListValueChanged(evt); } }); jScrollPane1.setViewportView(databaseList); testConnection.setText("Test Connection"); testConnection.setToolTipText("Test Connection Button"); testConnection.setName("testConnection"); testConnection.setEnabled(false); testConnection.addActionListener(new java.awt.event.ActionListen er() { public void actionPerformed(java.awt.event.ActionEvent e vt) { testConnectionActionPerformed(evt); } }); jLabel8.setText(GetBundle.getName("application.connectionwindow. label.jdbcdriver")); jLabel8.setName("jLabel8"); jLabel9.setText(GetBundle.getName("application.connectionwindow. label.host")); jLabel9.setName("jLabel9"); jLabel10.setText(GetBundle.getName("application.connectionwindow .label.database")); jLabel10.setName("jLabel10"); jLabel11.setText(GetBundle.getName("application.connectionwindow .label.username")); jLabel11.setName("jLabel11"); jLabel12.setText(GetBundle.getName("application.connectionwindow .label.password")); jLabel12.setName("jLabel12"); jLabel13.setText(GetBundle.getName("application.connectionwindow .label.connectionurl")); jLabel13.setName("jLabel13"); jLabel14.setText(GetBundle.getName("application.connectionwindow .label.port")); jLabel14.setName("jLabel14"); driverVersionList.setModel(new javax.swing.DefaultComboBoxModel( values)); driverVersionList.setToolTipText("Select the version of database driver");

driverVersionList.setName("driverVersionList"); databaseTestField.setToolTipText("Database Name"); databaseTestField.setName("databaseTestField"); databaseTestField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { databaseTestFieldKeyReleased(evt); } }); portField.setToolTipText("Port"); portField.setName("portField"); portField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { portFieldKeyReleased(evt); } }); connectionURLField.setToolTipText("Connection URL"); connectionURLField.setName("connectionURLField"); connectionURLField.addKeyListener(new java.awt.event.KeyAdapter( ) { public void keyReleased(java.awt.event.KeyEvent evt) { connectionURLFieldKeyReleased(evt); } }); hostTextField.setToolTipText("Host"); hostTextField.setName("hostTextField"); hostTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { hostTextFieldKeyReleased(evt); } }); usernameField.setToolTipText("Username"); usernameField.setName("usernameField"); usernameField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { usernameFieldKeyReleased(evt); } }); jarBrowser.setText(GetBundle.getName("application.buttons.button .browse")); jarBrowser.setToolTipText("Browse driver jar"); jarBrowser.setName("jarBrowser"); jarBrowser.setEnabled(true); jarBrowser.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e vt) { jarBrowserActionPerformed(evt); } }); paswordField.setToolTipText("Password"); paswordField.setName("paswordField"); paswordField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { paswordFieldKeyReleased(evt); } }); driverVersionList.addActionListener(new java.awt.event.ActionLis tener() { public void actionPerformed(java.awt.event.ActionEvent e

vt) { driverVersionListActionPerformed(evt); } }); driverClassNameOtherField.setEnabled(false); driverClassNameOtherField.setName("driverClassNameOtherField"); driverClassNameOtherField.addKeyListener(new java.awt.event.KeyA dapter() { public void keyReleased(java.awt.event.KeyEvent evt) { driverClassNameOtherFieldKeyReleased(evt); } }); driverClass.setText(GetBundle.getName("application.connectionwin dow.label.driverclass")); driverClass.setEnabled(false); driverClass.setName("driverClass"); jarBrowserOther.setText(GetBundle.getName("application.buttons.b utton.browse")); jarBrowserOther.setToolTipText("Browse driver jar"); jarBrowserOther.setEnabled(false); jarBrowserOther.setName("jarBrowserOther"); jarBrowserOther.addActionListener(new java.awt.event.ActionListe ner() { public void actionPerformed(java.awt.event.ActionEvent e vt) { jarBrowserOtherActionPerformed(evt); } }); schemaTestField.setToolTipText("Schema Name"); schemaTestField.setName("schemaTestField"); // NOI18N schemaTestField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { schemaTestFieldKeyReleased(evt); } }); jLabel15.setText("Schema:"); jLabel15.setName("jLabel15"); javax.swing.GroupLayout ConnectionParameterPanelLayout = new jav ax.swing.GroupLayout(ConnectionParameterPanel); ConnectionParameterPanel.setLayout(ConnectionParameterPanelLayou t); ConnectionParameterPanelLayout.setHorizontalGroup( ConnectionParameterPanelLayout.createParallelGro up(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConnectionParameterPanelLayout.createS equentialGroup() .addGroup(ConnectionParameterPan elLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jL abel5, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREF ERRED_SIZE) .addGroup(Connec tionParameterPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 423, javax.swing. GroupLayout.PREFERRED_SIZE)) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup()

.addGap(19, 19, 19) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing. GroupLayout.PREFERRED_SIZE) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.s wing.GroupLayout.PREFERRED_SIZE) .addComponent(testConnection)) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, ConnectionParameterPanelLay out.createSequentialGroup() .addGap(19, 19, 19) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing. GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.G roupLayout.PREFERRED_SIZE)) .addGap(59, 59, 59) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addComponent(driverVersionList, javax.swing.GroupLayout.PREFERRED_SIZE, 243, ja vax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jarBrowser, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swin g.GroupLayout.PREFERRED_SIZE)) .addComponent(databaseTestField, javax.swing.GroupLayout.Alignment.TRAILING, jav ax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, ConnectionParameterPanelLay out.createSequentialGroup() .addGap(18, 18, 18) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa

yout.Alignment.TRAILING) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addGap(2, 2, 2) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE ) .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALU E))) .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALU E)) .addGap(59, 59, 59) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(paswordField, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.s wing.GroupLayout.PREFERRED_SIZE) .addComponent(usernameField, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MA X_VALUE) .addComponent(hostTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.s wing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE))) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addComponent(driverClass, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_V ALUE) .addGap(61, 61, 61) .addComponent(driverClassNameOtherField, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jarBrowserOther, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax .swing.GroupLayout.PREFERRED_SIZE)) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addGap(2, 2, 2) .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALU E) .addGap(59, 59, 59)

.addComponent(portField, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VA LUE)) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupL ayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(61, 61, 61) .addComponent(connectionURLField, javax.swing.GroupLayout.PREFERRED_SIZE, 234, j avax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup() .addGap(18, 18, 18) .addComponent(jLabel15,javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.G roupLayout.PREFERRED_SIZE) .addGap(100, 100, 100) .addComponent(schemaTestField, javax.swing.GroupLayout.DEFAULT_SIZE, 272, javax. swing.GroupLayout.PREFERRED_SIZE))))))) .addGap(26, 26, 26)) ); ConnectionParameterPanelLayout.linkSize(javax.swing.SwingConstan ts.HORIZONTAL, new java.awt.Component[] {connectionURLField, databaseTestField, hostTextField, paswordField, portField, usernameField}); ConnectionParameterPanelLayout.linkSize(javax.swing.SwingConstan ts.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel11, jLabel12, jLabel13, jLabel14, jLabel9}); ConnectionParameterPanelLayout.setVerticalGroup( ConnectionParameterPanelLayout.createParallelGro up(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(ConnectionParameterPanelLayout.createS equentialGroup() .addComponent(jLabel5, javax.swi ng.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.Lay outStyle.ComponentPlacement.RELATED) .addComponent(jLabel6) .addGap(28, 28, 28) .addComponent(jLabel7) .addGap(18, 18, 18) .addGroup(ConnectionParameterPan elLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Connec tionParameterPanelLayout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.s wing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(testConnection)) .addGroup(ConnectionParameterPanelLayout.createSequentialGroup()

.addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.BASELINE) .addComponent(driverVersionList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.s wing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jarBrowser) .addComponent(jLabel8)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.TRAILING) .addComponent(jLabel10) .addComponent(databaseTestField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.s wing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.TRAILING) .addComponent(schemaTestField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swi ng.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel15)) .addGap(12, 12, 12) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.TRAILING) .addComponent(hostTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing .GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.TRAILING) .addComponent(usernameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing .GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.BASELINE) .addComponent(paswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing. GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel12))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.TRAILING) .addComponent(jLabel14) .addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.Gro upLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.BASELINE) .addComponent(connectionURLField, javax.swing.GroupLayout.PREFERRED_SIZE, javax. swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(ConnectionParameterPanelLayout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(jarBrowserOther) .addComponent(driverClass) .addComponent(driverClassNameOtherField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(88, Short.MAX_VALUE)) ); schemaTestField.getAccessibleContext().setAccessibleDescription( "Schema Name"); displayPanel.add(ConnectionParameterPanel, "card3"); ChooseServicePanel.setName("ChooseServicePanel"); jSeparator1.setName("jSeparator1"); jScrollPane2.setName("jScrollPane2"); checkStateful = new JCheckBox(); checkStateful.setEnabled(true); tableHeading.setFont(new java.awt.Font("Tahoma", 1, 14)); tableHeading.setText("Domain Class Name List"); tableHeading.setName("tableHeading"); tableWarning.setText("For service stateless please uncheck the c heckbox for particular domains"); tableWarning.setName("tableWarning"); javax.swing.GroupLayout ChooseServicePanelLayout = new javax.swi ng.GroupLayout(ChooseServicePanel); ChooseServicePanel.setLayout(ChooseServicePanelLayout); ChooseServicePanelLayout.setHorizontalGroup(

ChooseServicePanelLayout.createParallelGroup(jav ax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLay out.DEFAULT_SIZE, 637, Short.MAX_VALUE) .addComponent(jSeparator1, javax.swing.GroupLayo ut.DEFAULT_SIZE, 637, Short.MAX_VALUE) .addGroup(ChooseServicePanelLayout.createSequent ialGroup() .addContainerGap() .addComponent(tableHeading, java x.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(442, Short.MAX_ VALUE)) .addGroup(ChooseServicePanelLayo ut.createSequentialGroup() .addGap(33, 33, 33) .addComponent(ta bleWarning) .addContainerGap (254, Short.MAX_VALUE)) ); ChooseServicePanelLayout.setVerticalGroup( ChooseServicePanelLayout.createParallelGroup(jav ax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAI LING, ChooseServicePanelLayout.createSequentialGroup() .addContainerGap() .addComponent(tableHeading) .addPreferredGap(javax.swing.Lay outStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE) .addComponent(tableWarning) .addGap(18, 18, 18) .addComponent(jSeparator1, javax .swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.s wing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.Lay outStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, java x.swing.GroupLayout.PREFERRED_SIZE, 378, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); displayPanel.add(ChooseServicePanel, "card4"); buttonPanel.setName("buttonPanel"); backButton.setText(GetBundle.getName("application.buttons.button .back")); backButton.setEnabled(false); backButton.setName("backButton"); backButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e vt) { backButtonActionPerformed(evt); } }); nextButton.setText(GetBundle.getName("application.buttons.button .next")); nextButton.setName("nextButton"); nextButton.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e vt) { nextButtonActionPerformed(evt); } }); finishButton.setText(GetBundle.getName("application.buttons.butt on.finish")); finishButton.setEnabled(false); finishButton.setName("finishButton"); finishButton.addActionListener(new java.awt.event.ActionListener () { public void actionPerformed(java.awt.event.ActionEvent e vt) { finishButtonActionPerformed(evt); } }); helpButton.setText("..."); helpButton.setName("helpButton"); javax.swing.GroupLayout buttonPanelLayout = new javax.swing.Grou pLayout(buttonPanel); buttonPanel.setLayout(buttonPanelLayout); buttonPanelLayout.setHorizontalGroup( buttonPanelLayout.createParallelGroup(javax.swin g.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAI LING, buttonPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(helpButton, javax. swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(105, 105, 105) .addComponent(progressBar, javax.swing.GroupLayo ut.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout .PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.Compone ntPlacement.RELATED, 114, Short.MAX_VALUE) .addComponent(backButton) .addGap(5, 5, 5) .addComponent(nextButton) .addGap(5, 5, 5) .addComponent(finishButton) .addGap(93, 93, 93)) ); buttonPanelLayout.setVerticalGroup( buttonPanelLayout.createParallelGroup(javax.swin g.GroupLayout.Alignment.LEADING) .addGroup(buttonPanelLayout.createSequentialGrou p() .addContainerGap() .addGroup(buttonPanelLayout.crea teParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(ba ckButton) .addComponent(nextButton) .addComponent(finishButton) .addComponent(progressBar, javax.swi ng.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing .GroupLayout.PREFERRED_SIZE) .addComponent(helpButton))

.addContainerGap(javax.swing.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE)) ); jMenuBar1.setName("jMenuBar1"); // NOI18N jMenu1.setText("Theams"); jMenu1.setName("Theams"); // NOI18N jMenuItem1.setText("Theam1"); jMenuItem1.setName("jMenuItem1"); // NOI18N jMenu1.add(jMenuItem1); jMenuItem2.setText("Theam2"); jMenuItem2.setName("jMenuItem2"); // NOI18N jMenu1.add(jMenuItem2); jMenuItem3.setText("Theam3"); jMenuItem3.setName("jMenuItem3"); // NOI18N jMenu1.add(jMenuItem3); jMenuItem5.setText("Theam4"); jMenuItem5.setName("jMenuItem5"); // NOI18N jMenu1.add(jMenuItem5); jMenuItem6.setText("Theam5"); jMenuItem6.setName("jMenuItem6"); // NOI18N jMenu1.add(jMenuItem6); jMenuBar1.add(jMenu1); jMenu2.setText("Help"); jMenu2.setName("jMenu2"); // NOI18N jMenuItem4.setText("Help"); jMenuItem4.setName("jMenuItem4"); // NOI18N jMenu2.add(jMenuItem4); jMenuBar1.add(jMenu2); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem4ActionPerformed(evt); } }); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(get ContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayo ut.Alignment.LEADING) .addComponent(displayPanel, javax.swing.GroupLay out.DEFAULT_SIZE, 637, Short.MAX_VALUE) .addComponent(buttonPanel, javax.swing.GroupLayo ut.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayo ut.Alignment.LEADING)

.addGroup(javax.swing.GroupLayout.Alignment.TRAI LING, layout.createSequentialGroup() .addComponent(displayPanel, java x.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MA X_VALUE) .addPreferredGap(javax.swing.Lay outStyle.ComponentPlacement.RELATED) .addComponent(buttonPanel, javax .swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.s wing.GroupLayout.PREFERRED_SIZE)) ); pack(); } public String getDriverClassName() { return driverClassName; } public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; } @SuppressWarnings("serial") private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) { buttonState++; if(buttonState==1){ if(webProjectPath.getText().trim().equals("")&&component PathProject.getText().trim().equals("")){ webWarning.setText("Application path for web pro ject is required"); componentWarning.setText("Application path for c omponent project is required"); backButtonActionPerformed(evt); }else if(webProjectPath.getText().trim().equals("")){ webWarning.setText("Application path for web pro ject is required"); componentWarning.setText(""); backButtonActionPerformed(evt); }else if(componentPathProject.getText().trim().equals("" )){ componentWarning.setText("Application path for c omponent project is required"); webWarning.setText(""); backButtonActionPerformed(evt); } } if (buttonState > 0) { backButton.setEnabled(true); } else { backButton.setEnabled(false); } if(buttonState==1){ nextButton.setEnabled(true); } if (buttonState == 2) { String dbName = "default"; dbName = (String)databaseList.getSelectedValue(); if(dbName==null){

JOptionPane.showMessageDialog(null,"Please selec t database !"); } else if(dbName.equals(IfcCommonLiterals.DATABASE_MYSQL)) { serverType=IfcCommonLiterals.DATABASE_MYSQL; try { if(databaseTestField.getText().equals("" ) databaseTestField==null){ throw new SQLException("Database not found"); } if(hostTextField.getText().equals("") d atabaseTestField==null){ throw new SQLException("Host not found"); } if(flagConnection){ con=loadDriver.getConnection(con nectionURLField.getText(), usernameField.getText(), getPasswordValue()); }else{ con=new JDBCConnectionUtils().ge tJDBCConnection(connectionURLField.getText(), usernameField.getText(), getPasswo rdValue(),getDriverClassName()); } } catch (SQLException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (ClassNotFoundException e) { con=null; JOptionPane.showMessageDialog(null,"Driv er Not Found"); } catch (IOException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (InstantiationException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (IllegalAccessException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); }catch (Exception e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } nextButton.setEnabled(true); } else if(dbName.equals(IfcCommonLiterals.DATABASE_ORACLE) ){ serverType=IfcCommonLiterals.DATABASE_ORACLE; try {

if(databaseTestField.getText().equals("" ) databaseTestField==null){ throw new SQLException("Database not found"); } if(hostTextField.getText().equals("") d atabaseTestField==null){ throw new SQLException("Host not found"); } if(flagConnection){ //con=null; con=loadDriver.getConnection(con nectionURLField.getText(), usernameField.getText(), getPasswordValue()); }else{ con=new JDBCConnectionUtils().ge tJDBCConnection(connectionURLField.getText(), usernameField.getText(), getPasswo rdValue(),getDriverClassName()); } } catch (SQLException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (ClassNotFoundException e) { con=null; JOptionPane.showMessageDialog(null,"Driv er Not Found"); } catch (IOException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (InstantiationException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (IllegalAccessException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); }catch (Exception e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } nextButton.setEnabled(true); } else if(dbName.equals(IfcCommonLiterals.DATABASE_DB2)){ serverType=IfcCommonLiterals.DATABASE_DB2; try { if(databaseTestField.getText().equals("" ) databaseTestField==null){ throw new SQLException("Database not found"); } if(hostTextField.getText().equals("") d atabaseTestField==null){ throw new SQLException("Host not

found"); } if(flagConnection){ con=loadDriver.getConnection(con nectionURLField.getText(), usernameField.getText(), getPasswordValue()); }else{ con=new JDBCConnectionUtils().ge tJDBCConnection(connectionURLField.getText(), usernameField.getText(), getPasswo rdValue(),getDriverClassName()); } } catch (SQLException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (ClassNotFoundException e) { con=null; JOptionPane.showMessageDialog(null,"Driv er Not Found"); } catch (IOException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (InstantiationException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (IllegalAccessException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); }catch (Exception e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } nextButton.setEnabled(true); } else if(dbName.equals(IfcCommonLiterals.DATABASE_SQLSERV ER)){ serverType=IfcCommonLiterals.DATABASE_SQLSERVER; try { if(databaseTestField.getText().equals("" ) databaseTestField==null){ throw new SQLException("Database not found"); } if(hostTextField.getText().equals("") d atabaseTestField==null){ throw new SQLException("Host not found"); } if(flagConnection){ con=loadDriver.getConnection(con nectionURLField.getText(), usernameField.getText(), getPasswordValue()); }else{ con=new JDBCConnectionUtils().ge tJDBCConnection(connectionURLField.getText(), usernameField.getText(), getPasswo

rdValue(),getDriverClassName()); } } catch (SQLException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (ClassNotFoundException e) { con=null; JOptionPane.showMessageDialog(null,"Driv er Not Found"); } catch (IOException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (InstantiationException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (IllegalAccessException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); }catch (Exception e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } nextButton.setEnabled(true); } else if(dbName.equals(IfcCommonLiterals.DATABASE_OTHER)) { serverType=IfcCommonLiterals.DATABASE_OTHER; try { if(flagConnection){ con=loadDriver.getConnection(con nectionURLField.getText(), usernameField.getText(), getPasswordValue()); }else{ con=new JDBCConnectionUtils().ge tOtherConnection(connectionURLField.getText(), usernameField.getText(), getPassw ordValue(),driverClassNameOtherField.getText().trim()); } } catch (SQLException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (ClassNotFoundException e) { con=null; JOptionPane.showMessageDialog(null,"Driv er Not Found"); } catch (IOException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } catch (InstantiationException e) { con=null;

JOptionPane.showMessageDialog(null,e.get Message()); } catch (IllegalAccessException e) { con=null; JOptionPane.showMessageDialog(null,e.get Message()); } } if(con!=null){ basicXMLUtils=new BasicXMLUtils(); try { Map<String, List<String>> map = jDBCData baseInformation.getDomainInfoJavaDefault(con, usernameField.getText(),serverType ,schemaTestField.getText()); generateBasicXML = new GenerateBasicXML( ); generateBasicXML.generateBasiXML(map, co mponentPathProject.getText()); basicXMLUtils.getDomainClassListDefault( ); tableNames= basicXMLUtils.getAllTableLis tAsDatabase(); for(String table: tableNames){ tableNameAsDatabase.put(StringUt ils.capitalize(StringUtils.javaDefault(table)),table); } existingTablesList=basicXMLUtils.getExis tingTables(componentPathProject.getText()); newTablesList=basicXMLUtils.getNewTables (existingTablesList); if(map.isEmpty()){ throw new Exception("No tables f ound!"); } basicXMLUtils.setApplicationPath(compone ntPathProject.getText()); if(newTablesList!=null){ generateBasicXML.generateBasiXML (basicXMLUtils.getNewDomainInfoMap(map, basicXMLUtils.getNewTablesAsDatabase(bas icXMLUtils.getExistingTableListAsDatabase()) ), componentPathProject.getText()); } columnchangeTablesList=basicXMLUtils.get ColumnChangeTables(componentPathProject.getText(),jDBCDatabaseInformation,basicX MLUtils); List<String>existingTablesListTemp=existingT ablesList; final List<String>columnChamgeTablesListTemp =new ArrayList<String>(); for(String columnChangeTable:columnchangeTablesList){ if(existingTablesList.contains(StringUtils.capitalize(St ringUtils.javaDefault(columnChangeTable)))){ existingTablesListTemp.remove(StringUtils.capita lize(StringUtils.javaDefault(columnChangeTable)));

columnChamgeTablesListTemp.add(StringUtils.capit alize(StringUtils.javaDefault(columnChangeTable))); } }

listOne = new LinkedList<String>(); listOne.addAll(newTablesList); listOne.addAll(columnChamgeTablesListTem p); listOne.addAll(existingTablesListTemp); if(list==null){ throw new Exception("No tables f ound!"); } object=new Object [listOne.size()][4]; System.out.println("tableNameAsDatabase" +tableNameAsDatabase); for(Integer index=0;index<listOne.size() ;index++){ object[index][0]=new Boolean(tru e); object[index][1]=listOne.get(ind ex); object[index][2]=tableNameAsData base.get(listOne.get(index)); object[index][3]=new Boolean(tru e); } DefaultTableModel model = new DefaultTab leModel(object,new String [] {"Abc","Domain Class Name","Xyz", "Service Stateful "}); jTable1 = new JTable(model){ @SuppressWarnings("unchecked") Class[] types = new Class [] { java.lang.Boolean.class,java.lan g.Object.class,java.lang.String.class, java.lang.Boolean.class }; @SuppressWarnings("unchecked") public Class getColumnClass(int columnIndex) { return types [columnInde x]; }

public boolean isCellEditable(i nt row, int column) { if(row<newTables List.size()){

if(colum n==2){ return false; }else{ return t rue; } } return false; } public Component prepareRendere r(TableCellRenderer renderer,int Index_row, int Index_col) { Component comp = super .prepareRenderer(renderer, Index_row, Index_col); JComponent jComp=(JCom ponent)comp; columnchangeTablesList =basicXMLUtils.getColumnChangeTables(componentPathProject.getText(),jDBCDatabase Information,basicXMLUtils); List<String>newChangeL ist=new ArrayList<String>(); for(String changeTable :columnchangeTablesList){ newChangeList. add(StringUtils.capitalize(StringUtils.javaDefault(changeTable))); } if(Index_row<new TablesList.size()){ jComp.se tBackground(Color.white); jComp.se tForeground(Color.black); } else if(Index_ro w>=newTablesList.size()&&Index_row<(columnChamgeTablesListTemp.size()+newTablesL ist.size())){ jComp.se tBackground(Color.gray); jComp.se tForeground(Color.black); } else{ jComp.setBackground(Color.lightGray); jComp.setForeground(Color.black); } return comp; } }; jTable1.setToolTipText("Table of domain class name with there type of service"); jTable1.setColumnSelectionAllowed(true); jTable1.setName("jTable1"); jScrollPane2.setViewportView(jTable1); //jTable1.getColumnModel().getColumn(1).

setPreferredWidth(20); setColumnWidth(jTable1.getColumnModel(). getColumn(0), 100); setColumnWidth(jTable1.getColumnModel(). getColumn(1), 300); setColumnWidth(jTable1.getColumnModel().getColumn(2) , 300); setColumnWidth(jTable1.getColumnModel().getColumn(3) , 100); //jTable1.getColumn("Service Stateful"). setCellEditor(new DefaultCellEditor(checkStateful)); jTable1.getColumnModel().getSelectionMod el().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); //jTable1.getColumnModel().getColumn(1). setPreferredWidth(4); ListSelectionModel rowSM = jTable1.getSe lectionModel(); rowSM.addListSelectionListener(new ListS electionListener() { public void valueChanged(ListSel ectionEvent e) { if (e.getValueIsAdjustin g()) return; } }); finishButton.setEnabled(true); nextButton.setEnabled(false); } catch (Exception e) { JOptionPane.showMessageDialog(null,e.get Message()); backButtonActionPerformed(evt); } }else{ backButtonActionPerformed(evt); } }

CardLayout cardLayout = (CardLayout) displayPanel.getLayout(); cardLayout.next(displayPanel); if(buttonState==1){ nextButton.setEnabled(true); finishButton.setEnabled(false); } } public Object GetData(JTable table, int row_index, int col_index){ return table.getModel().getValueAt(row_index, col_index); } private void finishButtonActionPerformed(java.awt.event.ActionEvent evt) {

finishButton.setEnabled(false); backButton.setEnabled(false); progressBar.setValue(0); progressBar.setIndeterminate(false); progressBar.setVisible(true); Thread t = new Thread(){ public void run(){ while (process!=100) { Integer checkIndex=0; for(Integer index=0;index<listOne.size() ;index++){ if(newTablesList!=null basicXML Utils.getColumnChangeTables(componentPathProject.getText(),jDBCDatabaseInformati on,basicXMLUtils)!=null){ if(checkIndex<newTablesL ist.size()){ domainList.add(GetData(jTable1,i ndex, 0).toString()); serviceType.add((Boolean) GetDat a(jTable1,index, 1)); checkIndex++;} } else{ domainList.add(GetData(j Table1,index, 0).toString()); serviceType.add((Boolean ) GetData(jTable1,index, 1)); } } if(rootPackageName.getText()==null ro otPackageName.getText().equals("")) { rootPackageName.setText("org.yas h"); } try{ finishButtonThrowsException(); }catch (IOException e) { JOptionPane.showMessageDialog(null,e.getMessage()); dispose(); }catch (Exception e) { JOptionPane.showMessageDialog(null,e.getMessage()); dispose(); } finally{ try { stringUtils.getLogWritter().flus h(); stringUtils=null; } catch (IOException e) { } }

if(process==100){ dispose(); } } } };

t.start(); } private void backButtonActionPerformed(java.awt.event.ActionEvent evt) { if(buttonState==2){ con=null; basicXMLUtils=null; finishButton.setEnabled(false); } buttonState--; CardLayout cardLayout = (CardLayout) displayPanel.getLayout(); cardLayout.previous(displayPanel); if (buttonState == 0) { backButton.setEnabled(false); if(!(webProjectPath.getText().trim().equals(""))&&!(comp onentPathProject.getText().trim().equals(""))){ webWarning.setText(""); componentWarning.setText(""); } else if(!(webProjectPath.getText().trim().equals(""))){ webWarning.setText(""); } else if(!(componentPathProject.getText().trim().equals(" "))){ componentWarning.setText(""); } } else { backButton.setEnabled(true); } if (buttonState <= 1) { nextButton.setEnabled(true); } else { nextButton.setEnabled(false); listOne.clear(); } } private void webBrowseActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser chooser = new JFileChooser(); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(new JFrame()) == JFileChooser.APPROVE _OPTION) { String fileName = chooser.getSelectedFile().getPath(); webProjectPath.setText(fileName);

} } private void componentBrowseActionPerformed(java.awt.event.ActionEvent e vt) { JFileChooser chooser = new JFileChooser(); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(new JFrame()) == JFileChooser.APPROVE _OPTION) { String fileName = chooser.getSelectedFile().getPath(); componentPathProject.setText(fileName); } } private void jarBrowserActionPerformed(java.awt.event.ActionEvent evt) { if((getSelectedDriverVersion()==null) getSelectedDriverVersion( ).equals("")){ JOptionPane.showMessageDialog(null,"Please select driver version"); }else{ new DriverSelectionWindow(this).setVisible(true); } } private void testConnectionActionPerformed(java.awt.event.ActionEvent ev t) { String dbName = (String)databaseList.getSelectedValue(); if(dbName.equals(IfcCommonLiterals.DATABASE_OTHER)){ try { if(isFlagConnection()){ con=loadDriver.getConnection(connectionURLField. getText(), usernameField.getText(), getPasswordValue()); }else{ con=new JDBCConnectionUtils().getOtherConnection (connectionURLField.getText(), usernameField.getText(), getPasswordValue(),drive rClassNameOtherField.getText().trim()); } } catch (SQLException e) { con=null; JOptionPane.showMessageDialog(null,"Connection failed !" ); } catch (ClassNotFoundException e) { con=null; JOptionPane.showMessageDialog(null,"Driver Not Found !") ; } catch (IOException e) { con=null; } catch (InstantiationException e) { con=null; } catch (IllegalAccessException e) { con=null; } if(con!=null){ JOptionPane.showMessageDialog(null,"Connection Succeeded !"); } } else{ try {

if(isFlagConnection()){ con=loadDriver.getConnection(connectionU RLField.getText(), usernameField.getText(), getPasswordValue()); }else{ con=new JDBCConnectionUtils().getJDBCCon nection(connectionURLField.getText(), usernameField.getText(), getPasswordValue( ),getDriverClassName()); } } catch (SQLException e) { con=null; JOptionPane.showMessageDialog(null,"Connection f ailed !"); } catch (ClassNotFoundException e) { con=null; JOptionPane.showMessageDialog(null,"Driver Not F ound !"); } catch (IOException e) { con=null; } catch (InstantiationException e) { con=null; } catch (IllegalAccessException e) { con=null; } catch (Exception e) { con=null; JOptionPane.showMessageDialog(null,e.getMessage( )); } if(con!=null){ JOptionPane.showMessageDialog(null,"Connection S ucceeded !"); } } } private void driverVersionListActionPerformed(java.awt.event.ActionEvent evt) { // String driverClassName=null; JComboBox string = (JComboBox) evt.getSource(); selectedDriverVersion = (String) string.getSelectedItem(); List<String> classList = pataMap.get(selectedDriverVersion); driverClassName = (String) classList.get(0); setDriverClassName(driverClassName); //loadDriver.setClassName(driverClassName); setSelectedDriverVersion(selectedDriverVersion); } private void schemaTestFieldKeyReleased(java.awt.event.KeyEvent evt) { } private void databaseListValueChanged(javax.swing.event.ListSelectionEve nt evt) { String name = (String) databaseList.getSelectedValue(); if (name.equals(IfcCommonLiterals.DATABASE_MYSQL)) { selectedDriverVersion=this.map.get(name).get(0); List<String> classList = pataMap.get(selectedDriverVersi on); driverClassName = (String) classList.get(0); setDriverClassName(driverClassName); databaseTestField.setEnabled(true);

portField.setEnabled(true); hostTextField.setEnabled(true); setSelectedDriverVersion(selectedDriverVersion); databaseTestField.setText("test"); portField.setText("3306"); hostTextField.setText("localhost"); usernameField.setText("root"); paswordField.setText(""); connectionURLField.setText("jdbc:mysql://" + hostTextField.getText() + ":" + portFi eld.getText() + "/" + databaseTestField.getText()); testConnection.setEnabled(false); }else if(name.equals(IfcCommonLiterals.DATABASE_ORACLE)){ selectedDriverVersion=this.map.get(name).get(0); List<String> classList = pataMap.get(selectedDriverVersi on); driverClassName = (String) classList.get(0); setDriverClassName(driverClassName); databaseTestField.setEnabled(true); portField.setEnabled(true); hostTextField.setEnabled(true); databaseTestField.setText("xe"); portField.setText("1521"); hostTextField.setText("localhost"); usernameField.setText(""); paswordField.setText(""); connectionURLField.setText("jdbc:oracle:thin:@"+hostText Field.getText()+":"+portField.getText()+":"+databaseTestField.getText()); testConnection.setEnabled(false); } else if(name.equals(IfcCommonLiterals.DATABASE_DB2)){ selectedDriverVersion=this.map.get(name).get(0); List<String> classList = pataMap.get(selectedDriverVersi on); driverClassName = (String) classList.get(0); setDriverClassName(driverClassName); databaseTestField.setEnabled(true); portField.setEnabled(true); hostTextField.setEnabled(true); databaseTestField.setText("test"); portField.setText("50000"); hostTextField.setText("localhost"); usernameField.setText(""); paswordField.setText(""); connectionURLField.setText("jdbc:db2:@"+hostTextField.ge tText()+":"+portField.getText()+":"+databaseTestField.getText()); testConnection.setEnabled(false); } else if(name.equals(IfcCommonLiterals.DATABASE_SQLSERVER)){ selectedDriverVersion=this.map.get(name).get(0); List<String> classList = pataMap.get(selectedDriverVersi on);

driverClassName = (String) classList.get(0); setDriverClassName(driverClassName); databaseTestField.setEnabled(true); portField.setEnabled(true); hostTextField.setEnabled(true); databaseTestField.setText("test"); portField.setText("1433"); hostTextField.setText("localhost"); usernameField.setText(""); paswordField.setText(""); connectionURLField.setText("jdbc:sqlserver://"+hostTextF ield.getText()+":"+portField.getText()+";databaseName="+databaseTestField.getTex t()+";"); testConnection.setEnabled(false); } else{ databaseTestField.setEnabled(false); portField.setEnabled(false); hostTextField.setEnabled(false); databaseTestField.setText(""); portField.setText(""); hostTextField.setText(""); usernameField.setText(""); connectionURLField.setText(""); paswordField.setText(""); testConnection.setEnabled(false); driverClassNameOtherField.setText(""); } if (!evt.getValueIsAdjusting()) { selectedDriver = "Please Select database"; if(databaseList.getSelectedValue().toString().equals(Ifc CommonLiterals.DATABASE_OTHER)){ driverVersionList.setModel(new javax.swing.Defau ltComboBoxModel()); driverVersionList.setEnabled(false); jarBrowser.setEnabled(false); jarBrowserOther.setEnabled(true); driverClassNameOtherField.setEnabled(true); driverClass.setEnabled(true); }else{ driverClass.setEnabled(false); jarBrowserOther.setEnabled(false); driverClassNameOtherField.setEnabled(false); driverVersionList.setEnabled(true); jarBrowser.setEnabled(true); list =map.get(databaseList.getSelectedValue().to String()); Object[] object = list.toArray(); values = new String[object.length]; for(int k=0;k<object.length;k++){ values[k]=(String)object[k]; } driverVersionList.setModel(new javax.swing.Defau ltComboBoxModel(values)); } } } private void driverClassNameOtherFieldKeyReleased(java.awt.event.KeyEven t evt) {

testConnection.setEnabled(false); if((usernameField.getText().trim().equals("")) getPasswordValue ().trim().equals("") connectionURLField.getText().trim().equals("") driverClas sNameOtherField.getText().trim().equals("")){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } } private void jarBrowserOtherActionPerformed(java.awt.event.ActionEvent e vt) { if(driverClassNameOtherField.getText().trim()==null driverClass NameOtherField.getText().trim().equals("")){ JOptionPane.showMessageDialog(null,"Please enter driver class name !"); }else{ File[] files=null; JFileChooser chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(true); FileNameExtensionFilter filter = new FileNameExtensionFi lter(".jar files", "jar"); chooser.setFileFilter(filter); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if ( chooser.showOpenDialog(new JFrame())== JFileChooser .APPROVE_OPTION) { files =chooser.getSelectedFiles(); String[] jarPath = new String[files.length]; for(int i=0;i<files.length;i++){ jarPath[i]=files[i].getPath(); } StringUtils.initializeArray(jarPath); StringUtils.setDriverJarPath(jarPath); try { LoadDriver.loadDriver(StringUtils.DRIVER _JAR_PATH,driverClassNameOtherField.getText().trim()); flagConnection =true; this.setFlagConnection(flagConnection); WriteXMLPath.registerDriver(StringUtils. DRIVER_JAR_PATH); } catch (MalformedURLException e) { } catch (InstantiationException e) { } catch (IllegalAccessException e) { } catch (ClassNotFoundException e) { } catch (SQLException e) { } } } } private void databaseTestFieldKeyReleased(java.awt.event.KeyEvent evt) { String blank = ""; String newString = ((JTextField)evt.getSource()).getText()+blank ; testConnection.setEnabled(false); if(!(connectionURLField.getText().trim().equals(""))){ if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_MYSQL)){ connectionURLField.setText("jdbc:mysql://"+hostT extField.getText()+":"+portField.getText()+"/"+databaseTestField.getText()); }

if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_ORACLE)){ connectionURLField.setText("jdbc:oracle:thin:@"+ hostTextField.getText()+":"+portField.getText()+":"+databaseTestField.getText()) ; } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_DB2)){ connectionURLField.setText("jdbc:db2://"+hostTex tField.getText()+":"+portField.getText()+"/"+databaseTestField.getText()); } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_SQLSERVER)){ connectionURLField.setText("jdbc:sqlserver://"+h ostTextField.getText()+":"+portField.getText()+";databaseName="+databaseTestFiel d.getText()+";"); } if((hostTextField.getText().trim().equals("")) (usernam eField.getText().trim().equals("")) (getPasswordValue().trim().equals("")) (po rtField.getText().trim().equals("")) (connectionURLField.getText().trim().equal s(""))){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } }else{ connectionURLField.setText(blank); } if(newString.equals("")){ testConnection.setEnabled(false); } } private void hostTextFieldKeyReleased(java.awt.event.KeyEvent evt) { String blank = ""; String newString = ((JTextField)evt.getSource()).getText()+blank ; testConnection.setEnabled(false); if(!(connectionURLField.getText().trim().equals(""))){ if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_MYSQL)){ connectionURLField.setText("jdbc:mysql://"+hostT extField.getText()+":"+portField.getText()+"/"+databaseTestField.getText()); } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_ORACLE)){ connectionURLField.setText("jdbc:oracle:thin:@"+ hostTextField.getText()+":"+portField.getText()+":"+databaseTestField.getText()) ; } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_DB2)){ connectionURLField.setText("jdbc:db2://"+hostTex tField.getText()+":"+portField.getText()+"/"+databaseTestField.getText()); } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_SQLSERVER)){ connectionURLField.setText("jdbc:sqlserver://"+h ostTextField.getText()+":"+portField.getText()+";databaseName="+databaseTestFiel d.getText()+";");

} if((databaseTestField.getText().trim().equals("")) (use rnameField.getText().trim().equals("")) (getPasswordValue().trim().equals("")) (portField.getText().trim().equals("")) (connectionURLField.getText().trim().e quals(""))){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } }else{ connectionURLField.setText(blank); }if(newString.equals("")){ testConnection.setEnabled(false); } } private void usernameFieldKeyReleased(java.awt.event.KeyEvent evt) { String blank = ""; String newString = ((JTextField)evt.getSource()).getText()+blank ; testConnection.setEnabled(false); if(driverClassNameOtherField.isEnabled()){ if((usernameField.getText().trim().equals("")) getPassw ordValue().trim().equals("") connectionURLField.getText().trim().equals("") dr iverClassNameOtherField.getText().trim().equals("")){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } } else{ if((databaseTestField.getText().trim().equals("")) (por tField.getText().trim().equals("")) (getPasswordValue().trim().equals("")) (ho stTextField.getText().trim().equals("")) (connectionURLField.getText().trim().e quals(""))){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } if(newString.equals("")){ testConnection.setEnabled(false); } } } private void paswordFieldKeyReleased(java.awt.event.KeyEvent evt) { String blank = ""; String newString = ((JTextField)evt.getSource()).getText()+blank ; setPasswordValue(newString); testConnection.setEnabled(false); if(driverClassNameOtherField.isEnabled()){ if((usernameField.getText().trim().equals("")) getPassw ordValue().trim().equals("") connectionURLField.getText().trim().equals("") dr iverClassNameOtherField.getText().trim().equals("")){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } }else{ if((databaseTestField.getText().trim().equals("")) (por tField.getText().trim().equals("")) (usernameField.getText().trim().equals(""))

(hostTextField.getText().trim().equals("")) (connectionURLField.getText().tri m().equals(""))){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } if(newString.equals("")){ testConnection.setEnabled(false); } } } private void portFieldKeyReleased(java.awt.event.KeyEvent evt) { String blank = ""; String newString = ((JTextField)evt.getSource()).getText()+blank ; testConnection.setEnabled(false); if(!(connectionURLField.getText().trim().equals(""))){ if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_MYSQL)){ connectionURLField.setText("jdbc:mysql://"+hostT extField.getText()+":"+portField.getText()+"/"+databaseTestField.getText()); } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_ORACLE)){ connectionURLField.setText("jdbc:oracle:thin:@"+ hostTextField.getText()+":"+portField.getText()+":"+databaseTestField.getText()) ; } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_DB2)){ connectionURLField.setText("jdbc:db2://"+hostTex tField.getText()+":"+portField.getText()+"/"+databaseTestField.getText()); } if(((String)databaseList.getSelectedValue()).equals(IfcC ommonLiterals.DATABASE_SQLSERVER)){ connectionURLField.setText("jdbc:sqlserver://"+h ostTextField.getText()+":"+portField.getText()+";databaseName="+databaseTestFiel d.getText()+";"); } if((databaseTestField.getText().trim().equals("")) (use rnameField.getText().trim().equals("")) (getPasswordValue().trim().equals("")) (hostTextField.getText().trim().equals("")) (connectionURLField.getText().trim ().equals(""))){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } }else{ connectionURLField.setText(blank); } if(newString.equals("")){ testConnection.setEnabled(false); } } private void connectionURLFieldKeyReleased(java.awt.event.KeyEvent evt) { String blank = ""; String newString = ((JTextField)evt.getSource()).getText()+blank ; testConnection.setEnabled(false);

if(driverClassNameOtherField.isEnabled()){ if((usernameField.getText().trim().equals("")) getPassw ordValue().trim().equals("") connectionURLField.getText().trim().equals("") dr iverClassNameOtherField.getText().trim().equals("")){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } }else{ if((databaseTestField.getText().trim().equals("")) (por tField.getText().trim().equals("")) (usernameField.getText().trim().equals("")) (hostTextField.getText().trim().equals("")) getPasswordValue().trim().equals( "")){ testConnection.setEnabled(false); }else{ testConnection.setEnabled(true); } if(newString.equals("")){ testConnection.setEnabled(false); } } } /** * @param args the command line arguments */ /** * @return the selectedDriverVersion */ public String getSelectedDriverVersion() { return selectedDriverVersion; } /** * @param selectedDriverVersion the selectedDriverVersion to set */ public void setSelectedDriverVersion(String selectedDriverVersion) { this.selectedDriverVersion = selectedDriverVersion; } /** * @return the flagConnection */ public boolean isFlagConnection() { return flagConnection; } /** * @param flagConnection the flagConnection to set */ public void setFlagConnection(boolean flagConnection) { this.flagConnection = flagConnection; } public String getPasswordValue() { return passwordValue; } public void setPasswordValue(String passwordValue) { this.passwordValue = passwordValue; } public int getProcess() { return process;

} public void setProcess(int process) { this.process = process; } public void finishButtonThrowsException() throws IOException,Exception { setProcess(0); progressBar.setValue(getProcess()); StringUtils.setRootPackageName(rootPackageName.getText(),basicXM LUtils); StringUtils.setRootPackageNameForWeb(rootPackageName.getText(),w ebProjectPath.getText()); setProcess(10); progressBar.setValue(getProcess()); basicXMLUtils.setDomainClassList(domainList); setProcess(15); progressBar.setValue(getProcess()); basicXMLUtils.setServiceType(serviceType); StringUtils.APPLICATONPATH_LOG=webProjectPath.getText(); setProcess(20); progressBar.setValue(getProcess()); new GenerateDomainClass().generateDomainclass(basicXMLUtils.getD omainMetaData(),componentPathProject.getText(),basicXMLUtils,stringUtils); new GenerateProviderInterface().generateProviderInterface(compon entPathProject.getText(),basicXMLUtils,stringUtils); setProcess(25); progressBar.setValue(getProcess()); new GenerateFinderInterface().generateFinderInterface(componentP athProject.getText(),basicXMLUtils,stringUtils); new GenerateDataMapperInterface().generateDataMapperInterface(co mponentPathProject.getText(),basicXMLUtils,stringUtils); new GenerateMapperClass().generateMapperClass(componentPathProje ct.getText(),basicXMLUtils,stringUtils); setProcess(30); progressBar.setValue(getProcess()); new GenerateServiceInterface().generateSeriviceInterface(compone ntPathProject.getText(),basicXMLUtils,stringUtils); new GenerateServiceContextClass().generateSeriviceContextClass(c omponentPathProject.getText(),basicXMLUtils,stringUtils); new GenerateServiceClass().generateServiceClass(componentPathPro ject.getText(),basicXMLUtils,stringUtils); setProcess(40); progressBar.setValue(getProcess()); new GenerateSubServiceDomainNameXML().generateSubServiceDomainNa meXML(componentPathProject.getText(),basicXMLUtils,stringUtils); new GenerateSubServiceXML().generateSubServiceXML(componentPathP roject.getText(),stringUtils); new GenerateSubPersistanceHibernateXML().generateSubPersistanceH ibernateXML(componentPathProject.getText(),serverType,basicXMLUtils,stringUtils) ; setProcess(45); progressBar.setValue(getProcess()); new GenerateSubPersistenceMappersHibernateXML().generateSubPersi stenceMappersHibernateXML(componentPathProject.getText(),basicXMLUtils,stringUti ls); new GenerateDomainNameHbmXML().generateDomainNameHbmXML(componen tPathProject.getText(),basicXMLUtils.getDomainMetaData(),schemaTestField.getText (),basicXMLUtils,stringUtils); new GenerateSubPersistencXML().generateSubPersistencXML(componen tPathProject.getText(),stringUtils);

setProcess(50); progressBar.setValue(getProcess()); //web new GenerateActionClass().generateActionClass(webProjectPath.get Text(),basicXMLUtils,stringUtils); new GenerateApplicationConextLocalXML().generateApplicationConex tLocalXML(webProjectPath.getText(),serverType,databaseTestField.getText(),basicX MLUtils,stringUtils); new GenerateApplicationRegistryClass().generateApplicationRegist ryClass(webProjectPath.getText(),basicXMLUtils,stringUtils); setProcess(55); progressBar.setValue(getProcess()); new GenerateApplicationThreadLocalRegistryClass().generateApplic ationThreadLocalRegistryClass(webProjectPath.getText(),stringUtils); new GenerateFormClass().generateFormclass(basicXMLUtils.getDomai nMetaData(), webProjectPath.getText(),basicXMLUtils,stringUtils); new GenerateFormMapper().generateFormMapperClass(webProjectPath. getText(),basicXMLUtils,stringUtils); new GenerateHttpSessionClass().generateHttpSessionClass(webProje ctPath.getText(),basicXMLUtils,stringUtils); setProcess(60); progressBar.setValue(getProcess()); new GenerateServletContextListenerClass().generateServletContext ListenerClass(webProjectPath.getText(),stringUtils); new GenerateStrutsConfigXML().generateStrutsConfigXML(webProject Path.getText(),basicXMLUtils,stringUtils); new GenerateSubApplicationXML().generateSubApplicationXML(webPro jectPath.getText(),basicXMLUtils,stringUtils); new GenerateSubViewXML().generateSubViewXML(webProjectPath.getTe xt(),basicXMLUtils,stringUtils); setProcess(65); progressBar.setValue(getProcess()); if(existingTablesList==null existingTablesList.isEmpty()){ new GenerateWebXML().generateWebXML(webProjectPath.getTe xt(),stringUtils); } setProcess(70); progressBar.setValue(getProcess()); new GenerateApplicationNameLoggerPropertiesFile().generateApplic ationNameLoggerPropertiesFile(webProjectPath.getText(),basicXMLUtils,stringUtils ); new GenerateApplicationNamePropertiesFile().generateApplicationN amePropertiesFile(webProjectPath.getText(),stringUtils); new GenerateConnectionManagerPropertiesFile().generateConnection ManagerPropertiesFile(webProjectPath.getText(), usernameField.getText(),getPassw ordValue(),serverType,stringUtils); setProcess(80); progressBar.setValue(getProcess()); new GenerateActionUtilityClass().generateActionUtilityClass(webP rojectPath.getText(),stringUtils); new GenerateIndexJspFile().generateIndexJspFile(webProjectPath.g etText(),basicXMLUtils,stringUtils); new GenerateWelcomeJspFile().generateWelcomeJspFile(webProjectPa th.getText(),stringUtils); setProcess(95); progressBar.setValue(getProcess()); if(basicXMLUtils.getTablesWithColumnChanged()!=null&&!basicXMLUt ils.getTablesWithColumnChanged().isEmpty()){ Map<String ,List<String>>tableMetaData= jDBCDatabaseInfo rmation.getDomainInfoJavaDefault(con, usernameField.getText(),serverType,schemaT

estField.getText()); new GenerateDomainNameHbmIfNewColumnXML().generateDomain NameHbmIfNewColumnXML(componentPathProject.getText(),tableMetaData, schemaTestFi eld.getText(),basicXMLUtils); new DomainClassChangeIfNewColumn().generate(componentPat hProject.getText(),tableMetaData,basicXMLUtils); new FormClassChangeIfNewColumn().generate(webProjectPath .getText(), tableMetaData,basicXMLUtils); } setProcess(100); progressBar.setValue(getProcess()); dispose(); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.getWindows()[0].dispose(); } private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) { try { Desktop desktop = null; if (Desktop.isDesktopSupported()) { desktop = Desktop.getDesktop(); } desktop.open(new File("c:\\EJPMDocs.docx")); } catch (IOException ioe) { ioe.printStackTrace(); } } public static void main(String[] args) { SplashScreen splash = new SplashScreen(3000); // Normally, we'd call splash.showSplash() and get on // with the program. But, since this is only a test... splash.showSplashAndExit(); try { /* * com.jtattoo.plaf.smart.SmartLookAndFeel==========work ing * */

UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFee l"); /* * com.sun.java.swing.plaf.windows.WindowsLookAndFeel=== =======working * */ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.Wind owsLookAndFeel");

/* * com.birosoft.liquid.LiquidLookAndFeel==========workin g * */ //javax.swing.UIManager.setLookAndFeel("com.birosoft.liq uid.LiquidLookAndFeel"); // if you want decorations for frames and dialogs you can pu t this two lines // // JFrame.setDefaultLookAndFeelDecorated(true); // to de corate frames // JDialog.setDefaultLookAndFeelDecorated(true); // to decorate dialogs // // or put this one line // // com.birosoft.liquid.LiquidLookAndFeel.setLiquidDecora tions(true); // // or if you want to use Apple's Panther window decorati on // // com.birosoft.liquid.LiquidLookAndFeel.setLiquidDecora tions(true, "panther");

// select the Look and Feel } } } } } catch catch catch catch (InstantiationException e) { (ClassNotFoundException e) { (UnsupportedLookAndFeelException e) { (IllegalAccessException e) {

java.awt.EventQueue.invokeLater(new Runnable() { public void run() { MainFrame mainFrame = new MainFrame(); /*mainFrame.setLookAndFeel("com.sun.java.swing.p laf.windows.WindowsLookAndFeel");*/ JWindow jwin = new JWindow(); jwin.getContentPane() .add( new JLabel("Loading ZIP/JAR Manager...", SwingConstants.CENTER)); jwin.setBounds(200, 200, 200, 100); jwin.setVisible(true); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); }

jwin.setVisible(false); jwin.dispose(); mainFrame.setVisible(true); //mainFrame.setDefaultCloseOperation(JFrame.DISP OSE_ON_CLOSE); //dispose(); } }); } private void setColumnWidth(TableColumn column, int width) { column.setPreferredWidth(width); column.setMaxWidth(width); } }

S-ar putea să vă placă și