From: <yh...@us...> - 2010-08-28 09:31:56
|
Revision: 4 http://netbeansjavasql.svn.sourceforge.net/netbeansjavasql/?rev=4&view=rev Author: yhoppe Date: 2010-08-28 09:31:50 +0000 (Sat, 28 Aug 2010) Log Message: ----------- Some bugfixes and updates. General clean up Modified Paths: -------------- trunk/src/de/acyrance/nb/sqlgenerator/Generators/Code/MySQLCodeGenerator.java trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.form trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.java Modified: trunk/src/de/acyrance/nb/sqlgenerator/Generators/Code/MySQLCodeGenerator.java =================================================================== --- trunk/src/de/acyrance/nb/sqlgenerator/Generators/Code/MySQLCodeGenerator.java 2010-08-16 13:31:49 UTC (rev 3) +++ trunk/src/de/acyrance/nb/sqlgenerator/Generators/Code/MySQLCodeGenerator.java 2010-08-28 09:31:50 UTC (rev 4) @@ -45,7 +45,7 @@ csql.append(generateMySQLUpdate(vars, tablename, primary_key)); csql.append(generateMySQLDelete(vars, tablename, primary_key)); - return csql.toString(); + return csql.toString().replaceAll("java.lang.String", "String"); // Should be moved, dirty solution.. } /** @@ -391,7 +391,7 @@ sql.append(NbPreferences.forModule(SQLGeneratorOptionsPanel.class).get("codeModifier", "public")); sql.append(" static int "); sql.append("insertInto"); - sql.append(tablename); + sql.append(tablename.substring(0, 1).toUpperCase()).append(tablename.substring(1)); sql.append("(Connection con, "); for(int i = 0; i < vars.length; i++) { @@ -419,7 +419,7 @@ sql.append(NbPreferences.forModule(SQLGeneratorOptionsPanel.class).get("codeModifier", "public")); sql.append(" int "); sql.append("insertInto"); - sql.append(tablename); + sql.append(tablename.substring(0, 1).toUpperCase()).append(tablename.substring(1)); sql.append("(Connection con, "); for(int i = 0; i < vars.length; i++) { @@ -462,6 +462,10 @@ sql.append(name); if(i != vars.length -1) sql.append(", "); + + if(i % 6 == 0) { + sql.append("\"\n + \""); + } cnt++; } Modified: trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.form =================================================================== --- trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.form 2010-08-16 13:31:49 UTC (rev 3) +++ trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.form 2010-08-28 09:31:50 UTC (rev 4) @@ -1,6 +1,10 @@ <?xml version="1.1" encoding="UTF-8" ?> <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <NonVisualComponents> + <Component class="javax.swing.ButtonGroup" name="grpSQL"> + </Component> + </NonVisualComponents> <AuxValues> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> @@ -24,8 +28,8 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <Component id="generatorToolbar" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="panel_sqlcode" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="0" max="-2" attributes="0"/> + <Component id="panel_sqlcode" pref="506" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -51,6 +55,9 @@ </Component> <Component class="javax.swing.JToggleButton" name="btnSQL"> <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="grpSQL"/> + </Property> <Property name="selected" type="boolean" value="true"/> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <ResourceString bundle="de/acyrance/nb/sqlgenerator/Window/Bundle.properties" key="SQLGeneratorTopComponent.btnSQL.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> @@ -68,6 +75,9 @@ </Component> <Component class="javax.swing.JToggleButton" name="btnSQLCode"> <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="grpSQL"/> + </Property> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <ResourceString bundle="de/acyrance/nb/sqlgenerator/Window/Bundle.properties" key="SQLGeneratorTopComponent.btnSQLCode.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> </Property> @@ -107,7 +117,7 @@ <Container class="javax.swing.JPanel" name="panel_sqlcode"> <Properties> <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> - <Color id="Default Cursor"/> + <Color id="Standardcursor"/> </Property> <Property name="opaque" type="boolean" value="false"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> @@ -118,16 +128,12 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="scrollpane_code" pref="706" max="32767" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - </Group> + <Component id="scrollpane_code" alignment="0" pref="730" max="32767" attributes="0"/> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="scrollpane_code" alignment="0" pref="500" max="32767" attributes="0"/> + <Component id="scrollpane_code" alignment="0" pref="506" max="32767" attributes="0"/> </Group> </DimensionLayout> </Layout> Modified: trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.java =================================================================== --- trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.java 2010-08-16 13:31:49 UTC (rev 3) +++ trunk/src/de/acyrance/nb/sqlgenerator/Window/SQLGeneratorTopComponent.java 2010-08-28 09:31:50 UTC (rev 4) @@ -112,6 +112,7 @@ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + grpSQL = new javax.swing.ButtonGroup(); generatorToolbar = new javax.swing.JToolBar(); jSeparator2 = new javax.swing.JToolBar.Separator(); btnSQL = new javax.swing.JToggleButton(); @@ -130,6 +131,7 @@ generatorToolbar.setPreferredSize(new java.awt.Dimension(381, 35)); generatorToolbar.add(jSeparator2); + grpSQL.add(btnSQL); btnSQL.setSelected(true); org.openide.awt.Mnemonics.setLocalizedText(btnSQL, org.openide.util.NbBundle.getMessage(SQLGeneratorTopComponent.class, "SQLGeneratorTopComponent.btnSQL.text")); // NOI18N btnSQL.setFocusable(false); @@ -142,6 +144,7 @@ }); generatorToolbar.add(btnSQL); + grpSQL.add(btnSQLCode); org.openide.awt.Mnemonics.setLocalizedText(btnSQLCode, org.openide.util.NbBundle.getMessage(SQLGeneratorTopComponent.class, "SQLGeneratorTopComponent.btnSQLCode.text")); // NOI18N btnSQLCode.setFocusable(false); btnSQLCode.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); @@ -178,14 +181,11 @@ panel_sqlcode.setLayout(panel_sqlcodeLayout); panel_sqlcodeLayout.setHorizontalGroup( panel_sqlcodeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(panel_sqlcodeLayout.createSequentialGroup() - .addContainerGap() - .addComponent(scrollpane_code, javax.swing.GroupLayout.DEFAULT_SIZE, 706, Short.MAX_VALUE) - .addContainerGap()) + .addComponent(scrollpane_code, javax.swing.GroupLayout.DEFAULT_SIZE, 730, Short.MAX_VALUE) ); panel_sqlcodeLayout.setVerticalGroup( panel_sqlcodeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(scrollpane_code, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) + .addComponent(scrollpane_code, javax.swing.GroupLayout.DEFAULT_SIZE, 506, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -199,8 +199,8 @@ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(generatorToolbar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(panel_sqlcode, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(0, 0, 0) + .addComponent(panel_sqlcode, javax.swing.GroupLayout.DEFAULT_SIZE, 506, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents @@ -246,16 +246,10 @@ private void btnSQLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSQLActionPerformed textarea_code.setText(sql); - - btnSQL.setSelected(true); - btnSQLCode.setSelected(false); }//GEN-LAST:event_btnSQLActionPerformed private void btnSQLCodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSQLCodeActionPerformed textarea_code.setText(sqlcode); - - btnSQLCode.setSelected(true); - btnSQL.setSelected(false); }//GEN-LAST:event_btnSQLCodeActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables @@ -263,6 +257,7 @@ public javax.swing.JToggleButton btnSQLCode; public javax.swing.JComboBox combo_sqlswitch; private javax.swing.JToolBar generatorToolbar; + private javax.swing.ButtonGroup grpSQL; private javax.swing.JToolBar.Separator jSeparator1; private javax.swing.JToolBar.Separator jSeparator2; private javax.swing.JPanel panel_sqlcode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |