r2241 - in trunk: jaxx-compiler/src/main/java/jaxx/compiler/decorators jaxx-compiler/src/main/java/jaxx/compiler/tasks maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test
Author: tchemit Date: 2011-03-18 10:33:24 +0100 (Fri, 18 Mar 2011) New Revision: 2241 Url: http://nuiton.org/repositories/revision/jaxx/2241 Log: fix for real Anomalie #1404: Using decorator='boxed' miss import jaxx.runtime.SwingUtil Added: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/TestParent.jaxx Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1404Test.java trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/Test1.jaxx Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java 2011-03-17 18:17:49 UTC (rev 2240) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java 2011-03-18 09:33:24 UTC (rev 2241) @@ -63,6 +63,10 @@ String javaCode = child.getChildJavaCode(); String type = compiler.getImportManager().getType(SwingUtil.class); + if (log.isInfoEnabled()) { + log.info("SwingUtil type " + type); + } + compiler.setNeedSwingUtil(true); child.setChildJavaCode( type + ".boxComponentWithJxLayer(" + javaCode + ")"); Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java 2011-03-17 18:17:49 UTC (rev 2240) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java 2011-03-18 09:33:24 UTC (rev 2241) @@ -199,9 +199,8 @@ JavaArgument[] arguments = constructor.getArguments(); for (JavaArgument argument : arguments) { String type = argument.getType(); - String simpleType = null; try { - simpleType = importsManager.getType(type); + String simpleType = importsManager.getType(type); argument.setType(simpleType); } catch (Exception e) { log.error("file [" + f.getName() + Modified: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1404Test.java =================================================================== --- trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1404Test.java 2011-03-17 18:17:49 UTC (rev 2240) +++ trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1404Test.java 2011-03-18 09:33:24 UTC (rev 2241) @@ -39,7 +39,7 @@ GenerateMojo mojo = getMojo(); mojo.execute(); - assertNumberJaxxFiles(1); + assertNumberJaxxFiles(2); checkPattern(mojo, "import jaxx.runtime.SwingUtil;", true); } Modified: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/Test1.jaxx =================================================================== --- trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/Test1.jaxx 2011-03-17 18:17:49 UTC (rev 2240) +++ trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/Test1.jaxx 2011-03-18 09:33:24 UTC (rev 2241) @@ -22,4 +22,6 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --> -<JLabel implements="java.io.Serializable" text='test' decorator='boxed'/> \ No newline at end of file + <TestParent> + <JLabel id='label' decorator='boxed'/> + </TestParent> Copied: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/TestParent.jaxx (from rev 2240, trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/Test1.jaxx) =================================================================== --- trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/TestParent.jaxx (rev 0) +++ trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1404Test/TestParent.jaxx 2011-03-18 09:33:24 UTC (rev 2241) @@ -0,0 +1,25 @@ +<!-- + #%L + JAXX :: Maven plugin + + $Id$ + $HeadURL$ + %% + Copyright (C) 2008 - 2011 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 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 Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + <JPanel id='content'/> \ No newline at end of file
participants (1)
-
tchemit@users.nuiton.org