Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java diff -u topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java:1.1 topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java:1.2 --- topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java:1.1 Fri May 14 13:01:03 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java Wed Jun 9 10:58:37 2004 @@ -1,33 +1,33 @@ /* *##% - * 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. - *##%*/ +* 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. +*##%*/ /* * - * ObjectModelToEntityPanel.java - * - * Created: 11 mai 2004 - * - * @author Benjamin Poussin - * Copyright Code Lutin - * @version $Revision: 1.1 $ - * - * Mise a jour: $Date: 2004/05/14 13:01:03 $ - * par : $Author: bpoussin $ - */ +* ObjectModelToEntityPanel.java +* +* Created: 11 mai 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.2 $ +* +* Mise a jour: $Date: 2004/06/09 10:58:37 $ +* par : $Author: mazelier $ +*/ package org.codelutin.topia.generators.ui; @@ -39,43 +39,43 @@ import java.io.IOException; import org.codelutin.topia.Util; -public class ObjectModelToEntityPanel { // ObjectModelToEntityPanel +public class ObjectModelToEntityPanel extends ObjectModelGenerator { // ObjectModelToEntityPanel public String getFilenameForClass(ObjectModelClass clazz) { return (clazz.getPackageName() + ".ui.") - .replace('.', File.separatorChar) - + clazz.getName() + ".java"; + .replace('.', File.separatorChar) + + clazz.getName() + "Panel.java"; } public void generateFromClass(Writer output, ObjectModelClass clazz) - throws IOException { + throws IOException { if(Util.isEntity(clazz)){ + if (!"".equals(clazz.getPackageName())) { +/*{ + package <%=Util.getParentPackageName(clazz.getPackageName())%>.ui; +}*/ + } /*{ - <% if (!"".equals(clazz.getPackageName())) { %> -package <%=Util.getParentPackageName(clazz.getPackageName())%>.ui; - <% } %> - -public class <%=clazz.getName()%>Panel extends <%=clazz.getName()%>UI { + public class <%=clazz.getName()%>Panel extends <%=clazz.getName()%>PanelUI { - protected TopiaContext context = null; + protected TopiaContext context = null; - public <%=clazz.getName()%>Panel(TopiaContext context){ + public <%=clazz.getName()%>Panel(TopiaContext context){ this.context = context; init(); - } + } - public void on_save(){ - // TODO à implanter - System.out.println("on_save"); + public void on_save(){ + // TODO a implanter + System.out.println("on_save"); + } + + public void on_cancel(){ + // TODO a implanter + System.out.println("on_cancel"); + } } - - public void on_cancel(){ - // TODO à implanter - System.out.println("on_cancel"); - } -} - }*/ } } Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java diff -u topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java:1.5 topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java:1.6 --- topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java:1.5 Wed Jun 2 09:09:52 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java Wed Jun 9 10:58:37 2004 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Mise a jour: $Date: 2004/06/02 09:09:52 $ - * par : $Author: pineau $ + * Mise a jour: $Date: 2004/06/09 10:58:37 $ + * par : $Author: mazelier $ */ package org.codelutin.topia.generators.ui; @@ -74,16 +74,21 @@ - <%=clazz.getName()+"Panel"%> + <%=clazz.getName()%>Panel - }*/ + + }*/ + + int counterArguments =0; + for(Iterator i=clazz.getAttributes().iterator(); i.hasNext();) { ObjectModelAttribute att = (ObjectModelAttribute)i.next(); if("public".equals(att.getVisibility())) { - /*{ + /*{ + @@ -124,7 +129,8 @@ - }*/ + }*/ + if(att.referenceClassifier()){ generateEntityEditor(output, att, counterArguments); @@ -138,7 +144,8 @@ counterArguments++; } } - /*{ +/*{ + @@ -156,8 +163,7 @@ 0 - <%=(clazz.getAttributes().size()-1)%> - + <%= counterArguments %> 1 1 0.0 @@ -195,8 +201,7 @@ 1 - <%=(clazz.getAttributes().size()-1)%> - + <%= counterArguments %> 1 1 0.0 @@ -227,7 +232,8 @@ public void generateDefaultEditor(Writer output, ObjectModelAttribute att, int counterArguments) throws IOException { - /*{ + /*{ + @@ -262,8 +268,8 @@ - } - }*/ + + }*/ } @@ -273,43 +279,44 @@ */ public void generateEntityEditor(Writer output, ObjectModelAttribute att, int counterArguments) throws IOException { - /*{ - - - - - - <%=att.getName()+"Editor"%> - - - - - - - - 1 - <%=counterArguments%> - 1 - 1 - 0.0 - 0.0 - 10 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - - } - }*/ + /*{ + + + + + + + <%=att.getName()+"Editor"%> + + + + + + + + 1 + <%=counterArguments%> + 1 + 1 + 0.0 + 0.0 + 10 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + }*/ } /** @@ -317,7 +324,8 @@ */ public void generateBooleanEditor(Writer output, ObjectModelAttribute att, int counterArguments) throws IOException { - /*{ + /*{ + @@ -353,7 +361,7 @@ - }*/ + }*/ } /** @@ -362,7 +370,8 @@ */ public void generateCharEditor(Writer output, ObjectModelAttribute att, int counterArguments) throws IOException { - /*{ + /*{ + @@ -397,8 +406,8 @@ - } - }*/ + + }*/ }