Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToWidgetsXML.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToWidgetsXML.java:1.1 --- /dev/null Thu Jun 17 16:37:59 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToWidgetsXML.java Thu Jun 17 16:37:53 2004 @@ -0,0 +1,78 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* ObjectModelToWidgetsXML.java +* +* Created: Jun 16, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2004/06/17 16:37:53 $ +* par : $Author: mazelier $ +*/ + +package org.codelutin.topia.generators.ui; + +import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModel; +import org.codelutin.generator.models.object.ObjectModelClass; +import java.io.Writer; +import java.io.IOException; +import org.codelutin.topia.Util; +import java.util.Iterator; + +/** +* Cette classe permet de generer un fichier xml de type Buix, ainsi ce fichier +* pourra etre charge et le panel genere dans Topia pourra apparaitre dans la palette +* de Buix +*/ +public class ObjectModelToWidgetsXML extends ObjectModelGenerator{ // ObjectModelToWidgetsXML + + public String getFilenameForModel(ObjectModel model) { + return model.getName()+"-widgets.xml"; + } + + public void generateFromModel(Writer output, ObjectModel model) throws IOException { + +/*{ + +}*/ + Iterator classes = model.getClasses().iterator(); + while (classes.hasNext()) { + ObjectModelClass clazz = (ObjectModelClass) classes.next(); + generate(output, clazz); + } +/*{ + +}*/ + + } + + public void generate(Writer output, ObjectModelClass clazz) throws IOException{ + if(! Util.isEntity(clazz)) return; +/*{ + +}*/ + + } + +} // ObjectModelToWidgetsXML +