Author: ruschein
Date: 2011-08-22 10:46:05 -0700 (Mon, 22 Aug 2011)
New Revision: 26617

Modified:
   
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableManager.java
   
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyTableManagerTest.java
Log:
Added new addTable() method to allow registration of tables with the table 
manager.

Modified: 
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableManager.java
===================================================================
--- 
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableManager.java 
    2011-08-22 16:54:48 UTC (rev 26616)
+++ 
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableManager.java 
    2011-08-22 17:46:05 UTC (rev 26617)
@@ -59,6 +59,11 @@
         */
        Set<CyTableMetadata> getAllTables(boolean includePrivate);
 
+       /** Registers a new table with the manager and fires a TableAddedEvent 
event.
+        *  @param table a non-null CyTable that will be added to the manager
+        */
+       void addTable(CyTable table);
+
        /**
         * Returns the table with the specified SUID. 
         * @param suid The SUID identifying the CyTable.

Modified: 
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyTableManagerTest.java
===================================================================
--- 
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyTableManagerTest.java
 2011-08-22 16:54:48 UTC (rev 26616)
+++ 
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyTableManagerTest.java
 2011-08-22 17:46:05 UTC (rev 26617)
@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2010-2011, The Cytoscape Consortium (www.cytoscape.org)
 
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
@@ -91,8 +91,16 @@
 
        @Test
        public void testReset() {
+               mgr.addTable(goodNetwork.getDefaultNodeTable());
                assertFalse(mgr.getAllTables(true).isEmpty());
                mgr.reset();
                assertTrue(mgr.getAllTables(true).isEmpty());
        }
+
+       @Test
+       public void testAddTable() {
+               mgr.addTable(goodNetwork.getDefaultNodeTable());
+               assertEquals(goodNetwork.getDefaultNodeTable(),
+                            
mgr.getTable(goodNetwork.getDefaultNodeTable().getSUID()));
+       }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to