Adds a psf for the 1.3.x branch and duplicates the 1.2.x psf as trunk, which is what...
[phpeclipse.git] / net.sourceforge.phpeclipse.wizards / src / net / sourceforge / phpeclipse / wizards / actions / data / PHPDataWizard.java
1 package net.sourceforge.phpeclipse.wizards.actions.data;
2
3 import net.sourceforge.phpeclipse.wizards.xml.ModelUtil;
4
5 import org.w3c.dom.Document;
6 import org.w3c.dom.Element;
7
8 import com.quantum.extensions.IDataExtension;
9 import com.quantum.model.Column;
10 import com.quantum.model.xml.XMLToModelConverter;
11 import com.quantum.util.StringMatrix;
12
13 public class PHPDataWizard implements IDataExtension {
14
15   /*
16    * (non-Javadoc)
17    * 
18    * @see com.quantum.extensions.IDataExtension#run(org.w3c.dom.Document)
19    */
20   public void run(Document doc) {
21     Element root = doc.getDocumentElement();
22
23     // matrix contains the actual selected data in the row:
24 //    StringMatrix matrix = new StringMatrix();
25 //    String sub = "DataRow";
26 //    ModelUtil.xmlToStringMatrix(matrix, root, sub);
27 //    System.out.println(matrix.toString());
28
29     try {
30       XMLToModelConverter c = new XMLToModelConverter(root);
31       String name = ModelUtil.getTableName(root);
32       System.out.print("Table-name: ");
33       System.out.println(name);
34       Column[] cols = c.getColumns();
35       for (int i = 0; i < cols.length; i++) {
36         System.out.print("Column-name: " + i + " ");
37         System.out.println(cols[i].getName());
38       }
39
40     } catch (Exception e) {
41       e.printStackTrace();
42     }
43   }
44
45 }