Index: topia/src/java/org/codelutin/topia/ui/generators/ObjectModelToEntitySelectionPanel.java diff -u /dev/null topia/src/java/org/codelutin/topia/ui/generators/ObjectModelToEntitySelectionPanel.java:1.1 --- /dev/null Tue Jul 20 16:03:27 2004 +++ topia/src/java/org/codelutin/topia/ui/generators/ObjectModelToEntitySelectionPanel.java Tue Jul 20 16:03:22 2004 @@ -0,0 +1,110 @@ +/* *##% + * 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. + *##%*/ + +/* * + * ObjectModelToEntitySelectionPanel.java + * + * Created: Jul 20, 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/20 16:03:22 $ + * par : $Author: mazelier $ + */ + +package org.codelutin.topia.ui.generators; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; + +import org.codelutin.generator.ObjectModelGeneratorWithCapitalizeName; +import org.codelutin.generator.models.object.ObjectModelClass; + +/** +* Ce generateur permet de generer la classe avec l'ensemble +* des methodes a implanter pour le panel de selection +*/ +public class ObjectModelToEntitySelectionPanel +extends ObjectModelGeneratorWithCapitalizeName { // ObjectModelToEntitySelectionPanel + + public String getFilenameForClass(ObjectModelClass clazz) { + return (clazz.getPackageName() + ".ui.") + .replace('.', File.separatorChar) + + capitalizeName(clazz) + "SelectionPanel.java"; + } +/** +* Methodes a implanter : les handlers des buttons SelectAll, Reset, Ok et Cancel */ + public void generateFromClass(Writer output, ObjectModelClass clazz) + throws IOException { + if(Util.isEntity(clazz)){ + if (!"".equals(clazz.getPackageName())) { + +/*{ +/** +* Generated: by ToPIA Framework +* Copyright Code Lutin +* http://www.codelutin.com +*) + +package <%=clazz.getPackageName()%>.ui; + +import org.codelutin.topia.TopiaContext; +import org.codelutin.topia.TopiaQuery; +}*/ + } +/*{ + +public class <%=capitalizeName(clazz)%>SelectionPanel extends <%=capitalizeName(clazz)%>SelectionPanelUI { + + public <%=capitalizeName(clazz)%>SelectionPanel(){ + init(); + } + + public <%=capitalizeName(clazz)%>SelectionPanel(TopiaContext context){ + setContext(context); + init(); + } + + public void on_selectAll(){ + // TODO a implanter + System.out.println("on_selectAll"); + } + + public void on_reset(){ + // TODO a implanter + System.out.println("on_reset"); + } + + public void on_cancel(){ + // TODO a implanter + System.out.println("on_cancel"); + } + + public void on_ok(){ + // TODO a implanter + System.out.println("on_ok"); + } +} +}*/ + } + } +} // ObjectModelToEntitySelectionPanel + Index: topia/src/java/org/codelutin/topia/ui/generators/ObjectModelToEntitySelectionUIModel.java diff -u /dev/null topia/src/java/org/codelutin/topia/ui/generators/ObjectModelToEntitySelectionUIModel.java:1.1 --- /dev/null Tue Jul 20 16:03:27 2004 +++ topia/src/java/org/codelutin/topia/ui/generators/ObjectModelToEntitySelectionUIModel.java Tue Jul 20 16:03:22 2004 @@ -0,0 +1,199 @@ +/* *##% + * 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. + *##%*/ + +/* * + * ObjectModelToEntitySelectionUIModel.java + * + * Created: Jul 20, 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/20 16:03:22 $ + * par : $Author: mazelier $ + */ + +package org.codelutin.topia.ui.generators; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; + +import org.codelutin.generator.ObjectModelGeneratorWithCapitalizeName; +import org.codelutin.generator.models.object.ObjectModelClass; + + +/** +* Ce generateur permet de generer l'interface de selection de champs +* se trouvant dans une table +*/ +public class ObjectModelToEntitySelectionUIModel +extends ObjectModelGeneratorWithCapitalizeName{ // ObjectModelToEntitySelectionUIModel + + public String getFilenameForClass(ObjectModelClass clazz) { + // put .uimodel file in uimodel directory + return ".." + File.separator + "uimodel" + File.separator + capitalizeName(clazz) + "SelectionPanel.uimodel"; + } + + /** + * Genere un panel qui contient un table dans laquelle on + * selectionnera les champs qui devront etre ajoute a une liste + * d'entites + */ + public void generateFromClass(Writer output, ObjectModelClass clazz) + throws IOException { + + if(Util.isEntity(clazz)){ +/*{ + + + package="<%=clazz.getPackageName()%>.ui"<% } %>> + + + + + + + + + + <%=clazz.getName()%>SelectionPanel + + +}*/ +String title = clazz.getName(); +generateBorderPanel(output, clazz, title+"SelectionPanel"); +/*{ + + + + + + + + <%=capitalizeName(clazz)%>TablePanelPanel + + +}*/ +generateBorderPanel(output, clazz, title+" List"); +/*{ + + + + + + 0 + 0 + 1 + 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + + + + <%=capitalizeName(clazz)%>ButtonsPanel + + +}*/ +generateBorderPanel(output, clazz, ""); +/*{ + + + + + + 0 + 1 + 1 + 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + +}*/ + } + } + + /** + * Genere le border du panel + */ + public void generateBorderPanel(Writer output, ObjectModelClass clazz, + String name) throws IOException { +/*{ + + + + + + + 0 + + + <%=name%> + 0 + 0 + + + + +}*/ + } + +} // ObjectModelToEntitySelectionUIModel +