Revision: 3446
Author: ferguson.sebastian
Date: Fri Apr 9 08:41:23 2010
Log: Architect no longer references SPSession, it uses workspace container
and runnable dispatcher
http://code.google.com/p/power-architect/source/detail?r=3446
Modified:
/trunk/regress/ca/sqlpower/architect/ArchitectProjectTest.java
/trunk/regress/ca/sqlpower/architect/enterprise/ArchitectSessionPersisterTest.java
/trunk/regress/ca/sqlpower/architect/swingui/TestPlayPenComponent.java
/trunk/regress/ca/sqlpower/architect/swingui/TestSwingUIProject.java
/trunk/src/main/java/ca/sqlpower/architect/ArchitectProject.java
/trunk/src/main/java/ca/sqlpower/architect/ArchitectSession.java
/trunk/src/main/java/ca/sqlpower/architect/enterprise/ArchitectClientSideSession.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/enterprise/RevisionListPanel.java
=======================================
--- /trunk/regress/ca/sqlpower/architect/ArchitectProjectTest.java Thu Mar
18 07:58:15 2010
+++ /trunk/regress/ca/sqlpower/architect/ArchitectProjectTest.java Fri Apr
9 08:41:23 2010
@@ -58,11 +58,11 @@
}
/**
- * Minor test to ensure the child position offset does allow children
that
- * are subclasses of child types it allows.
+ * Tests the architect project's ability to add children subclassing
the things in its allowedChildTypes.
+ * Fails if childPositionOffset throws an IllegalArgumentException.
*/
public void testChildPositionOffset() throws Exception {
- assertEquals(1,
objectUnderTest.childPositionOffset(ProfileManagerImpl.class));
+ objectUnderTest.childPositionOffset(ProfileManagerImpl.class);
}
@Override
=======================================
---
/trunk/regress/ca/sqlpower/architect/enterprise/ArchitectSessionPersisterTest.java
Thu Mar 18 07:58:15 2010
+++
/trunk/regress/ca/sqlpower/architect/enterprise/ArchitectSessionPersisterTest.java
Fri Apr 9 08:41:23 2010
@@ -52,7 +52,7 @@
session = new ArchitectSessionImpl(new
TestingArchitectSessionContext(), "test");
SessionPersisterSuperConverter converter = new
ArchitectPersisterSuperConverter(getPLIni(), session.getWorkspace());
persister = new ArchitectSessionPersister("test",
session.getWorkspace(), converter);
- persister.setSession(session);
+ persister.setWorkspaceContainer(session);
}
/**
=======================================
--- /trunk/regress/ca/sqlpower/architect/swingui/TestPlayPenComponent.java
Mon Apr 5 16:15:43 2010
+++ /trunk/regress/ca/sqlpower/architect/swingui/TestPlayPenComponent.java
Fri Apr 9 08:41:23 2010
@@ -123,6 +123,8 @@
copyIgnoreProperties.add("preferredSize");
copyIgnoreProperties.add("selected");
copyIgnoreProperties.add("session");
+ copyIgnoreProperties.add("workspaceContainer");
+ copyIgnoreProperties.add("runnableDispatcher");
copyIgnoreProperties.add("size");
copyIgnoreProperties.add("toolTipText");
copyIgnoreProperties.add("width");
=======================================
--- /trunk/regress/ca/sqlpower/architect/swingui/TestSwingUIProject.java
Tue Apr 6 14:44:35 2010
+++ /trunk/regress/ca/sqlpower/architect/swingui/TestSwingUIProject.java
Fri Apr 9 08:41:23 2010
@@ -237,6 +237,8 @@
propertiesToIgnore.add("magicEnabled");
propertiesToIgnore.add("childrenInaccessibleReason");
propertiesToIgnore.add("session");
+ propertiesToIgnore.add("workspaceContainer");
+ propertiesToIgnore.add("runnableDispatcher");
propertiesToIgnore.add("foregroundThread");
propertiesToIgnore.add("backgroundThread");
return propertiesToIgnore;
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/ArchitectProject.java Tue
Apr 6 14:44:35 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/ArchitectProject.java Fri
Apr 9 08:41:23 2010
@@ -50,7 +50,9 @@
import ca.sqlpower.sqlobject.SQLObject;
import ca.sqlpower.sqlobject.SQLObjectException;
import ca.sqlpower.sqlobject.SQLObjectRoot;
+import ca.sqlpower.util.RunnableDispatcher;
import ca.sqlpower.util.SessionNotFoundException;
+import ca.sqlpower.util.WorkspaceContainer;
/**
*
@@ -264,6 +266,16 @@
}
}
+ @Override @Transient @Accessor
+ public WorkspaceContainer getWorkspaceContainer() {
+ return getSession();
+ }
+
+ @Override @Transient @Accessor
+ public RunnableDispatcher getRunnableDispatcher() {
+ return getSession();
+ }
+
public boolean allowsChildren() {
return true;
}
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/ArchitectSession.java Thu
Feb 25 09:46:15 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/ArchitectSession.java Fri
Apr 9 08:41:23 2010
@@ -30,10 +30,11 @@
import ca.sqlpower.sqlobject.SQLObjectException;
import ca.sqlpower.sqlobject.SQLObjectRoot;
import ca.sqlpower.swingui.event.SessionLifecycleListener;
-import ca.sqlpower.util.SPSession;
+import ca.sqlpower.util.RunnableDispatcher;
import ca.sqlpower.util.UserPrompterFactory;
-
-public interface ArchitectSession extends UserPrompterFactory,
SQLDatabaseMapping, SPSession {
+import ca.sqlpower.util.WorkspaceContainer;
+
+public interface ArchitectSession extends UserPrompterFactory,
SQLDatabaseMapping, WorkspaceContainer, RunnableDispatcher {
public static final String PREFS_PL_INI_PATH = "PL.INI.PATH";
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/enterprise/ArchitectClientSideSession.java
Tue Apr 6 14:37:05 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/enterprise/ArchitectClientSideSession.java
Fri Apr 9 08:41:23 2010
@@ -157,7 +157,7 @@
sessionPersister = new ArchitectSessionPersister("inbound-" +
projectLocation.getUUID(), getWorkspace(),
new SessionPersisterSuperConverter(dataSourceCollection,
getWorkspace()));
- sessionPersister.setSession(this);
+ sessionPersister.setWorkspaceContainer(this);
jsonMessageDecoder = new SPJSONMessageDecoder(sessionPersister);
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java
Fri Mar 12 13:32:07 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java
Fri Apr 9 08:41:23 2010
@@ -244,7 +244,7 @@
public void childAdded(SPChildEvent e) {
if
(!SQLPowerUtils.getAncestorList(e.getSource()).contains(root)
&& !e.getSource().equals(root)) return;
- if (!root.getSession().isForegroundThread())
+ if (!root.getRunnableDispatcher().isForegroundThread())
throw new IllegalStateException("Adding a child " +
e.getChild() + " to " + e.getSource() +
" not on the foreground thread.");
if (logger.isDebugEnabled()) {
@@ -289,7 +289,7 @@
public void childRemoved(SPChildEvent e) {
if
(!SQLPowerUtils.getAncestorList(e.getSource()).contains(root)
&& !e.getSource().equals(root)) return;
- if (!root.getSession().isForegroundThread())
+ if (!root.getRunnableDispatcher().isForegroundThread())
throw new IllegalStateException("Removing a child " +
e.getChild() + " to " + e.getSource() +
" not on the foreground thread.");
if (logger.isDebugEnabled()) {
@@ -314,7 +314,7 @@
}
public void transactionEnded(TransactionEvent e) {
- if (!root.getSession().isForegroundThread())
+ if (!root.getRunnableDispatcher().isForegroundThread())
throw new IllegalStateException("Transaction ended for " +
e.getSource() +
" while not on the foreground thread.");
if (transactionCount == 0) {
@@ -339,7 +339,7 @@
}
public void transactionRollback(TransactionEvent e) {
- if (!root.getSession().isForegroundThread())
+ if (!root.getRunnableDispatcher().isForegroundThread())
throw new IllegalStateException("Transaction rolled back
for " + e.getSource() +
" while not on the foreground thread.");
transactionCount = 0;
@@ -347,7 +347,7 @@
}
public void transactionStarted(TransactionEvent e) {
- if (!root.getSession().isForegroundThread())
+ if (!root.getRunnableDispatcher().isForegroundThread())
throw new IllegalStateException("Transaction started for "
+ e.getSource() +
" while not on the foreground thread.");
transactionCount++;
@@ -357,7 +357,7 @@
if (!SQLPowerUtils.getAncestorList(((SPObject)
e.getSource())).contains(root) && !e.getSource().equals(root)) return;
- if (!root.getSession().isForegroundThread())
+ if (!root.getRunnableDispatcher().isForegroundThread())
throw new IllegalStateException("Changing the property" +
e.getPropertyName() + " on " + e.getSource() +
" not on the foreground thread.");
logger.debug("dbObjectChanged. source="+e.getSource());
//$NON-NLS-1$
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/enterprise/RevisionListPanel.java
Mon Mar 29 09:06:23 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/enterprise/RevisionListPanel.java
Fri Apr 9 08:41:23 2010
@@ -204,7 +204,7 @@
new SessionPersisterSuperConverter(
revisionSession.getDataSources(),
revisionSession.getWorkspace()));
- sessionPersister.setSession(revisionSession);
+ sessionPersister.setWorkspaceContainer(revisionSession);
SPJSONMessageDecoder decoder = new
SPJSONMessageDecoder(sessionPersister);
--
To unsubscribe, reply using "remove me" as the subject.