Author: [EMAIL PROTECTED]
Date: Mon Sep 15 07:26:13 2008
New Revision: 2716

Modified:
   trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
   trunk/src/ca/sqlpower/architect/swingui/PlayPen.java
   trunk/src/ca/sqlpower/architect/swingui/SQLScriptDialog.java
   trunk/src/ca/sqlpower/architect/swingui/action/ExportDDLAction.java

Log:
SPSwingWorker has two methods for returning the value of the cancelled variable: isCanceled and isCancelled. They both do EXACTLY the same thing. Since we're Canadian =), I went with the British spelling (isCancelled). Also, the variable is named cancelled.

Modified: trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java Mon Sep 15 07:26:13 2008
@@ -502,6 +502,7 @@
             } else {
                 for (SPSwingWorker currentWorker : swingWorkers) {
                     currentWorker.kill();
+                    currentWorker.setCancelled(true);
                 }
             }
         }

Modified: trunk/src/ca/sqlpower/architect/swingui/PlayPen.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/PlayPen.java        (original)
+++ trunk/src/ca/sqlpower/architect/swingui/PlayPen.java Mon Sep 15 07:26:13 2008
@@ -1489,8 +1489,8 @@
                 * ProgressMonitor's.
                 */
                @Override
-               public synchronized boolean isCanceled() {
-                       return super.isCanceled() || pm.isCanceled();
+               public synchronized boolean isCancelled() {
+                       return super.isCancelled() || pm.isCanceled();
                }

                /**
@@ -1505,7 +1505,7 @@

                                Iterator<SQLObject> soIt = 
sqlObjects.iterator();
                                // first pass: figure out how much work we need 
to do...
-                               while (soIt.hasNext() && !isCanceled()) {
+                               while (soIt.hasNext() && !isCancelled()) {
                                        pmMax += 
ArchitectUtils.countTablesSnapshot(soIt.next());
                                }
                                jobSize = new Integer(pmMax);
@@ -1529,7 +1529,7 @@
                 */
                private void ensurePopulated(List<SQLObject> soList) {
                        for (SQLObject so : soList) {
-                               if (isCanceled()) break;
+                               if (isCancelled()) break;
                                try {
                                        if (so instanceof SQLTable) progress++;
                                        ensurePopulated(so.getChildren());
@@ -1563,7 +1563,7 @@
                                // reset iterator
                                Iterator<SQLObject> soIt = 
sqlObjects.iterator();

-                               while (soIt.hasNext() && !isCanceled()) {
+                               while (soIt.hasNext() && !isCancelled()) {
                                        SQLObject someData = soIt.next();
                                        someData.fireDbStructureChanged();
                                        if (someData instanceof SQLTable) {
@@ -1574,7 +1574,7 @@
                                        } else if (someData instanceof 
SQLSchema) {
                                                SQLSchema sourceSchema = 
(SQLSchema) someData;
                                                Iterator it = 
sourceSchema.getChildren().iterator();
-                                               while (it.hasNext() && 
!isCanceled()) {
+                                               while (it.hasNext() && 
!isCancelled()) {
                             Object nextTable = it.next();
if (nextTable instanceof SQLExceptionNode) continue;
                                                        SQLTable sourceTable = 
(SQLTable) nextTable;
@@ -1587,10 +1587,10 @@
                                                SQLCatalog sourceCatalog = 
(SQLCatalog) someData;
                                                Iterator cit = 
sourceCatalog.getChildren().iterator();
                                                if 
(sourceCatalog.isSchemaContainer()) {
-                                                       while (cit.hasNext() && 
!isCanceled()) {
+                                                       while (cit.hasNext() && 
!isCancelled()) {
                                                                SQLSchema 
sourceSchema = (SQLSchema) cit.next();
                                                                Iterator it = 
sourceSchema.getChildren().iterator();
-                                                               while (it.hasNext() 
&& !isCanceled()) {
+                                                               while (it.hasNext() 
&& !isCancelled()) {
                                                                        Object 
nextTable = it.next();
if (nextTable instanceof SQLExceptionNode) continue; SQLTable sourceTable = (SQLTable) nextTable;
@@ -1601,7 +1601,7 @@
                                                                }
                                                        }
                                                } else {
-                                                       while (cit.hasNext() && 
!isCanceled()) {
+                                                       while (cit.hasNext() && 
!isCancelled()) {
                                 Object nextTable = cit.next();
if (nextTable instanceof SQLExceptionNode) continue;
                                                                SQLTable 
sourceTable = (SQLTable) nextTable;

Modified: trunk/src/ca/sqlpower/architect/swingui/SQLScriptDialog.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/SQLScriptDialog.java        
(original)
+++ trunk/src/ca/sqlpower/architect/swingui/SQLScriptDialog.java Mon Sep 15 07:26:13 2008
@@ -304,7 +304,7 @@
                        finished = false;
                        setCancelled(false);
                        hasStarted = true;
-                       if (isCanceled() || finished) return;
+                       if (isCancelled() || finished) return;

                        SQLDatabase target = new SQLDatabase(targetDataSource);
statusLabel.setText(Messages.getString("SQLScriptDialog.creatingObjectsInTargetDb") + target.getDataSource() ); //$NON-NLS-1$
@@ -352,7 +352,7 @@
logWriter.info("Database Target: " + target.getDataSource()); //$NON-NLS-1$ logWriter.info("Playpen Dump: " + target.getDataSource()); //$NON-NLS-1$
                                Iterator it = statements.iterator();
-                               while (it.hasNext() && !finished && 
!isCanceled()) {
+                               while (it.hasNext() && !finished && 
!isCancelled()) {
                                        DDLStatement ddlStmt = (DDLStatement) 
it.next();
                                        try {
                                                stmtsTried++;
@@ -388,7 +388,7 @@
                                                        throw new 
RuntimeException(ex2);
                                                }

-                                               if (isCanceled()) {
+                                               if (isCancelled()) {
                                                        finished = true;
// don't return, we might as well display how many statements ended up being processed...
                                                }

Modified: trunk/src/ca/sqlpower/architect/swingui/action/ExportDDLAction.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/action/ExportDDLAction.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/action/ExportDDLAction.java Mon Sep 15 07:26:13 2008
@@ -284,7 +284,7 @@
                 */
                public void doStuff() {

-                       if (this.isCanceled()) return;
+                       if (this.isCancelled()) return;

// First, test if it's possible to connect to the target database
             Connection con = null;
@@ -413,7 +413,7 @@
                }

                public void doStuff() {
-                       if (isCanceled())
+                       if (isCancelled())
                                return;
                        if (conflictFinder.doesUserWantToDropConflicts()) {
                                cr = conflictFinder.getConflictResolver();

Reply via email to