1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/PageProcessor.java Wed Apr 03 18:23:49 2013 +0200
1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/PageProcessor.java Thu Apr 04 06:12:36 2013 +0200
1.3 @@ -138,7 +138,7 @@
1.4 w.append(" private boolean locked;\n");
1.5 w.append(" private org.apidesign.bck2brwsr.htmlpage.Knockout ko;\n");
1.6 w.append(body.toString());
1.7 - w.append(" private static Class<" + e.getSimpleName() + "> modelFor() { return null; }\n");
1.8 + w.append(" private static Class<" + inPckName(e) + "> modelFor() { return null; }\n");
1.9 w.append(" public ").append(className).append("() {\n");
1.10 w.append(" ko = org.apidesign.bck2brwsr.htmlpage.Knockout.applyBindings(this, ");
1.11 writeStringArray(propsGetSet, w);
1.12 @@ -785,4 +785,18 @@
1.13 w.write(" return sb.toString();\n");
1.14 w.write(" }\n");
1.15 }
1.16 +
1.17 + private String inPckName(Element e) {
1.18 + StringBuilder sb = new StringBuilder();
1.19 + while (e.getKind() != ElementKind.PACKAGE) {
1.20 + if (sb.length() == 0) {
1.21 + sb.append(e.getSimpleName());
1.22 + } else {
1.23 + sb.insert(0, '.');
1.24 + sb.insert(0, e.getSimpleName());
1.25 + }
1.26 + e = e.getEnclosingElement();
1.27 + }
1.28 + return sb.toString();
1.29 + }
1.30 }
2.1 --- a/javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/PeopleImpl.java Wed Apr 03 18:23:49 2013 +0200
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,34 +0,0 @@
2.4 -/**
2.5 - * Back 2 Browser Bytecode Translator
2.6 - * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
2.7 - *
2.8 - * This program is free software: you can redistribute it and/or modify
2.9 - * it under the terms of the GNU General Public License as published by
2.10 - * the Free Software Foundation, version 2 of the License.
2.11 - *
2.12 - * This program is distributed in the hope that it will be useful,
2.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
2.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.15 - * GNU General Public License for more details.
2.16 - *
2.17 - * You should have received a copy of the GNU General Public License
2.18 - * along with this program. Look for COPYING file in the top folder.
2.19 - * If not, see http://opensource.org/licenses/GPL-2.0.
2.20 - */
2.21 -package org.apidesign.bck2brwsr.htmlpage;
2.22 -
2.23 -import org.apidesign.bck2brwsr.htmlpage.api.Model;
2.24 -import org.apidesign.bck2brwsr.htmlpage.api.Property;
2.25 -
2.26 -/**
2.27 - *
2.28 - * @author Jaroslav Tulach <jtulach@netbeans.org>
2.29 - */
2.30 -@Model(className = "People", properties = {
2.31 - @Property(array = true, name = "info", type = PersonImpl.class),
2.32 - @Property(array = true, name = "nicknames", type = String.class),
2.33 - @Property(array = true, name = "age", type = int.class),
2.34 -})
2.35 -public class PeopleImpl {
2.36 -
2.37 -}
3.1 --- a/javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/PersonImpl.java Wed Apr 03 18:23:49 2013 +0200
3.2 +++ b/javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/PersonImpl.java Thu Apr 04 06:12:36 2013 +0200
3.3 @@ -50,4 +50,11 @@
3.4 p.setSex(Sex.MALE);
3.5 }
3.6 }
3.7 +
3.8 + @Model(className = "People", properties = {
3.9 + @Property(array = true, name = "info", type = PersonImpl.class),
3.10 + @Property(array = true, name = "nicknames", type = String.class),
3.11 + @Property(array = true, name = "age", type = int.class),})
3.12 + public class PeopleImpl {
3.13 + }
3.14 }