Java Code Examples for net.sf.mpxj.ProjectFile#getTables()

The following examples show how to use net.sf.mpxj.ProjectFile#getTables() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProjectTreeController.java    From mpxj with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Add tables to the tree.
 *
 * @param parentNode parent tree node
 * @param file tables container
 */
private void addTables(MpxjTreeNode parentNode, ProjectFile file)
{
   for (Table table : file.getTables())
   {
      final Table t = table;
      MpxjTreeNode childNode = new MpxjTreeNode(table, TABLE_EXCLUDED_METHODS)
      {
         @Override public String toString()
         {
            return t.getName();
         }
      };
      parentNode.add(childNode);

      addColumns(childNode, table);
   }
}
 
Example 2
Source File: BasicTest.java    From mpxj with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Test retrieval of table information.
 *
 * @throws Exception
 */
@Test public void testTables() throws Exception
{
   ProjectFile mpp = new MPPReader().read(MpxjTestData.filePath("legacy/sample98.mpp"));
   List<Table> tables = mpp.getTables();
   //      Iterator iter = tables.iterator();
   //      while (iter.hasNext() == true)
   //      {
   //         System.out.println(iter.next());
   //      }

   assertEquals("Incorrect number of tables", 1, tables.size());

   mpp = new MPPReader().read(MpxjTestData.filePath("legacy/sample.mpp"));
   tables = mpp.getTables();
   //      iter = tables.iterator();
   //      while (iter.hasNext() == true)
   //      {
   //         System.out.println(iter.next());
   //      }

   assertEquals("Incorrect number of tables", 2, tables.size());
}
 
Example 3
Source File: AbstractView.java    From mpxj with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Constructor.
 *
 * @param parent parent file
 */
public AbstractView(ProjectFile parent)
{
   m_properties = parent.getProjectProperties();
   m_tables = parent.getTables();
}