Thread: [Squirrel-sql-commits] sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff DiffEx
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Rob M. <man...@us...> - 2007-08-28 03:25:55
|
Update of /cvsroot/squirrel-sql/sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22083/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff Modified Files: DiffExecutor.java ColumnDifference.java Log Message: improve UI and added diff for remarks. Index: ColumnDifference.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/ColumnDifference.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ColumnDifference.java 16 Jun 2007 04:17:13 -0000 1.1 --- ColumnDifference.java 28 Aug 2007 03:25:47 -0000 1.2 *************** *** 44,47 **** --- 44,50 ---- private boolean col2Exists = true; + private String col1remarks = ""; + private String col2remarks = ""; + public ColumnDifference() {} *************** *** 68,71 **** --- 71,75 ---- tableName = c1.getTableName(); columnName = c1.getColumnName(); + col1remarks = c1.getRemarks(); } *************** *** 75,79 **** col2IsNullable = c2.isNullable().equalsIgnoreCase("NO") ? false : true; tableName = c2.getTableName(); ! columnName = c2.getColumnName(); } --- 79,84 ---- col2IsNullable = c2.isNullable().equalsIgnoreCase("NO") ? false : true; tableName = c2.getTableName(); ! columnName = c2.getColumnName(); ! col2remarks = c2.getRemarks(); } *************** *** 102,105 **** --- 107,118 ---- } + public String getCol1Remarks() { + return col1remarks; + } + + public String getCol2Remarks() { + return col2remarks; + } + /** * Returns a boolean indicating whether or not the two columns are different *************** *** 121,124 **** --- 134,140 ---- return true; } + if (!remarksEqual()) { + return true; + } return false; } *************** *** 180,183 **** --- 196,222 ---- } + public boolean remarksEqual() { + if (col1remarks == null && col2remarks == null) { + return true; + } + if ((col1remarks == null && col2remarks != null) + || (col1remarks != null && col2remarks == null)) { + return false; + } + return col1remarks.equals(col2remarks); + } + + public boolean typesEqual() { + return col1Type == col2Type; + } + + public boolean lengthsEqual() { + return col1Length == col2Length; + } + + public boolean nullableEqual() { + return col1IsNullable == col2IsNullable; + } + public String toString() { StringBuilder result = new StringBuilder(); Index: DiffExecutor.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/DiffExecutor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DiffExecutor.java 16 Jun 2007 14:14:01 -0000 1.3 --- DiffExecutor.java 28 Aug 2007 03:25:47 -0000 1.4 *************** *** 32,35 **** --- 32,36 ---- import net.sourceforge.squirrel_sql.client.session.ISession; import net.sourceforge.squirrel_sql.fw.dialects.DialectFactory; + import net.sourceforge.squirrel_sql.fw.gui.GUIUtils; import net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectType; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; *************** *** 180,189 **** final MainFrame frame = sourceSession.getApplication().getMainFrame(); if (colDifferences != null && colDifferences.size() > 0) { ! ! ColumnDiffDialog dialog = new ColumnDiffDialog(frame, false); ! dialog.setColumnDifferences(colDifferences); ! dialog.setSession1Label(sourceSession.getAlias().getName()); ! dialog.setSession2Label(destSession.getAlias().getName()); ! dialog.setVisible(true); } else { SwingUtilities.invokeLater(new Runnable() { --- 181,193 ---- final MainFrame frame = sourceSession.getApplication().getMainFrame(); if (colDifferences != null && colDifferences.size() > 0) { ! GUIUtils.processOnSwingEventThread(new Runnable() { ! public void run() { ! ColumnDiffDialog dialog = new ColumnDiffDialog(frame, false); ! dialog.setColumnDifferences(colDifferences); ! dialog.setSession1Label(sourceSession.getAlias().getName()); ! dialog.setSession2Label(destSession.getAlias().getName()); ! dialog.setVisible(true); ! } ! }); } else { SwingUtilities.invokeLater(new Runnable() { |