Jaxx-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
October 2009
- 3 participants
- 80 discussions
r1610 - branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer
by tchemit@users.nuiton.org 28 Oct '09
by tchemit@users.nuiton.org 28 Oct '09
28 Oct '09
Author: tchemit
Date: 2009-10-28 08:42:33 +0100 (Wed, 28 Oct 2009)
New Revision: 1610
Modified:
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java
Log:
ajout license
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java 2009-10-28 07:38:25 UTC (rev 1609)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java 2009-10-28 07:42:33 UTC (rev 1610)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.renderer;
import java.awt.Component;
1
0
r1609 - branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer
by tchemit@users.nuiton.org 28 Oct '09
by tchemit@users.nuiton.org 28 Oct '09
28 Oct '09
Author: tchemit
Date: 2009-10-28 08:38:25 +0100 (Wed, 28 Oct 2009)
New Revision: 1609
Added:
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorTableCelleRenderer.java
Log:
add multi table decorator
Added: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorTableCelleRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorTableCelleRenderer.java (rev 0)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorTableCelleRenderer.java 2009-10-28 07:38:25 UTC (rev 1609)
@@ -0,0 +1,85 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing.renderer;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+import jaxx.runtime.decorator.Decorator;
+import jaxx.runtime.decorator.JXPathDecorator;
+
+/**
+ * A {@link TableCellRenderer} which compute text with the matching decorator
+ * from {@link #decorators} based on the type of value and leave the hand to
+ * the {@link #delegate} to perform the visual renderer.
+ *
+ * @author chemit
+ * @since 2.0.0
+ */
+public class MultiDecoratorTableCelleRenderer implements TableCellRenderer {
+
+ /**
+ * Delegate cell renderer
+ */
+ protected TableCellRenderer delegate;
+ /**
+ * accepted types
+ */
+ protected List<Class<?>> types;
+ /**
+ * decorators for accepted types
+ */
+ protected Decorator<?>[] decorators;
+
+ public MultiDecoratorTableCelleRenderer(JXPathDecorator<?>... decorator) {
+ this(new DefaultTableCellRenderer(), decorator);
+ }
+
+ public MultiDecoratorTableCelleRenderer(TableCellRenderer delegate, JXPathDecorator<?>... decorator) {
+ this.delegate = delegate;
+
+ this.types = new ArrayList<Class<?>>();
+ List<Decorator<?>> tmp = new ArrayList<Decorator<?>>();
+ for (JXPathDecorator<?> d : decorator) {
+ if (types.contains(d.getInternalClass())) {
+ throw new IllegalArgumentException("can not have twice a decorator of type " + d.getInternalClass());
+ }
+ types.add(d.getInternalClass());
+ tmp.add(d);
+ }
+ decorators = tmp.toArray(new Decorator<?>[tmp.size()]);
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasfocus, int row, int column) {
+ if (value != null) {
+ int i = types.indexOf(value.getClass());
+ if (i != -1) {
+ Decorator<?> d = decorators[i];
+ value = d.toString(value);
+ }
+ }
+ return delegate.getTableCellRendererComponent(table, value, isSelected, hasfocus, row, column);
+ }
+}
Property changes on: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorTableCelleRenderer.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
1
0
r1608 - in branches/jaxx-2.X/jaxx-demo/src/main: java/jaxx/demo/component/jaxx/editor java/jaxx/demo/component/swing java/jaxx/demo/feature/validation java/jaxx/demo/fun resources/i18n
by tchemit@users.nuiton.org 28 Oct '09
by tchemit@users.nuiton.org 28 Oct '09
28 Oct '09
Author: tchemit
Date: 2009-10-28 08:29:27 +0100 (Wed, 28 Oct 2009)
New Revision: 1608
Modified:
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties
branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties
Log:
update demo from changes in compiler and runtime
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2009-10-28 07:20:17 UTC (rev 1607)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2009-10-28 07:29:27 UTC (rev 1608)
@@ -79,7 +79,7 @@
<row>
<cell>
<JLabel border='{new TitledBorder(_("jaxxdemo.i18neditor.selected.locale"))}'
- text='{editor.getSelectedLocale()}'/>
+ text='{editor.getSelectedLocale().toString()}'/>
</cell>
</row>
</Table>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2009-10-28 07:20:17 UTC (rev 1607)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2009-10-28 07:29:27 UTC (rev 1608)
@@ -43,7 +43,7 @@
</cell>
<cell>
- <JButton text='{jaxxComboBox.getSelectedItem()}'/>
+ <JButton text='{String.valueOf(jaxxComboBox.getSelectedItem())}'/>
</cell>
</row>
<row>
@@ -58,7 +58,7 @@
</cell>
<cell>
- <JButton text='{comboBox.getSelectedItem()}'/>
+ <JButton text='{comboBox.getSelectedItem()+""}'/>
</cell>
</row>
</Table>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2009-10-28 07:20:17 UTC (rev 1607)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2009-10-28 07:29:27 UTC (rev 1608)
@@ -21,7 +21,7 @@
<jaxx.demo.DemoPanel>
<style source="Validation.css"/>
-<script><![CDATA[
+ <script><![CDATA[
import static org.nuiton.i18n.I18n.n_;
import jaxx.runtime.validator.swing.SwingValidatorMessageListRenderer;
@@ -32,7 +32,7 @@
return new String[]{ getDefaultSource(), "Validation.css", "Model.java", "Identity.java" };
}
]]>
-</script>
+ </script>
<!-- models -->
<Model id='model1'/>
<Model id='model2'/>
@@ -92,7 +92,7 @@
<JLabel text='Ratio:'/>
</cell>
<cell>
- <JSlider id='ratio' minimum='0' maximum='100'
+ <JSlider id='ratio' minimum='0' maximum='100'
value='{model1.getRatio()}'
_validatorLabel='{n_("form.ratio")}'
onStateChanged='model1.setRatio(ratio.getValue())'/>
@@ -127,7 +127,7 @@
<JLabel text='Ratio:'/>
</cell>
<cell>
- <JLabel text='{model1.getRatio()}'/>
+ <JLabel text='{model1.getRatio()+""}'/>
</cell>
</row>
</Table>
@@ -165,7 +165,7 @@
<JLabel text='Ratio:'/>
</cell>
<cell>
- <JSlider id='_ratio' minimum='0' maximum='100'
+ <JSlider id='_ratio' minimum='0' maximum='100'
value='{model2.getRatio()}'
_validatorLabel='{n_("form2.ratio")}'
onStateChanged='model2.setRatio(_ratio.getValue())'/>
@@ -200,7 +200,7 @@
<JLabel text='Ratio:'/>
</cell>
<cell>
- <JLabel text='{model2.getRatio()}'/>
+ <JLabel text='{model2.getRatio()+""}'/>
</cell>
</row>
</Table>
@@ -254,7 +254,7 @@
<JLabel text='Config file :'/>
</cell>
<cell>
- <JTextField id='config' text='{identity.getConfig()}'
+ <JTextField id='config' text='{identity.getConfig()+""}'
onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/>
</cell>
</row>
@@ -263,7 +263,7 @@
<JLabel text='Working directory:'/>
</cell>
<cell>
- <JTextField id='dir' text='{identity.getDir()}'
+ <JTextField id='dir' text='{identity.getDir()+""}'
onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/>
</cell>
</row>
@@ -303,7 +303,7 @@
<JLabel text='Age:'/>
</cell>
<cell>
- <JLabel text='{identity.getAge()}'/>
+ <JLabel text='{identity.getAge()+""}'/>
</cell>
</row>
<row>
@@ -311,7 +311,7 @@
<JLabel text='Config file:'/>
</cell>
<cell>
- <JLabel text='{identity.getConfig()}'/>
+ <JLabel text='{identity.getConfig()+""}'/>
</cell>
</row>
<row>
@@ -319,7 +319,7 @@
<JLabel text='Directory file:'/>
</cell>
<cell>
- <JLabel text='{identity.getDir()}'/>
+ <JLabel text='{identity.getDir()+""}'/>
</cell>
</row>
</Table>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2009-10-28 07:20:17 UTC (rev 1607)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2009-10-28 07:29:27 UTC (rev 1608)
@@ -133,7 +133,7 @@
<JLabel text='Ratio:'/>
</cell>
<cell>
- <JLabel text='{model1.getRatio()}'/>
+ <JLabel text='{model1.getRatio()+""}'/>
</cell>
</row>
</Table>
@@ -206,7 +206,7 @@
<JLabel text='Ratio:'/>
</cell>
<cell>
- <JLabel text='{model2.getRatio()}'/>
+ <JLabel text='{model2.getRatio()+""}'/>
</cell>
</row>
</Table>
@@ -260,7 +260,7 @@
<JLabel text='Config file :'/>
</cell>
<cell>
- <JTextField id='config' text='{identity.getConfig()}'
+ <JTextField id='config' text='{identity.getConfig()+""}'
onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/>
</cell>
</row>
@@ -269,7 +269,7 @@
<JLabel text='Working directory:'/>
</cell>
<cell>
- <JTextField id='dir' text='{identity.getDir()}'
+ <JTextField id='dir' text='{identity.getDir()+""}'
onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/>
</cell>
</row>
@@ -309,7 +309,7 @@
<JLabel text='Age:'/>
</cell>
<cell>
- <JLabel text='{identity.getAge()}'/>
+ <JLabel text='{identity.getAge()+""}'/>
</cell>
</row>
<row>
@@ -317,7 +317,7 @@
<JLabel text='Config file:'/>
</cell>
<cell>
- <JLabel text='{identity.getConfig()}'/>
+ <JLabel text='{identity.getConfig()+""}'/>
</cell>
</row>
<row>
@@ -325,7 +325,7 @@
<JLabel text='Directory file:'/>
</cell>
<cell>
- <JLabel text='{identity.getDir()}'/>
+ <JLabel text='{identity.getDir()+""}'/>
</cell>
</row>
</Table>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx 2009-10-28 07:20:17 UTC (rev 1607)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx 2009-10-28 07:29:27 UTC (rev 1608)
@@ -21,7 +21,7 @@
<jaxx.demo.DemoPanel>
<script>int count;</script>
<JPanel id='demoPanel'>
- <JTextField text='{count}' constraints='BorderLayout.NORTH'/>
+ <JTextField text='{count+""}' constraints='BorderLayout.NORTH'/>
<HBox constraints='BorderLayout.SOUTH'>
<JButton text='Dec (-)' onActionPerformed='count--'/>
<JButton text='Reset' onActionPerformed='count = 0'/>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2009-10-28 07:20:17 UTC (rev 1607)
+++ branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2009-10-28 07:29:27 UTC (rev 1608)
@@ -42,6 +42,7 @@
First\ Name\:=
FirstName\:=
Font\ size=
+Font\ size\:\ =
Fool\ me\ once=
Fool\ me\ twice=
Green=
@@ -81,6 +82,7 @@
Supported\ Swing\ components\:=
Text2\:=
Text\:=
+Total\:\ =
Underline=
Upper\ case\ text\:=
Use\ the\ spinner\ to=
@@ -90,6 +92,7 @@
Welcome\ to\ the\ JAXX\ framework\!=
Working\ directory\:=
Yellow=
+You\ entered\:\ =
Your\ name\:=
\\u00f7=
actors=
Modified: branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2009-10-28 07:20:17 UTC (rev 1607)
+++ branches/jaxx-2.X/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2009-10-28 07:29:27 UTC (rev 1608)
@@ -42,6 +42,7 @@
First\ Name\:=Pr\u00E9nom
FirstName\:=Pr\u00E9nom \:
Font\ size=Taille de la police
+Font\ size\:\ =
Fool\ me\ once=
Fool\ me\ twice=
Green=Vert
@@ -81,6 +82,7 @@
Supported\ Swing\ components\:=Composants Swing support\u00E9s
Text2\:=Text 2
Text\:=Texte \:
+Total\:\ =
Underline=soulign\u00E9
Upper\ case\ text\:=Texte en majuscule
Use\ the\ spinner\ to=Utiliser la jauge pour
@@ -90,6 +92,7 @@
Welcome\ to\ the\ JAXX\ framework\!=Bienvenu dans le framework JAXX
Working\ directory\:=R\u00E9pertoire de travail
Yellow=Jaune
+You\ entered\:\ =
Your\ name\:=Votre nom \:
\\u00f7=
actors=Acteurs
1
0
Author: tchemit
Date: 2009-10-28 08:20:17 +0100 (Wed, 28 Oct 2009)
New Revision: 1607
Added:
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/Bean.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/BeanImpl.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBindingTest.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/log4j.properties
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/First.jaxx
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/simpleBinding.xml
Modified:
branches/jaxx-2.X/maven-jaxx-plugin/pom.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1722Test/Bug_1722.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1750Test/Bug_1750.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1751Test/Bug_1751.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/CSSTests.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClassReferences.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClientProperty.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ErrorJaxxContextImplementorClass.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Errors.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Force.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Icon.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Initializers.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/InnerClasses.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/NoLog.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/OverridingDataBindings.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Script.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/SpecialSubclassing.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/WithLog.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorErrors.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorOk.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DecoratorTest/Decorator.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/error.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/ok.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nText.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nTitle.xml
branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nToolTipText.xml
Log:
- ajout test sur bindings
- les fichiers generes sont dans target/generated-sources
Modified: branches/jaxx-2.X/maven-jaxx-plugin/pom.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/pom.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/pom.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -129,7 +129,7 @@
</execution>
</executions>
</plugin>
-
+
</plugins>
<pluginManagement>
@@ -491,5 +491,5 @@
</plugin>
</plugins>
</reporting>
-
-</project>
\ No newline at end of file
+
+</project>
Added: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/Bean.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/Bean.java (rev 0)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/Bean.java 2009-10-28 07:20:17 UTC (rev 1607)
@@ -0,0 +1,16 @@
+package org.nuiton.jaxx.plugin.DataBinding;
+
+import java.beans.PropertyChangeListener;
+
+public interface Bean {
+
+ void addPropertyChangeListener(PropertyChangeListener listener);
+
+ void addPropertyChangeListener(String propertyName, PropertyChangeListener listener);
+
+ void removePropertyChangeListener(PropertyChangeListener listener);
+
+ void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
+
+ String getText();
+}
Property changes on: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/Bean.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/BeanImpl.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/BeanImpl.java (rev 0)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/BeanImpl.java 2009-10-28 07:20:17 UTC (rev 1607)
@@ -0,0 +1,38 @@
+package org.nuiton.jaxx.plugin.DataBinding;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+public class BeanImpl {
+
+ protected String text;
+ PropertyChangeSupport p;
+
+ public BeanImpl() {
+ p = new PropertyChangeSupport(this);
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ p.addPropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ p.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ p.removePropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ p.removePropertyChangeListener(propertyName, listener);
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+}
Property changes on: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/BeanImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBindingTest.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBindingTest.java (rev 0)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBindingTest.java 2009-10-28 07:20:17 UTC (rev 1607)
@@ -0,0 +1,33 @@
+package org.nuiton.jaxx.plugin;
+
+import java.io.IOException;
+import org.junit.Test;
+
+/**
+ *
+ * @author chemit
+ * @since 2.0.0
+ */
+public class DataBindingTest extends JaxxBaseTest {
+
+ @Test
+ public void simpleBinding() throws Exception {
+
+ GenerateMojo mojo = getMojo();
+ mojo.execute();
+ assertNumberJaxxFiles(1);
+
+ // no bindings
+ checkPattern(mojo, "new jaxx.runtime.DataBindingListener(this, \"nobinding1.text\");", false);
+ checkPattern(mojo, "new jaxx.runtime.DataBindingListener(this, \"nobinding2.text\");", false);
+
+ // with bindings
+ checkBinding(mojo, "binding8.text");
+ }
+
+ protected void checkBinding(GenerateMojo mojo, String... bindings) throws IOException {
+ for (String b : bindings) {
+ checkPattern(mojo, "new jaxx.runtime.DataBindingListener(this, \"" + b + "\");", true);
+ }
+ }
+}
Property changes on: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBindingTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/log4j.properties
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/log4j.properties (rev 0)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/log4j.properties 2009-10-28 07:20:17 UTC (rev 1607)
@@ -0,0 +1,9 @@
+# Global logging configuration
+log4j.rootLogger=ERROR, stdout
+# Console output...
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n
+
+log4j.logger.jaxx.compiler=INFO
+log4j.logger.jaxx.compiler.binding=DEBUG
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1722Test/Bug_1722.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1722Test/Bug_1722.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1722Test/Bug_1722.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<!--<verbose>true</verbose>-->
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1750Test/Bug_1750.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1750Test/Bug_1750.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1750Test/Bug_1750.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<!--<verbose>true</verbose>-->
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1751Test/Bug_1751.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1751Test/Bug_1751.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Bug1751Test/Bug_1751.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<i18nable>true</i18nable>
<force>true</force>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/CSSTests.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/CSSTests.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/CSSTests.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<i18nable>false</i18nable>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClassReferences.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClassReferences.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClassReferences.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClientProperty.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClientProperty.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ClientProperty.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<addLogger>false</addLogger>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ErrorJaxxContextImplementorClass.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ErrorJaxxContextImplementorClass.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/ErrorJaxxContextImplementorClass.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<jaxxContextFQN>java.lang.String</jaxxContextFQN>
<force>true</force>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Errors.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Errors.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Errors.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Force.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Force.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Force.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Icon.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Icon.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Icon.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<i18nable>false</i18nable>
<force>true</force>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Initializers.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Initializers.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Initializers.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/InnerClasses.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/InnerClasses.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/InnerClasses.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/NoLog.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/NoLog.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/NoLog.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<addLogger>false</addLogger>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/OverridingDataBindings.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/OverridingDataBindings.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/OverridingDataBindings.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Script.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Script.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/Script.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/SpecialSubclassing.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/SpecialSubclassing.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/SpecialSubclassing.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/WithLog.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/WithLog.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerTest/WithLog.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<addLogger>true</addLogger>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorErrors.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorErrors.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorErrors.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -14,7 +14,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<!--<verbose>true</verbose>-->
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorOk.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorOk.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/CompilerValidatorTest/ValidatorOk.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<!--<verbose>true</verbose>-->
Added: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/First.jaxx
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/First.jaxx (rev 0)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/First.jaxx 2009-10-28 07:20:17 UTC (rev 1607)
@@ -0,0 +1,24 @@
+
+<JPanel>
+
+ <java.io.File id='file' constructorParams='""'/>
+ <java.io.File id='file2' javaBean='new File("")'/>
+
+ <org.nuiton.jaxx.plugin.DataBinding.Bean id='bean' javaBean='new BeanImpl()'/>
+ <org.nuiton.jaxx.plugin.DataBinding.BeanImpl id='beanImpl' javaBean='new BeanImpl()'/>
+
+ <JLabel id='nobinding1' text='{file.getAbsolutePath()}'/>
+ <JLabel id='nobinding2' text='{getFile().getAbsolutePath()}'/>
+
+ <JLabel id='binding0' text='{file2.getAbsolutePath()}' javaBean='new JLabel()'/>
+ <JLabel id='binding1' text='{this.getFile2().getAbsolutePath()}'/>
+ <JLabel id='binding2' text='{getFile2().getAbsolutePath()}'/>
+ <JLabel id='binding3' text='{bean.getText()}'/>
+ <JLabel id='binding4' text='{getBean().getText()}'/>
+ <JLabel id='binding5' text='{beanImpl.getText()}'/>
+ <JLabel id='binding6' text='{getBeanImpl().getText()}'/>
+ <JLabel id='binding7' text='{binding0.getText()}'/>
+ <JLabel id='binding8' text='{getBinding0().getText()}'/>
+ <JLabel id='binding9' text='{binding0.getText() + binding1.getText()}'/>
+
+</JPanel>
Added: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/simpleBinding.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/simpleBinding.xml (rev 0)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DataBindingTest/simpleBinding.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jaxx.test</groupId>
+ <artifactId>test</artifactId>
+ <version>0</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-jaxx-plugin</artifactId>
+ <configuration>
+ <src>${basedir}/target/test-classes</src>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
+ <force>true</force>
+ <!--<verbose>true</verbose>-->
+ <includes>
+ <value>**/DataBindingTest/*.jaxx</value>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DecoratorTest/Decorator.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DecoratorTest/Decorator.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/DecoratorTest/Decorator.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<addLogger>false</addLogger>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/error.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/error.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/error.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<!--<verbose>true</verbose>-->
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/ok.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/ok.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/Evolution74Test/ok.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<includes>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nText.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nText.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nText.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<i18nable>true</i18nable>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nTitle.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nTitle.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nTitle.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<i18nable>true</i18nable>
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nToolTipText.xml
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nToolTipText.xml 2009-10-28 07:19:17 UTC (rev 1606)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/I18nTest/I18nToolTipText.xml 2009-10-28 07:20:17 UTC (rev 1607)
@@ -13,7 +13,7 @@
<artifactId>maven-jaxx-plugin</artifactId>
<configuration>
<src>${basedir}/target/test-classes</src>
- <outJava>${basedir}/target/it-generated-sources/java</outJava>
+ <outJava>${basedir}/target/generated-sources/test-java</outJava>
<!--outResource>${basedir}/target/it-generated-sources/resources</outResource-->
<force>true</force>
<i18nable>true</i18nable>
1
0
r1606 - in branches/jaxx-2.X: jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer jaxx-widgets/src/main/java/jaxx/runtime/swing
by tchemit@users.nuiton.org 28 Oct '09
by tchemit@users.nuiton.org 28 Oct '09
28 Oct '09
Author: tchemit
Date: 2009-10-28 08:19:17 +0100 (Wed, 28 Oct 2009)
New Revision: 1606
Added:
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorListCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorTableCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java
Removed:
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java
Modified:
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java
Log:
amelioration des renderer sur Decorator (et deplacement vers jaxx.runtime.swing.renderer)
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx 2009-10-28 07:18:13 UTC (rev 1605)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx 2009-10-28 07:19:17 UTC (rev 1606)
@@ -24,7 +24,7 @@
import jaxx.runtime.SwingUtil;
import jaxx.demo.component.jaxx.navigation.*;
import jaxx.runtime.decorator.DecoratorUtils;
-import jaxx.runtime.decorator.swing.DecoratorListCellRenderer;
+import jaxx.runtime.swing.renderer.MultiDecoratorListCellRenderer;
import jaxx.runtime.swing.navigation.NavigationTreeNode;
@Override
@@ -56,7 +56,7 @@
columnHeaderView='{toolbar}'
horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JList id='list' model='{new DefaultListModel()}' cellRenderer='{new DecoratorListCellRenderer(DecoratorUtils.get(People.class.getSimpleName()))}'/>
+ <JList id='list' model='{new DefaultListModel()}' cellRenderer='{getContextValue(MultiDecoratorListCellRenderer.class)}'/>
</JScrollPane>
<JToolBar id='toolbar' constraints='BorderLayout.SOUTH'
floatable='false'>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx 2009-10-28 07:18:13 UTC (rev 1605)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx 2009-10-28 07:19:17 UTC (rev 1606)
@@ -27,10 +27,17 @@
import jaxx.runtime.SwingUtil;
import jaxx.demo.component.jaxx.navigation.*;
import jaxx.runtime.decorator.DecoratorUtils;
-import jaxx.runtime.decorator.swing.DecoratorListCellRenderer;
+import jaxx.runtime.decorator.MultiJXPathDecorator;
+import jaxx.runtime.swing.renderer.MultiDecoratorListCellRenderer;
import jaxx.runtime.swing.navigation.NavigationTreeNode;
import jaxx.runtime.swing.navigation.NavigationContentUI;
+// init shared list decorator
+MultiJXPathDecorator<?> d0 = (MultiJXPathDecorator<?>)DecoratorUtils.get(People.class.getSimpleName());
+MultiJXPathDecorator<?> d1 = (MultiJXPathDecorator<?>)DecoratorUtils.get(Movie.class.getSimpleName());
+MultiDecoratorListCellRenderer r = new MultiDecoratorListCellRenderer(d0,d1);
+setContextValue(r);
+
ContentUIHandler getHandler() {
return getContextValue(ContentUIHandler.class);
}
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx 2009-10-28 07:18:13 UTC (rev 1605)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx 2009-10-28 07:19:17 UTC (rev 1606)
@@ -24,7 +24,7 @@
import jaxx.runtime.SwingUtil;
import jaxx.demo.component.jaxx.navigation.*;
import jaxx.runtime.decorator.DecoratorUtils;
-import jaxx.runtime.decorator.swing.DecoratorListCellRenderer;
+import jaxx.runtime.swing.renderer.MultiDecoratorListCellRenderer;
import jaxx.runtime.swing.navigation.NavigationTreeNode;
@Override
@@ -56,7 +56,7 @@
columnHeaderView='{toolbar}'
horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JList id='list' model='{new DefaultListModel()}' cellRenderer='{new DecoratorListCellRenderer(DecoratorUtils.get(Movie.class.getSimpleName()))}'/>
+ <JList id='list' model='{new DefaultListModel()}' cellRenderer='{getContextValue(MultiDecoratorListCellRenderer.class)}'/>
</JScrollPane>
<JToolBar id='toolbar' opaque='false' constraints='BorderLayout.SOUTH'
floatable='false'>
Deleted: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java 2009-10-28 07:18:13 UTC (rev 1605)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java 2009-10-28 07:19:17 UTC (rev 1606)
@@ -1,67 +0,0 @@
-/*
- * *##%
- * JAXX Runtime
- * Copyright (C) 2008 - 2009 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>.
- * ##%*
- */
-package jaxx.runtime.decorator.swing;
-
-import jaxx.runtime.decorator.*;
-import java.awt.Component;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JList;
-import javax.swing.ListCellRenderer;
-
-/**
- * A {@link ListCellRenderer} which compute text with the given {@link #decorator}
- * and leave the hand to the {@link #delegate} to perform the visual renderer.
- *
- * @author chemit
- * @since 1.7.2
- */
-public class DecoratorListCellRenderer implements ListCellRenderer {
-
- /**
- * Delegate cell renderer
- */
- protected ListCellRenderer delegate;
- /**
- * Decorator to produce text to render
- */
- protected Decorator<?> decorator;
-
- public DecoratorListCellRenderer(Decorator<?> decorator) {
- this(new DefaultListCellRenderer(), decorator);
- }
-
- public DecoratorListCellRenderer(ListCellRenderer delegate, Decorator<?> decorator) {
- this.delegate = delegate;
- this.decorator = decorator;
- }
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- if (value != null) {
- if (value instanceof String) {
- value = (String) value;
- } else {
- value = decorator.toString(value);
- }
- }
- return delegate.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
-}
Deleted: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java 2009-10-28 07:18:13 UTC (rev 1605)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java 2009-10-28 07:19:17 UTC (rev 1606)
@@ -1,63 +0,0 @@
-/*
- * *##%
- * JAXX Runtime
- * Copyright (C) 2008 - 2009 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>.
- * ##%*
- */
-package jaxx.runtime.decorator.swing;
-
-import jaxx.runtime.decorator.*;
-import javax.swing.JTable;
-import javax.swing.table.TableCellRenderer;
-import java.awt.Component;
-import javax.swing.table.DefaultTableCellRenderer;
-
-/**
- * A {@link TableCellRenderer} which compute text with the given {@link #decorator}
- * and leave the hand to the {@link #delegate} to perform the visual renderer.
- *
- * @author chemit
- * @since 1.7.2 (was previously {@code jaxx.runtime.swing.DecoratorTableCellRenderer}).
- */
-public class DecoratorTableCellRenderer implements TableCellRenderer {
-
- /**
- * Delegate cell renderer
- */
- protected TableCellRenderer delegate;
- /**
- * Decorator to produce text to render
- */
- protected Decorator<?> decorator;
-
- public DecoratorTableCellRenderer(Decorator<?> decorator) {
- this(new DefaultTableCellRenderer(), decorator);
- }
-
- public DecoratorTableCellRenderer(TableCellRenderer delegate, Decorator<?> decorator) {
- this.delegate = delegate;
- this.decorator = decorator;
- }
-
- @Override
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasfocus, int row, int column) {
- if (value != null) {
- value = decorator.toString(value);
- }
- return delegate.getTableCellRendererComponent(table, value, isSelected, hasfocus, row, column);
- }
-}
Copied: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorListCellRenderer.java (from rev 1603, branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java)
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorListCellRenderer.java (rev 0)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorListCellRenderer.java 2009-10-28 07:19:17 UTC (rev 1606)
@@ -0,0 +1,67 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing.renderer;
+
+import jaxx.runtime.decorator.*;
+import java.awt.Component;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+import javax.swing.ListCellRenderer;
+
+/**
+ * A {@link ListCellRenderer} which compute text with the given {@link #decorator}
+ * and leave the hand to the {@link #delegate} to perform the visual renderer.
+ *
+ * @author chemit
+ * @since 1.7.2
+ */
+public class DecoratorListCellRenderer implements ListCellRenderer {
+
+ /**
+ * Delegate cell renderer
+ */
+ protected ListCellRenderer delegate;
+ /**
+ * Decorator to produce text to render
+ */
+ protected Decorator<?> decorator;
+
+ public DecoratorListCellRenderer(Decorator<?> decorator) {
+ this(new DefaultListCellRenderer(), decorator);
+ }
+
+ public DecoratorListCellRenderer(ListCellRenderer delegate, Decorator<?> decorator) {
+ this.delegate = delegate;
+ this.decorator = decorator;
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ if (value != null) {
+ if (value instanceof String) {
+ value = (String) value;
+ } else {
+ value = decorator.toString(value);
+ }
+ }
+ return delegate.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ }
+}
Property changes on: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorListCellRenderer.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: svn:mergeinfo
+
Copied: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorTableCellRenderer.java (from rev 1603, branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java)
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorTableCellRenderer.java (rev 0)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorTableCellRenderer.java 2009-10-28 07:19:17 UTC (rev 1606)
@@ -0,0 +1,63 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing.renderer;
+
+import jaxx.runtime.decorator.*;
+import javax.swing.JTable;
+import javax.swing.table.TableCellRenderer;
+import java.awt.Component;
+import javax.swing.table.DefaultTableCellRenderer;
+
+/**
+ * A {@link TableCellRenderer} which compute text with the given {@link #decorator}
+ * and leave the hand to the {@link #delegate} to perform the visual renderer.
+ *
+ * @author chemit
+ * @since 1.7.2 (was previously {@code jaxx.runtime.swing.DecoratorTableCellRenderer}).
+ */
+public class DecoratorTableCellRenderer implements TableCellRenderer {
+
+ /**
+ * Delegate cell renderer
+ */
+ protected TableCellRenderer delegate;
+ /**
+ * Decorator to produce text to render
+ */
+ protected Decorator<?> decorator;
+
+ public DecoratorTableCellRenderer(Decorator<?> decorator) {
+ this(new DefaultTableCellRenderer(), decorator);
+ }
+
+ public DecoratorTableCellRenderer(TableCellRenderer delegate, Decorator<?> decorator) {
+ this.delegate = delegate;
+ this.decorator = decorator;
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasfocus, int row, int column) {
+ if (value != null) {
+ value = decorator.toString(value);
+ }
+ return delegate.getTableCellRendererComponent(table, value, isSelected, hasfocus, row, column);
+ }
+}
Property changes on: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorTableCellRenderer.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: svn:mergeinfo
+
Added: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java (rev 0)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java 2009-10-28 07:19:17 UTC (rev 1606)
@@ -0,0 +1,64 @@
+package jaxx.runtime.swing.renderer;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+import javax.swing.ListCellRenderer;
+import jaxx.runtime.decorator.Decorator;
+import jaxx.runtime.decorator.JXPathDecorator;
+
+/**
+ * A {@link ListCellRenderer} which compute text with the matching decorator
+ * from {@link #decorators} and leave the hand to the {@link #delegate} to
+ * perform the visual renderer.
+ *
+ * @author chemit
+ * @since 2.0.0
+ */
+public class MultiDecoratorListCellRenderer implements ListCellRenderer {
+
+ /**
+ * Delegate cell renderer
+ */
+ protected ListCellRenderer delegate;
+ /**
+ * accepted types
+ */
+ protected List<Class<?>> types;
+ /**
+ * decorators for accepted types
+ */
+ protected Decorator<?>[] decorators;
+
+ public MultiDecoratorListCellRenderer(ListCellRenderer delegate, JXPathDecorator<?>... decorator) {
+ this.delegate = delegate;
+ this.types = new ArrayList<Class<?>>();
+ List<Decorator<?>> tmp = new ArrayList<Decorator<?>>();
+ for (JXPathDecorator<?> d : decorator) {
+ if (types.contains(d.getInternalClass())) {
+ throw new IllegalArgumentException("can not have twice a decorator of type " + d.getInternalClass());
+ }
+ types.add(d.getInternalClass());
+ tmp.add(d);
+ }
+ decorators = tmp.toArray(new Decorator<?>[tmp.size()]);
+ }
+
+ public MultiDecoratorListCellRenderer(JXPathDecorator<?>... decorator) {
+ this(new DefaultListCellRenderer(), decorator);
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ if (value != null) {
+ int i = types.indexOf(value.getClass());
+ if (i != -1) {
+ Decorator<?> d = decorators[i];
+ value = d.toString(value);
+ }
+ }
+ return delegate.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ }
+}
Property changes on: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java 2009-10-28 07:18:13 UTC (rev 1605)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java 2009-10-28 07:19:17 UTC (rev 1606)
@@ -48,7 +48,7 @@
import jaxx.runtime.decorator.Decorator;
import jaxx.runtime.decorator.JXPathDecorator;
import jaxx.runtime.decorator.MultiJXPathDecorator;
-import jaxx.runtime.decorator.swing.DecoratorListCellRenderer;
+import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
import jaxx.runtime.decorator.DecoratorUtils;
import org.jdesktop.swingx.autocomplete.AutoCompletePropertyChangeListener;
1
0
r1605 - in branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler: . binding css decorators finalizers tags
by tchemit@users.nuiton.org 28 Oct '09
by tchemit@users.nuiton.org 28 Oct '09
28 Oct '09
Author: tchemit
Date: 2009-10-28 08:18:13 +0100 (Wed, 28 Oct 2009)
New Revision: 1605
Added:
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBinding.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java
Modified:
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java
Log:
- Evolution #105: permettre l'initialisation des objets sans JavaBean
- Evolution #100: am?\195?\169lioration du design du compilateur
- Evolution #99: Am?\195?\169liorer le code g?\195?\169n?\195?\169r?\195?\169
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -117,6 +117,10 @@
* client properties
*/
private Map<String, String> clientProperties;
+ /**
+ * initializer of the object
+ */
+ private String initializer;
public class ChildRef {
@@ -426,6 +430,14 @@
this.constructorParams = constructorParams;
}
+ public String getInitializer() {
+ return initializer;
+ }
+
+ public void setInitializer(String initializer) {
+ this.initializer = initializer;
+ }
+
/**
* Returns the code that performs basic initialization of this object,
* after it has already been constructed.
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -20,6 +20,7 @@
*/
package jaxx.compiler;
+import jaxx.compiler.binding.DataBinding;
import jaxx.compiler.css.StylesheetHelper;
import jaxx.compiler.script.ScriptManager;
import jaxx.compiler.java.JavaMethod;
@@ -632,18 +633,20 @@
expression.append(escapeJavaString(stringValue.substring(lastPos, pos)));
expression.append('"');
}
-
- if (expression.length() > 0) {
+ boolean multi = expression.length() > 0;
+ if (multi) {
expression.append(" + ");
+ expression.append('(');
}
- expression.append('(');
int pos2 = getNextRightBrace(stringValue, pos + 1);
if (pos2 == -1) {
reportError("unmatched '{' in expression: " + stringValue);
return "";
}
expression.append(stringValue.substring(pos + 1, pos2));
- expression.append(')');
+ if (multi) {
+ expression.append(')');
+ }
pos2++;
if (pos2 < stringValue.length()) {
pos = getNextLeftBrace(stringValue, pos2);
@@ -661,7 +664,12 @@
expression.append(escapeJavaString(stringValue.substring(lastPos)));
expression.append('"');
}
- return type == ClassDescriptorLoader.getClassDescriptor(String.class) ? "String.valueOf(" + expression + ")" : expression.toString();
+ //TC-20091027 : developper must write extact databinding
+ // the fact of adding the String boxed for String type binding is not
+ // a good thing, since it add one more call to process in binding
+ // and add nothing special more ?
+// return type == ClassDescriptorLoader.getClassDescriptor(String.class) ? "String.valueOf(" + expression + ")" : expression.toString();
+ return expression.toString();
}
return null;
}
@@ -1307,10 +1315,22 @@
}
public String getAutoId(ClassDescriptor objectClass) {
+ String name = objectClass.getName();
+ name = name.substring(name.lastIndexOf(".") + 1);
+ return getAutoId(name);
+// if (configuration.getOptimize()) {
+// return "$" + Integer.toString(autogenID++, 36);
+// } else {
+// String name = objectClass.getName();
+// name = name.substring(name.lastIndexOf(".") + 1);
+// return "$" + name + autogenID++;
+// }
+ }
+
+ public String getAutoId(String name) {
if (configuration.getOptimize()) {
return "$" + Integer.toString(autogenID++, 36);
} else {
- String name = objectClass.getName();
name = name.substring(name.lastIndexOf(".") + 1);
return "$" + name + autogenID++;
}
@@ -1368,26 +1388,26 @@
return javaFile;
}
- public void finalizeCompilers(Iterable<JAXXCompilerFinalizer> generatorIterator) throws Exception {
+ public void finalizeCompiler(Iterable<JAXXCompilerFinalizer> finalizers) throws Exception {
int dotPos = getOutputClassName().lastIndexOf(".");
String packageName = dotPos != -1 ? getOutputClassName().substring(0, dotPos) : null;
String simpleClassName = getOutputClassName().substring(dotPos + 1);
CompiledObject compiledObject = getRootObject();
- for (JAXXCompilerFinalizer generator : generatorIterator) {
- generator.finalizeCompiler(compiledObject, this, javaFile, packageName, simpleClassName);
+ for (JAXXCompilerFinalizer finalizer : finalizers) {
+ finalizer.finalizeCompiler(compiledObject, this, javaFile, packageName, simpleClassName);
}
for (CompiledObject object : getObjects().values()) {
object.finalizeCompiler(this);
}
- for (JAXXCompilerFinalizer generator : generatorIterator) {
- generator.prepareJavaFile(compiledObject, this, javaFile, packageName, simpleClassName);
+ for (JAXXCompilerFinalizer finalizer : finalizers) {
+ finalizer.prepareJavaFile(compiledObject, this, javaFile, packageName, simpleClassName);
}
}
- public void generate(JavaFileGenerator generator, Iterable<JAXXCompilerFinalizer> generatorIterator) throws IOException {
+ public void generate(JavaFileGenerator generator) throws IOException {
File dest;
if (getConfiguration().getTargetDirectory() != null) {
dest = new File(getConfiguration().getTargetDirectory(), getOutputClassName().replace('.', File.separatorChar) + ".java");
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -365,7 +365,7 @@
for (String className : engine.jaxxFileClassNames) {
JAXXCompiler compiler = engine.getCompiler(className, "Internal error: could not find compiler for " + className + " during code generation");
addStartProfileTime(engine, compiler);
- compiler.finalizeCompilers(engine.finalizers);
+ compiler.finalizeCompiler(engine.finalizers);
addEndProfileTime(engine, compiler);
if (compiler.isFailed()) {
success = false;
@@ -387,7 +387,7 @@
for (String className : engine.jaxxFileClassNames) {
JAXXCompiler compiler = engine.getCompiler(className, "Internal error: could not find compiler for " + className + " during code generation");
addStartProfileTime(engine, compiler);
- compiler.generate(generator, engine.finalizers);
+ compiler.generate(generator);
addEndProfileTime(engine, compiler);
if (compiler.isFailed()) {
success = false;
Copied: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBinding.java (from rev 1602, branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java)
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBinding.java (rev 0)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBinding.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -0,0 +1,137 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.binding;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Represents a data binding in a JAXX file. <code>DataBinding</code> uses
+ * {@link DataSource} to track changes to a source expression and update
+ * the destination.
+ */
+public class DataBinding {
+
+ /**
+ * Logger
+ */
+ protected static final Log log = LogFactory.getLog(DataBinding.class);
+ /**
+ * Id of the data binding
+ */
+ private String id;
+ /**
+ * source of the data binding
+ */
+ private String source;
+ /**
+ * A Java snippet which will cause the destination property to be updated with the current value of
+ * the binding.
+ */
+ private String assignment;
+
+ /**
+ * Creates a new data binding.
+ *
+ * @param source the Java source code for the data binding expression
+ * @param id the data binding destination in the form <code><id>.<propertyName></code>
+ * @param assignment Java snippet which will cause the destination property to be updated with the current value of the binding
+ */
+ public DataBinding(String source, String id, String assignment) {
+ this.id = id;
+ this.source = source;
+ this.assignment = assignment;
+ if (log.isDebugEnabled()) {
+ log.debug("id=" + id + " assignement=" + assignment + " source=" + source);
+ }
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Compiles the data binding expression. This method calls methods in
+ * <code>JAXXCompiler</code> to add the Java code that performs the data
+ * binding setup.
+ *
+ * @param compiler compiler which includes the data binding
+ * @param quickNoDependencies true to optimize bindings with no dependencies by simply running them at startup time
+ * @return {@code true} if the expression has dependencies, {@code false} otherwise
+ * @throws CompilerException if a compilation error occurs
+ */
+ public boolean compile(JAXXCompiler compiler, boolean quickNoDependencies) throws CompilerException {
+
+ DataSource dataSource = new DataSource(id, source, compiler);
+
+ // handles all of the listener additions
+ //TC-20091026 use 'this' instead of root object javaCode
+// boolean result = dataSource.compile("new jaxx.runtime.DataBindingListener(" + compiler.getRootObject().getJavaCode() + ", " + compiler.getJavaCode(id) + ")");
+ boolean result = dataSource.compile("new jaxx.runtime.DataBindingListener(this, " + compiler.getJavaCode(id) + ")");
+ if (log.isDebugEnabled()) {
+ log.debug(id + " isBinding ? " + result);
+ }
+ String eol = JAXXCompiler.getLineSeparator();
+ if (!result && quickNoDependencies) {
+ // layout is specially handled early in the chain
+ if (!id.endsWith(".layout")) {
+ compiler.appendInitDataBindings(assignment + eol);
+ }
+ return false; // no dependencies, just a static expression
+ }
+
+ StringBuilder buffer = new StringBuilder();
+ if (compiler.hasProcessDataBinding()) {
+ buffer.append(" else ");
+// compiler.appendProcessDataBinding(" else ");
+ } else {
+ buffer.append(" ");
+// compiler.appendProcessDataBinding(" ");
+ }
+ buffer.append("if (" + compiler.getJavaCode(id) + ".equals($dest)) {" + eol);
+// compiler.appendProcessDataBinding("if (" + compiler.getJavaCode(id) + ".equals($dest)) {" + eol);
+ String objectCode = dataSource.getObjectCode();
+ if (log.isDebugEnabled()) {
+ log.debug(id + " objectCode= " + objectCode);
+ }
+ //TC-20091026 no need to test objectCode not null if on root object
+// boolean needTest = objectCode != null;
+ boolean needTest = objectCode != null && !compiler.getRootObject().getId().equals(objectCode);
+ if (needTest) {
+ buffer.append(" if (" + objectCode + " != null) {" + eol);
+ buffer.append(" ");
+// compiler.appendProcessDataBinding(" if (" + objectCode + " != null) {" + eol);
+// compiler.appendProcessDataBinding(" ");
+ }
+ buffer.append(" " + assignment.trim());
+// compiler.appendProcessDataBinding(" " + assignment.trim());
+ if (needTest) {
+ buffer.append(eol + " }");
+// compiler.appendProcessDataBinding(eol + " }");
+ }
+ buffer.append(eol + " }");
+// compiler.appendProcessDataBinding(eol + " }");
+ compiler.appendProcessDataBinding(buffer.toString());
+ return true;
+ }
+}
Property changes on: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBinding.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java (from rev 1602, branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java)
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java (rev 0)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -0,0 +1,596 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.binding;
+
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.java.JavaField;
+import jaxx.compiler.java.parser.JavaParser;
+import jaxx.compiler.java.parser.JavaParserConstants;
+import jaxx.compiler.java.parser.JavaParserTreeConstants;
+import jaxx.compiler.java.parser.SimpleNode;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.reflect.FieldDescriptor;
+import jaxx.compiler.reflect.MethodDescriptor;
+import jaxx.compiler.tags.DefaultObjectHandler;
+import jaxx.compiler.tags.TagManager;
+import jaxx.compiler.types.TypeManager;
+
+import java.beans.Introspector;
+import java.beans.PropertyChangeListener;
+import java.io.StringReader;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Represents a Java expression which fires a <code>PropertyChangeEvent</code> when it can be
+ * determined that its value may have changed. Events are fired on a "best effort" basis, and events
+ * may either be fired too often (the value has not actually changed) or not often enough (the value
+ * changed but no event was fired).
+ */
+public class DataSource {
+
+ /**
+ * Logger
+ */
+ protected static final Log log = LogFactory.getLog(DataSource.class);
+
+ /**
+ * type attached to "null" constants in parsed expressions
+ */
+ private class NULL {
+ }
+ /**
+ * id of data source
+ */
+ private String id;
+ /**
+ * The Java source code for the expression.
+ */
+ private String source;
+ /**
+ * The current <code>JAXXCompiler</code>.
+ */
+ private JAXXCompiler compiler;
+ /**
+ * List of symbols which this data source expression depends on.
+ */
+ private List<String> dependencySymbols = new ArrayList<String>();
+ /**
+ *
+ */
+ private StringBuffer addListenerCode = new StringBuffer();
+ /**
+ *
+ */
+ private StringBuffer removeListenerCode = new StringBuffer();
+ /**
+ *
+ */
+ private boolean compiled;
+ /**
+ * the delegate of property to be required
+ */
+ private String objectCode;
+ /**
+ * the data source id
+ */
+ private String listenerId;
+
+ /**
+ * Creates a new data source. After creating a <code>DataSource</code>, use {@link #compile}
+ * to cause it to function at runtime.
+ *
+ * @param id the DataSource's id
+ * @param source the Java source code for the data source expression
+ * @param compiler the current <code>JAXXCompiler</code>
+ */
+ public DataSource(String id, String source, JAXXCompiler compiler) {
+ this.id = id;
+ this.source = source;
+ this.compiler = compiler;
+ if (log.isDebugEnabled()) {
+ log.debug("id=" + id + " source=" + source);
+ }
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public String getObjectCode() {
+ return objectCode;
+ }
+
+ public String getListenerId() {
+ return listenerId;
+ }
+
+ /**
+ * Compiles the data source expression and listener. This method calls methods in <code>JAXXCompiler</code>
+ * to add the Java code that performs the data source setup. Adding listeners to <code>DataSource</code> is
+ * slightly more complicated than with ordinary classes, because <code>DataSource</code> only exists at compile
+ * time. You must pass in a Java expression which evaluates to a <code>PropertyChangeListener</code>; this
+ * expression will be compiled and evaluated at runtime to yield the <code>DataSource's</code> listener.
+ *
+ * @param propertyChangeListenerCode Java code snippet which evaluates to a <code>PropertyChangeListener</code>
+ * @return <code>true</code> if the expression has dependencies, <code>false</code> otherwise
+ * @throws CompilerException if a compilation error occurs
+ * @throws IllegalStateException if data source was already compiled
+ */
+ public boolean compile(String propertyChangeListenerCode) throws CompilerException, IllegalStateException {
+ if (compiled) {
+ throw new IllegalStateException(this + " has already been compiled");
+ }
+// String listenerId = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(getClass()));
+ listenerId = compiler.getAutoId(getClass().getSimpleName());
+ if (log.isDebugEnabled()) {
+ log.debug("listenerId=" + listenerId);
+ }
+ JavaParser p = new JavaParser(new StringReader(source));
+// JavaParser p = new JavaParser(new StringReader(source + ";"));
+ while (!p.Line()) {
+ SimpleNode node = p.popNode();
+ if (log.isDebugEnabled()) {
+ log.debug("will scan node " + node.getText());
+ }
+// scanNode(node, listenerId);
+ scanNode(node);
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("dependencySymbols=" + dependencySymbols);
+ }
+ if (dependencySymbols.size() > 0) {
+ // a real binding was detected
+
+ // add a dataBinding field
+ //TC 20081108 prefer add a real JavaField instead of raw code
+ //compiler.appendBodyCode("private PropertyChangeListener " + id + " = " + propertyChangeListenerCode + ";\n");
+ compiler.addSimpleField(new JavaField(Modifier.PRIVATE, PropertyChangeListener.class.getSimpleName(), listenerId, false, propertyChangeListenerCode));
+
+ // add listener codes in compiler
+
+// compileListeners();
+ String javaCodeId = TypeManager.getJavaCode(id);
+ String eol = JAXXCompiler.getLineSeparator();
+
+// if (addListenerCode.length() > 0) {
+ if (compiler.hasApplyDataBinding()) {
+ compiler.appendApplyDataBinding(" else ");
+ }
+ compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {");
+ compiler.appendApplyDataBinding(" " + addListenerCode + eol);
+ compiler.appendApplyDataBinding("}");
+// }
+
+// if (removeListenerCode.length() > 0) {
+ if (compiler.hasRemoveDataBinding()) {
+ compiler.appendRemoveDataBinding(" else ");
+ }
+ compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {");
+ compiler.appendRemoveDataBinding(" " + removeListenerCode + eol);
+ compiler.appendRemoveDataBinding("}");
+// }
+ }
+ //TC-20091027 if no dependency symbols then no listeners
+// compileListeners();
+ compiled = true;
+
+ return dependencySymbols.size() > 0;
+ }
+
+ /**
+ * @return a list of symbols on which this data source depends.
+ */
+ public Collection<String> getDependencies() {
+ return Collections.unmodifiableList(dependencySymbols);
+ }
+
+ /**
+ * Examines a node to identify any dependencies it contains.
+ *
+ * @param node node to scan
+ // * @param listenerId id of listener
+ * @throws CompilerException ?
+ */
+ private void scanNode(SimpleNode node) throws CompilerException {
+// private void scanNode(SimpleNode node, String listenerId) throws CompilerException {
+ if (node.getId() == JavaParserTreeConstants.JJTMETHODDECLARATION ||
+ node.getId() == JavaParserTreeConstants.JJTFIELDDECLARATION) {
+ return;
+ }
+ if (log.isTraceEnabled()) {
+ log.trace(node.getText());
+ }
+ int count = node.jjtGetNumChildren();
+ for (int i = 0; i < count; i++) {
+ scanNode(node.getChild(i));
+ }
+ // determine node type
+ ClassDescriptor type = null;
+ if (node.jjtGetNumChildren() == 1) {
+ type = node.getChild(0).getJavaType();
+ }
+ switch (node.getId()) {
+ case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE:
+ type = ClassDescriptorLoader.getClassDescriptor(Class.class);
+ break;
+ case JavaParserTreeConstants.JJTPRIMARYEXPRESSION:
+// type = determineExpressionType(node, listenerId);
+ type = determineExpressionType(node);
+ break;
+ case JavaParserTreeConstants.JJTLITERAL:
+ type = determineLiteralType(node);
+ break;
+ case JavaParserTreeConstants.JJTCASTEXPRESSION:
+ type = TagManager.resolveClass(node.getChild(0).getText(), compiler);
+ break;
+ }
+ node.setJavaType(type);
+
+// switch (node.getId()) {
+// case JavaParserTreeConstants.JJTMETHODDECLARATION:
+// break;
+// case JavaParserTreeConstants.JJTFIELDDECLARATION:
+// break;
+//
+// default:
+// int count = node.jjtGetNumChildren();
+// for (int i = 0; i < count; i++) {
+// scanNode(node.getChild(i), listenerId);
+// }
+// determineNodeType(node);
+// }
+ }
+
+ /**
+ * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which
+ * can be tracked.
+ *
+ * @param expression the node to scan
+ // * @param listenerId id of the listener
+ * @return the class descriptor of the return type or null
+ */
+// private ClassDescriptor determineExpressionType(SimpleNode expression, String listenerId) {
+ private ClassDescriptor determineExpressionType(SimpleNode expression) {
+ assert expression.getId() == JavaParserTreeConstants.JJTPRIMARYEXPRESSION;
+ SimpleNode prefix = expression.getChild(0);
+ if (prefix.jjtGetNumChildren() == 1) {
+ int type = prefix.getChild(0).getId();
+ if (type == JavaParserTreeConstants.JJTLITERAL || type == JavaParserTreeConstants.JJTEXPRESSION) {
+ prefix.setJavaType(prefix.getChild(0).getJavaType());
+ } else if (type == JavaParserTreeConstants.JJTNAME && expression.jjtGetNumChildren() == 1) {
+ // name with no arguments after it
+// prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(), compiler.getRootObject().getObjectClass(), false, listenerId));
+ prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(), compiler.getRootObject().getObjectClass(), false));
+ }
+ }
+
+ if (expression.jjtGetNumChildren() == 1) {
+ return prefix.getJavaType();
+ }
+
+ ClassDescriptor contextClass = prefix.getJavaType();
+ if (contextClass == null) {
+ contextClass = compiler.getRootObject().getObjectClass();
+ }
+ String lastNode = prefix.getText().trim();
+
+ for (int i = 1; i < expression.jjtGetNumChildren(); i++) {
+ SimpleNode suffix = expression.getChild(i);
+ if (suffix.jjtGetNumChildren() == 1 && suffix.getChild(0).getId() == JavaParserTreeConstants.JJTARGUMENTS) {
+ if (suffix.getChild(0).jjtGetNumChildren() == 0) {
+ // at the moment only no-argument methods are trackable
+// contextClass = scanCompoundSymbol(lastNode, contextClass, true, listenerId);
+ contextClass = scanCompoundSymbol(lastNode, contextClass, true);
+ if (contextClass == null) {
+ return null;
+ }
+ int dotPos = lastNode.lastIndexOf(".");
+ String code = dotPos == -1 ? "" : lastNode.substring(0, dotPos);
+ for (int j = i - 2; j >= 0; j--) {
+ code = expression.getChild(j).getText() + code;
+ }
+ if (code.length() == 0) {
+ code = compiler.getRootObject().getJavaCode();
+ }
+ String methodName = lastNode.substring(dotPos + 1).trim();
+ try {
+ MethodDescriptor method = contextClass.getMethodDescriptor(methodName);
+// trackMemberIfPossible(code, contextClass, method.getName(), true, listenerId);
+ trackMemberIfPossible(code, contextClass, method.getName(), true);
+ return method.getReturnType();
+ } catch (NoSuchMethodException e) {
+ // happens for methods defined in the current JAXX file via scripts
+ String propertyName = null;
+ if (methodName.startsWith("is")) {
+ propertyName = Introspector.decapitalize(methodName.substring("is".length()));
+ } else if (methodName.startsWith("get")) {
+ propertyName = Introspector.decapitalize(methodName.substring("get".length()));
+ }
+ if (propertyName != null) {
+ //TC-20091026 use the getScriptMethod from compiler
+ MethodDescriptor newMethod = compiler.getScriptMethod(methodName);
+ if (newMethod != null) {
+ addListener(compiler.getRootObject().getId(),
+ null,
+ "addPropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
+ "removePropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator());
+ contextClass = newMethod.getReturnType();
+ }
+// MethodDescriptor[] newMethods = compiler.getScriptMethods();
+// for (MethodDescriptor newMethod : newMethods) {
+// if (newMethod.getName().equals(methodName)) {
+// addListener(compiler.getRootObject().getId(),
+// null,
+// "addPropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
+// "removePropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator());
+// contextClass = newMethod.getReturnType();
+// break;
+// }
+// }
+ }
+ }
+ }
+ }
+ lastNode = suffix.getText().trim();
+ if (lastNode.startsWith(".")) {
+ lastNode = lastNode.substring(1);
+ }
+ }
+
+ return null;
+ }
+
+ private ClassDescriptor determineLiteralType(SimpleNode node) {
+ assert node.getId() == JavaParserTreeConstants.JJTLITERAL;
+ if (node.jjtGetNumChildren() == 1) {
+ int childId = node.getChild(0).getId();
+ if (childId == JavaParserTreeConstants.JJTBOOLEANLITERAL) {
+ return ClassDescriptorLoader.getClassDescriptor(boolean.class);
+ }
+ if (childId == JavaParserTreeConstants.JJTNULLLITERAL) {
+ return ClassDescriptorLoader.getClassDescriptor(NULL.class);
+ }
+ throw new RuntimeException("Expected BooleanLiteral or NullLiteral, found " + JavaParserTreeConstants.jjtNodeName[childId]);
+ }
+ int nodeId = node.firstToken.kind;
+ switch (nodeId) {
+ case JavaParserConstants.INTEGER_LITERAL:
+ if (node.firstToken.image.toLowerCase().endsWith("l")) {
+ return ClassDescriptorLoader.getClassDescriptor(long.class);
+ }
+ return ClassDescriptorLoader.getClassDescriptor(int.class);
+ case JavaParserConstants.CHARACTER_LITERAL:
+ return ClassDescriptorLoader.getClassDescriptor(char.class);
+ case JavaParserConstants.FLOATING_POINT_LITERAL:
+ if (node.firstToken.image.toLowerCase().endsWith("f")) {
+ return ClassDescriptorLoader.getClassDescriptor(float.class);
+ }
+ return ClassDescriptorLoader.getClassDescriptor(double.class);
+ case JavaParserConstants.STRING_LITERAL:
+ return ClassDescriptorLoader.getClassDescriptor(String.class);
+ default:
+ throw new RuntimeException("Expected literal token, found " + JavaParserConstants.tokenImage[nodeId]);
+ }
+ }
+
+ /**
+ * Scans through a compound symbol (foo.bar.baz) to identify and track all trackable pieces of it.
+ *
+ * @param symbol symbol to scan
+ * @param contextClass current class context
+ * @param isMethod flag to search a method
+ // * @param listenerId id of the listener
+ * @return the type of the symbol (or null if it could not be determined).
+ */
+// private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescriptor contextClass, boolean isMethod, String listenerId) {
+ private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescriptor contextClass, boolean isMethod) {
+ String[] tokens = symbol.split("\\s*\\.\\s*");
+ StringBuffer currentSymbol = new StringBuffer();
+ StringBuffer tokensSeenSoFar = new StringBuffer();
+ boolean accepted; // if this ends up false, it means we weren't able to figure out
+ // which object the method is being invoked on
+ boolean recognizeClassNames = true;
+ for (int j = 0; j < tokens.length - (isMethod ? 1 : 0); j++) {
+ accepted = false;
+
+ if (tokensSeenSoFar.length() > 0) {
+ tokensSeenSoFar.append('.');
+ }
+ tokensSeenSoFar.append(tokens[j]);
+ if (currentSymbol.length() > 0) {
+ currentSymbol.append('.');
+ }
+ currentSymbol.append(tokens[j]);
+
+ if (currentSymbol.indexOf(".") == -1) {
+ String memberName = currentSymbol.toString();
+ CompiledObject object = compiler.getCompiledObject(memberName);
+ if (object != null) {
+ contextClass = object.getObjectClass();
+ currentSymbol.setLength(0);
+ accepted = true;
+ recognizeClassNames = false;
+ } else {
+ try {
+ FieldDescriptor field = contextClass.getFieldDescriptor(memberName);
+// trackMemberIfPossible(tokensSeenSoFar.toString(), contextClass, field.getName(), false, listenerId);
+ trackMemberIfPossible(tokensSeenSoFar.toString(), contextClass, field.getName(), false);
+ contextClass = field.getType();
+ currentSymbol.setLength(0);
+ accepted = true;
+ recognizeClassNames = false;
+ } catch (NoSuchFieldException e) {
+ if (j == 0 || j == 1 && tokens[0].equals(compiler.getRootObject().getId())) { // still in root context
+ FieldDescriptor[] newFields = compiler.getScriptFields();
+ for (FieldDescriptor newField : newFields) {
+ if (newField.getName().equals(memberName)) {
+ addListener(tokensSeenSoFar.toString(),
+ null,
+ "addPropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
+ "removePropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator());
+ contextClass = newField.getType();
+ assert contextClass != null : "script field '" + memberName + "' is defined, but has type null";
+ currentSymbol.setLength(0);
+ accepted = true;
+ recognizeClassNames = false;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (currentSymbol.length() > 0 && recognizeClassNames) {
+ contextClass = TagManager.resolveClass(currentSymbol.toString(), compiler);
+ if (contextClass != null) {
+ currentSymbol.setLength(0);
+ //accepted = true;
+ //recognizeClassNames = false;
+ // TODO: for now we don't handle statics
+ return null;
+ }
+ }
+ if (!accepted) {
+ return null;
+ }
+ }
+
+ return contextClass;
+ }
+
+// private void trackMemberIfPossible(String objectCode, ClassDescriptor objectClass, String memberName, boolean method, String listenerId) {
+ private void trackMemberIfPossible(String objectCode, ClassDescriptor objectClass, String memberName, boolean method) {
+// if (objectClass.isInterface()) {
+// // might be technically possible to track in some cases, but for now
+// // we can't create a DefaultObjectHandler for interfaces
+// return;
+// }
+
+ DefaultObjectHandler handler = TagManager.getTagHandler(objectClass);
+ try {
+ if (handler.isMemberBound(memberName)) {
+ addListener(objectCode + "." + memberName + (method ? "()" : ""),
+ objectCode,
+ handler.getAddMemberListenerCode(objectCode, id, memberName, listenerId, compiler),
+ handler.getRemoveMemberListenerCode(objectCode, id, memberName, listenerId, compiler));
+ }
+ } catch (UnsupportedAttributeException e) {
+ // ignore -- this is thrown for methods like toString(), for which there is no tracking and
+ // no setting support
+ }
+ }
+
+ private void addListener(String dependencySymbol, String objectCode, String addCode, String removeCode) {
+ this.objectCode = objectCode;
+ //TC-20091026 no need to test objectCode not null if on root object
+// boolean needTest = objectCode != null;
+ boolean needTest = objectCode != null && !compiler.getRootObject().getId().equals(objectCode);
+ if (!dependencySymbols.contains(dependencySymbol)) {
+ dependencySymbols.add(dependencySymbol);
+ String eol = JAXXCompiler.getLineSeparator();
+ addListenerCode.append(eol);
+ if (needTest) {
+ addListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol);
+ addListenerCode.append(" ");
+ }
+ addListenerCode.append(" ").append(addCode.trim());
+ if (needTest) {
+ addListenerCode.append(eol).append(" }");
+ }
+
+ removeListenerCode.append(eol);
+ if (needTest) {
+ removeListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol);
+ removeListenerCode.append(" ");
+ }
+ removeListenerCode.append(" ").append(removeCode.trim());
+ if (needTest) {
+ removeListenerCode.append(eol).append(" }");
+ }
+ }
+ }
+// /**
+// * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which
+// * can be tracked.
+// *
+// * @param node node to scan
+// * @param listenerId the listener id
+// */
+//// private void determineNodeType(SimpleNode node, String listenerId) {
+// private void determineNodeType(SimpleNode node) {
+// ClassDescriptor type = null;
+// if (node.jjtGetNumChildren() == 1) {
+// type = node.getChild(0).getJavaType();
+// }
+// switch (node.getId()) {
+// case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE:
+// type = ClassDescriptorLoader.getClassDescriptor(Class.class);
+// break;
+// case JavaParserTreeConstants.JJTPRIMARYEXPRESSION:
+// type = determineExpressionType(node, listenerId);
+// break;
+// case JavaParserTreeConstants.JJTLITERAL:
+// type = determineLiteralType(node);
+// break;
+// case JavaParserTreeConstants.JJTCASTEXPRESSION:
+// type = TagManager.resolveClass(node.getChild(0).getText(), compiler);
+// break;
+// }
+// node.setJavaType(type);
+// }
+// private void compileListeners() {
+// String javaCodeId = TypeManager.getJavaCode(id);
+// String eol = JAXXCompiler.getLineSeparator();
+// if (addListenerCode.length() > 0) {
+// if (compiler.hasApplyDataBinding()) {
+// compiler.appendApplyDataBinding(" else ");
+// }
+//// compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol);
+// compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {");
+// compiler.appendApplyDataBinding(" " + addListenerCode + eol);
+// compiler.appendApplyDataBinding("}");
+// }
+//
+// if (removeListenerCode.length() > 0) {
+// if (compiler.hasRemoveDataBinding()) {
+// compiler.appendRemoveDataBinding(" else ");
+// }
+//// compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol);
+// compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {");
+// compiler.appendRemoveDataBinding(" " + removeListenerCode + eol);
+// compiler.appendRemoveDataBinding("}");
+// }
+// }
+}
Property changes on: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -20,6 +20,8 @@
*/
package jaxx.compiler.css;
+import jaxx.compiler.binding.DataSource;
+import jaxx.compiler.binding.DataBinding;
import jaxx.compiler.*;
import jaxx.runtime.css.Selector;
import jaxx.runtime.css.Rule;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -81,6 +81,8 @@
String init = object.getId() + " = ";
if (object.isJavaBean() && object.getJavaBeanInitCode() != null) {
init += object.getJavaBeanInitCode();
+ } else if (object.getInitializer() != null) {
+ init += object.getInitializer();
} else {
//TC - 20081017 compiledObject can have generics
String canonicalName = JAXXCompiler.getCanonicalName(object);
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -88,23 +88,23 @@
String eol = JAXXCompiler.getLineSeparator();
- if (options.isGenerateHelp()) {
+// if (options.isGenerateHelp()) {
- // add code to init javax help system
- Iterator<CompiledObject> itr = compiler.getObjectCreationOrder();
+ // add code to init javax help system
+ Iterator<CompiledObject> itr = compiler.getObjectCreationOrder();
- for (; itr.hasNext();) {
- CompiledObject o = itr.next();
- String helpID = getHelpId(o);
- if (helpID != null) {
- buffer.append(eol);
- // detects a helpId to register
- buffer.append("registerHelpId(_broker, " + o.getJavaCode() + ", " + helpID + ");");
- //keep the helpID for helpSet generation
- helpIds.add(helpID);
- }
+ for (; itr.hasNext();) {
+ CompiledObject o = itr.next();
+ String helpID = getHelpId(o);
+ if (helpID != null) {
+ buffer.append(eol);
+ // detects a helpId to register
+ buffer.append("registerHelpId(_broker, " + o.getJavaCode() + ", " + helpID + ");");
+ //keep the helpID for helpSet generation
+ helpIds.add(helpID);
}
}
+// }
if (buffer.length() > 0) {
StringBuilder extraCode = new StringBuilder(helpBrokerFQN).append(" _broker = getBroker();");
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -24,7 +24,7 @@
import jaxx.compiler.CompilerException;
import jaxx.compiler.CompiledObject;
import jaxx.compiler.CompiledObjectDecorator;
-import jaxx.compiler.DataBinding;
+import jaxx.compiler.binding.DataBinding;
import jaxx.compiler.EventHandler;
import jaxx.compiler.JAXXCompiler;
import jaxx.compiler.java.JavaMethod;
@@ -39,7 +39,6 @@
import jaxx.runtime.JAXXObject;
import jaxx.runtime.JAXXObjectDescriptor;
import jaxx.runtime.JAXXContext;
-import jaxx.runtime.Util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,6 +47,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import jaxx.runtime.Util;
import static jaxx.compiler.java.JavaFileGenerator.*;
/**
@@ -242,45 +242,10 @@
CompiledObjectDecorator decorator = object.getDecorator();
decorator.finalizeCompiler(compiler, root, object, javaFile, packageName, className, fullClassName);
}
- String eol = JAXXCompiler.getLineSeparator();
- // DataBinding
- for (DataBinding dataBinding : compiler.getDataBindings()) {
- if (dataBinding.compile(compiler, true)) {
- String expression = "applyDataBinding(" + compiler.getJavaCode(dataBinding.getId()) + ");" + eol;
- compiler.appendInitDataBindings(expression);
- }
- }
+ finalizeBindings(compiler, superclassIsJAXXObject);
- if (superclassIsJAXXObject) {
- boolean hasBind = compiler.hasApplyDataBinding();
- if (hasBind) {
- compiler.appendApplyDataBinding(" else {");
- compiler.appendApplyDataBinding(eol);
- compiler.appendApplyDataBinding(" ");
- }
- compiler.appendApplyDataBinding("super.applyDataBinding($binding);");
- compiler.appendApplyDataBinding(eol);
-
- if (hasBind) {
- compiler.appendApplyDataBinding(" return;");
- compiler.appendApplyDataBinding(eol);
- compiler.appendApplyDataBinding("}");
- }
-
- hasBind = compiler.hasRemoveDataBinding();
- if (hasBind) {
- compiler.appendRemoveDataBinding(" else {");
- compiler.appendRemoveDataBinding(eol);
- compiler.appendRemoveDataBinding(" ");
- }
- compiler.appendRemoveDataBinding("super.removeDataBinding($binding);");
- compiler.appendRemoveDataBinding(eol);
-
- if (hasBind) {
- compiler.appendRemoveDataBinding("}");
- }
- } else {
+ if (!superclassIsJAXXObject) {
javaFile.addInterface(JAXXCompiler.getCanonicalName(JAXXObject.class));
}
}
@@ -405,7 +370,47 @@
}
+ protected void finalizeBindings(JAXXCompiler compiler, boolean superclassIsJAXXObject) {
+ String eol = JAXXCompiler.getLineSeparator();
+ for (DataBinding dataBinding : compiler.getDataBindings()) {
+ if (dataBinding.compile(compiler, true)) {
+ String expression = "applyDataBinding(" + compiler.getJavaCode(dataBinding.getId()) + ");" + eol;
+ compiler.appendInitDataBindings(expression);
+ }
+ }
+
+ if (superclassIsJAXXObject) {
+ boolean hasBind = compiler.hasApplyDataBinding();
+ if (hasBind) {
+ compiler.appendApplyDataBinding(" else {");
+ compiler.appendApplyDataBinding(eol);
+ compiler.appendApplyDataBinding(" ");
+ }
+ compiler.appendApplyDataBinding("super.applyDataBinding($binding);");
+ compiler.appendApplyDataBinding(eol);
+
+ if (hasBind) {
+ compiler.appendApplyDataBinding(" return;");
+ compiler.appendApplyDataBinding(eol);
+ compiler.appendApplyDataBinding("}");
+ }
+
+ hasBind = compiler.hasRemoveDataBinding();
+ if (hasBind) {
+ compiler.appendRemoveDataBinding(" else {");
+ compiler.appendRemoveDataBinding(eol);
+ compiler.appendRemoveDataBinding(" ");
+ }
+ compiler.appendRemoveDataBinding("super.removeDataBinding($binding);");
+ compiler.appendRemoveDataBinding(eol);
+
+ if (hasBind) {
+ compiler.appendRemoveDataBinding("}");
+ }
+ }
+ }
+
/*---------------------------------------------------------------------------------*/
/*-- Create fields ----------------------------------------------------------------*/
/*---------------------------------------------------------------------------------*/
@@ -614,8 +619,9 @@
if (superclassIsJAXXObject) {
code.append(" else {").append(eol);
code.append(" super.processDataBinding($dest, true);").append(eol);
- code.append(" }").append(eol);
+ code.append(" }");
}
+ code.append(eol);
code.append("} finally {").append(eol);
code.append(" $activeBindings.remove($dest);").append(eol);
code.append("}").append(eol);
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2009-10-27 10:46:23 UTC (rev 1604)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2009-10-28 07:18:13 UTC (rev 1605)
@@ -85,6 +85,7 @@
public static final String GENERICTYPE_ATTRIBUTE = "genericType";
public static final String ID_ATTRIBUTE = "id";
public static final String IMPLEMENTS_ATTRIBUTE = "implements";
+ public static final String INITIALIZER_ATTRIBUTE = "initializer";
public static final String JAVA_BEAN_ATTRIBUTE = "javaBean";
public static final String LAYOUT_ATTRIBUTE = "layout";
public static final String MNEMONIC_ATTRIBUTE = "mnemonic";
@@ -324,7 +325,8 @@
}
ProxyEventInfo eventInfo = eventInfos != null ? eventInfos.get(memberName) : null;
- if (eventInfo != null) { // a "proxied" event is one that doesn't fire PropertyChangeEvent, so we need to convert its native event type into PropertyChangeEvents
+ if (eventInfo != null) {
+ // a "proxied" event is one that doesn't fire PropertyChangeEvent, so we need to convert its native event type into PropertyChangeEvents
StringBuffer result = new StringBuffer();
String methodName = "$pr" + compiler.getUniqueId(propertyChangeListenerCode);
boolean methodExists = compiler.hasMethod(methodName);
@@ -665,7 +667,8 @@
continue;
}
if (name.equals(CONSTRAINTS_ATTRIBUTE) || isEventHandlerName(name)) {
- compiler.preprocessScript(value); // adds dependencies as a side effect
+ // adds dependencies as a side effect
+ compiler.preprocessScript(value);
} else if (name.equals(CONSTRUCTOR_PARAMS_ATTRIBUTE)) {
for (String param : value.split("\\s*,\\s*")) {
compiler.preprocessScript(param);
@@ -713,6 +716,14 @@
}
continue;
}
+ if (name.equals(INITIALIZER_ATTRIBUTE)) {
+ if (!value.isEmpty()) {
+ object.setInitializer(value);
+ } else {
+ object.setInitializer("null");
+ }
+ continue;
+ }
if (name.equals(IMPLEMENTS_ATTRIBUTE)) {
if (object != compiler.getRootObject()) {
// can ony be apply to root object
@@ -863,23 +874,25 @@
if (inline) {
compiler.addInlineStyle(object, propertyName, true);
}
- ClassDescriptor propertyType = getPropertyType(object, propertyName, compiler);
- if (propertyType != null &&
- propertyType != ClassDescriptorLoader.getClassDescriptor(Boolean.class) &&
- propertyType != ClassDescriptorLoader.getClassDescriptor(Byte.class) &&
- propertyType != ClassDescriptorLoader.getClassDescriptor(Short.class) &&
- propertyType != ClassDescriptorLoader.getClassDescriptor(Integer.class) &&
- propertyType != ClassDescriptorLoader.getClassDescriptor(Float.class) &&
- propertyType != ClassDescriptorLoader.getClassDescriptor(Double.class) &&
- propertyType != ClassDescriptorLoader.getClassDescriptor(Character.class)) {
- //binding = "((" + propertyType.getName() + ") " + binding + ")";
- }
+ //TC-20091027 : make sure this code is never used ?
+// ClassDescriptor propertyType = getPropertyType(object, propertyName, compiler);
+// if (propertyType != null &&
+// propertyType != ClassDescriptorLoader.getClassDescriptor(Boolean.class) &&
+// propertyType != ClassDescriptorLoader.getClassDescriptor(Byte.class) &&
+// propertyType != ClassDescriptorLoader.getClassDescriptor(Short.class) &&
+// propertyType != ClassDescriptorLoader.getClassDescriptor(Integer.class) &&
+// propertyType != ClassDescriptorLoader.getClassDescriptor(Float.class) &&
+// propertyType != ClassDescriptorLoader.getClassDescriptor(Double.class) &&
+// propertyType != ClassDescriptorLoader.getClassDescriptor(Character.class)) {
+// //binding = "((" + propertyType.getName() + ") " + binding + ")";
+// }
+ String setPropertyCode = getSetPropertyCode(object.getJavaCode(), propertyName, binding, compiler);
if (propertyName.equals(LAYOUT_ATTRIBUTE)) { // handle containerDelegate (e.g. contentPane on JFrame)
// have to set layout early, before children are added
- object.appendInitializationCode(getSetPropertyCode(object.getJavaCode(), propertyName, binding, compiler));
+ object.appendInitializationCode(setPropertyCode);
}
// object.registerDataBinding(binding, propertyName, getSetPropertyCode(object.getJavaCode(), propertyName, binding, compiler), compiler);
- compiler.registerDataBinding(binding, object.getId() + "." + propertyName, getSetPropertyCode(object.getJavaCode(), propertyName, binding, compiler));
+ compiler.registerDataBinding(binding, object.getId() + "." + propertyName, setPropertyCode);
} else { // no bindings, convert from string
if (inline) {
compiler.addInlineStyle(object, propertyName, false);
1
0
r1604 - branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime
by tchemit@users.nuiton.org 27 Oct '09
by tchemit@users.nuiton.org 27 Oct '09
27 Oct '09
Author: tchemit
Date: 2009-10-27 11:46:23 +0100 (Tue, 27 Oct 2009)
New Revision: 1604
Modified:
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java
Log:
in Util.initContext add a entry in ui context when parentContext is a JAXXOBbject (it will make possible to walk into UI ancestor without using the getParentContainer method
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java 2009-10-27 00:40:30 UTC (rev 1603)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java 2009-10-27 10:46:23 UTC (rev 1604)
@@ -54,6 +54,7 @@
* Logger
*/
static private final Log log = LogFactory.getLog(Util.class);
+ public static final String PARENT = "parent";
// Maps root objects to lists of event listeners
private static Map<Object, WeakReference<List<EventListenerDescriptor>>> eventListeners = new WeakHashMap<Object, WeakReference<List<EventListenerDescriptor>>>();
private static Map<JAXXObject, WeakReference<List<DataBindingUpdateListener>>> dataBindingUpdateListeners = new WeakHashMap<JAXXObject, WeakReference<List<DataBindingUpdateListener>>>();
@@ -121,17 +122,15 @@
public static <O> JAXXContextEntryDef<List<O>> newListContextEntryDef(String name) {
Class<List<O>> castList = Util.<O>castList();
- JAXXContextEntryDef<List<O>> contextEntryDef = new JAXXContextEntryDef<List<O>>(name,castList);
+ JAXXContextEntryDef<List<O>> contextEntryDef = new JAXXContextEntryDef<List<O>>(name, castList);
return contextEntryDef;
}
-
@SuppressWarnings({"unchecked"})
protected static <O> Class<List<O>> castList() {
return (Class<List<O>>) Collections.emptyList().getClass();
}
-
/**
* Method to initialize the context of a ui.
*
@@ -145,6 +144,11 @@
} else {
ui.setContextValue(parentContext);
}
+ // if parentContext is a JAXXObject then
+ // add an special parent entry to can go up
+ if (parentContext instanceof JAXXObject) {
+ ui.setContextValue(parentContext, PARENT);
+ }
}
public static Object getEventListener(Class<? extends EventListener> listenerClass, final String listenerMethodName, final Object methodContainer, final String methodName) {
1
0
r1603 - in branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler: css/parser java/parser
by tchemit@users.nuiton.org 27 Oct '09
by tchemit@users.nuiton.org 27 Oct '09
27 Oct '09
Author: tchemit
Date: 2009-10-27 01:40:30 +0100 (Tue, 27 Oct 2009)
New Revision: 1603
Modified:
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java
Log:
put the Generated By JavaCC comment line at top of file
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParser.java */
/*
* *##%
* JAXX Compiler
@@ -18,802 +19,801 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParser.java */
-package jaxx.compiler.css.parser;
-
-public class CSSParser/*@bgen(jjtree)*/ implements CSSParserTreeConstants, CSSParserConstants {/*@bgen(jjtree)*/
- protected JJTCSSParserState jjtree = new JJTCSSParserState();
-
- public SimpleNode popNode() {
- if (jjtree.nodeArity() > 0) // number of child nodes
- return (SimpleNode) jjtree.popNode();
- else
- return null;
- }
-
- void jjtreeOpenNodeScope(Node n) {
- ((SimpleNode) n).firstToken = getToken(1);
- }
-
- void jjtreeCloseNodeScope(Node n) {
- ((SimpleNode) n).lastToken = getToken(0);
- }
-
- public static void main(String args[]) {
- System.out.println("Reading from standard input...");
- CSSParser css = new CSSParser(System.in);
- try {
- SimpleNode n = css.Stylesheet();
- n.dump("");
- System.out.println("Thank you.");
- } catch (Exception e) {
- System.out.println("Oops.");
- System.out.println(e.getMessage());
- e.printStackTrace();
- }
- }
-
- final public SimpleNode Stylesheet() throws ParseException {
- /*@bgen(jjtree) Stylesheet */
- SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEET);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- label_1:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENTIFIER:
- case PSEUDOCLASS_COLON:
- case 29:
- case 30:
- case 31:
- ;
- break;
- default:
- jj_la1[0] = jj_gen;
- break label_1;
- }
- Rule();
- }
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- {
- if (true) return jjtn000;
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void Rule() throws ParseException {
- /*@bgen(jjtree) Rule */
- SimpleNode jjtn000 = new SimpleNode(JJTRULE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- Selectors();
- jj_consume_token(LEFT_BRACE);
- Declaration();
- label_2:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[1] = jj_gen;
- break label_2;
- }
- jj_consume_token(SEMICOLON);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENTIFIER:
- Declaration();
- break;
- default:
- jj_la1[2] = jj_gen;
- ;
- }
- }
- jj_consume_token(RIGHT_BRACE);
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Selectors() throws ParseException {
- /*@bgen(jjtree) Selectors */
- SimpleNode jjtn000 = new SimpleNode(JJTSELECTORS);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- Selector();
- label_3:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case 28:
- ;
- break;
- default:
- jj_la1[3] = jj_gen;
- break label_3;
- }
- jj_consume_token(28);
- Selector();
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Selector() throws ParseException {
- /*@bgen(jjtree) Selector */
- SimpleNode jjtn000 = new SimpleNode(JJTSELECTOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENTIFIER:
- case 29:
- JavaClass();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case 30:
- Id();
- break;
- default:
- jj_la1[4] = jj_gen;
- ;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case 31:
- Class();
- break;
- default:
- jj_la1[5] = jj_gen;
- ;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PSEUDOCLASS_COLON:
- PseudoClass();
- break;
- default:
- jj_la1[6] = jj_gen;
- ;
- }
- break;
- case 30:
- Id();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case 31:
- Class();
- break;
- default:
- jj_la1[7] = jj_gen;
- ;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PSEUDOCLASS_COLON:
- PseudoClass();
- break;
- default:
- jj_la1[8] = jj_gen;
- ;
- }
- break;
- case 31:
- Class();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PSEUDOCLASS_COLON:
- PseudoClass();
- break;
- default:
- jj_la1[9] = jj_gen;
- ;
- }
- break;
- case PSEUDOCLASS_COLON:
- PseudoClass();
- break;
- default:
- jj_la1[10] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void JavaClass() throws ParseException {
- /*@bgen(jjtree) JavaClass */
- SimpleNode jjtn000 = new SimpleNode(JJTJAVACLASS);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENTIFIER:
- jj_consume_token(IDENTIFIER);
- break;
- case 29:
- jj_consume_token(29);
- break;
- default:
- jj_la1[11] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Id() throws ParseException {
- /*@bgen(jjtree) Id */
- SimpleNode jjtn000 = new SimpleNode(JJTID);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(30);
- jj_consume_token(IDENTIFIER);
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Class() throws ParseException {
- /*@bgen(jjtree) Class */
- SimpleNode jjtn000 = new SimpleNode(JJTCLASS);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(31);
- jj_consume_token(IDENTIFIER);
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void PseudoClass() throws ParseException {
- /*@bgen(jjtree) PseudoClass */
- SimpleNode jjtn000 = new SimpleNode(JJTPSEUDOCLASS);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(PSEUDOCLASS_COLON);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PSEUDOCLASS_IDENTIFIER:
- jj_consume_token(PSEUDOCLASS_IDENTIFIER);
- break;
- case PROGRAMMATIC_PSEUDOCLASS:
- jj_consume_token(PROGRAMMATIC_PSEUDOCLASS);
- break;
- default:
- jj_la1[12] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case 32:
- AnimationProperties();
- break;
- default:
- jj_la1[13] = jj_gen;
- ;
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void AnimationProperties() throws ParseException {
- /*@bgen(jjtree) AnimationProperties */
- SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTIES);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(32);
- AnimationProperty();
- label_4:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case 28:
- ;
- break;
- default:
- jj_la1[14] = jj_gen;
- break label_4;
- }
- jj_consume_token(28);
- AnimationProperty();
- }
- jj_consume_token(33);
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void AnimationProperty() throws ParseException {
- /*@bgen(jjtree) AnimationProperty */
- SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTY);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(IDENTIFIER);
- jj_consume_token(34);
- jj_consume_token(DECIMAL_LITERAL);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENTIFIER:
- jj_consume_token(IDENTIFIER);
- break;
- default:
- jj_la1[15] = jj_gen;
- ;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Declaration() throws ParseException {
- /*@bgen(jjtree) Declaration */
- SimpleNode jjtn000 = new SimpleNode(JJTDECLARATION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- Property();
- jj_consume_token(COLON);
- Expression();
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Property() throws ParseException {
- /*@bgen(jjtree) Property */
- SimpleNode jjtn000 = new SimpleNode(JJTPROPERTY);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(IDENTIFIER);
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Expression() throws ParseException {
- /*@bgen(jjtree) Expression */
- SimpleNode jjtn000 = new SimpleNode(JJTEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DECIMAL_LITERAL:
- jj_consume_token(DECIMAL_LITERAL);
- break;
- case STRING:
- jj_consume_token(STRING);
- break;
- case IDENTIFIER:
- jj_consume_token(IDENTIFIER);
- break;
- case HEXCOLOR:
- jj_consume_token(HEXCOLOR);
- break;
- case EMS:
- jj_consume_token(EMS);
- break;
- case EXS:
- jj_consume_token(EXS);
- break;
- case LENGTH:
- jj_consume_token(LENGTH);
- break;
- case JAVA_CODE_START:
- JavaCode();
- break;
- default:
- jj_la1[16] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void JavaCode() throws ParseException {
- /*@bgen(jjtree) JavaCode */
- SimpleNode jjtn000 = new SimpleNode(JJTJAVACODE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(JAVA_CODE_START);
- jj_consume_token(JAVA_CODE);
- jj_consume_token(JAVA_CODE_END);
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- final public void Identifier() throws ParseException {
- /*@bgen(jjtree) Identifier */
- SimpleNode jjtn000 = new SimpleNode(JJTIDENTIFIER);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(IDENTIFIER);
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
-
- public CSSParserTokenManager token_source;
- SimpleCharStream jj_input_stream;
- public Token token, jj_nt;
- private int jj_ntk;
- private int jj_gen;
- final private int[] jj_la1 = new int[17];
- static private int[] jj_la1_0;
- static private int[] jj_la1_1;
-
- static {
- jj_la1_0();
- jj_la1_1();
- }
-
- private static void jj_la1_0() {
- jj_la1_0 = new int[]{0xe0002200, 0x8000, 0x200, 0x10000000, 0x40000000, 0x80000000, 0x2000, 0x80000000, 0x2000, 0x2000, 0xe0002200, 0x20000200, 0x201000, 0x0, 0x10000000, 0x200, 0xec40280,};
- }
-
- private static void jj_la1_1() {
- jj_la1_1 = new int[]{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,};
- }
-
- public CSSParser(java.io.InputStream stream) {
- this(stream, null);
- }
-
- public CSSParser(java.io.InputStream stream, String encoding) {
- try {
- jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);
- } catch (java.io.UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
- token_source = new CSSParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 17; i++) jj_la1[i] = -1;
- }
-
- public void ReInit(java.io.InputStream stream) {
- ReInit(stream, null);
- }
-
- public void ReInit(java.io.InputStream stream, String encoding) {
- try {
- jj_input_stream.ReInit(stream, encoding, 1, 1);
- } catch (java.io.UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jjtree.reset();
- jj_gen = 0;
- for (int i = 0; i < 17; i++) jj_la1[i] = -1;
- }
-
- public CSSParser(java.io.Reader stream) {
- jj_input_stream = new SimpleCharStream(stream, 1, 1);
- token_source = new CSSParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 17; i++) jj_la1[i] = -1;
- }
-
- public void ReInit(java.io.Reader stream) {
- jj_input_stream.ReInit(stream, 1, 1);
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jjtree.reset();
- jj_gen = 0;
- for (int i = 0; i < 17; i++) jj_la1[i] = -1;
- }
-
- public CSSParser(CSSParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 17; i++) jj_la1[i] = -1;
- }
-
- public void ReInit(CSSParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jjtree.reset();
- jj_gen = 0;
- for (int i = 0; i < 17; i++) jj_la1[i] = -1;
- }
-
- final private Token jj_consume_token(int kind) throws ParseException {
- Token oldToken;
- if ((oldToken = token).next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- if (token.kind == kind) {
- jj_gen++;
- return token;
- }
- token = oldToken;
- jj_kind = kind;
- throw generateParseException();
- }
-
- final public Token getNextToken() {
- if (token.next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- jj_gen++;
- return token;
- }
-
- final public Token getToken(int index) {
- Token t = token;
- for (int i = 0; i < index; i++) {
- if (t.next != null) t = t.next;
- else t = t.next = token_source.getNextToken();
- }
- return t;
- }
-
- final private int jj_ntk() {
- if ((jj_nt = token.next) == null)
- return (jj_ntk = (token.next = token_source.getNextToken()).kind);
- else
- return (jj_ntk = jj_nt.kind);
- }
-
- private java.util.Vector jj_expentries = new java.util.Vector();
- private int[] jj_expentry;
- private int jj_kind = -1;
-
- public ParseException generateParseException() {
- Token errortok = token.next;
- int line = errortok.beginLine, column = errortok.beginColumn;
- String mess = (errortok.kind == 0) ? tokenImage[0] : errortok.image;
- return new ParseException("Parse error. Encountered: " + mess, line, column);
- }
-
- final public void enable_tracing() {
- }
-
- final public void disable_tracing() {
- }
-
-}
+package jaxx.compiler.css.parser;
+
+public class CSSParser/*@bgen(jjtree)*/ implements CSSParserTreeConstants, CSSParserConstants {/*@bgen(jjtree)*/
+ protected JJTCSSParserState jjtree = new JJTCSSParserState();
+
+ public SimpleNode popNode() {
+ if (jjtree.nodeArity() > 0) // number of child nodes
+ return (SimpleNode) jjtree.popNode();
+ else
+ return null;
+ }
+
+ void jjtreeOpenNodeScope(Node n) {
+ ((SimpleNode) n).firstToken = getToken(1);
+ }
+
+ void jjtreeCloseNodeScope(Node n) {
+ ((SimpleNode) n).lastToken = getToken(0);
+ }
+
+ public static void main(String args[]) {
+ System.out.println("Reading from standard input...");
+ CSSParser css = new CSSParser(System.in);
+ try {
+ SimpleNode n = css.Stylesheet();
+ n.dump("");
+ System.out.println("Thank you.");
+ } catch (Exception e) {
+ System.out.println("Oops.");
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ final public SimpleNode Stylesheet() throws ParseException {
+ /*@bgen(jjtree) Stylesheet */
+ SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEET);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ label_1:
+ while (true) {
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case IDENTIFIER:
+ case PSEUDOCLASS_COLON:
+ case 29:
+ case 30:
+ case 31:
+ ;
+ break;
+ default:
+ jj_la1[0] = jj_gen;
+ break label_1;
+ }
+ Rule();
+ }
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtc000 = false;
+ jjtreeCloseNodeScope(jjtn000);
+ {
+ if (true) return jjtn000;
+ }
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public void Rule() throws ParseException {
+ /*@bgen(jjtree) Rule */
+ SimpleNode jjtn000 = new SimpleNode(JJTRULE);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ Selectors();
+ jj_consume_token(LEFT_BRACE);
+ Declaration();
+ label_2:
+ while (true) {
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case SEMICOLON:
+ ;
+ break;
+ default:
+ jj_la1[1] = jj_gen;
+ break label_2;
+ }
+ jj_consume_token(SEMICOLON);
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case IDENTIFIER:
+ Declaration();
+ break;
+ default:
+ jj_la1[2] = jj_gen;
+ ;
+ }
+ }
+ jj_consume_token(RIGHT_BRACE);
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Selectors() throws ParseException {
+ /*@bgen(jjtree) Selectors */
+ SimpleNode jjtn000 = new SimpleNode(JJTSELECTORS);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ Selector();
+ label_3:
+ while (true) {
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case 28:
+ ;
+ break;
+ default:
+ jj_la1[3] = jj_gen;
+ break label_3;
+ }
+ jj_consume_token(28);
+ Selector();
+ }
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Selector() throws ParseException {
+ /*@bgen(jjtree) Selector */
+ SimpleNode jjtn000 = new SimpleNode(JJTSELECTOR);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case IDENTIFIER:
+ case 29:
+ JavaClass();
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case 30:
+ Id();
+ break;
+ default:
+ jj_la1[4] = jj_gen;
+ ;
+ }
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case 31:
+ Class();
+ break;
+ default:
+ jj_la1[5] = jj_gen;
+ ;
+ }
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case PSEUDOCLASS_COLON:
+ PseudoClass();
+ break;
+ default:
+ jj_la1[6] = jj_gen;
+ ;
+ }
+ break;
+ case 30:
+ Id();
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case 31:
+ Class();
+ break;
+ default:
+ jj_la1[7] = jj_gen;
+ ;
+ }
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case PSEUDOCLASS_COLON:
+ PseudoClass();
+ break;
+ default:
+ jj_la1[8] = jj_gen;
+ ;
+ }
+ break;
+ case 31:
+ Class();
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case PSEUDOCLASS_COLON:
+ PseudoClass();
+ break;
+ default:
+ jj_la1[9] = jj_gen;
+ ;
+ }
+ break;
+ case PSEUDOCLASS_COLON:
+ PseudoClass();
+ break;
+ default:
+ jj_la1[10] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void JavaClass() throws ParseException {
+ /*@bgen(jjtree) JavaClass */
+ SimpleNode jjtn000 = new SimpleNode(JJTJAVACLASS);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case IDENTIFIER:
+ jj_consume_token(IDENTIFIER);
+ break;
+ case 29:
+ jj_consume_token(29);
+ break;
+ default:
+ jj_la1[11] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Id() throws ParseException {
+ /*@bgen(jjtree) Id */
+ SimpleNode jjtn000 = new SimpleNode(JJTID);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(30);
+ jj_consume_token(IDENTIFIER);
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Class() throws ParseException {
+ /*@bgen(jjtree) Class */
+ SimpleNode jjtn000 = new SimpleNode(JJTCLASS);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(31);
+ jj_consume_token(IDENTIFIER);
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void PseudoClass() throws ParseException {
+ /*@bgen(jjtree) PseudoClass */
+ SimpleNode jjtn000 = new SimpleNode(JJTPSEUDOCLASS);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(PSEUDOCLASS_COLON);
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case PSEUDOCLASS_IDENTIFIER:
+ jj_consume_token(PSEUDOCLASS_IDENTIFIER);
+ break;
+ case PROGRAMMATIC_PSEUDOCLASS:
+ jj_consume_token(PROGRAMMATIC_PSEUDOCLASS);
+ break;
+ default:
+ jj_la1[12] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case 32:
+ AnimationProperties();
+ break;
+ default:
+ jj_la1[13] = jj_gen;
+ ;
+ }
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void AnimationProperties() throws ParseException {
+ /*@bgen(jjtree) AnimationProperties */
+ SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTIES);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(32);
+ AnimationProperty();
+ label_4:
+ while (true) {
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case 28:
+ ;
+ break;
+ default:
+ jj_la1[14] = jj_gen;
+ break label_4;
+ }
+ jj_consume_token(28);
+ AnimationProperty();
+ }
+ jj_consume_token(33);
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void AnimationProperty() throws ParseException {
+ /*@bgen(jjtree) AnimationProperty */
+ SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTY);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(IDENTIFIER);
+ jj_consume_token(34);
+ jj_consume_token(DECIMAL_LITERAL);
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case IDENTIFIER:
+ jj_consume_token(IDENTIFIER);
+ break;
+ default:
+ jj_la1[15] = jj_gen;
+ ;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Declaration() throws ParseException {
+ /*@bgen(jjtree) Declaration */
+ SimpleNode jjtn000 = new SimpleNode(JJTDECLARATION);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ Property();
+ jj_consume_token(COLON);
+ Expression();
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Property() throws ParseException {
+ /*@bgen(jjtree) Property */
+ SimpleNode jjtn000 = new SimpleNode(JJTPROPERTY);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(IDENTIFIER);
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Expression() throws ParseException {
+ /*@bgen(jjtree) Expression */
+ SimpleNode jjtn000 = new SimpleNode(JJTEXPRESSION);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
+ case DECIMAL_LITERAL:
+ jj_consume_token(DECIMAL_LITERAL);
+ break;
+ case STRING:
+ jj_consume_token(STRING);
+ break;
+ case IDENTIFIER:
+ jj_consume_token(IDENTIFIER);
+ break;
+ case HEXCOLOR:
+ jj_consume_token(HEXCOLOR);
+ break;
+ case EMS:
+ jj_consume_token(EMS);
+ break;
+ case EXS:
+ jj_consume_token(EXS);
+ break;
+ case LENGTH:
+ jj_consume_token(LENGTH);
+ break;
+ case JAVA_CODE_START:
+ JavaCode();
+ break;
+ default:
+ jj_la1[16] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ } catch (Throwable jjte000) {
+ if (jjtc000) {
+ jjtree.clearNodeScope(jjtn000);
+ jjtc000 = false;
+ } else {
+ jjtree.popNode();
+ }
+ if (jjte000 instanceof RuntimeException) {
+ {
+ if (true) throw (RuntimeException) jjte000;
+ }
+ }
+ if (jjte000 instanceof ParseException) {
+ {
+ if (true) throw (ParseException) jjte000;
+ }
+ }
+ {
+ if (true) throw (Error) jjte000;
+ }
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void JavaCode() throws ParseException {
+ /*@bgen(jjtree) JavaCode */
+ SimpleNode jjtn000 = new SimpleNode(JJTJAVACODE);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(JAVA_CODE_START);
+ jj_consume_token(JAVA_CODE);
+ jj_consume_token(JAVA_CODE_END);
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ final public void Identifier() throws ParseException {
+ /*@bgen(jjtree) Identifier */
+ SimpleNode jjtn000 = new SimpleNode(JJTIDENTIFIER);
+ boolean jjtc000 = true;
+ jjtree.openNodeScope(jjtn000);
+ jjtreeOpenNodeScope(jjtn000);
+ try {
+ jj_consume_token(IDENTIFIER);
+ } finally {
+ if (jjtc000) {
+ jjtree.closeNodeScope(jjtn000, true);
+ jjtreeCloseNodeScope(jjtn000);
+ }
+ }
+ }
+
+ public CSSParserTokenManager token_source;
+ SimpleCharStream jj_input_stream;
+ public Token token, jj_nt;
+ private int jj_ntk;
+ private int jj_gen;
+ final private int[] jj_la1 = new int[17];
+ static private int[] jj_la1_0;
+ static private int[] jj_la1_1;
+
+ static {
+ jj_la1_0();
+ jj_la1_1();
+ }
+
+ private static void jj_la1_0() {
+ jj_la1_0 = new int[]{0xe0002200, 0x8000, 0x200, 0x10000000, 0x40000000, 0x80000000, 0x2000, 0x80000000, 0x2000, 0x2000, 0xe0002200, 0x20000200, 0x201000, 0x0, 0x10000000, 0x200, 0xec40280,};
+ }
+
+ private static void jj_la1_1() {
+ jj_la1_1 = new int[]{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,};
+ }
+
+ public CSSParser(java.io.InputStream stream) {
+ this(stream, null);
+ }
+
+ public CSSParser(java.io.InputStream stream, String encoding) {
+ try {
+ jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);
+ } catch (java.io.UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ token_source = new CSSParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 17; i++) jj_la1[i] = -1;
+ }
+
+ public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try {
+ jj_input_stream.ReInit(stream, encoding, 1, 1);
+ } catch (java.io.UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jjtree.reset();
+ jj_gen = 0;
+ for (int i = 0; i < 17; i++) jj_la1[i] = -1;
+ }
+
+ public CSSParser(java.io.Reader stream) {
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
+ token_source = new CSSParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 17; i++) jj_la1[i] = -1;
+ }
+
+ public void ReInit(java.io.Reader stream) {
+ jj_input_stream.ReInit(stream, 1, 1);
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jjtree.reset();
+ jj_gen = 0;
+ for (int i = 0; i < 17; i++) jj_la1[i] = -1;
+ }
+
+ public CSSParser(CSSParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 17; i++) jj_la1[i] = -1;
+ }
+
+ public void ReInit(CSSParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jjtree.reset();
+ jj_gen = 0;
+ for (int i = 0; i < 17; i++) jj_la1[i] = -1;
+ }
+
+ final private Token jj_consume_token(int kind) throws ParseException {
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
+ }
+
+ final public Token getNextToken() {
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
+ }
+
+ final public Token getToken(int index) {
+ Token t = token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
+ }
+
+ final private int jj_ntk() {
+ if ((jj_nt = token.next) == null)
+ return (jj_ntk = (token.next = token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
+ }
+
+ private java.util.Vector jj_expentries = new java.util.Vector();
+ private int[] jj_expentry;
+ private int jj_kind = -1;
+
+ public ParseException generateParseException() {
+ Token errortok = token.next;
+ int line = errortok.beginLine, column = errortok.beginColumn;
+ String mess = (errortok.kind == 0) ? tokenImage[0] : errortok.image;
+ return new ParseException("Parse error. Encountered: " + mess, line, column);
+ }
+
+ final public void enable_tracing() {
+ }
+
+ final public void disable_tracing() {
+ }
+
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserConstants.java */
/*
* *##%
* JAXX Compiler
@@ -18,75 +19,74 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserConstants.java */
-package jaxx.compiler.css.parser;
-
-public interface CSSParserConstants {
-
- int EOF = 0;
- int DECIMAL_LITERAL = 7;
- int INTEGER_LITERAL = 8;
- int IDENTIFIER = 9;
- int LETTER = 10;
- int DIGIT = 11;
- int PSEUDOCLASS_IDENTIFIER = 12;
- int PSEUDOCLASS_COLON = 13;
- int COLON = 14;
- int SEMICOLON = 15;
- int LEFT_BRACE = 16;
- int RIGHT_BRACE = 17;
- int JAVA_CODE_START = 18;
- int JAVA_CODE = 19;
- int JAVA_CODE_END = 20;
- int PROGRAMMATIC_PSEUDOCLASS = 21;
- int STRING = 22;
- int HEXCOLOR = 23;
- int HEXDIGIT = 24;
- int EMS = 25;
- int EXS = 26;
- int LENGTH = 27;
-
- int DEFAULT = 0;
- int IN_RULE = 1;
- int JAVA_CODE_RULE = 2;
- int IN_PSEUDOCLASS = 3;
-
- String[] tokenImage = {
- "<EOF>",
- "\" \"",
- "\"\\t\"",
- "\"\\n\"",
- "\"\\r\"",
- "<token of kind 5>",
- "<token of kind 6>",
- "<DECIMAL_LITERAL>",
- "<INTEGER_LITERAL>",
- "<IDENTIFIER>",
- "<LETTER>",
- "<DIGIT>",
- "<PSEUDOCLASS_IDENTIFIER>",
- "\":\"",
- "\":\"",
- "\";\"",
- "\"{\"",
- "\"}\"",
- "<JAVA_CODE_START>",
- "<JAVA_CODE>",
- "<JAVA_CODE_END>",
- "<PROGRAMMATIC_PSEUDOCLASS>",
- "<STRING>",
- "<HEXCOLOR>",
- "<HEXDIGIT>",
- "<EMS>",
- "<EXS>",
- "<LENGTH>",
- "\",\"",
- "\"*\"",
- "\"#\"",
- "\".\"",
- "\"[\"",
- "\"]\"",
- "\"=\"",
- };
-
-}
+package jaxx.compiler.css.parser;
+
+public interface CSSParserConstants {
+
+ int EOF = 0;
+ int DECIMAL_LITERAL = 7;
+ int INTEGER_LITERAL = 8;
+ int IDENTIFIER = 9;
+ int LETTER = 10;
+ int DIGIT = 11;
+ int PSEUDOCLASS_IDENTIFIER = 12;
+ int PSEUDOCLASS_COLON = 13;
+ int COLON = 14;
+ int SEMICOLON = 15;
+ int LEFT_BRACE = 16;
+ int RIGHT_BRACE = 17;
+ int JAVA_CODE_START = 18;
+ int JAVA_CODE = 19;
+ int JAVA_CODE_END = 20;
+ int PROGRAMMATIC_PSEUDOCLASS = 21;
+ int STRING = 22;
+ int HEXCOLOR = 23;
+ int HEXDIGIT = 24;
+ int EMS = 25;
+ int EXS = 26;
+ int LENGTH = 27;
+
+ int DEFAULT = 0;
+ int IN_RULE = 1;
+ int JAVA_CODE_RULE = 2;
+ int IN_PSEUDOCLASS = 3;
+
+ String[] tokenImage = {
+ "<EOF>",
+ "\" \"",
+ "\"\\t\"",
+ "\"\\n\"",
+ "\"\\r\"",
+ "<token of kind 5>",
+ "<token of kind 6>",
+ "<DECIMAL_LITERAL>",
+ "<INTEGER_LITERAL>",
+ "<IDENTIFIER>",
+ "<LETTER>",
+ "<DIGIT>",
+ "<PSEUDOCLASS_IDENTIFIER>",
+ "\":\"",
+ "\":\"",
+ "\";\"",
+ "\"{\"",
+ "\"}\"",
+ "<JAVA_CODE_START>",
+ "<JAVA_CODE>",
+ "<JAVA_CODE_END>",
+ "<PROGRAMMATIC_PSEUDOCLASS>",
+ "<STRING>",
+ "<HEXCOLOR>",
+ "<HEXDIGIT>",
+ "<EMS>",
+ "<EXS>",
+ "<LENGTH>",
+ "\",\"",
+ "\"*\"",
+ "\"#\"",
+ "\".\"",
+ "\"[\"",
+ "\"]\"",
+ "\"=\"",
+ };
+
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserTokenManager.java */
/*
* *##%
* JAXX Compiler
@@ -18,1155 +19,1154 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserTokenManager.java */
-package jaxx.compiler.css.parser;
-
-public class CSSParserTokenManager implements CSSParserConstants {
- public java.io.PrintStream debugStream = System.out;
-
- public void setDebugStream(java.io.PrintStream ds) {
- debugStream = ds;
- }
-
- private int jjStopStringLiteralDfa_0(int pos, long active0) {
- switch (pos) {
- default:
- return -1;
- }
- }
-
- private int jjStartNfa_0(int pos, long active0) {
- return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
- }
-
- private int jjStopAtPos(int pos, int kind) {
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- return pos + 1;
- }
-
- private int jjStartNfaWithStates_0(int pos, int kind, int state) {
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return pos + 1;
- }
- return jjMoveNfa_0(state, pos + 1);
- }
-
- private int jjMoveStringLiteralDfa0_0() {
- switch (curChar) {
- case 35:
- return jjStopAtPos(0, 30);
- case 42:
- return jjStopAtPos(0, 29);
- case 44:
- return jjStopAtPos(0, 28);
- case 46:
- return jjStopAtPos(0, 31);
- case 58:
- return jjStopAtPos(0, 13);
- case 59:
- return jjStopAtPos(0, 15);
- case 61:
- return jjStopAtPos(0, 34);
- case 91:
- return jjStopAtPos(0, 32);
- case 93:
- return jjStopAtPos(0, 33);
- case 123:
- return jjStopAtPos(0, 16);
- default:
- return jjMoveNfa_0(3, 0);
- }
- }
-
- private void jjCheckNAdd(int state) {
- if (jjrounds[state] != jjround) {
- jjstateSet[jjnewStateCnt++] = state;
- jjrounds[state] = jjround;
- }
- }
-
- private void jjAddStates(int start, int end) {
- do {
- jjstateSet[jjnewStateCnt++] = jjnextStates[start];
- } while (start++ != end);
- }
-
- private void jjCheckNAddTwoStates(int state1, int state2) {
- jjCheckNAdd(state1);
- jjCheckNAdd(state2);
- }
-
- private void jjCheckNAddStates(int start, int end) {
- do {
- jjCheckNAdd(jjnextStates[start]);
- } while (start++ != end);
- }
-
- private void jjCheckNAddStates(int start) {
- jjCheckNAdd(jjnextStates[start]);
- jjCheckNAdd(jjnextStates[start + 1]);
- }
-
- static final long[] jjbitVec0 = {
- 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
- };
-
- private int jjMoveNfa_0(int startState, int curPos) {
- int[] nextStates;
- int startsAt = 0;
- jjnewStateCnt = 17;
- int i = 1;
- jjstateSet[0] = startState;
- int j, kind = 0x7fffffff;
- for (; ;) {
- if (++jjround == 0x7fffffff)
- ReInitRounds();
- if (curChar < 64) {
- long l = 1L << curChar;
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 3:
- if ((0x3ff000000000000L & l) != 0L) {
- if (kind > 7)
- kind = 7;
- jjCheckNAddTwoStates(0, 1);
- } else if (curChar == 47)
- jjAddStates(0, 1);
- else if (curChar == 45) {
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(4);
- }
- break;
- case 0:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAddTwoStates(0, 1);
- break;
- case 1:
- if (curChar == 46)
- jjCheckNAdd(2);
- break;
- case 2:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAdd(2);
- break;
- case 4:
- if ((0x3ff200000000000L & l) == 0L)
- break;
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(4);
- break;
- case 5:
- if (curChar == 47)
- jjAddStates(0, 1);
- break;
- case 6:
- if (curChar == 47)
- jjCheckNAddStates(2, 4);
- break;
- case 7:
- if ((0xffffffffffffdbffL & l) != 0L)
- jjCheckNAddStates(2, 4);
- break;
- case 8:
- if ((0x2400L & l) != 0L && kind > 5)
- kind = 5;
- break;
- case 9:
- if (curChar == 10 && kind > 5)
- kind = 5;
- break;
- case 10:
- if (curChar == 13)
- jjstateSet[jjnewStateCnt++] = 9;
- break;
- case 11:
- if (curChar == 42)
- jjCheckNAddTwoStates(12, 13);
- break;
- case 12:
- if ((0xfffffbffffffffffL & l) != 0L)
- jjCheckNAddTwoStates(12, 13);
- break;
- case 13:
- if (curChar == 42)
- jjAddStates(5, 6);
- break;
- case 14:
- if ((0xffff7fffffffffffL & l) != 0L)
- jjCheckNAddTwoStates(15, 13);
- break;
- case 15:
- if ((0xfffffbffffffffffL & l) != 0L)
- jjCheckNAddTwoStates(15, 13);
- break;
- case 16:
- if (curChar == 47 && kind > 6)
- kind = 6;
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else if (curChar < 128) {
- long l = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 3:
- case 4:
- if ((0x7fffffe87fffffeL & l) == 0L)
- break;
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(4);
- break;
- case 7:
- jjAddStates(2, 4);
- break;
- case 12:
- jjCheckNAddTwoStates(12, 13);
- break;
- case 14:
- case 15:
- jjCheckNAddTwoStates(15, 13);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else {
- int i2 = (curChar & 0xff) >> 6;
- long l2 = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 7:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjAddStates(2, 4);
- break;
- case 12:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjCheckNAddTwoStates(12, 13);
- break;
- case 14:
- case 15:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjCheckNAddTwoStates(15, 13);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- }
- if (kind != 0x7fffffff) {
- jjmatchedKind = kind;
- jjmatchedPos = curPos;
- kind = 0x7fffffff;
- }
- ++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 17 - (jjnewStateCnt = startsAt)))
- return curPos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return curPos;
- }
- }
- }
-
- private int jjStopStringLiteralDfa_3(int pos, long active0) {
- switch (pos) {
- default:
- return -1;
- }
- }
-
- private int jjStartNfa_3(int pos, long active0) {
- return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0), pos + 1);
- }
-
- private int jjStartNfaWithStates_3(int pos, int kind, int state) {
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return pos + 1;
- }
- return jjMoveNfa_3(state, pos + 1);
- }
-
- private int jjMoveStringLiteralDfa0_3() {
- switch (curChar) {
- case 59:
- return jjStopAtPos(0, 15);
- default:
- return jjMoveNfa_3(3, 0);
- }
- }
-
- private int jjMoveNfa_3(int startState, int curPos) {
- int[] nextStates;
- int startsAt = 0;
- jjnewStateCnt = 8;
- int i = 1;
- jjstateSet[0] = startState;
- int j, kind = 0x7fffffff;
- for (; ;) {
- if (++jjround == 0x7fffffff)
- ReInitRounds();
- if (curChar < 64) {
- long l = 1L << curChar;
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 3:
- if ((0x3ff000000000000L & l) != 0L) {
- if (kind > 7)
- kind = 7;
- jjCheckNAddTwoStates(0, 1);
- } else if (curChar == 45) {
- if (kind > 12)
- kind = 12;
- jjCheckNAdd(4);
- }
- break;
- case 0:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAddTwoStates(0, 1);
- break;
- case 1:
- if (curChar == 46)
- jjCheckNAdd(2);
- break;
- case 2:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAdd(2);
- break;
- case 4:
- if ((0x3ff200000000000L & l) == 0L)
- break;
- if (kind > 12)
- kind = 12;
- jjCheckNAdd(4);
- break;
- case 6:
- jjAddStates(7, 8);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else if (curChar < 128) {
- long l = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 3:
- if ((0x7fffffe87fffffeL & l) != 0L) {
- if (kind > 12)
- kind = 12;
- jjCheckNAdd(4);
- } else if (curChar == 123)
- jjCheckNAdd(6);
- break;
- case 4:
- if ((0x7fffffe87fffffeL & l) == 0L)
- break;
- if (kind > 12)
- kind = 12;
- jjCheckNAdd(4);
- break;
- case 5:
- if (curChar == 123)
- jjCheckNAdd(6);
- break;
- case 6:
- if ((0xdfffffffffffffffL & l) != 0L)
- jjCheckNAddTwoStates(6, 7);
- break;
- case 7:
- if (curChar == 125)
- kind = 21;
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else {
- int i2 = (curChar & 0xff) >> 6;
- long l2 = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 6:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjAddStates(7, 8);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- }
- if (kind != 0x7fffffff) {
- jjmatchedKind = kind;
- jjmatchedPos = curPos;
- kind = 0x7fffffff;
- }
- ++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 8 - (jjnewStateCnt = startsAt)))
- return curPos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return curPos;
- }
- }
- }
-
- private int jjStopStringLiteralDfa_1(int pos, long active0) {
- switch (pos) {
- default:
- return -1;
- }
- }
-
- private int jjStartNfa_1(int pos, long active0) {
- return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1);
- }
-
- private int jjStartNfaWithStates_1(int pos, int kind, int state) {
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return pos + 1;
- }
- return jjMoveNfa_1(state, pos + 1);
- }
-
- private int jjMoveStringLiteralDfa0_1() {
- switch (curChar) {
- case 58:
- return jjStopAtPos(0, 14);
- case 59:
- return jjStopAtPos(0, 15);
- case 125:
- return jjStopAtPos(0, 17);
- default:
- return jjMoveNfa_1(0, 0);
- }
- }
-
- private int jjMoveNfa_1(int startState, int curPos) {
- int[] nextStates;
- int startsAt = 0;
- jjnewStateCnt = 50;
- int i = 1;
- jjstateSet[0] = startState;
- int j, kind = 0x7fffffff;
- for (; ;) {
- if (++jjround == 0x7fffffff)
- ReInitRounds();
- if (curChar < 64) {
- long l = 1L << curChar;
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 0:
- if ((0x3ff000000000000L & l) != 0L) {
- if (kind > 7)
- kind = 7;
- jjCheckNAddStates(9, 22);
- } else if (curChar == 47)
- jjAddStates(23, 24);
- else if (curChar == 35)
- jjstateSet[jjnewStateCnt++] = 7;
- else if (curChar == 34)
- jjCheckNAddTwoStates(4, 5);
- else if (curChar == 45) {
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(1);
- }
- break;
- case 1:
- if ((0x3ff200000000000L & l) == 0L)
- break;
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(1);
- break;
- case 3:
- if (curChar == 34)
- jjCheckNAddTwoStates(4, 5);
- break;
- case 4:
- if ((0xfffffffbffffdbffL & l) != 0L)
- jjCheckNAddTwoStates(4, 5);
- break;
- case 5:
- if (curChar == 34 && kind > 22)
- kind = 22;
- break;
- case 6:
- if (curChar == 35)
- jjstateSet[jjnewStateCnt++] = 7;
- break;
- case 7:
- if ((0x3ff000000000000L & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 8;
- break;
- case 8:
- if ((0x3ff000000000000L & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 9;
- break;
- case 9:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 23)
- kind = 23;
- jjstateSet[jjnewStateCnt++] = 10;
- break;
- case 10:
- if ((0x3ff000000000000L & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 11;
- break;
- case 11:
- if ((0x3ff000000000000L & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 12;
- break;
- case 12:
- if ((0x3ff000000000000L & l) != 0L && kind > 23)
- kind = 23;
- break;
- case 13:
- if (curChar == 47)
- jjAddStates(23, 24);
- break;
- case 14:
- if (curChar == 47)
- jjCheckNAddStates(25, 27);
- break;
- case 15:
- if ((0xffffffffffffdbffL & l) != 0L)
- jjCheckNAddStates(25, 27);
- break;
- case 16:
- if ((0x2400L & l) != 0L && kind > 5)
- kind = 5;
- break;
- case 17:
- if (curChar == 10 && kind > 5)
- kind = 5;
- break;
- case 18:
- if (curChar == 13)
- jjstateSet[jjnewStateCnt++] = 17;
- break;
- case 19:
- if (curChar == 42)
- jjCheckNAddTwoStates(20, 21);
- break;
- case 20:
- if ((0xfffffbffffffffffL & l) != 0L)
- jjCheckNAddTwoStates(20, 21);
- break;
- case 21:
- if (curChar == 42)
- jjAddStates(28, 29);
- break;
- case 22:
- if ((0xffff7fffffffffffL & l) != 0L)
- jjCheckNAddTwoStates(23, 21);
- break;
- case 23:
- if ((0xfffffbffffffffffL & l) != 0L)
- jjCheckNAddTwoStates(23, 21);
- break;
- case 24:
- if (curChar == 47 && kind > 6)
- kind = 6;
- break;
- case 25:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAddStates(9, 22);
- break;
- case 26:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAddTwoStates(26, 27);
- break;
- case 27:
- if (curChar == 46)
- jjCheckNAdd(28);
- break;
- case 28:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAdd(28);
- break;
- case 29:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(30, 32);
- break;
- case 30:
- if (curChar == 46)
- jjCheckNAdd(31);
- break;
- case 31:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(31, 33);
- break;
- case 34:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(33, 35);
- break;
- case 35:
- if (curChar == 46)
- jjCheckNAdd(36);
- break;
- case 36:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(36, 38);
- break;
- case 39:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(36, 41);
- break;
- case 40:
- if (curChar == 46)
- jjCheckNAdd(41);
- break;
- case 41:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(42, 46);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else if (curChar < 128) {
- long l = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 0:
- if ((0x7fffffe87fffffeL & l) != 0L) {
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(1);
- } else if (curChar == 123) {
- if (kind > 18)
- kind = 18;
- }
- break;
- case 1:
- if ((0x7fffffe87fffffeL & l) == 0L)
- break;
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(1);
- break;
- case 2:
- if (curChar == 123 && kind > 18)
- kind = 18;
- break;
- case 4:
- if ((0xffffffffefffffffL & l) != 0L)
- jjAddStates(47, 48);
- break;
- case 7:
- if ((0x7e0000007eL & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 8;
- break;
- case 8:
- if ((0x7e0000007eL & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 9;
- break;
- case 9:
- if ((0x7e0000007eL & l) == 0L)
- break;
- if (kind > 23)
- kind = 23;
- jjstateSet[jjnewStateCnt++] = 10;
- break;
- case 10:
- if ((0x7e0000007eL & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 11;
- break;
- case 11:
- if ((0x7e0000007eL & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 12;
- break;
- case 12:
- if ((0x7e0000007eL & l) != 0L && kind > 23)
- kind = 23;
- break;
- case 15:
- jjAddStates(25, 27);
- break;
- case 20:
- jjCheckNAddTwoStates(20, 21);
- break;
- case 22:
- case 23:
- jjCheckNAddTwoStates(23, 21);
- break;
- case 32:
- if (curChar == 109 && kind > 25)
- kind = 25;
- break;
- case 33:
- if (curChar == 101)
- jjstateSet[jjnewStateCnt++] = 32;
- break;
- case 37:
- if (curChar == 120 && kind > 26)
- kind = 26;
- break;
- case 38:
- if (curChar == 101)
- jjstateSet[jjnewStateCnt++] = 37;
- break;
- case 42:
- if (curChar == 109 && kind > 27)
- kind = 27;
- break;
- case 43:
- if (curChar == 109)
- jjCheckNAdd(42);
- break;
- case 44:
- if (curChar == 99)
- jjCheckNAdd(42);
- break;
- case 45:
- if (curChar == 110 && kind > 27)
- kind = 27;
- break;
- case 46:
- if (curChar == 105)
- jjstateSet[jjnewStateCnt++] = 45;
- break;
- case 47:
- if (curChar == 112)
- jjAddStates(49, 50);
- break;
- case 48:
- if (curChar == 116 && kind > 27)
- kind = 27;
- break;
- case 49:
- if (curChar == 99 && kind > 27)
- kind = 27;
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else {
- int i2 = (curChar & 0xff) >> 6;
- long l2 = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 4:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjAddStates(47, 48);
- break;
- case 15:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjAddStates(25, 27);
- break;
- case 20:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjCheckNAddTwoStates(20, 21);
- break;
- case 22:
- case 23:
- if ((jjbitVec0[i2] & l2) != 0L)
- jjCheckNAddTwoStates(23, 21);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- }
- if (kind != 0x7fffffff) {
- jjmatchedKind = kind;
- jjmatchedPos = curPos;
- kind = 0x7fffffff;
- }
- ++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 50 - (jjnewStateCnt = startsAt)))
- return curPos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return curPos;
- }
- }
- }
-
- private int jjStopStringLiteralDfa_2(int pos, long active0) {
- switch (pos) {
- default:
- return -1;
- }
- }
-
- private int jjStartNfa_2(int pos, long active0) {
- return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1);
- }
-
- private int jjStartNfaWithStates_2(int pos, int kind, int state) {
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return pos + 1;
- }
- return jjMoveNfa_2(state, pos + 1);
- }
-
- private int jjMoveStringLiteralDfa0_2() {
- switch (curChar) {
- case 59:
- return jjStartNfaWithStates_2(0, 15, 3);
- default:
- return jjMoveNfa_2(4, 0);
- }
- }
-
- private int jjMoveNfa_2(int startState, int curPos) {
- int[] nextStates;
- int startsAt = 0;
- jjnewStateCnt = 5;
- int i = 1;
- jjstateSet[0] = startState;
- int j, kind = 0x7fffffff;
- for (; ;) {
- if (++jjround == 0x7fffffff)
- ReInitRounds();
- if (curChar < 64) {
- long l = 1L << curChar;
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 4:
- if (kind > 19)
- kind = 19;
- jjCheckNAdd(3);
- if ((0x3ff000000000000L & l) != 0L) {
- if (kind > 7)
- kind = 7;
- jjCheckNAddTwoStates(0, 1);
- }
- break;
- case 0:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAddTwoStates(0, 1);
- break;
- case 1:
- if (curChar == 46)
- jjCheckNAdd(2);
- break;
- case 2:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 7)
- kind = 7;
- jjCheckNAdd(2);
- break;
- case 3:
- if (kind > 19)
- kind = 19;
- jjCheckNAdd(3);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else if (curChar < 128) {
- long l = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 4:
- if ((0xdfffffffffffffffL & l) != 0L) {
- if (kind > 19)
- kind = 19;
- jjCheckNAdd(3);
- } else if (curChar == 125) {
- if (kind > 20)
- kind = 20;
- }
- break;
- case 3:
- if ((0xdfffffffffffffffL & l) == 0L)
- break;
- kind = 19;
- jjCheckNAdd(3);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- } else {
- int i2 = (curChar & 0xff) >> 6;
- long l2 = 1L << (curChar & 077);
- MatchLoop:
- do {
- switch (jjstateSet[--i]) {
- case 4:
- case 3:
- if ((jjbitVec0[i2] & l2) == 0L)
- break;
- if (kind > 19)
- kind = 19;
- jjCheckNAdd(3);
- break;
- default:
- break;
- }
- } while (i != startsAt);
- }
- if (kind != 0x7fffffff) {
- jjmatchedKind = kind;
- jjmatchedPos = curPos;
- kind = 0x7fffffff;
- }
- ++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt)))
- return curPos;
- try {
- curChar = input_stream.readChar();
- }
- catch (java.io.IOException e) {
- return curPos;
- }
- }
- }
-
- static final int[] jjnextStates = {
- 6, 11, 7, 8, 10, 14, 16, 6, 7, 26, 27, 29, 30, 33, 34, 35,
- 38, 39, 40, 43, 44, 46, 47, 14, 19, 15, 16, 18, 22, 24, 29, 30,
- 33, 34, 35, 38, 39, 40, 43, 44, 46, 47, 41, 43, 44, 46, 47, 4,
- 5, 48, 49,
- };
- public static final String[] jjstrLiteralImages = {
- "", null, null, null, null, null, null, null, null, null, null, null, null,
- "\72", "\72", "\73", "\173", "\175", null, null, null, null, null, null, null, null,
- null, null, "\54", "\52", "\43", "\56", "\133", "\135", "\75",};
- public static final String[] lexStateNames = {
- "DEFAULT",
- "IN_RULE",
- "JAVA_CODE_RULE",
- "IN_PSEUDOCLASS",
- };
- public static final int[] jjnewLexState = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, -1, -1, 1, 0, 2, -1, 1, 0, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- };
- static final long[] jjtoToken = {
- 0x7fefff281L,
- };
- static final long[] jjtoSkip = {
- 0x7eL,
- };
- protected SimpleCharStream input_stream;
- private final int[] jjrounds = new int[50];
- private final int[] jjstateSet = new int[100];
- protected char curChar;
-
- public CSSParserTokenManager(SimpleCharStream stream) {
- if (SimpleCharStream.staticFlag)
- throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
- input_stream = stream;
- }
-
- public CSSParserTokenManager(SimpleCharStream stream, int lexState) {
- this(stream);
- SwitchTo(lexState);
- }
-
- public void ReInit(SimpleCharStream stream) {
- jjmatchedPos = jjnewStateCnt = 0;
- curLexState = defaultLexState;
- input_stream = stream;
- ReInitRounds();
- }
-
- private void ReInitRounds() {
- int i;
- jjround = 0x80000001;
- for (i = 50; i-- > 0;)
- jjrounds[i] = 0x80000000;
- }
-
- public void ReInit(SimpleCharStream stream, int lexState) {
- ReInit(stream);
- SwitchTo(lexState);
- }
-
- public void SwitchTo(int lexState) {
- if (lexState >= 4 || lexState < 0)
- throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
- else
- curLexState = lexState;
- }
-
- protected Token jjFillToken() {
- Token t = Token.newToken(jjmatchedKind);
- t.kind = jjmatchedKind;
- String im = jjstrLiteralImages[jjmatchedKind];
- t.image = (im == null) ? input_stream.GetImage() : im;
- t.beginLine = input_stream.getBeginLine();
- t.beginColumn = input_stream.getBeginColumn();
- t.endLine = input_stream.getEndLine();
- t.endColumn = input_stream.getEndColumn();
- return t;
- }
-
- int curLexState = 0;
- int defaultLexState = 0;
- int jjnewStateCnt;
- int jjround;
- int jjmatchedPos;
- int jjmatchedKind;
-
- public Token getNextToken() {
- int kind;
- Token specialToken = null;
- Token matchedToken;
- int curPos = 0;
-
- EOFLoop:
- for (; ;) {
- try {
- curChar = input_stream.BeginToken();
- }
- catch (java.io.IOException e) {
- jjmatchedKind = 0;
- matchedToken = jjFillToken();
- return matchedToken;
- }
-
- switch (curLexState) {
- case 0:
- try {
- input_stream.backup(0);
- while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
- curChar = input_stream.BeginToken();
- }
- catch (java.io.IOException e1) {
- continue EOFLoop;
- }
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_0();
- break;
- case 1:
- try {
- input_stream.backup(0);
- while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
- curChar = input_stream.BeginToken();
- }
- catch (java.io.IOException e1) {
- continue EOFLoop;
- }
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_1();
- break;
- case 2:
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_2();
- break;
- case 3:
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_3();
- break;
- }
- if (jjmatchedKind != 0x7fffffff) {
- if (jjmatchedPos + 1 < curPos)
- input_stream.backup(curPos - jjmatchedPos - 1);
- if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
- matchedToken = jjFillToken();
- if (jjnewLexState[jjmatchedKind] != -1)
- curLexState = jjnewLexState[jjmatchedKind];
- return matchedToken;
- } else {
- if (jjnewLexState[jjmatchedKind] != -1)
- curLexState = jjnewLexState[jjmatchedKind];
- continue EOFLoop;
- }
- }
- int error_line = input_stream.getEndLine();
- int error_column = input_stream.getEndColumn();
- String error_after = null;
- boolean EOFSeen = false;
- try {
- input_stream.readChar();
- input_stream.backup(1);
- }
- catch (java.io.IOException e1) {
- EOFSeen = true;
- error_after = curPos <= 1 ? "" : input_stream.GetImage();
- if (curChar == '\n' || curChar == '\r') {
- error_line++;
- error_column = 0;
- } else
- error_column++;
- }
- if (!EOFSeen) {
- input_stream.backup(1);
- error_after = curPos <= 1 ? "" : input_stream.GetImage();
- }
- throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
- }
- }
-
-}
+package jaxx.compiler.css.parser;
+
+public class CSSParserTokenManager implements CSSParserConstants {
+ public java.io.PrintStream debugStream = System.out;
+
+ public void setDebugStream(java.io.PrintStream ds) {
+ debugStream = ds;
+ }
+
+ private int jjStopStringLiteralDfa_0(int pos, long active0) {
+ switch (pos) {
+ default:
+ return -1;
+ }
+ }
+
+ private int jjStartNfa_0(int pos, long active0) {
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+ }
+
+ private int jjStopAtPos(int pos, int kind) {
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+ }
+
+ private int jjStartNfaWithStates_0(int pos, int kind, int state) {
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return pos + 1;
+ }
+ return jjMoveNfa_0(state, pos + 1);
+ }
+
+ private int jjMoveStringLiteralDfa0_0() {
+ switch (curChar) {
+ case 35:
+ return jjStopAtPos(0, 30);
+ case 42:
+ return jjStopAtPos(0, 29);
+ case 44:
+ return jjStopAtPos(0, 28);
+ case 46:
+ return jjStopAtPos(0, 31);
+ case 58:
+ return jjStopAtPos(0, 13);
+ case 59:
+ return jjStopAtPos(0, 15);
+ case 61:
+ return jjStopAtPos(0, 34);
+ case 91:
+ return jjStopAtPos(0, 32);
+ case 93:
+ return jjStopAtPos(0, 33);
+ case 123:
+ return jjStopAtPos(0, 16);
+ default:
+ return jjMoveNfa_0(3, 0);
+ }
+ }
+
+ private void jjCheckNAdd(int state) {
+ if (jjrounds[state] != jjround) {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+ }
+
+ private void jjAddStates(int start, int end) {
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+ }
+
+ private void jjCheckNAddTwoStates(int state1, int state2) {
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+ }
+
+ private void jjCheckNAddStates(int start, int end) {
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+ }
+
+ private void jjCheckNAddStates(int start) {
+ jjCheckNAdd(jjnextStates[start]);
+ jjCheckNAdd(jjnextStates[start + 1]);
+ }
+
+ static final long[] jjbitVec0 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+ };
+
+ private int jjMoveNfa_0(int startState, int curPos) {
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 17;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (; ;) {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64) {
+ long l = 1L << curChar;
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 3:
+ if ((0x3ff000000000000L & l) != 0L) {
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddTwoStates(0, 1);
+ } else if (curChar == 47)
+ jjAddStates(0, 1);
+ else if (curChar == 45) {
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(4);
+ }
+ break;
+ case 0:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddTwoStates(0, 1);
+ break;
+ case 1:
+ if (curChar == 46)
+ jjCheckNAdd(2);
+ break;
+ case 2:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAdd(2);
+ break;
+ case 4:
+ if ((0x3ff200000000000L & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(4);
+ break;
+ case 5:
+ if (curChar == 47)
+ jjAddStates(0, 1);
+ break;
+ case 6:
+ if (curChar == 47)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 7:
+ if ((0xffffffffffffdbffL & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 8:
+ if ((0x2400L & l) != 0L && kind > 5)
+ kind = 5;
+ break;
+ case 9:
+ if (curChar == 10 && kind > 5)
+ kind = 5;
+ break;
+ case 10:
+ if (curChar == 13)
+ jjstateSet[jjnewStateCnt++] = 9;
+ break;
+ case 11:
+ if (curChar == 42)
+ jjCheckNAddTwoStates(12, 13);
+ break;
+ case 12:
+ if ((0xfffffbffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(12, 13);
+ break;
+ case 13:
+ if (curChar == 42)
+ jjAddStates(5, 6);
+ break;
+ case 14:
+ if ((0xffff7fffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(15, 13);
+ break;
+ case 15:
+ if ((0xfffffbffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(15, 13);
+ break;
+ case 16:
+ if (curChar == 47 && kind > 6)
+ kind = 6;
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else if (curChar < 128) {
+ long l = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 3:
+ case 4:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(4);
+ break;
+ case 7:
+ jjAddStates(2, 4);
+ break;
+ case 12:
+ jjCheckNAddTwoStates(12, 13);
+ break;
+ case 14:
+ case 15:
+ jjCheckNAddTwoStates(15, 13);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else {
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 7:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(2, 4);
+ break;
+ case 12:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjCheckNAddTwoStates(12, 13);
+ break;
+ case 14:
+ case 15:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjCheckNAddTwoStates(15, 13);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ }
+ if (kind != 0x7fffffff) {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 17 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return curPos;
+ }
+ }
+ }
+
+ private int jjStopStringLiteralDfa_3(int pos, long active0) {
+ switch (pos) {
+ default:
+ return -1;
+ }
+ }
+
+ private int jjStartNfa_3(int pos, long active0) {
+ return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0), pos + 1);
+ }
+
+ private int jjStartNfaWithStates_3(int pos, int kind, int state) {
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return pos + 1;
+ }
+ return jjMoveNfa_3(state, pos + 1);
+ }
+
+ private int jjMoveStringLiteralDfa0_3() {
+ switch (curChar) {
+ case 59:
+ return jjStopAtPos(0, 15);
+ default:
+ return jjMoveNfa_3(3, 0);
+ }
+ }
+
+ private int jjMoveNfa_3(int startState, int curPos) {
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 8;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (; ;) {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64) {
+ long l = 1L << curChar;
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 3:
+ if ((0x3ff000000000000L & l) != 0L) {
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddTwoStates(0, 1);
+ } else if (curChar == 45) {
+ if (kind > 12)
+ kind = 12;
+ jjCheckNAdd(4);
+ }
+ break;
+ case 0:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddTwoStates(0, 1);
+ break;
+ case 1:
+ if (curChar == 46)
+ jjCheckNAdd(2);
+ break;
+ case 2:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAdd(2);
+ break;
+ case 4:
+ if ((0x3ff200000000000L & l) == 0L)
+ break;
+ if (kind > 12)
+ kind = 12;
+ jjCheckNAdd(4);
+ break;
+ case 6:
+ jjAddStates(7, 8);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else if (curChar < 128) {
+ long l = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 3:
+ if ((0x7fffffe87fffffeL & l) != 0L) {
+ if (kind > 12)
+ kind = 12;
+ jjCheckNAdd(4);
+ } else if (curChar == 123)
+ jjCheckNAdd(6);
+ break;
+ case 4:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 12)
+ kind = 12;
+ jjCheckNAdd(4);
+ break;
+ case 5:
+ if (curChar == 123)
+ jjCheckNAdd(6);
+ break;
+ case 6:
+ if ((0xdfffffffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(6, 7);
+ break;
+ case 7:
+ if (curChar == 125)
+ kind = 21;
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else {
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 6:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(7, 8);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ }
+ if (kind != 0x7fffffff) {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 8 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return curPos;
+ }
+ }
+ }
+
+ private int jjStopStringLiteralDfa_1(int pos, long active0) {
+ switch (pos) {
+ default:
+ return -1;
+ }
+ }
+
+ private int jjStartNfa_1(int pos, long active0) {
+ return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1);
+ }
+
+ private int jjStartNfaWithStates_1(int pos, int kind, int state) {
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return pos + 1;
+ }
+ return jjMoveNfa_1(state, pos + 1);
+ }
+
+ private int jjMoveStringLiteralDfa0_1() {
+ switch (curChar) {
+ case 58:
+ return jjStopAtPos(0, 14);
+ case 59:
+ return jjStopAtPos(0, 15);
+ case 125:
+ return jjStopAtPos(0, 17);
+ default:
+ return jjMoveNfa_1(0, 0);
+ }
+ }
+
+ private int jjMoveNfa_1(int startState, int curPos) {
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 50;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (; ;) {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64) {
+ long l = 1L << curChar;
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 0:
+ if ((0x3ff000000000000L & l) != 0L) {
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddStates(9, 22);
+ } else if (curChar == 47)
+ jjAddStates(23, 24);
+ else if (curChar == 35)
+ jjstateSet[jjnewStateCnt++] = 7;
+ else if (curChar == 34)
+ jjCheckNAddTwoStates(4, 5);
+ else if (curChar == 45) {
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(1);
+ }
+ break;
+ case 1:
+ if ((0x3ff200000000000L & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(1);
+ break;
+ case 3:
+ if (curChar == 34)
+ jjCheckNAddTwoStates(4, 5);
+ break;
+ case 4:
+ if ((0xfffffffbffffdbffL & l) != 0L)
+ jjCheckNAddTwoStates(4, 5);
+ break;
+ case 5:
+ if (curChar == 34 && kind > 22)
+ kind = 22;
+ break;
+ case 6:
+ if (curChar == 35)
+ jjstateSet[jjnewStateCnt++] = 7;
+ break;
+ case 7:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 8;
+ break;
+ case 8:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 9;
+ break;
+ case 9:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 23)
+ kind = 23;
+ jjstateSet[jjnewStateCnt++] = 10;
+ break;
+ case 10:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 11;
+ break;
+ case 11:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 12;
+ break;
+ case 12:
+ if ((0x3ff000000000000L & l) != 0L && kind > 23)
+ kind = 23;
+ break;
+ case 13:
+ if (curChar == 47)
+ jjAddStates(23, 24);
+ break;
+ case 14:
+ if (curChar == 47)
+ jjCheckNAddStates(25, 27);
+ break;
+ case 15:
+ if ((0xffffffffffffdbffL & l) != 0L)
+ jjCheckNAddStates(25, 27);
+ break;
+ case 16:
+ if ((0x2400L & l) != 0L && kind > 5)
+ kind = 5;
+ break;
+ case 17:
+ if (curChar == 10 && kind > 5)
+ kind = 5;
+ break;
+ case 18:
+ if (curChar == 13)
+ jjstateSet[jjnewStateCnt++] = 17;
+ break;
+ case 19:
+ if (curChar == 42)
+ jjCheckNAddTwoStates(20, 21);
+ break;
+ case 20:
+ if ((0xfffffbffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(20, 21);
+ break;
+ case 21:
+ if (curChar == 42)
+ jjAddStates(28, 29);
+ break;
+ case 22:
+ if ((0xffff7fffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(23, 21);
+ break;
+ case 23:
+ if ((0xfffffbffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(23, 21);
+ break;
+ case 24:
+ if (curChar == 47 && kind > 6)
+ kind = 6;
+ break;
+ case 25:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddStates(9, 22);
+ break;
+ case 26:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddTwoStates(26, 27);
+ break;
+ case 27:
+ if (curChar == 46)
+ jjCheckNAdd(28);
+ break;
+ case 28:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAdd(28);
+ break;
+ case 29:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(30, 32);
+ break;
+ case 30:
+ if (curChar == 46)
+ jjCheckNAdd(31);
+ break;
+ case 31:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(31, 33);
+ break;
+ case 34:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(33, 35);
+ break;
+ case 35:
+ if (curChar == 46)
+ jjCheckNAdd(36);
+ break;
+ case 36:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(36, 38);
+ break;
+ case 39:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(36, 41);
+ break;
+ case 40:
+ if (curChar == 46)
+ jjCheckNAdd(41);
+ break;
+ case 41:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(42, 46);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else if (curChar < 128) {
+ long l = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 0:
+ if ((0x7fffffe87fffffeL & l) != 0L) {
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(1);
+ } else if (curChar == 123) {
+ if (kind > 18)
+ kind = 18;
+ }
+ break;
+ case 1:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(1);
+ break;
+ case 2:
+ if (curChar == 123 && kind > 18)
+ kind = 18;
+ break;
+ case 4:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjAddStates(47, 48);
+ break;
+ case 7:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 8;
+ break;
+ case 8:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 9;
+ break;
+ case 9:
+ if ((0x7e0000007eL & l) == 0L)
+ break;
+ if (kind > 23)
+ kind = 23;
+ jjstateSet[jjnewStateCnt++] = 10;
+ break;
+ case 10:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 11;
+ break;
+ case 11:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 12;
+ break;
+ case 12:
+ if ((0x7e0000007eL & l) != 0L && kind > 23)
+ kind = 23;
+ break;
+ case 15:
+ jjAddStates(25, 27);
+ break;
+ case 20:
+ jjCheckNAddTwoStates(20, 21);
+ break;
+ case 22:
+ case 23:
+ jjCheckNAddTwoStates(23, 21);
+ break;
+ case 32:
+ if (curChar == 109 && kind > 25)
+ kind = 25;
+ break;
+ case 33:
+ if (curChar == 101)
+ jjstateSet[jjnewStateCnt++] = 32;
+ break;
+ case 37:
+ if (curChar == 120 && kind > 26)
+ kind = 26;
+ break;
+ case 38:
+ if (curChar == 101)
+ jjstateSet[jjnewStateCnt++] = 37;
+ break;
+ case 42:
+ if (curChar == 109 && kind > 27)
+ kind = 27;
+ break;
+ case 43:
+ if (curChar == 109)
+ jjCheckNAdd(42);
+ break;
+ case 44:
+ if (curChar == 99)
+ jjCheckNAdd(42);
+ break;
+ case 45:
+ if (curChar == 110 && kind > 27)
+ kind = 27;
+ break;
+ case 46:
+ if (curChar == 105)
+ jjstateSet[jjnewStateCnt++] = 45;
+ break;
+ case 47:
+ if (curChar == 112)
+ jjAddStates(49, 50);
+ break;
+ case 48:
+ if (curChar == 116 && kind > 27)
+ kind = 27;
+ break;
+ case 49:
+ if (curChar == 99 && kind > 27)
+ kind = 27;
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else {
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 4:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(47, 48);
+ break;
+ case 15:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(25, 27);
+ break;
+ case 20:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjCheckNAddTwoStates(20, 21);
+ break;
+ case 22:
+ case 23:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjCheckNAddTwoStates(23, 21);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ }
+ if (kind != 0x7fffffff) {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 50 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return curPos;
+ }
+ }
+ }
+
+ private int jjStopStringLiteralDfa_2(int pos, long active0) {
+ switch (pos) {
+ default:
+ return -1;
+ }
+ }
+
+ private int jjStartNfa_2(int pos, long active0) {
+ return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1);
+ }
+
+ private int jjStartNfaWithStates_2(int pos, int kind, int state) {
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return pos + 1;
+ }
+ return jjMoveNfa_2(state, pos + 1);
+ }
+
+ private int jjMoveStringLiteralDfa0_2() {
+ switch (curChar) {
+ case 59:
+ return jjStartNfaWithStates_2(0, 15, 3);
+ default:
+ return jjMoveNfa_2(4, 0);
+ }
+ }
+
+ private int jjMoveNfa_2(int startState, int curPos) {
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 5;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (; ;) {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64) {
+ long l = 1L << curChar;
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 4:
+ if (kind > 19)
+ kind = 19;
+ jjCheckNAdd(3);
+ if ((0x3ff000000000000L & l) != 0L) {
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddTwoStates(0, 1);
+ }
+ break;
+ case 0:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAddTwoStates(0, 1);
+ break;
+ case 1:
+ if (curChar == 46)
+ jjCheckNAdd(2);
+ break;
+ case 2:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 7)
+ kind = 7;
+ jjCheckNAdd(2);
+ break;
+ case 3:
+ if (kind > 19)
+ kind = 19;
+ jjCheckNAdd(3);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else if (curChar < 128) {
+ long l = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 4:
+ if ((0xdfffffffffffffffL & l) != 0L) {
+ if (kind > 19)
+ kind = 19;
+ jjCheckNAdd(3);
+ } else if (curChar == 125) {
+ if (kind > 20)
+ kind = 20;
+ }
+ break;
+ case 3:
+ if ((0xdfffffffffffffffL & l) == 0L)
+ break;
+ kind = 19;
+ jjCheckNAdd(3);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ } else {
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop:
+ do {
+ switch (jjstateSet[--i]) {
+ case 4:
+ case 3:
+ if ((jjbitVec0[i2] & l2) == 0L)
+ break;
+ if (kind > 19)
+ kind = 19;
+ jjCheckNAdd(3);
+ break;
+ default:
+ break;
+ }
+ } while (i != startsAt);
+ }
+ if (kind != 0x7fffffff) {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try {
+ curChar = input_stream.readChar();
+ }
+ catch (java.io.IOException e) {
+ return curPos;
+ }
+ }
+ }
+
+ static final int[] jjnextStates = {
+ 6, 11, 7, 8, 10, 14, 16, 6, 7, 26, 27, 29, 30, 33, 34, 35,
+ 38, 39, 40, 43, 44, 46, 47, 14, 19, 15, 16, 18, 22, 24, 29, 30,
+ 33, 34, 35, 38, 39, 40, 43, 44, 46, 47, 41, 43, 44, 46, 47, 4,
+ 5, 48, 49,
+ };
+ public static final String[] jjstrLiteralImages = {
+ "", null, null, null, null, null, null, null, null, null, null, null, null,
+ "\72", "\72", "\73", "\173", "\175", null, null, null, null, null, null, null, null,
+ null, null, "\54", "\52", "\43", "\56", "\133", "\135", "\75",};
+ public static final String[] lexStateNames = {
+ "DEFAULT",
+ "IN_RULE",
+ "JAVA_CODE_RULE",
+ "IN_PSEUDOCLASS",
+ };
+ public static final int[] jjnewLexState = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, -1, -1, 1, 0, 2, -1, 1, 0, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ };
+ static final long[] jjtoToken = {
+ 0x7fefff281L,
+ };
+ static final long[] jjtoSkip = {
+ 0x7eL,
+ };
+ protected SimpleCharStream input_stream;
+ private final int[] jjrounds = new int[50];
+ private final int[] jjstateSet = new int[100];
+ protected char curChar;
+
+ public CSSParserTokenManager(SimpleCharStream stream) {
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ input_stream = stream;
+ }
+
+ public CSSParserTokenManager(SimpleCharStream stream, int lexState) {
+ this(stream);
+ SwitchTo(lexState);
+ }
+
+ public void ReInit(SimpleCharStream stream) {
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+ }
+
+ private void ReInitRounds() {
+ int i;
+ jjround = 0x80000001;
+ for (i = 50; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+ }
+
+ public void ReInit(SimpleCharStream stream, int lexState) {
+ ReInit(stream);
+ SwitchTo(lexState);
+ }
+
+ public void SwitchTo(int lexState) {
+ if (lexState >= 4 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+ }
+
+ protected Token jjFillToken() {
+ Token t = Token.newToken(jjmatchedKind);
+ t.kind = jjmatchedKind;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ t.image = (im == null) ? input_stream.GetImage() : im;
+ t.beginLine = input_stream.getBeginLine();
+ t.beginColumn = input_stream.getBeginColumn();
+ t.endLine = input_stream.getEndLine();
+ t.endColumn = input_stream.getEndColumn();
+ return t;
+ }
+
+ int curLexState = 0;
+ int defaultLexState = 0;
+ int jjnewStateCnt;
+ int jjround;
+ int jjmatchedPos;
+ int jjmatchedKind;
+
+ public Token getNextToken() {
+ int kind;
+ Token specialToken = null;
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop:
+ for (; ;) {
+ try {
+ curChar = input_stream.BeginToken();
+ }
+ catch (java.io.IOException e) {
+ jjmatchedKind = 0;
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+
+ switch (curLexState) {
+ case 0:
+ try {
+ input_stream.backup(0);
+ while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
+ curChar = input_stream.BeginToken();
+ }
+ catch (java.io.IOException e1) {
+ continue EOFLoop;
+ }
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ break;
+ case 1:
+ try {
+ input_stream.backup(0);
+ while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
+ curChar = input_stream.BeginToken();
+ }
+ catch (java.io.IOException e1) {
+ continue EOFLoop;
+ }
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_1();
+ break;
+ case 2:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_2();
+ break;
+ case 3:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_3();
+ break;
+ }
+ if (jjmatchedKind != 0x7fffffff) {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
+ matchedToken = jjFillToken();
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ return matchedToken;
+ } else {
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ continue EOFLoop;
+ }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try {
+ input_stream.readChar();
+ input_stream.backup(1);
+ }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ } else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+ }
+
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. .\CSSParserTreeConstants.java */
/*
* *##%
* JAXX Compiler
@@ -18,43 +19,42 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. .\CSSParserTreeConstants.java */
-
-package jaxx.compiler.css.parser;
-
-public interface CSSParserTreeConstants {
- public int JJTSTYLESHEET = 0;
- public int JJTRULE = 1;
- public int JJTSELECTORS = 2;
- public int JJTSELECTOR = 3;
- public int JJTJAVACLASS = 4;
- public int JJTID = 5;
- public int JJTCLASS = 6;
- public int JJTPSEUDOCLASS = 7;
- public int JJTANIMATIONPROPERTIES = 8;
- public int JJTANIMATIONPROPERTY = 9;
- public int JJTDECLARATION = 10;
- public int JJTPROPERTY = 11;
- public int JJTEXPRESSION = 12;
- public int JJTJAVACODE = 13;
- public int JJTIDENTIFIER = 14;
-
-
- public String[] jjtNodeName = {
- "Stylesheet",
- "Rule",
- "Selectors",
- "Selector",
- "JavaClass",
- "Id",
- "Class",
- "PseudoClass",
- "AnimationProperties",
- "AnimationProperty",
- "Declaration",
- "Property",
- "Expression",
- "JavaCode",
- "Identifier",
- };
-}
+
+package jaxx.compiler.css.parser;
+
+public interface CSSParserTreeConstants {
+ public int JJTSTYLESHEET = 0;
+ public int JJTRULE = 1;
+ public int JJTSELECTORS = 2;
+ public int JJTSELECTOR = 3;
+ public int JJTJAVACLASS = 4;
+ public int JJTID = 5;
+ public int JJTCLASS = 6;
+ public int JJTPSEUDOCLASS = 7;
+ public int JJTANIMATIONPROPERTIES = 8;
+ public int JJTANIMATIONPROPERTY = 9;
+ public int JJTDECLARATION = 10;
+ public int JJTPROPERTY = 11;
+ public int JJTEXPRESSION = 12;
+ public int JJTJAVACODE = 13;
+ public int JJTIDENTIFIER = 14;
+
+
+ public String[] jjtNodeName = {
+ "Stylesheet",
+ "Rule",
+ "Selectors",
+ "Selector",
+ "JavaClass",
+ "Id",
+ "Class",
+ "PseudoClass",
+ "AnimationProperties",
+ "AnimationProperty",
+ "Declaration",
+ "Property",
+ "Expression",
+ "JavaCode",
+ "Identifier",
+ };
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. .\JJTCSSParserState.java */
/*
* *##%
* JAXX Compiler
@@ -18,126 +19,125 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. .\JJTCSSParserState.java */
-
-package jaxx.compiler.css.parser;
-
-class JJTCSSParserState {
- private java.util.Stack<Node> nodes;
- private java.util.Stack<Integer> marks;
-
- private int sp; // number of nodes on stack
- private int mk; // current mark
- private boolean node_created;
-
- JJTCSSParserState() {
- nodes = new java.util.Stack<Node>();
- marks = new java.util.Stack<Integer>();
- sp = 0;
- mk = 0;
- }
-
- /* Determines whether the current node was actually closed and
- pushed. This should only be called in the final user action of a
- node scope. */
- boolean nodeCreated() {
- return node_created;
- }
-
- /* Call this to reinitialize the node stack. It is called
-automatically by the parser's ReInit() method. */
- void reset() {
- nodes.removeAllElements();
- marks.removeAllElements();
- sp = 0;
- mk = 0;
- }
-
- /* Returns the root node of the AST. It only makes sense to call
-this after a successful parse. */
- Node rootNode() {
- return nodes.elementAt(0);
- }
-
- /* Pushes a node on to the stack. */
- void pushNode(Node n) {
- nodes.push(n);
- ++sp;
- }
-
- /* Returns the node on the top of the stack, and remove it from the
- stack. */
- Node popNode() {
- if (--sp < mk) {
- mk = marks.pop();
- }
- return nodes.pop();
- }
-
- /* Returns the node currently on the top of the stack. */
- Node peekNode() {
- return nodes.peek();
- }
-
- /* Returns the number of children on the stack in the current node
- scope. */
- int nodeArity() {
- return sp - mk;
- }
-
-
- void clearNodeScope(Node n) {
- while (sp > mk) {
- popNode();
- }
- mk = marks.pop();
- }
-
-
- void openNodeScope(Node n) {
- marks.push(mk);
- mk = sp;
- n.jjtOpen();
- }
-
-
- /* A definite node is constructed from a specified number of
-children. That number of nodes are popped from the stack and
-made the children of the definite node. Then the definite node
-is pushed on to the stack. */
- void closeNodeScope(Node n, int num) {
- mk = marks.pop();
- while (num-- > 0) {
- Node c = popNode();
- c.jjtSetParent(n);
- n.jjtAddChild(c, num);
- }
- n.jjtClose();
- pushNode(n);
- node_created = true;
- }
-
-
- /* A conditional node is constructed if its condition is true. All
-the nodes that have been pushed since the node was opened are
-made children of the the conditional node, which is then pushed
-on to the stack. If the condition is false the node is not
-constructed and they are left on the stack. */
- void closeNodeScope(Node n, boolean condition) {
- if (condition) {
- int a = nodeArity();
- mk = marks.pop();
- while (a-- > 0) {
- Node c = popNode();
- c.jjtSetParent(n);
- n.jjtAddChild(c, a);
- }
- n.jjtClose();
- pushNode(n);
- node_created = true;
- } else {
- mk = marks.pop();
- node_created = false;
- }
- }
-}
+
+package jaxx.compiler.css.parser;
+
+class JJTCSSParserState {
+ private java.util.Stack<Node> nodes;
+ private java.util.Stack<Integer> marks;
+
+ private int sp; // number of nodes on stack
+ private int mk; // current mark
+ private boolean node_created;
+
+ JJTCSSParserState() {
+ nodes = new java.util.Stack<Node>();
+ marks = new java.util.Stack<Integer>();
+ sp = 0;
+ mk = 0;
+ }
+
+ /* Determines whether the current node was actually closed and
+ pushed. This should only be called in the final user action of a
+ node scope. */
+ boolean nodeCreated() {
+ return node_created;
+ }
+
+ /* Call this to reinitialize the node stack. It is called
+automatically by the parser's ReInit() method. */
+ void reset() {
+ nodes.removeAllElements();
+ marks.removeAllElements();
+ sp = 0;
+ mk = 0;
+ }
+
+ /* Returns the root node of the AST. It only makes sense to call
+this after a successful parse. */
+ Node rootNode() {
+ return nodes.elementAt(0);
+ }
+
+ /* Pushes a node on to the stack. */
+ void pushNode(Node n) {
+ nodes.push(n);
+ ++sp;
+ }
+
+ /* Returns the node on the top of the stack, and remove it from the
+ stack. */
+ Node popNode() {
+ if (--sp < mk) {
+ mk = marks.pop();
+ }
+ return nodes.pop();
+ }
+
+ /* Returns the node currently on the top of the stack. */
+ Node peekNode() {
+ return nodes.peek();
+ }
+
+ /* Returns the number of children on the stack in the current node
+ scope. */
+ int nodeArity() {
+ return sp - mk;
+ }
+
+
+ void clearNodeScope(Node n) {
+ while (sp > mk) {
+ popNode();
+ }
+ mk = marks.pop();
+ }
+
+
+ void openNodeScope(Node n) {
+ marks.push(mk);
+ mk = sp;
+ n.jjtOpen();
+ }
+
+
+ /* A definite node is constructed from a specified number of
+children. That number of nodes are popped from the stack and
+made the children of the definite node. Then the definite node
+is pushed on to the stack. */
+ void closeNodeScope(Node n, int num) {
+ mk = marks.pop();
+ while (num-- > 0) {
+ Node c = popNode();
+ c.jjtSetParent(n);
+ n.jjtAddChild(c, num);
+ }
+ n.jjtClose();
+ pushNode(n);
+ node_created = true;
+ }
+
+
+ /* A conditional node is constructed if its condition is true. All
+the nodes that have been pushed since the node was opened are
+made children of the the conditional node, which is then pushed
+on to the stack. If the condition is false the node is not
+constructed and they are left on the stack. */
+ void closeNodeScope(Node n, boolean condition) {
+ if (condition) {
+ int a = nodeArity();
+ mk = marks.pop();
+ while (a-- > 0) {
+ Node c = popNode();
+ c.jjtSetParent(n);
+ n.jjtAddChild(c, a);
+ }
+ n.jjtClose();
+ pushNode(n);
+ node_created = true;
+ } else {
+ mk = marks.pop();
+ node_created = false;
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. Node.java */
/*
* *##%
* JAXX Compiler
@@ -18,54 +19,53 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. Node.java */
-
-package jaxx.compiler.css.parser;
-
-/* All AST nodes must implement this interface. It provides basic
- machinery for constructing the parent and child relationships
- between nodes. */
-
-public interface Node {
-
- /**
- * This method is called after the node has been made the current
- * node. It indicates that child nodes can now be added to it.
- */
- public void jjtOpen();
-
- /**
- * This method is called after all the child nodes have been
- * added.
- */
- public void jjtClose();
-
- /**
- * This pair of methods are used to inform the node of its
- * parent.
- *
- * @param n node
- */
- public void jjtSetParent(Node n);
-
- public Node jjtGetParent();
-
- /**
- * This method tells the node to add its argument to the node's
- * list of children.
- *
- * @param n node
- * @param i pos
- */
- public void jjtAddChild(Node n, int i);
-
- /**
- * @param i pos
- * @return a child node. The children are numbered
- * from zero, left to right.
- */
- public Node jjtGetChild(int i);
-
- /** @return the number of children the node has. */
- public int jjtGetNumChildren();
-}
+
+package jaxx.compiler.css.parser;
+
+/* All AST nodes must implement this interface. It provides basic
+ machinery for constructing the parent and child relationships
+ between nodes. */
+
+public interface Node {
+
+ /**
+ * This method is called after the node has been made the current
+ * node. It indicates that child nodes can now be added to it.
+ */
+ public void jjtOpen();
+
+ /**
+ * This method is called after all the child nodes have been
+ * added.
+ */
+ public void jjtClose();
+
+ /**
+ * This pair of methods are used to inform the node of its
+ * parent.
+ *
+ * @param n node
+ */
+ public void jjtSetParent(Node n);
+
+ public Node jjtGetParent();
+
+ /**
+ * This method tells the node to add its argument to the node's
+ * list of children.
+ *
+ * @param n node
+ * @param i pos
+ */
+ public void jjtAddChild(Node n, int i);
+
+ /**
+ * @param i pos
+ * @return a child node. The children are numbered
+ * from zero, left to right.
+ */
+ public Node jjtGetChild(int i);
+
+ /** @return the number of children the node has. */
+ public int jjtGetNumChildren();
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
/*
* *##%
* JAXX Compiler
@@ -18,23 +19,22 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
-package jaxx.compiler.css.parser;
-
-public class ParseException extends jaxx.compiler.java.parser.ParseException {
- private static final long serialVersionUID = 229575674880359031L;
-
- public ParseException() {
- super();
- }
-
-
- public ParseException(String message) {
- super(message);
- }
-
-
- public ParseException(String message, int line, int column) {
- super(message, line, column);
- }
-}
+package jaxx.compiler.css.parser;
+
+public class ParseException extends jaxx.compiler.java.parser.ParseException {
+ private static final long serialVersionUID = 229575674880359031L;
+
+ public ParseException() {
+ super();
+ }
+
+
+ public ParseException(String message) {
+ super(message);
+ }
+
+
+ public ParseException(String message, int line, int column) {
+ super(message, line, column);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
/*
* *##%
* JAXX Compiler
@@ -18,401 +19,400 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
-package jaxx.compiler.css.parser;
-
-/**
- * An implementation of interface CharStream, where the stream is assumed to
- * contain only ASCII characters (without unicode processing).
- */
-
-public class SimpleCharStream {
- public static final boolean staticFlag = false;
- int bufsize;
- int available;
- int tokenBegin;
- public int bufpos = -1;
- protected int bufline[];
- protected int bufcolumn[];
-
- protected int column = 0;
- protected int line = 1;
-
- protected boolean prevCharIsCR = false;
- protected boolean prevCharIsLF = false;
-
- protected java.io.Reader inputStream;
-
- protected char[] buffer;
- protected int maxNextCharInd = 0;
- protected int inBuf = 0;
- protected int tabSize = 8;
-
- protected void setTabSize(int i) {
- tabSize = i;
- }
-
- protected int getTabSize(int i) {
- return tabSize;
- }
-
-
- protected void ExpandBuff(boolean wrapAround) {
- char[] newbuffer = new char[bufsize + 2048];
- int newbufline[] = new int[bufsize + 2048];
- int newbufcolumn[] = new int[bufsize + 2048];
-
- try {
- if (wrapAround) {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- System.arraycopy(buffer, 0, newbuffer,
- bufsize - tokenBegin, bufpos);
- buffer = newbuffer;
-
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
- bufline = newbufline;
-
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
- System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
- bufcolumn = newbufcolumn;
-
- maxNextCharInd = (bufpos += (bufsize - tokenBegin));
- } else {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- buffer = newbuffer;
-
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- bufline = newbufline;
-
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
- bufcolumn = newbufcolumn;
-
- maxNextCharInd = (bufpos -= tokenBegin);
- }
- }
- catch (Throwable t) {
- throw new Error(t.getMessage());
- }
-
-
- bufsize += 2048;
- available = bufsize;
- tokenBegin = 0;
- }
-
- protected void FillBuff() throws java.io.IOException {
- if (maxNextCharInd == available) {
- if (available == bufsize) {
- if (tokenBegin > 2048) {
- bufpos = maxNextCharInd = 0;
- available = tokenBegin;
- } else if (tokenBegin < 0)
- bufpos = maxNextCharInd = 0;
- else
- ExpandBuff(false);
- } else if (available > tokenBegin)
- available = bufsize;
- else if ((tokenBegin - available) < 2048)
- ExpandBuff(true);
- else
- available = tokenBegin;
- }
-
- int i;
- try {
- if ((i = inputStream.read(buffer, maxNextCharInd,
- available - maxNextCharInd)) == -1) {
- inputStream.close();
- throw new java.io.IOException();
- } else
- maxNextCharInd += i;
- }
- catch (java.io.IOException e) {
- --bufpos;
- backup(0);
- if (tokenBegin == -1)
- tokenBegin = bufpos;
- throw e;
- }
- }
-
- public char BeginToken() throws java.io.IOException {
- tokenBegin = -1;
- char c = readChar();
- tokenBegin = bufpos;
-
- return c;
- }
-
- protected void UpdateLineColumn(char c) {
- column++;
-
- if (prevCharIsLF) {
- prevCharIsLF = false;
- line += (column = 1);
- } else if (prevCharIsCR) {
- prevCharIsCR = false;
- if (c == '\n') {
- prevCharIsLF = true;
- } else
- line += (column = 1);
- }
-
- switch (c) {
- case '\r':
- prevCharIsCR = true;
- break;
- case '\n':
- prevCharIsLF = true;
- break;
- case '\t':
- column--;
- column += (tabSize - (column % tabSize));
- break;
- default:
- break;
- }
-
- bufline[bufpos] = line;
- bufcolumn[bufpos] = column;
- }
-
- public char readChar() throws java.io.IOException {
- if (inBuf > 0) {
- --inBuf;
-
- if (++bufpos == bufsize)
- bufpos = 0;
-
- return buffer[bufpos];
- }
-
- if (++bufpos >= maxNextCharInd)
- FillBuff();
-
- char c = buffer[bufpos];
-
- UpdateLineColumn(c);
- return (c);
- }
-
- /**
- * @return ???
- * @see #getEndColumn
- * @deprecated
- */
-
- public int getColumn() {
- return bufcolumn[bufpos];
- }
-
- /**
- * @return ???
- * @see #getEndLine
- * @deprecated
- */
-
- public int getLine() {
- return bufline[bufpos];
- }
-
- public int getEndColumn() {
- return bufcolumn[bufpos];
- }
-
- public int getEndLine() {
- return bufline[bufpos];
- }
-
- public int getBeginColumn() {
- return bufcolumn[tokenBegin];
- }
-
- public int getBeginLine() {
- return bufline[tokenBegin];
- }
-
- public void backup(int amount) {
-
- inBuf += amount;
- if ((bufpos -= amount) < 0)
- bufpos += bufsize;
- }
-
- public SimpleCharStream(java.io.Reader dstream, int startline,
- int startcolumn, int buffersize) {
- inputStream = dstream;
- line = startline;
- column = startcolumn - 1;
-
- available = bufsize = buffersize;
- buffer = new char[buffersize];
- bufline = new int[buffersize];
- bufcolumn = new int[buffersize];
- }
-
- public SimpleCharStream(java.io.Reader dstream, int startline,
- int startcolumn) {
- this(dstream, startline, startcolumn, 4096);
- }
-
- public SimpleCharStream(java.io.Reader dstream) {
- this(dstream, 1, 1, 4096);
- }
-
- public void ReInit(java.io.Reader dstream, int startline,
- int startcolumn, int buffersize) {
- inputStream = dstream;
- line = startline;
- column = startcolumn - 1;
-
- if (buffer == null || buffersize != buffer.length) {
- available = bufsize = buffersize;
- buffer = new char[buffersize];
- bufline = new int[buffersize];
- bufcolumn = new int[buffersize];
- }
- prevCharIsLF = prevCharIsCR = false;
- tokenBegin = inBuf = maxNextCharInd = 0;
- bufpos = -1;
- }
-
- public void ReInit(java.io.Reader dstream, int startline,
- int startcolumn) {
- ReInit(dstream, startline, startcolumn, 4096);
- }
-
- public void ReInit(java.io.Reader dstream) {
- ReInit(dstream, 1, 1, 4096);
- }
-
- public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
- this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
- }
-
- public SimpleCharStream(java.io.InputStream dstream, int startline,
- int startcolumn, int buffersize) {
- this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
- }
-
- public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn) throws java.io.UnsupportedEncodingException {
- this(dstream, encoding, startline, startcolumn, 4096);
- }
-
- public SimpleCharStream(java.io.InputStream dstream, int startline,
- int startcolumn) {
- this(dstream, startline, startcolumn, 4096);
- }
-
- public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
- this(dstream, encoding, 1, 1, 4096);
- }
-
- public SimpleCharStream(java.io.InputStream dstream) {
- this(dstream, 1, 1, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
- ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
- }
-
- public void ReInit(java.io.InputStream dstream, int startline,
- int startcolumn, int buffersize) {
- ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
- }
-
- public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
- ReInit(dstream, encoding, 1, 1, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream) {
- ReInit(dstream, 1, 1, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn) throws java.io.UnsupportedEncodingException {
- ReInit(dstream, encoding, startline, startcolumn, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream, int startline,
- int startcolumn) {
- ReInit(dstream, startline, startcolumn, 4096);
- }
-
- public String GetImage() {
- if (bufpos >= tokenBegin)
- return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
- else
- return new String(buffer, tokenBegin, bufsize - tokenBegin) +
- new String(buffer, 0, bufpos + 1);
- }
-
- public char[] GetSuffix(int len) {
- char[] ret = new char[len];
-
- if ((bufpos + 1) >= len)
- System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
- else {
- System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
- len - bufpos - 1);
- System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
- }
-
- return ret;
- }
-
- public void Done() {
- buffer = null;
- bufline = null;
- bufcolumn = null;
- }
-
- /**
- * Method to adjust line and column numbers for the start of a token.
- *
- * @param newLine ?
- * @param newCol ?
- */
- public void adjustBeginLineColumn(int newLine, int newCol) {
- int start = tokenBegin;
- int len;
-
- if (bufpos >= tokenBegin) {
- len = bufpos - tokenBegin + inBuf + 1;
- } else {
- len = bufsize - tokenBegin + bufpos + 1 + inBuf;
- }
-
- int i = 0, j = 0, k;
- int nextColDiff, columnDiff = 0;
-
- while (i < len &&
- bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) {
- bufline[j] = newLine;
- nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
- bufcolumn[j] = newCol + columnDiff;
- columnDiff = nextColDiff;
- i++;
- }
-
- if (i < len) {
- bufline[j] = newLine++;
- bufcolumn[j] = newCol + columnDiff;
-
- while (i++ < len) {
- if (bufline[j = start % bufsize] != bufline[++start % bufsize])
- bufline[j] = newLine++;
- else
- bufline[j] = newLine;
- }
- }
-
- line = bufline[j];
- column = bufcolumn[j];
- }
-
-}
+package jaxx.compiler.css.parser;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public class SimpleCharStream {
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+
+ protected void setTabSize(int i) {
+ tabSize = i;
+ }
+
+ protected int getTabSize(int i) {
+ return tabSize;
+ }
+
+
+ protected void ExpandBuff(boolean wrapAround) {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try {
+ if (wrapAround) {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer,
+ bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ } else {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t) {
+ throw new Error(t.getMessage());
+ }
+
+
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException {
+ if (maxNextCharInd == available) {
+ if (available == bufsize) {
+ if (tokenBegin > 2048) {
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
+ } else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
+ else
+ ExpandBuff(false);
+ } else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd,
+ available - maxNextCharInd)) == -1) {
+ inputStream.close();
+ throw new java.io.IOException();
+ } else
+ maxNextCharInd += i;
+ }
+ catch (java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
+ }
+
+ public char BeginToken() throws java.io.IOException {
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c) {
+ column++;
+
+ if (prevCharIsLF) {
+ prevCharIsLF = false;
+ line += (column = 1);
+ } else if (prevCharIsCR) {
+ prevCharIsCR = false;
+ if (c == '\n') {
+ prevCharIsLF = true;
+ } else
+ line += (column = 1);
+ }
+
+ switch (c) {
+ case '\r':
+ prevCharIsCR = true;
+ break;
+ case '\n':
+ prevCharIsLF = true;
+ break;
+ case '\t':
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default:
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+ public char readChar() throws java.io.IOException {
+ if (inBuf > 0) {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
+
+ char c = buffer[bufpos];
+
+ UpdateLineColumn(c);
+ return (c);
+ }
+
+ /**
+ * @return ???
+ * @see #getEndColumn
+ * @deprecated
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /**
+ * @return ???
+ * @see #getEndLine
+ * @deprecated
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize) {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn) {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.Reader dstream) {
+ this(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize) {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length) {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ bufpos = -1;
+ }
+
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn) {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.Reader dstream) {
+ ReInit(dstream, 1, 1, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize) {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn) {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream) {
+ this(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize) {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
+ ReInit(dstream, encoding, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream) {
+ ReInit(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException {
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn) {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ public String GetImage() {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ public char[] GetSuffix(int len) {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ public void Done() {
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ *
+ * @param newLine ?
+ * @param newCol ?
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol) {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin) {
+ len = bufpos - tokenBegin + inBuf + 1;
+ } else {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k;
+ int nextColDiff, columnDiff = 0;
+
+ while (i < len &&
+ bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len) {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len) {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
/*
* *##%
* JAXX Compiler
@@ -18,125 +19,124 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
-
-package jaxx.compiler.css.parser;
-
-public class SimpleNode implements Node {
- protected Node parent;
- protected Node[] children;
- protected int id;
- protected CSSParser parser;
- public Token firstToken;
- public Token lastToken;
-
-
- public SimpleNode(int i) {
- id = i;
- }
-
- public SimpleNode(CSSParser p, int i) {
- this(i);
- parser = p;
- }
-
-
- public int getId() {
- return id;
- }
-
- public void jjtOpen() {
- }
-
- public void jjtClose() {
- }
-
- public void jjtSetParent(Node n) {
- parent = n;
- }
-
- public Node jjtGetParent() {
- return parent;
- }
-
- public SimpleNode getParent() {
- return (SimpleNode) parent;
- }
-
- public void jjtAddChild(Node n, int i) {
- if (children == null) {
- children = new Node[i + 1];
- } else if (i >= children.length) {
- Node c[] = new Node[i + 1];
- System.arraycopy(children, 0, c, 0, children.length);
- children = c;
- }
- children[i] = n;
- }
-
- public Node jjtGetChild(int i) {
- return children[i];
- }
-
- public SimpleNode getChild(int i) {
- return (SimpleNode) children[i];
- }
-
- public int jjtGetNumChildren() {
- return (children == null) ? 0 : children.length;
- }
-
- /* You can override these two methods in subclasses of SimpleNode to
-customize the way the node appears when the tree is dumped. If
-your output uses more than one line you should override
-toString(String), otherwise overriding toString() is probably all
-you need to do. */
-
- @Override
- public String toString() {
- return getClass().getName() + "[" + getText() + "]";
- }
-
- public String toString(String prefix) {
- return prefix + toString();
- }
-
- /* Override this method if you want to customize how the node dumps
- out its children. */
-
- public void dump(String prefix) {
- System.out.println(toString(prefix));
- if (children != null) {
- for (Node aChildren : children) {
- SimpleNode n = (SimpleNode) aChildren;
- if (n != null) {
- n.dump(prefix + " ");
- }
- }
- }
- }
-
- private void appendSpecialTokens(StringBuffer s, Token st) {
- if (st != null) {
- appendSpecialTokens(s, st.specialToken);
- s.append(st.image);
- }
- }
-
-
- /** @return the text of the tokens comprising this node. */
- public String getText() {
- StringBuffer text = new StringBuffer();
- Token t = firstToken;
- while (t != null) {
- appendSpecialTokens(text, t.specialToken);
- text.append(t.image);
- if (t == lastToken)
- break;
- t = t.next;
- }
-
- return text.toString();
- }
-}
-
+
+package jaxx.compiler.css.parser;
+
+public class SimpleNode implements Node {
+ protected Node parent;
+ protected Node[] children;
+ protected int id;
+ protected CSSParser parser;
+ public Token firstToken;
+ public Token lastToken;
+
+
+ public SimpleNode(int i) {
+ id = i;
+ }
+
+ public SimpleNode(CSSParser p, int i) {
+ this(i);
+ parser = p;
+ }
+
+
+ public int getId() {
+ return id;
+ }
+
+ public void jjtOpen() {
+ }
+
+ public void jjtClose() {
+ }
+
+ public void jjtSetParent(Node n) {
+ parent = n;
+ }
+
+ public Node jjtGetParent() {
+ return parent;
+ }
+
+ public SimpleNode getParent() {
+ return (SimpleNode) parent;
+ }
+
+ public void jjtAddChild(Node n, int i) {
+ if (children == null) {
+ children = new Node[i + 1];
+ } else if (i >= children.length) {
+ Node c[] = new Node[i + 1];
+ System.arraycopy(children, 0, c, 0, children.length);
+ children = c;
+ }
+ children[i] = n;
+ }
+
+ public Node jjtGetChild(int i) {
+ return children[i];
+ }
+
+ public SimpleNode getChild(int i) {
+ return (SimpleNode) children[i];
+ }
+
+ public int jjtGetNumChildren() {
+ return (children == null) ? 0 : children.length;
+ }
+
+ /* You can override these two methods in subclasses of SimpleNode to
+customize the way the node appears when the tree is dumped. If
+your output uses more than one line you should override
+toString(String), otherwise overriding toString() is probably all
+you need to do. */
+
+ @Override
+ public String toString() {
+ return getClass().getName() + "[" + getText() + "]";
+ }
+
+ public String toString(String prefix) {
+ return prefix + toString();
+ }
+
+ /* Override this method if you want to customize how the node dumps
+ out its children. */
+
+ public void dump(String prefix) {
+ System.out.println(toString(prefix));
+ if (children != null) {
+ for (Node aChildren : children) {
+ SimpleNode n = (SimpleNode) aChildren;
+ if (n != null) {
+ n.dump(prefix + " ");
+ }
+ }
+ }
+ }
+
+ private void appendSpecialTokens(StringBuffer s, Token st) {
+ if (st != null) {
+ appendSpecialTokens(s, st.specialToken);
+ s.append(st.image);
+ }
+ }
+
+
+ /** @return the text of the tokens comprising this node. */
+ public String getText() {
+ StringBuffer text = new StringBuffer();
+ Token t = firstToken;
+ while (t != null) {
+ appendSpecialTokens(text, t.specialToken);
+ text.append(t.image);
+ if (t == lastToken)
+ break;
+ t = t.next;
+ }
+
+ return text.toString();
+ }
+}
+
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
/*
* *##%
* JAXX Compiler
@@ -18,79 +19,78 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
-package jaxx.compiler.css.parser;
-
-/** Describes the input token stream. */
-
-public class Token {
-
- /**
- * An integer that describes the kind of this token. This numbering
- * system is determined by JavaCCParser, and a table of these numbers is
- * stored in the file ...Constants.java.
- */
- public int kind;
-
- /**
- * beginLine and beginColumn describe the position of the first character
- * of this token; endLine and endColumn describe the position of the
- * last character of this token.
- */
- public int beginLine, beginColumn, endLine, endColumn;
-
- /** The string image of the token. */
- public String image;
-
- /**
- * A reference to the next regular (non-special) token from the input
- * stream. If this is the last token from the input stream, or if the
- * token manager has not read tokens beyond this one, this field is
- * set to null. This is true only if this token is also a regular
- * token. Otherwise, see below for a description of the contents of
- * this field.
- */
- public Token next;
-
- /**
- * This field is used to access special tokens that occur prior to this
- * token, but after the immediately preceding regular (non-special) token.
- * If there are no such special tokens, this field is set to null.
- * When there are more than one such special token, this field refers
- * to the last of these special tokens, which in turn refers to the next
- * previous special token through its specialToken field, and so on
- * until the first special token (whose specialToken field is null).
- * The next fields of special tokens refer to other special tokens that
- * immediately follow it (without an intervening regular token). If there
- * is no such token, this field is null.
- */
- public Token specialToken;
-
- /** Returns the image. */
- public String toString() {
- return image;
- }
-
- /**
- * Returns a new Token object, by default. However, if you want, you
- * can create and return subclass objects based on the value of ofKind.
- * Simply add the cases to the switch for all those special cases.
- * For example, if you have a subclass of Token called IDToken that
- * you want to create if ofKind is ID, simlpy add something like :
- * <p/>
- * case MyParserConstants.ID : return new IDToken();
- * <p/>
- * to the following switch statement. Then you can cast matchedToken
- * variable to the appropriate type and use it in your lexical actions.
- *
- * @param ofKind kind of token
- * @return the new token
- */
- public static Token newToken(int ofKind) {
- switch (ofKind) {
- default:
- return new Token();
- }
- }
-
-}
+package jaxx.compiler.css.parser;
+
+/** Describes the input token stream. */
+
+public class Token {
+
+ /**
+ * An integer that describes the kind of this token. This numbering
+ * system is determined by JavaCCParser, and a table of these numbers is
+ * stored in the file ...Constants.java.
+ */
+ public int kind;
+
+ /**
+ * beginLine and beginColumn describe the position of the first character
+ * of this token; endLine and endColumn describe the position of the
+ * last character of this token.
+ */
+ public int beginLine, beginColumn, endLine, endColumn;
+
+ /** The string image of the token. */
+ public String image;
+
+ /**
+ * A reference to the next regular (non-special) token from the input
+ * stream. If this is the last token from the input stream, or if the
+ * token manager has not read tokens beyond this one, this field is
+ * set to null. This is true only if this token is also a regular
+ * token. Otherwise, see below for a description of the contents of
+ * this field.
+ */
+ public Token next;
+
+ /**
+ * This field is used to access special tokens that occur prior to this
+ * token, but after the immediately preceding regular (non-special) token.
+ * If there are no such special tokens, this field is set to null.
+ * When there are more than one such special token, this field refers
+ * to the last of these special tokens, which in turn refers to the next
+ * previous special token through its specialToken field, and so on
+ * until the first special token (whose specialToken field is null).
+ * The next fields of special tokens refer to other special tokens that
+ * immediately follow it (without an intervening regular token). If there
+ * is no such token, this field is null.
+ */
+ public Token specialToken;
+
+ /** Returns the image. */
+ public String toString() {
+ return image;
+ }
+
+ /**
+ * Returns a new Token object, by default. However, if you want, you
+ * can create and return subclass objects based on the value of ofKind.
+ * Simply add the cases to the switch for all those special cases.
+ * For example, if you have a subclass of Token called IDToken that
+ * you want to create if ofKind is ID, simlpy add something like :
+ * <p/>
+ * case MyParserConstants.ID : return new IDToken();
+ * <p/>
+ * to the following switch statement. Then you can cast matchedToken
+ * variable to the appropriate type and use it in your lexical actions.
+ *
+ * @param ofKind kind of token
+ * @return the new token
+ */
+ public static Token newToken(int ofKind) {
+ switch (ofKind) {
+ default:
+ return new Token();
+ }
+ }
+
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
/*
* *##%
* JAXX Compiler
@@ -18,129 +19,128 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
-package jaxx.compiler.css.parser;
-
-public class TokenMgrError extends Error {
- /*
- * Ordinals for various reasons why an Error of this type can be thrown.
- */
-
- /** Lexical error occured. */
- static final int LEXICAL_ERROR = 0;
-
- /** An attempt wass made to create a second instance of a static token manager. */
- static final int STATIC_LEXER_ERROR = 1;
-
- /** Tried to change to an invalid lexical state. */
- static final int INVALID_LEXICAL_STATE = 2;
-
- /** Detected (and bailed out of) an infinite loop in the token manager. */
- static final int LOOP_DETECTED = 3;
-
- /**
- * Indicates the reason why the exception is thrown. It will have
- * one of the above 4 values.
- */
- int errorCode;
- private static final long serialVersionUID = -4308847190164230336L;
-
- /**
- * Replaces unprintable characters by their espaced (or unicode escaped)
- * equivalents in the given string
- *
- * @param str text to espace
- * @return the espaced text
- */
- protected static String addEscapes(String str) {
- StringBuffer retval = new StringBuffer();
- char ch;
- for (int i = 0; i < str.length(); i++) {
- switch (str.charAt(i)) {
- case 0:
- continue;
- case '\b':
- retval.append("\\b");
- continue;
- case '\t':
- retval.append("\\t");
- continue;
- case '\n':
- retval.append("\\n");
- continue;
- case '\f':
- retval.append("\\f");
- continue;
- case '\r':
- retval.append("\\r");
- continue;
- case '\"':
- retval.append("\\\"");
- continue;
- case '\'':
- retval.append("\\\'");
- continue;
- case '\\':
- retval.append("\\\\");
- continue;
- default:
- if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
- String s = "0000" + Integer.toString(ch, 16);
- retval.append("\\u").append(s.substring(s.length() - 4, s.length()));
- } else {
- retval.append(ch);
- }
- }
- }
- return retval.toString();
- }
-
- /**
- * @param EOFSeen : indicates if EOF caused the lexicl error
- * @param lexState : lexical state in which this error occured
- * @param errorLine : line number when the error occured
- * @param errorColumn : column number when the error occured
- * @param errorAfter : prefix that was seen before this error occured
- * @param curChar : the offending character
- * Note: You can customize the lexical error message by modifying this method.
- * @return a detailed message for the Error when it is thrown by the
- * token manager to indicate a lexical error.
- */
- protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
- return ("Lexical error at line " +
- errorLine + ", column " +
- errorColumn + ". Encountered: " +
- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") +
- "after : \"" + addEscapes(errorAfter) + "\"");
- }
-
- /**
- * You can also modify the body of this method to customize your error messages.
- * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
- * of end-users concern, so you can return something like :
- * <p/>
- * "Internal Error : Please file a bug report .... "
- * <p/>
- * from this method for such cases in the release version of your parser.
- */
- @Override
- public String getMessage() {
- return super.getMessage();
- }
-
- /*
- * Constructors of various flavors follow.
- */
-
- public TokenMgrError() {
- }
-
- public TokenMgrError(String message, int reason) {
- super(message);
- errorCode = reason;
- }
-
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
- this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
- }
-}
+package jaxx.compiler.css.parser;
+
+public class TokenMgrError extends Error {
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /** Lexical error occured. */
+ static final int LEXICAL_ERROR = 0;
+
+ /** An attempt wass made to create a second instance of a static token manager. */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /** Tried to change to an invalid lexical state. */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /** Detected (and bailed out of) an infinite loop in the token manager. */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+ private static final long serialVersionUID = -4308847190164230336L;
+
+ /**
+ * Replaces unprintable characters by their espaced (or unicode escaped)
+ * equivalents in the given string
+ *
+ * @param str text to espace
+ * @return the espaced text
+ */
+ protected static String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i)) {
+ case 0:
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u").append(s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * @param EOFSeen : indicates if EOF caused the lexicl error
+ * @param lexState : lexical state in which this error occured
+ * @param errorLine : line number when the error occured
+ * @param errorColumn : column number when the error occured
+ * @param errorAfter : prefix that was seen before this error occured
+ * @param curChar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ * @return a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return ("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ * <p/>
+ * "Internal Error : Please file a bug report .... "
+ * <p/>
+ * from this method for such cases in the release version of your parser.
+ */
+ @Override
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ public TokenMgrError() {
+ }
+
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. .\JJTJavaParserState.java */
/*
* *##%
* JAXX Compiler
@@ -18,126 +19,125 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. .\JJTJavaParserState.java */
-
-package jaxx.compiler.java.parser;
-
-class JJTJavaParserState {
- private java.util.Stack<Node> nodes;
- private java.util.Stack<Integer> marks;
-
- private int sp; // number of nodes on stack
- private int mk; // current mark
- private boolean node_created;
-
- JJTJavaParserState() {
- nodes = new java.util.Stack<Node>();
- marks = new java.util.Stack<Integer>();
- sp = 0;
- mk = 0;
- }
-
- /* Determines whether the current node was actually closed and
- pushed. This should only be called in the final user action of a
- node scope. */
- boolean nodeCreated() {
- return node_created;
- }
-
- /* Call this to reinitialize the node stack. It is called
-automatically by the parser's ReInit() method. */
- void reset() {
- nodes.removeAllElements();
- marks.removeAllElements();
- sp = 0;
- mk = 0;
- }
-
- /* Returns the root node of the AST. It only makes sense to call
-this after a successful parse. */
- Node rootNode() {
- return nodes.elementAt(0);
- }
-
- /* Pushes a node on to the stack. */
- void pushNode(Node n) {
- nodes.push(n);
- ++sp;
- }
-
- /* Returns the node on the top of the stack, and remove it from the
- stack. */
- Node popNode() {
- if (--sp < mk) {
- mk = marks.pop();
- }
- return nodes.pop();
- }
-
- /* Returns the node currently on the top of the stack. */
- Node peekNode() {
- return nodes.peek();
- }
-
- /* Returns the number of children on the stack in the current node
- scope. */
- int nodeArity() {
- return sp - mk;
- }
-
-
- void clearNodeScope(Node n) {
- while (sp > mk) {
- popNode();
- }
- mk = marks.pop();
- }
-
-
- void openNodeScope(Node n) {
- marks.push(mk);
- mk = sp;
- n.jjtOpen();
- }
-
-
- /* A definite node is constructed from a specified number of
-children. That number of nodes are popped from the stack and
-made the children of the definite node. Then the definite node
-is pushed on to the stack. */
- void closeNodeScope(Node n, int num) {
- mk = marks.pop();
- while (num-- > 0) {
- Node c = popNode();
- c.jjtSetParent(n);
- n.jjtAddChild(c, num);
- }
- n.jjtClose();
- pushNode(n);
- node_created = true;
- }
-
-
- /* A conditional node is constructed if its condition is true. All
-the nodes that have been pushed since the node was opened are
-made children of the the conditional node, which is then pushed
-on to the stack. If the condition is false the node is not
-constructed and they are left on the stack. */
- void closeNodeScope(Node n, boolean condition) {
- if (condition) {
- int a = nodeArity();
- mk = marks.pop();
- while (a-- > 0) {
- Node c = popNode();
- c.jjtSetParent(n);
- n.jjtAddChild(c, a);
- }
- n.jjtClose();
- pushNode(n);
- node_created = true;
- } else {
- mk = marks.pop();
- node_created = false;
- }
- }
-}
+
+package jaxx.compiler.java.parser;
+
+class JJTJavaParserState {
+ private java.util.Stack<Node> nodes;
+ private java.util.Stack<Integer> marks;
+
+ private int sp; // number of nodes on stack
+ private int mk; // current mark
+ private boolean node_created;
+
+ JJTJavaParserState() {
+ nodes = new java.util.Stack<Node>();
+ marks = new java.util.Stack<Integer>();
+ sp = 0;
+ mk = 0;
+ }
+
+ /* Determines whether the current node was actually closed and
+ pushed. This should only be called in the final user action of a
+ node scope. */
+ boolean nodeCreated() {
+ return node_created;
+ }
+
+ /* Call this to reinitialize the node stack. It is called
+automatically by the parser's ReInit() method. */
+ void reset() {
+ nodes.removeAllElements();
+ marks.removeAllElements();
+ sp = 0;
+ mk = 0;
+ }
+
+ /* Returns the root node of the AST. It only makes sense to call
+this after a successful parse. */
+ Node rootNode() {
+ return nodes.elementAt(0);
+ }
+
+ /* Pushes a node on to the stack. */
+ void pushNode(Node n) {
+ nodes.push(n);
+ ++sp;
+ }
+
+ /* Returns the node on the top of the stack, and remove it from the
+ stack. */
+ Node popNode() {
+ if (--sp < mk) {
+ mk = marks.pop();
+ }
+ return nodes.pop();
+ }
+
+ /* Returns the node currently on the top of the stack. */
+ Node peekNode() {
+ return nodes.peek();
+ }
+
+ /* Returns the number of children on the stack in the current node
+ scope. */
+ int nodeArity() {
+ return sp - mk;
+ }
+
+
+ void clearNodeScope(Node n) {
+ while (sp > mk) {
+ popNode();
+ }
+ mk = marks.pop();
+ }
+
+
+ void openNodeScope(Node n) {
+ marks.push(mk);
+ mk = sp;
+ n.jjtOpen();
+ }
+
+
+ /* A definite node is constructed from a specified number of
+children. That number of nodes are popped from the stack and
+made the children of the definite node. Then the definite node
+is pushed on to the stack. */
+ void closeNodeScope(Node n, int num) {
+ mk = marks.pop();
+ while (num-- > 0) {
+ Node c = popNode();
+ c.jjtSetParent(n);
+ n.jjtAddChild(c, num);
+ }
+ n.jjtClose();
+ pushNode(n);
+ node_created = true;
+ }
+
+
+ /* A conditional node is constructed if its condition is true. All
+the nodes that have been pushed since the node was opened are
+made children of the the conditional node, which is then pushed
+on to the stack. If the condition is false the node is not
+constructed and they are left on the stack. */
+ void closeNodeScope(Node n, boolean condition) {
+ if (condition) {
+ int a = nodeArity();
+ mk = marks.pop();
+ while (a-- > 0) {
+ Node c = popNode();
+ c.jjtSetParent(n);
+ n.jjtAddChild(c, a);
+ }
+ n.jjtClose();
+ pushNode(n);
+ node_created = true;
+ } else {
+ mk = marks.pop();
+ node_created = false;
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.0 */
/*
* *##%
* JAXX Compiler
@@ -18,533 +19,532 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.0 */
-package jaxx.compiler.java.parser;
-
-/**
- * An implementation of interface CharStream, where the stream is assumed to
- * contain only ASCII characters (with java-like unicode escape processing).
- */
-
-public class JavaCharStream {
- public static final boolean staticFlag = false;
-
- static int hexval(char c) throws java.io.IOException {
- switch (c) {
- case '0':
- return 0;
- case '1':
- return 1;
- case '2':
- return 2;
- case '3':
- return 3;
- case '4':
- return 4;
- case '5':
- return 5;
- case '6':
- return 6;
- case '7':
- return 7;
- case '8':
- return 8;
- case '9':
- return 9;
-
- case 'a':
- case 'A':
- return 10;
- case 'b':
- case 'B':
- return 11;
- case 'c':
- case 'C':
- return 12;
- case 'd':
- case 'D':
- return 13;
- case 'e':
- case 'E':
- return 14;
- case 'f':
- case 'F':
- return 15;
- }
-
- throw new java.io.IOException(); // Should never come here
- }
-
- public int bufpos = -1;
- int bufsize;
- int available;
- int tokenBegin;
- protected int bufline[];
- protected int bufcolumn[];
-
- protected int column = 0;
- protected int line = 1;
-
- protected boolean prevCharIsCR = false;
- protected boolean prevCharIsLF = false;
-
- protected java.io.Reader inputStream;
-
- protected char[] nextCharBuf;
- protected char[] buffer;
- protected int maxNextCharInd = 0;
- protected int nextCharInd = -1;
- protected int inBuf = 0;
- protected int tabSize = 8;
-
- protected void setTabSize(int i) {
- tabSize = i;
- }
-
- protected int getTabSize(int i) {
- return tabSize;
- }
-
- protected void ExpandBuff(boolean wrapAround) {
- char[] newbuffer = new char[bufsize + 2048];
- int newbufline[] = new int[bufsize + 2048];
- int newbufcolumn[] = new int[bufsize + 2048];
-
- try {
- if (wrapAround) {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- System.arraycopy(buffer, 0, newbuffer,
- bufsize - tokenBegin, bufpos);
- buffer = newbuffer;
-
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
- bufline = newbufline;
-
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
- System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
- bufcolumn = newbufcolumn;
-
- bufpos += (bufsize - tokenBegin);
- } else {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- buffer = newbuffer;
-
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- bufline = newbufline;
-
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
- bufcolumn = newbufcolumn;
-
- bufpos -= tokenBegin;
- }
- }
- catch (Throwable t) {
- throw new Error(t.getMessage());
- }
-
- available = (bufsize += 2048);
- tokenBegin = 0;
- }
-
- protected void FillBuff() throws java.io.IOException {
- int i;
- if (maxNextCharInd == 4096)
- maxNextCharInd = nextCharInd = 0;
-
- try {
- if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
- 4096 - maxNextCharInd)) == -1) {
- inputStream.close();
- throw new java.io.IOException();
- } else {
- maxNextCharInd += i;
- }
- }
- catch (java.io.IOException e) {
- if (bufpos != 0) {
- --bufpos;
- backup(0);
- } else {
- bufline[bufpos] = line;
- bufcolumn[bufpos] = column;
- }
- throw e;
- }
- }
-
- protected char ReadByte() throws java.io.IOException {
- if (++nextCharInd >= maxNextCharInd)
- FillBuff();
-
- return nextCharBuf[nextCharInd];
- }
-
- public char BeginToken() throws java.io.IOException {
- if (inBuf > 0) {
- --inBuf;
-
- if (++bufpos == bufsize) {
- bufpos = 0;
- }
-
- tokenBegin = bufpos;
- return buffer[bufpos];
- }
-
- tokenBegin = 0;
- bufpos = -1;
-
- return readChar();
- }
-
- protected void AdjustBuffSize() {
- if (available == bufsize) {
- if (tokenBegin > 2048) {
- bufpos = 0;
- available = tokenBegin;
- } else
- ExpandBuff(false);
- } else if (available > tokenBegin)
- available = bufsize;
- else if ((tokenBegin - available) < 2048)
- ExpandBuff(true);
- else
- available = tokenBegin;
- }
-
- protected void UpdateLineColumn(char c) {
- column++;
-
- if (prevCharIsLF) {
- prevCharIsLF = false;
- line += (column = 1);
- } else if (prevCharIsCR) {
- prevCharIsCR = false;
- if (c == '\n') {
- prevCharIsLF = true;
- } else
- line += (column = 1);
- }
-
- switch (c) {
- case '\r':
- prevCharIsCR = true;
- break;
- case '\n':
- prevCharIsLF = true;
- break;
- case '\t':
- column--;
- column += (tabSize - (column % tabSize));
- break;
- default:
- break;
- }
-
- bufline[bufpos] = line;
- bufcolumn[bufpos] = column;
- }
-
- public char readChar() throws java.io.IOException {
- if (inBuf > 0) {
- --inBuf;
-
- if (++bufpos == bufsize)
- bufpos = 0;
-
- return buffer[bufpos];
- }
-
- char c;
-
- if (++bufpos == available)
- AdjustBuffSize();
-
- if ((buffer[bufpos] = c = ReadByte()) == '\\') {
- UpdateLineColumn(c);
-
- int backSlashCnt = 1;
-
- for (; ;) // Read all the backslashes
- {
- if (++bufpos == available)
- AdjustBuffSize();
-
- try {
- if ((buffer[bufpos] = c = ReadByte()) != '\\') {
- UpdateLineColumn(c);
- // found a non-backslash char.
- if ((c == 'u') && ((backSlashCnt & 1) == 1)) {
- if (--bufpos < 0)
- bufpos = bufsize - 1;
-
- break;
- }
-
- backup(backSlashCnt);
- return '\\';
- }
- }
- catch (java.io.IOException e) {
- if (backSlashCnt > 1)
- backup(backSlashCnt);
-
- return '\\';
- }
-
- UpdateLineColumn(c);
- backSlashCnt++;
- }
-
- // Here, we have seen an odd number of backslash's followed by a 'u'
- try {
- while ((c = ReadByte()) == 'u')
- ++column;
-
- buffer[bufpos] = c = (char) (hexval(c) << 12 |
- hexval(ReadByte()) << 8 |
- hexval(ReadByte()) << 4 |
- hexval(ReadByte()));
-
- column += 4;
- }
- catch (java.io.IOException e) {
- throw new Error("Invalid escape character at line " + line +
- " column " + column + ".");
- }
-
- if (backSlashCnt == 1)
- return c;
- else {
- backup(backSlashCnt - 1);
- return '\\';
- }
- } else {
- UpdateLineColumn(c);
- return (c);
- }
- }
-
- /**
- * @return column index
- * @see #getEndColumn
- * @deprecated
- */
-
- public int getColumn() {
- return bufcolumn[bufpos];
- }
-
- /**
- * @return line type ???
- * @see #getEndLine
- * @deprecated
- */
-
- public int getLine() {
- return bufline[bufpos];
- }
-
- public int getEndColumn() {
- return bufcolumn[bufpos];
- }
-
- public int getEndLine() {
- return bufline[bufpos];
- }
-
- public int getBeginColumn() {
- return bufcolumn[tokenBegin];
- }
-
- public int getBeginLine() {
- return bufline[tokenBegin];
- }
-
- public void backup(int amount) {
-
- inBuf += amount;
- if ((bufpos -= amount) < 0)
- bufpos += bufsize;
- }
-
- public JavaCharStream(java.io.Reader dstream,
- int startline, int startcolumn, int buffersize) {
- inputStream = dstream;
- line = startline;
- column = startcolumn - 1;
-
- available = bufsize = buffersize;
- buffer = new char[buffersize];
- bufline = new int[buffersize];
- bufcolumn = new int[buffersize];
- nextCharBuf = new char[4096];
- }
-
- public JavaCharStream(java.io.Reader dstream,
- int startline, int startcolumn) {
- this(dstream, startline, startcolumn, 4096);
- }
-
- public JavaCharStream(java.io.Reader dstream) {
- this(dstream, 1, 1, 4096);
- }
-
- public void ReInit(java.io.Reader dstream,
- int startline, int startcolumn, int buffersize) {
- inputStream = dstream;
- line = startline;
- column = startcolumn - 1;
-
- if (buffer == null || buffersize != buffer.length) {
- available = bufsize = buffersize;
- buffer = new char[buffersize];
- bufline = new int[buffersize];
- bufcolumn = new int[buffersize];
- nextCharBuf = new char[4096];
- }
- prevCharIsLF = prevCharIsCR = false;
- tokenBegin = inBuf = maxNextCharInd = 0;
- nextCharInd = bufpos = -1;
- }
-
- public void ReInit(java.io.Reader dstream,
- int startline, int startcolumn) {
- ReInit(dstream, startline, startcolumn, 4096);
- }
-
- public void ReInit(java.io.Reader dstream) {
- ReInit(dstream, 1, 1, 4096);
- }
-
- public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
- this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
- }
-
- public JavaCharStream(java.io.InputStream dstream, int startline,
- int startcolumn, int buffersize) {
- this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
- }
-
- public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn) throws java.io.UnsupportedEncodingException {
- this(dstream, encoding, startline, startcolumn, 4096);
- }
-
- public JavaCharStream(java.io.InputStream dstream, int startline,
- int startcolumn) {
- this(dstream, startline, startcolumn, 4096);
- }
-
- public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
- this(dstream, encoding, 1, 1, 4096);
- }
-
- public JavaCharStream(java.io.InputStream dstream) {
- this(dstream, 1, 1, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
- ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
- }
-
- public void ReInit(java.io.InputStream dstream, int startline,
- int startcolumn, int buffersize) {
- ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
- }
-
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn) throws java.io.UnsupportedEncodingException {
- ReInit(dstream, encoding, startline, startcolumn, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream, int startline,
- int startcolumn) {
- ReInit(dstream, startline, startcolumn, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
- ReInit(dstream, encoding, 1, 1, 4096);
- }
-
- public void ReInit(java.io.InputStream dstream) {
- ReInit(dstream, 1, 1, 4096);
- }
-
- public String GetImage() {
- if (bufpos >= tokenBegin)
- return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
- else
- return new String(buffer, tokenBegin, bufsize - tokenBegin) +
- new String(buffer, 0, bufpos + 1);
- }
-
- public char[] GetSuffix(int len) {
- char[] ret = new char[len];
-
- if ((bufpos + 1) >= len)
- System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
- else {
- System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
- len - bufpos - 1);
- System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
- }
-
- return ret;
- }
-
- public void Done() {
- nextCharBuf = null;
- buffer = null;
- bufline = null;
- bufcolumn = null;
- }
-
- /**
- * Method to adjust line and column numbers for the start of a token.
- *
- * @param newLine line number ?
- * @param newCol column number ?
- */
- public void adjustBeginLineColumn(int newLine, int newCol) {
- int start = tokenBegin;
- int len;
-
- if (bufpos >= tokenBegin) {
- len = bufpos - tokenBegin + inBuf + 1;
- } else {
- len = bufsize - tokenBegin + bufpos + 1 + inBuf;
- }
-
- int i = 0, j = 0, k;
- int nextColDiff, columnDiff = 0;
-
- while (i < len &&
- bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) {
- bufline[j] = newLine;
- nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
- bufcolumn[j] = newCol + columnDiff;
- columnDiff = nextColDiff;
- i++;
- }
-
- if (i < len) {
- bufline[j] = newLine++;
- bufcolumn[j] = newCol + columnDiff;
-
- while (i++ < len) {
- if (bufline[j = start % bufsize] != bufline[++start % bufsize])
- bufline[j] = newLine++;
- else
- bufline[j] = newLine;
- }
- }
-
- line = bufline[j];
- column = bufcolumn[j];
- }
-
-}
+package jaxx.compiler.java.parser;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (with java-like unicode escape processing).
+ */
+
+public class JavaCharStream {
+ public static final boolean staticFlag = false;
+
+ static int hexval(char c) throws java.io.IOException {
+ switch (c) {
+ case '0':
+ return 0;
+ case '1':
+ return 1;
+ case '2':
+ return 2;
+ case '3':
+ return 3;
+ case '4':
+ return 4;
+ case '5':
+ return 5;
+ case '6':
+ return 6;
+ case '7':
+ return 7;
+ case '8':
+ return 8;
+ case '9':
+ return 9;
+
+ case 'a':
+ case 'A':
+ return 10;
+ case 'b':
+ case 'B':
+ return 11;
+ case 'c':
+ case 'C':
+ return 12;
+ case 'd':
+ case 'D':
+ return 13;
+ case 'e':
+ case 'E':
+ return 14;
+ case 'f':
+ case 'F':
+ return 15;
+ }
+
+ throw new java.io.IOException(); // Should never come here
+ }
+
+ public int bufpos = -1;
+ int bufsize;
+ int available;
+ int tokenBegin;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] nextCharBuf;
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int nextCharInd = -1;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+
+ protected void setTabSize(int i) {
+ tabSize = i;
+ }
+
+ protected int getTabSize(int i) {
+ return tabSize;
+ }
+
+ protected void ExpandBuff(boolean wrapAround) {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try {
+ if (wrapAround) {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer,
+ bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ bufpos += (bufsize - tokenBegin);
+ } else {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ bufpos -= tokenBegin;
+ }
+ }
+ catch (Throwable t) {
+ throw new Error(t.getMessage());
+ }
+
+ available = (bufsize += 2048);
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException {
+ int i;
+ if (maxNextCharInd == 4096)
+ maxNextCharInd = nextCharInd = 0;
+
+ try {
+ if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
+ 4096 - maxNextCharInd)) == -1) {
+ inputStream.close();
+ throw new java.io.IOException();
+ } else {
+ maxNextCharInd += i;
+ }
+ }
+ catch (java.io.IOException e) {
+ if (bufpos != 0) {
+ --bufpos;
+ backup(0);
+ } else {
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+ throw e;
+ }
+ }
+
+ protected char ReadByte() throws java.io.IOException {
+ if (++nextCharInd >= maxNextCharInd)
+ FillBuff();
+
+ return nextCharBuf[nextCharInd];
+ }
+
+ public char BeginToken() throws java.io.IOException {
+ if (inBuf > 0) {
+ --inBuf;
+
+ if (++bufpos == bufsize) {
+ bufpos = 0;
+ }
+
+ tokenBegin = bufpos;
+ return buffer[bufpos];
+ }
+
+ tokenBegin = 0;
+ bufpos = -1;
+
+ return readChar();
+ }
+
+ protected void AdjustBuffSize() {
+ if (available == bufsize) {
+ if (tokenBegin > 2048) {
+ bufpos = 0;
+ available = tokenBegin;
+ } else
+ ExpandBuff(false);
+ } else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ protected void UpdateLineColumn(char c) {
+ column++;
+
+ if (prevCharIsLF) {
+ prevCharIsLF = false;
+ line += (column = 1);
+ } else if (prevCharIsCR) {
+ prevCharIsCR = false;
+ if (c == '\n') {
+ prevCharIsLF = true;
+ } else
+ line += (column = 1);
+ }
+
+ switch (c) {
+ case '\r':
+ prevCharIsCR = true;
+ break;
+ case '\n':
+ prevCharIsLF = true;
+ break;
+ case '\t':
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default:
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+ public char readChar() throws java.io.IOException {
+ if (inBuf > 0) {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ char c;
+
+ if (++bufpos == available)
+ AdjustBuffSize();
+
+ if ((buffer[bufpos] = c = ReadByte()) == '\\') {
+ UpdateLineColumn(c);
+
+ int backSlashCnt = 1;
+
+ for (; ;) // Read all the backslashes
+ {
+ if (++bufpos == available)
+ AdjustBuffSize();
+
+ try {
+ if ((buffer[bufpos] = c = ReadByte()) != '\\') {
+ UpdateLineColumn(c);
+ // found a non-backslash char.
+ if ((c == 'u') && ((backSlashCnt & 1) == 1)) {
+ if (--bufpos < 0)
+ bufpos = bufsize - 1;
+
+ break;
+ }
+
+ backup(backSlashCnt);
+ return '\\';
+ }
+ }
+ catch (java.io.IOException e) {
+ if (backSlashCnt > 1)
+ backup(backSlashCnt);
+
+ return '\\';
+ }
+
+ UpdateLineColumn(c);
+ backSlashCnt++;
+ }
+
+ // Here, we have seen an odd number of backslash's followed by a 'u'
+ try {
+ while ((c = ReadByte()) == 'u')
+ ++column;
+
+ buffer[bufpos] = c = (char) (hexval(c) << 12 |
+ hexval(ReadByte()) << 8 |
+ hexval(ReadByte()) << 4 |
+ hexval(ReadByte()));
+
+ column += 4;
+ }
+ catch (java.io.IOException e) {
+ throw new Error("Invalid escape character at line " + line +
+ " column " + column + ".");
+ }
+
+ if (backSlashCnt == 1)
+ return c;
+ else {
+ backup(backSlashCnt - 1);
+ return '\\';
+ }
+ } else {
+ UpdateLineColumn(c);
+ return (c);
+ }
+ }
+
+ /**
+ * @return column index
+ * @see #getEndColumn
+ * @deprecated
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /**
+ * @return line type ???
+ * @see #getEndLine
+ * @deprecated
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ public JavaCharStream(java.io.Reader dstream,
+ int startline, int startcolumn, int buffersize) {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ nextCharBuf = new char[4096];
+ }
+
+ public JavaCharStream(java.io.Reader dstream,
+ int startline, int startcolumn) {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public JavaCharStream(java.io.Reader dstream) {
+ this(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.Reader dstream,
+ int startline, int startcolumn, int buffersize) {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length) {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ nextCharBuf = new char[4096];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ nextCharInd = bufpos = -1;
+ }
+
+ public void ReInit(java.io.Reader dstream,
+ int startline, int startcolumn) {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.Reader dstream) {
+ ReInit(dstream, 1, 1, 4096);
+ }
+
+ public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public JavaCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize) {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
+ }
+
+ public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ public JavaCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn) {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ public JavaCharStream(java.io.InputStream dstream) {
+ this(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException {
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize) {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException {
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn) {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {
+ ReInit(dstream, encoding, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream) {
+ ReInit(dstream, 1, 1, 4096);
+ }
+
+ public String GetImage() {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ public char[] GetSuffix(int len) {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ public void Done() {
+ nextCharBuf = null;
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ *
+ * @param newLine line number ?
+ * @param newCol column number ?
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol) {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin) {
+ len = bufpos - tokenBegin + inBuf + 1;
+ } else {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k;
+ int nextColDiff, columnDiff = 0;
+
+ while (i < len &&
+ bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len) {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len) {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParser.java */
/*
* *##%
* JAXX Compiler
@@ -18,7 +19,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParser.java */
package jaxx.compiler.java.parser;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserConstants.java */
/*
* *##%
* JAXX Compiler
@@ -18,7 +19,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserConstants.java */
package jaxx.compiler.java.parser;
public interface JavaParserConstants {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserTokenManager.java */
/*
* *##%
* JAXX Compiler
@@ -18,7 +19,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserTokenManager.java */
package jaxx.compiler.java.parser;
public class JavaParserTokenManager implements JavaParserConstants {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. ./JavaParserTreeConstants.java */
/*
* *##%
* JAXX Compiler
@@ -18,7 +19,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. ./JavaParserTreeConstants.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. Node.java */
/*
* *##%
* JAXX Compiler
@@ -18,54 +19,53 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. Node.java */
-
-package jaxx.compiler.java.parser;
-
-/* All AST nodes must implement this interface. It provides basic
- machinery for constructing the parent and child relationships
- between nodes. */
-
-public interface Node {
-
- /**
- * This method is called after the node has been made the current
- * node. It indicates that child nodes can now be added to it.
- */
- public void jjtOpen();
-
- /**
- * This method is called after all the child nodes have been
- * added.
- */
- public void jjtClose();
-
- /**
- * This pair of methods are used to inform the node of its
- * parent.
- *
- * @param n node
- */
- public void jjtSetParent(Node n);
-
- public Node jjtGetParent();
-
- /**
- * This method tells the node to add its argument to the node's
- * list of children.
- *
- * @param n node
- * @param i index ?
- */
- public void jjtAddChild(Node n, int i);
-
- /**
- * @param i index of child
- * @return a child node. The children are numbered
- * from zero, left to right.
- */
- public Node jjtGetChild(int i);
-
- /** @return the number of children the node has. */
- public int jjtGetNumChildren();
-}
+
+package jaxx.compiler.java.parser;
+
+/* All AST nodes must implement this interface. It provides basic
+ machinery for constructing the parent and child relationships
+ between nodes. */
+
+public interface Node {
+
+ /**
+ * This method is called after the node has been made the current
+ * node. It indicates that child nodes can now be added to it.
+ */
+ public void jjtOpen();
+
+ /**
+ * This method is called after all the child nodes have been
+ * added.
+ */
+ public void jjtClose();
+
+ /**
+ * This pair of methods are used to inform the node of its
+ * parent.
+ *
+ * @param n node
+ */
+ public void jjtSetParent(Node n);
+
+ public Node jjtGetParent();
+
+ /**
+ * This method tells the node to add its argument to the node's
+ * list of children.
+ *
+ * @param n node
+ * @param i index ?
+ */
+ public void jjtAddChild(Node n, int i);
+
+ /**
+ * @param i index of child
+ * @return a child node. The children are numbered
+ * from zero, left to right.
+ */
+ public Node jjtGetChild(int i);
+
+ /** @return the number of children the node has. */
+ public int jjtGetNumChildren();
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
/*
* *##%
* JAXX Compiler
@@ -18,217 +19,216 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
-package jaxx.compiler.java.parser;
-
-/**
- * This exception is thrown when parse errors are encountered.
- * You can explicitly create objects of this exception type by
- * calling the method generateParseException in the generated
- * parser.
- * <p/>
- * You can modify this class to customize your error reporting
- * mechanisms so long as you retain the public fields.
- */
-public class ParseException extends jaxx.compiler.CompilerException {
- int line;
- int column;
- private static final long serialVersionUID = 6179854408401024700L;
-
- /**
- * This constructor is used by the method "generateParseException"
- * in the generated parser. Calling this constructor generates
- * a new object of this type with the fields "currentToken",
- * "expectedTokenSequences", and "tokenImage" set. The boolean
- * flag "specialConstructor" is also set to true to indicate that
- * this constructor was used to create this object.
- * This constructor calls its super class with the empty string
- * to force the "toString" method of parent class "Throwable" to
- * print the error message in the form:
- * ParseException: <result of getMessage>
- *
- * @param currentTokenVal ?
- * @param expectedTokenSequencesVal ?
- * @param tokenImageVal ?
- */
- public ParseException(Token currentTokenVal,
- int[][] expectedTokenSequencesVal,
- String[] tokenImageVal
- ) {
- super("");
- specialConstructor = true;
- currentToken = currentTokenVal;
- expectedTokenSequences = expectedTokenSequencesVal;
- tokenImage = tokenImageVal;
- }
-
- /**
- * The following constructors are for use by you for whatever
- * purpose you can think of. Constructing the exception in this
- * manner makes the exception behave in the normal way - i.e., as
- * documented in the class "Throwable". The fields "errorToken",
- * "expectedTokenSequences", and "tokenImage" do not contain
- * relevant information. The JavaCC generated code does not use
- * these constructors.
- */
-
- public ParseException() {
- super();
- specialConstructor = false;
- }
-
- public ParseException(String message) {
- super(message);
- specialConstructor = false;
- }
-
- public ParseException(String message, int line, int column) {
- super(message);
- specialConstructor = false;
- this.line = line;
- this.column = column;
- }
-
-
- /**
- * This variable determines which constructor was used to create
- * this object and thereby affects the semantics of the
- * "getMessage" method (see below).
- */
- protected boolean specialConstructor;
-
- /**
- * This is the last token that has been consumed successfully. If
- * this object has been created due to a parse error, the token
- * followng this token will (therefore) be the first error token.
- */
- public Token currentToken;
-
- /**
- * Each entry in this array is an array of integers. Each array
- * of integers represents a sequence of tokens (by their ordinal
- * values) that is expected at this point of the parse.
- */
- public int[][] expectedTokenSequences;
-
- /**
- * This is a reference to the "tokenImage" array of the generated
- * parser within which the parse error occurred. This array is
- * defined in the generated ...Constants interface.
- */
- public String[] tokenImage;
-
- /**
- * This method has the standard behavior when this object has been
- * created using the standard constructors. Otherwise, it uses
- * "currentToken" and "expectedTokenSequences" to generate a parse
- * error message and returns it. If this object has been created
- * due to a parse error, and you do not catch it (it gets thrown
- * from the parser), then this method is called during the printing
- * of the final stack trace, and hence the correct error message
- * gets displayed.
- */
- public String getMessage() {
- if (!specialConstructor) {
- return super.getMessage();
- }
- StringBuffer expected = new StringBuffer();
- int maxSize = 0;
- for (int[] expectedTokenSequence : expectedTokenSequences) {
- if (maxSize < expectedTokenSequence.length) {
- maxSize = expectedTokenSequence.length;
- }
- for (int anExpectedTokenSequence : expectedTokenSequence) {
- expected.append(tokenImage[anExpectedTokenSequence]).append(" ");
- }
- if (expectedTokenSequence[expectedTokenSequence.length - 1] != 0) {
- expected.append("...");
- }
- expected.append(eol).append(" ");
- }
- String retval = "Encountered \"";
- Token tok = currentToken.next;
- for (int i = 0; i < maxSize; i++) {
- if (i != 0) retval += " ";
- if (tok.kind == 0) {
- retval += tokenImage[0];
- break;
- }
- retval += add_escapes(tok.image);
- tok = tok.next;
- }
- retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
- retval += "." + eol;
- if (expectedTokenSequences.length == 1) {
- retval += "Was expecting:" + eol + " ";
- } else {
- retval += "Was expecting one of:" + eol + " ";
- }
- retval += expected.toString();
- return retval;
- }
-
-
- public int getLine() {
- return line;
- }
-
- public int getColumn() {
- return column;
- }
-
- /** The end of line string for this machine. */
- protected String eol = System.getProperty("line.separator", "\n");
-
- /**
- * Used to convert raw characters to their escaped version
- * when these raw version cannot be used as part of an ASCII
- * string literal.
- *
- * @param str text to treate
- * @return the escaped version of text
- */
- protected String add_escapes(String str) {
- StringBuffer retval = new StringBuffer();
- char ch;
- for (int i = 0; i < str.length(); i++) {
- switch (str.charAt(i)) {
- case 0:
- continue;
- case '\b':
- retval.append("\\b");
- continue;
- case '\t':
- retval.append("\\t");
- continue;
- case '\n':
- retval.append("\\n");
- continue;
- case '\f':
- retval.append("\\f");
- continue;
- case '\r':
- retval.append("\\r");
- continue;
- case '\"':
- retval.append("\\\"");
- continue;
- case '\'':
- retval.append("\\\'");
- continue;
- case '\\':
- retval.append("\\\\");
- continue;
- default:
- if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
- String s = "0000" + Integer.toString(ch, 16);
- retval.append("\\u").append(s.substring(s.length() - 4, s.length()));
- } else {
- retval.append(ch);
- }
- }
- }
- return retval.toString();
- }
-
-}
+package jaxx.compiler.java.parser;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ * <p/>
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends jaxx.compiler.CompilerException {
+ int line;
+ int column;
+ private static final long serialVersionUID = 6179854408401024700L;
+
+ /**
+ * This constructor is used by the method "generateParseException"
+ * in the generated parser. Calling this constructor generates
+ * a new object of this type with the fields "currentToken",
+ * "expectedTokenSequences", and "tokenImage" set. The boolean
+ * flag "specialConstructor" is also set to true to indicate that
+ * this constructor was used to create this object.
+ * This constructor calls its super class with the empty string
+ * to force the "toString" method of parent class "Throwable" to
+ * print the error message in the form:
+ * ParseException: <result of getMessage>
+ *
+ * @param currentTokenVal ?
+ * @param expectedTokenSequencesVal ?
+ * @param tokenImageVal ?
+ */
+ public ParseException(Token currentTokenVal,
+ int[][] expectedTokenSequencesVal,
+ String[] tokenImageVal
+ ) {
+ super("");
+ specialConstructor = true;
+ currentToken = currentTokenVal;
+ expectedTokenSequences = expectedTokenSequencesVal;
+ tokenImage = tokenImageVal;
+ }
+
+ /**
+ * The following constructors are for use by you for whatever
+ * purpose you can think of. Constructing the exception in this
+ * manner makes the exception behave in the normal way - i.e., as
+ * documented in the class "Throwable". The fields "errorToken",
+ * "expectedTokenSequences", and "tokenImage" do not contain
+ * relevant information. The JavaCC generated code does not use
+ * these constructors.
+ */
+
+ public ParseException() {
+ super();
+ specialConstructor = false;
+ }
+
+ public ParseException(String message) {
+ super(message);
+ specialConstructor = false;
+ }
+
+ public ParseException(String message, int line, int column) {
+ super(message);
+ specialConstructor = false;
+ this.line = line;
+ this.column = column;
+ }
+
+
+ /**
+ * This variable determines which constructor was used to create
+ * this object and thereby affects the semantics of the
+ * "getMessage" method (see below).
+ */
+ protected boolean specialConstructor;
+
+ /**
+ * This is the last token that has been consumed successfully. If
+ * this object has been created due to a parse error, the token
+ * followng this token will (therefore) be the first error token.
+ */
+ public Token currentToken;
+
+ /**
+ * Each entry in this array is an array of integers. Each array
+ * of integers represents a sequence of tokens (by their ordinal
+ * values) that is expected at this point of the parse.
+ */
+ public int[][] expectedTokenSequences;
+
+ /**
+ * This is a reference to the "tokenImage" array of the generated
+ * parser within which the parse error occurred. This array is
+ * defined in the generated ...Constants interface.
+ */
+ public String[] tokenImage;
+
+ /**
+ * This method has the standard behavior when this object has been
+ * created using the standard constructors. Otherwise, it uses
+ * "currentToken" and "expectedTokenSequences" to generate a parse
+ * error message and returns it. If this object has been created
+ * due to a parse error, and you do not catch it (it gets thrown
+ * from the parser), then this method is called during the printing
+ * of the final stack trace, and hence the correct error message
+ * gets displayed.
+ */
+ public String getMessage() {
+ if (!specialConstructor) {
+ return super.getMessage();
+ }
+ StringBuffer expected = new StringBuffer();
+ int maxSize = 0;
+ for (int[] expectedTokenSequence : expectedTokenSequences) {
+ if (maxSize < expectedTokenSequence.length) {
+ maxSize = expectedTokenSequence.length;
+ }
+ for (int anExpectedTokenSequence : expectedTokenSequence) {
+ expected.append(tokenImage[anExpectedTokenSequence]).append(" ");
+ }
+ if (expectedTokenSequence[expectedTokenSequence.length - 1] != 0) {
+ expected.append("...");
+ }
+ expected.append(eol).append(" ");
+ }
+ String retval = "Encountered \"";
+ Token tok = currentToken.next;
+ for (int i = 0; i < maxSize; i++) {
+ if (i != 0) retval += " ";
+ if (tok.kind == 0) {
+ retval += tokenImage[0];
+ break;
+ }
+ retval += add_escapes(tok.image);
+ tok = tok.next;
+ }
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ retval += "." + eol;
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + eol + " ";
+ } else {
+ retval += "Was expecting one of:" + eol + " ";
+ }
+ retval += expected.toString();
+ return retval;
+ }
+
+
+ public int getLine() {
+ return line;
+ }
+
+ public int getColumn() {
+ return column;
+ }
+
+ /** The end of line string for this machine. */
+ protected String eol = System.getProperty("line.separator", "\n");
+
+ /**
+ * Used to convert raw characters to their escaped version
+ * when these raw version cannot be used as part of an ASCII
+ * string literal.
+ *
+ * @param str text to treate
+ * @return the escaped version of text
+ */
+ protected String add_escapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i)) {
+ case 0:
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u").append(s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ }
+ }
+ return retval.toString();
+ }
+
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
/*
* *##%
* JAXX Compiler
@@ -18,138 +19,137 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
-
-package jaxx.compiler.java.parser;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-
-public class SimpleNode implements Node {
- protected Node parent;
- protected Node[] children;
- protected int id;
- protected JavaParser parser;
- public Token firstToken;
- public Token lastToken;
- private ClassDescriptor javaType;
-
-
- public SimpleNode(int i) {
- id = i;
- }
-
- public SimpleNode(JavaParser p, int i) {
- this(i);
- parser = p;
- }
-
-
- public int getId() {
- return id;
- }
-
- public void jjtOpen() {
- }
-
- public void jjtClose() {
- }
-
- public void jjtSetParent(Node n) {
- parent = n;
- }
-
- public Node jjtGetParent() {
- return parent;
- }
-
- public SimpleNode getParent() {
- return (SimpleNode) parent;
- }
-
-
- public ClassDescriptor getJavaType() {
- return javaType;
- }
-
-
- public void setJavaType(ClassDescriptor javaType) {
- this.javaType = javaType;
- }
-
- public void jjtAddChild(Node n, int i) {
- if (children == null) {
- children = new Node[i + 1];
- } else if (i >= children.length) {
- Node c[] = new Node[i + 1];
- System.arraycopy(children, 0, c, 0, children.length);
- children = c;
- }
- children[i] = n;
- }
-
- public Node jjtGetChild(int i) {
- return children[i];
- }
-
- public SimpleNode getChild(int i) {
- return (SimpleNode) children[i];
- }
-
- public int jjtGetNumChildren() {
- return (children == null) ? 0 : children.length;
- }
-
- /* You can override these two methods in subclasses of SimpleNode to
-customize the way the node appears when the tree is dumped. If
-your output uses more than one line you should override
-toString(String), otherwise overriding toString() is probably all
-you need to do. */
-
- @Override
- public String toString() {
- return getClass().getName() + "[" + getText() + "]";
- }
-
- public String toString(String prefix) {
- return prefix + toString();
- }
-
- /* Override this method if you want to customize how the node dumps
- out its children. */
-
- public void dump(String prefix) {
- System.out.println(toString(prefix));
- if (children != null) {
- for (Node aChildren : children) {
- SimpleNode n = (SimpleNode) aChildren;
- if (n != null) {
- n.dump(prefix + " ");
- }
- }
- }
- }
-
- private void appendSpecialTokens(StringBuffer s, Token st) {
- if (st != null) {
- appendSpecialTokens(s, st.specialToken);
- s.append(st.image);
- }
- }
-
-
- /** @return the text of the tokens comprising this node. */
- public String getText() {
- StringBuffer text = new StringBuffer();
- Token t = firstToken;
- while (t != null) {
- appendSpecialTokens(text, t.specialToken);
- text.append(t.image);
- if (t == lastToken)
- break;
- t = t.next;
- }
-
- return text.toString();
- }
-}
-
+
+package jaxx.compiler.java.parser;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+
+public class SimpleNode implements Node {
+ protected Node parent;
+ protected Node[] children;
+ protected int id;
+ protected JavaParser parser;
+ public Token firstToken;
+ public Token lastToken;
+ private ClassDescriptor javaType;
+
+
+ public SimpleNode(int i) {
+ id = i;
+ }
+
+ public SimpleNode(JavaParser p, int i) {
+ this(i);
+ parser = p;
+ }
+
+
+ public int getId() {
+ return id;
+ }
+
+ public void jjtOpen() {
+ }
+
+ public void jjtClose() {
+ }
+
+ public void jjtSetParent(Node n) {
+ parent = n;
+ }
+
+ public Node jjtGetParent() {
+ return parent;
+ }
+
+ public SimpleNode getParent() {
+ return (SimpleNode) parent;
+ }
+
+
+ public ClassDescriptor getJavaType() {
+ return javaType;
+ }
+
+
+ public void setJavaType(ClassDescriptor javaType) {
+ this.javaType = javaType;
+ }
+
+ public void jjtAddChild(Node n, int i) {
+ if (children == null) {
+ children = new Node[i + 1];
+ } else if (i >= children.length) {
+ Node c[] = new Node[i + 1];
+ System.arraycopy(children, 0, c, 0, children.length);
+ children = c;
+ }
+ children[i] = n;
+ }
+
+ public Node jjtGetChild(int i) {
+ return children[i];
+ }
+
+ public SimpleNode getChild(int i) {
+ return (SimpleNode) children[i];
+ }
+
+ public int jjtGetNumChildren() {
+ return (children == null) ? 0 : children.length;
+ }
+
+ /* You can override these two methods in subclasses of SimpleNode to
+customize the way the node appears when the tree is dumped. If
+your output uses more than one line you should override
+toString(String), otherwise overriding toString() is probably all
+you need to do. */
+
+ @Override
+ public String toString() {
+ return getClass().getName() + "[" + getText() + "]";
+ }
+
+ public String toString(String prefix) {
+ return prefix + toString();
+ }
+
+ /* Override this method if you want to customize how the node dumps
+ out its children. */
+
+ public void dump(String prefix) {
+ System.out.println(toString(prefix));
+ if (children != null) {
+ for (Node aChildren : children) {
+ SimpleNode n = (SimpleNode) aChildren;
+ if (n != null) {
+ n.dump(prefix + " ");
+ }
+ }
+ }
+ }
+
+ private void appendSpecialTokens(StringBuffer s, Token st) {
+ if (st != null) {
+ appendSpecialTokens(s, st.specialToken);
+ s.append(st.image);
+ }
+ }
+
+
+ /** @return the text of the tokens comprising this node. */
+ public String getText() {
+ StringBuffer text = new StringBuffer();
+ Token t = firstToken;
+ while (t != null) {
+ appendSpecialTokens(text, t.specialToken);
+ text.append(t.image);
+ if (t == lastToken)
+ break;
+ t = t.next;
+ }
+
+ return text.toString();
+ }
+}
+
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
/*
* *##%
* JAXX Compiler
@@ -18,7 +19,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
package jaxx.compiler.java.parser;
/** Describes the input token stream. */
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java 2009-10-26 19:13:36 UTC (rev 1602)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java 2009-10-27 00:40:30 UTC (rev 1603)
@@ -1,3 +1,4 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
/*
* *##%
* JAXX Compiler
@@ -18,129 +19,128 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
-package jaxx.compiler.java.parser;
-
-public class TokenMgrError extends Error {
- /*
- * Ordinals for various reasons why an Error of this type can be thrown.
- */
-
- /** Lexical error occured. */
- static final int LEXICAL_ERROR = 0;
-
- /** An attempt wass made to create a second instance of a static token manager. */
- static final int STATIC_LEXER_ERROR = 1;
-
- /** Tried to change to an invalid lexical state. */
- static final int INVALID_LEXICAL_STATE = 2;
-
- /** Detected (and bailed out of) an infinite loop in the token manager. */
- static final int LOOP_DETECTED = 3;
-
- /**
- * Indicates the reason why the exception is thrown. It will have
- * one of the above 4 values.
- */
- int errorCode;
- private static final long serialVersionUID = -9131500865453532454L;
-
- /**
- * Replaces unprintable characters by their espaced (or unicode escaped)
- * equivalents in the given string
- *
- * @param str text to treate
- * @return the treated text
- */
- protected static String addEscapes(String str) {
- StringBuffer retval = new StringBuffer();
- char ch;
- for (int i = 0; i < str.length(); i++) {
- switch (str.charAt(i)) {
- case 0:
- continue;
- case '\b':
- retval.append("\\b");
- continue;
- case '\t':
- retval.append("\\t");
- continue;
- case '\n':
- retval.append("\\n");
- continue;
- case '\f':
- retval.append("\\f");
- continue;
- case '\r':
- retval.append("\\r");
- continue;
- case '\"':
- retval.append("\\\"");
- continue;
- case '\'':
- retval.append("\\\'");
- continue;
- case '\\':
- retval.append("\\\\");
- continue;
- default:
- if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
- String s = "0000" + Integer.toString(ch, 16);
- retval.append("\\u").append(s.substring(s.length() - 4, s.length()));
- } else {
- retval.append(ch);
- }
- }
- }
- return retval.toString();
- }
-
- /**
- * @param EOFSeen : indicates if EOF caused the lexicl error
- * @param lexState : lexical state in which this error occured
- * @param errorLine : line number when the error occured
- * @param errorColumn : column number when the error occured
- * @param errorAfter : prefix that was seen before this error occured
- * @param curChar : the offending character
- * Note: You can customize the lexical error message by modifying this method.
- * @return a detailed message for the Error when it is thrown by the
- * token manager to indicate a lexical error.
- */
- protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
- return ("Lexical error at line " +
- errorLine + ", column " +
- errorColumn + ". Encountered: " +
- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") +
- "after : \"" + addEscapes(errorAfter) + "\"");
- }
-
- /**
- * You can also modify the body of this method to customize your error messages.
- * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
- * of end-users concern, so you can return something like :
- * <p/>
- * "Internal Error : Please file a bug report .... "
- * <p/>
- * from this method for such cases in the release version of your parser.
- */
- @Override
- public String getMessage() {
- return super.getMessage();
- }
-
- /*
- * Constructors of various flavors follow.
- */
-
- public TokenMgrError() {
- }
-
- public TokenMgrError(String message, int reason) {
- super(message);
- errorCode = reason;
- }
-
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
- this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
- }
-}
+package jaxx.compiler.java.parser;
+
+public class TokenMgrError extends Error {
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /** Lexical error occured. */
+ static final int LEXICAL_ERROR = 0;
+
+ /** An attempt wass made to create a second instance of a static token manager. */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /** Tried to change to an invalid lexical state. */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /** Detected (and bailed out of) an infinite loop in the token manager. */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+ private static final long serialVersionUID = -9131500865453532454L;
+
+ /**
+ * Replaces unprintable characters by their espaced (or unicode escaped)
+ * equivalents in the given string
+ *
+ * @param str text to treate
+ * @return the treated text
+ */
+ protected static String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i)) {
+ case 0:
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u").append(s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * @param EOFSeen : indicates if EOF caused the lexicl error
+ * @param lexState : lexical state in which this error occured
+ * @param errorLine : line number when the error occured
+ * @param errorColumn : column number when the error occured
+ * @param errorAfter : prefix that was seen before this error occured
+ * @param curChar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ * @return a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return ("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ * <p/>
+ * "Internal Error : Please file a bug report .... "
+ * <p/>
+ * from this method for such cases in the release version of your parser.
+ */
+ @Override
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ public TokenMgrError() {
+ }
+
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
+}
1
0
Author: tchemit
Date: 2009-10-26 20:13:36 +0100 (Mon, 26 Oct 2009)
New Revision: 1602
Modified:
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java
branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java
branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java
branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java
branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java
branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java
branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java
branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java
branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java
branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java
branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java
branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java
branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java
Log:
update java files license header
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,96 +1,112 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * A Map implementation which uses Classes as keys. <code>ClassMap</code> differs from typical maps
- * in that it takes subclasses into account; mapping a class to a value also maps all subclasses of
- * that class to the value.
- * <p/>
- * A <code>get</code> operation will return the value associated with the class itself, or failing
- * that, with its nearest ancestor for which there exists a mapping.
- * @param <T> type of the class
- */
-public class ClassMap<T> extends HashMap<ClassDescriptor, T> {
-
- private static final long serialVersionUID = 5149779660675529037L;
- /**
- * Logger
- */
- protected static final Log log = LogFactory.getLog(ClassMap.class);
- /**
- * Keeps track of automatically-added Classes so we can distinguish them from user-added
- * Classes. Unknown Classes are automatically added to the map during <code>get</code>
- * calls to speed up subsequent requests, but they must be updated when the mappings
- * for their superclasses are modified.
- */
- private List<ClassDescriptor> autoKeys = new ArrayList<ClassDescriptor>();
-
- /**
- * Returns the value associated with the key <code>Class</code>. If the class itself does not have
- * a mapping, its superclass will be checked, and so on until an ancestor class with a mapping is
- * located. If none of the class' ancestors have a mapping, <code>null</code> is returned.
- *
- * @param key the class to check
- * @return the mapping for the class
- */
- @Override
- public T get(Object key) {
- T result = null;
- ClassDescriptor c = (ClassDescriptor) key;
- while (c != null) {
- result = super.get(c);
- if (result != null) {
- break;
- }
- c = c.getSuperclass();
- }
-
- if (result == null && ((ClassDescriptor) key).isInterface()) {
- result = get(ClassDescriptorLoader.getClassDescriptor(Object.class));
- }
-
- if (c != key && result != null) { // no mapping for the class itself, but found one for a superclass
- put((ClassDescriptor) key, result);
- autoKeys.add((ClassDescriptor) key);
- }
- return result;
- }
-
- /**
- * Associates a value with a class and all of its descendents.
- *
- * @param key the class to map
- * @param value the value to map to the class
- * @return the old value associated with the class
- */
- @Override
- public T put(ClassDescriptor key, T value) {
- //if (!(key instanceof ClassDescriptor)) {
- // throw new IllegalArgumentException("expected ClassDescriptor, got " + key);
- //}
- if (autoKeys.size() > 0) { // remove all automatic keys which descend from the class being modified
- Iterator<ClassDescriptor> i = autoKeys.iterator();
- while (i.hasNext()) {
- ClassDescriptor auto = i.next();
- if (key.isAssignableFrom(auto)) {
- i.remove();
- remove(auto);
- }
- }
- }
- return super.put(key, value);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * A Map implementation which uses Classes as keys. <code>ClassMap</code> differs from typical maps
+ * in that it takes subclasses into account; mapping a class to a value also maps all subclasses of
+ * that class to the value.
+ * <p/>
+ * A <code>get</code> operation will return the value associated with the class itself, or failing
+ * that, with its nearest ancestor for which there exists a mapping.
+ * @param <T> type of the class
+ */
+public class ClassMap<T> extends HashMap<ClassDescriptor, T> {
+
+ private static final long serialVersionUID = 5149779660675529037L;
+ /**
+ * Logger
+ */
+ protected static final Log log = LogFactory.getLog(ClassMap.class);
+ /**
+ * Keeps track of automatically-added Classes so we can distinguish them from user-added
+ * Classes. Unknown Classes are automatically added to the map during <code>get</code>
+ * calls to speed up subsequent requests, but they must be updated when the mappings
+ * for their superclasses are modified.
+ */
+ private List<ClassDescriptor> autoKeys = new ArrayList<ClassDescriptor>();
+
+ /**
+ * Returns the value associated with the key <code>Class</code>. If the class itself does not have
+ * a mapping, its superclass will be checked, and so on until an ancestor class with a mapping is
+ * located. If none of the class' ancestors have a mapping, <code>null</code> is returned.
+ *
+ * @param key the class to check
+ * @return the mapping for the class
+ */
+ @Override
+ public T get(Object key) {
+ T result = null;
+ ClassDescriptor c = (ClassDescriptor) key;
+ while (c != null) {
+ result = super.get(c);
+ if (result != null) {
+ break;
+ }
+ c = c.getSuperclass();
+ }
+
+ if (result == null && ((ClassDescriptor) key).isInterface()) {
+ result = get(ClassDescriptorLoader.getClassDescriptor(Object.class));
+ }
+
+ if (c != key && result != null) { // no mapping for the class itself, but found one for a superclass
+ put((ClassDescriptor) key, result);
+ autoKeys.add((ClassDescriptor) key);
+ }
+ return result;
+ }
+
+ /**
+ * Associates a value with a class and all of its descendents.
+ *
+ * @param key the class to map
+ * @param value the value to map to the class
+ * @return the old value associated with the class
+ */
+ @Override
+ public T put(ClassDescriptor key, T value) {
+ //if (!(key instanceof ClassDescriptor)) {
+ // throw new IllegalArgumentException("expected ClassDescriptor, got " + key);
+ //}
+ if (autoKeys.size() > 0) { // remove all automatic keys which descend from the class being modified
+ Iterator<ClassDescriptor> i = autoKeys.iterator();
+ while (i.hasNext()) {
+ ClassDescriptor auto = i.next();
+ if (key.isAssignableFrom(auto)) {
+ i.remove();
+ remove(auto);
+ }
+ }
+ }
+ return super.put(key, value);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,690 +1,706 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.reflect.MethodDescriptor;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.compiler.tags.TagManager;
-
-import java.awt.Container;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.lang.StringUtils;
-
-/**
- * Represents an object in the <code>.java</code> file being generated during compilation. There is
- * a <code>CompiledObject</code> for each class tag encountered, and certain tags may generate
- * additional objects for various reasons.
- */
-public class CompiledObject {
-
- /**
- * The object's id.
- */
- private String id;
- /**
- * Java code referring to the object.
- */
- private String javaCode;
- /**
- * The object's class.
- */
- private ClassDescriptor objectClass;
- /**
- * The style class.
- */
- private String styleClass;
- /**
- * The container containing this CompiledObject.
- */
- private CompiledObject parent;
- /**
- * true if this object overrides an object of the same id in a superclass
- * of the object being compiled
- */
- private boolean override;
- /**
- * Comma-separated Java code snippets representing the parameters that
- * should be passed to the object's constructor.
- */
- private String constructorParams;
- /**
- * Java code snippet which performs basic initialization of the object (after it has already been constructed).
- * Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other
- * CompiledObjects from initializationCode -- you must refer to them from additionCode instead.
- */
- private StringBuffer initializationCode = new StringBuffer();
- /**
- * Java code snippet which completes setup by adding any child objects, or otherwise manipulates any refererenced
- * objects. Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other
- * CompiledObjects from initializationCode -- you must refer to them from additionCode instead.
- */
- private StringBuffer additionCode = new StringBuffer();
- /**
- * List of all registered event handlers.
- */
- private List<EventHandler> eventHandlers = new ArrayList<EventHandler>();
- /**
- * All properties that have been applied to this CompiledObject.
- */
- private Map<String, String> properties = new HashMap<String, String>();
- /**
- * generic types of the compiled object
- */
- private String[] genericTypes;
- /**
- * a flag to indicate if javaBean full support must be support for this
- * object by root object
- */
- private boolean javaBean;
- /**
- * code to initialize the bean (can be null)
- */
- private String javaBeanInitCode;
- /**
- * the type of the override object (can be null if no overide)
- */
- private ClassDescriptor overrideType;
- /**
- * the decorator
- */
- private CompiledObjectDecorator decorator;
- /**
- * client properties
- */
- private Map<String, String> clientProperties;
-
- public class ChildRef {
-
- CompiledObject child;
- String constraints;
- String childJavaCode;
- String delegateCode;
-
- public ChildRef(CompiledObject child, String constraints, String childJavaCode, String delegateCode) {
- this.child = child;
- this.constraints = constraints;
- this.childJavaCode = childJavaCode;
- this.delegateCode = delegateCode;
- }
-
- public CompiledObject getChild() {
- return child;
- }
-
- public void setChild(CompiledObject child) {
- this.child = child;
- }
-
- public String getConstraints() {
- return constraints;
- }
-
- public void setConstraints(String constraints) {
- this.constraints = constraints;
- }
-
- public String getChildJavaCode() {
- return childJavaCode;
- }
-
- public void setChildJavaCode(String childJavaCode) {
- this.childJavaCode = childJavaCode;
- }
-
- public String getDelegateCode() {
- return delegateCode;
- }
-
- public void setDelegateCode(String delegateCode) {
- this.delegateCode = delegateCode;
- }
-
- public void addToAdditionCode(StringBuffer buffer, boolean isRootObject) {
- //TC-20091026 do not prefix if on root object
- String prefix;
- if (isRootObject) {
- prefix = "";
- } else {
- prefix = javaCode + delegateCode + ".";
- }
- if (constraints != null) {
-// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(", ").append(constraints).append(");");
- buffer.append(prefix).append("add(").append(childJavaCode).append(", ").append(constraints).append(");");
- } else {
-// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(");");
- buffer.append(prefix).append("add(").append(childJavaCode).append(");");
- }
- buffer.append(JAXXCompiler.getLineSeparator());
- }
- }
- private List<ChildRef> childs;
-
- /**
- * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a
- * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}.
- *
- * @param id the object's id
- * @param objectClass the object's class
- * @param compiler the current <code>JAXXCompiler</code>
- * @throws NullPointerException if id or class is null
- */
- public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler) {
- this(id, objectClass, compiler, false);
- }
-
- /**
- * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a
- * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}.
- *
- * @param id the object's id
- * @param objectClass the object's class
- * @param compiler the current <code>JAXXCompiler</code>
- * @param force <code>true</code> to force acceptance of invalid ids
- * @throws NullPointerException if id or class is null
- */
- public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) {
- this(id, id, objectClass, compiler, force);
- }
-
- /**
- * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a
- * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}.
- *
- * @param id the object's id
- * @param javaCode Java code referring to the object
- * @param objectClass the object's class
- * @param force <code>true</code> to force acceptance of invalid ids
- * @param compiler the current <code>JAXXCompiler</code>
- * @throws CompilerException if the id is not a valid Java identifier
- * @throws NullPointerException if id or class is null
- */
- public CompiledObject(String id, String javaCode, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) throws CompilerException {
- if (!force) {
- if (!isValidID(id)) {
- compiler.reportError("the id '" + id + "' is not a valid Java identifier");
- }
- }
- this.id = id;
- this.javaCode = javaCode;
-
- if (objectClass == null) {
- throw new NullPointerException();
- }
- this.objectClass = objectClass;
- this.childs = new ArrayList<ChildRef>();
- }
-
- public static boolean isValidID(String id) {
- boolean valid = true;
- if (id.length() == 0) {
- valid = false;
- }
- if (valid) {
- if (!Character.isJavaIdentifierStart(id.charAt(0))) {
- valid = false;
- }
- if (valid) {
- for (int i = 1; i < id.length(); i++) {
- if (!Character.isJavaIdentifierPart(id.charAt(i))) {
- valid = false;
- break;
- }
- }
- }
- }
- return valid;
- }
-
- /**
- * True if this object overrides an object in the superclass of the class
- * being compiled. For this to be true, the class currently being compiled
- * must be a subclass of another <code>JAXXObject</code> which has an
- * identically-named object.
- *
- * @return <code>true</code> if this object is an override
- * @see #setOverride
- */
- public boolean isOverride() {
- return override;
- }
-
- /**
- * Sets whether this class overrides an identically-named object in the
- * parent class.
- *
- * @param override <code>true</code> if this object is an override
- * @see #isOverride
- */
- public void setOverride(boolean override) {
- this.override = override;
- }
-
- /**
- * Returns this object's CSS style class.
- *
- * @return the value of the <code>styleClass</code> attribute
- */
- public String getStyleClass() {
- return styleClass;
- }
-
- /**
- * Sets this object's CSS style class.
- *
- * @param styleClass the new style class
- */
- public void setStyleClass(String styleClass) {
- this.styleClass = styleClass;
- }
-
- /**
- * Returns this object's parent container. Non-visual components (and
- * the root container) return <code>null</code>.
- *
- * @return the object's parent container
- */
- public CompiledObject getParent() {
- return parent;
- }
-
- /**
- * Sets this object's parent container.
- *
- * @param parent the parent container
- * @throws IllegalArgumentException if parent is not a {@link Container}
- */
- public void setParent(CompiledObject parent) throws IllegalArgumentException {
- if (!ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(parent.getObjectClass())) {
- throw new IllegalArgumentException("parent must descend from java.awt.Container");
- }
- this.parent = parent;
- }
-
- /**
- * Returns the name of the method that should be generated in the compiled
- * <code>.java</code> file
- * in order to create this object. This is just a suggestion and may be
- * ignored.
- *
- * @return the suggested name of the method which initializes this object
- */
- public String getCreationMethodName() {
- return "create" + StringUtils.capitalize(getId());
- }
-
- /**
- * Returns the name of the method that should be generated in the compiled
- * <code>.java</code> file in order to add children to this object. This
- * is just a suggestion and may be ignored.
- *
- * @return the suggested name of the method which completes this object's setup
- */
- public String getAdditionMethodName() {
- return "addChildrenTo" + StringUtils.capitalize(getId());
- }
-
- /**
- * Returns the type of this object.
- *
- * @return the class this <code>CompiledObject</code> represents
- */
- public ClassDescriptor getObjectClass() {
- return objectClass;
- }
-
- /**
- * Returns this object's id. Generally, a field with this name will be
- * created in the compiled <code>.java</code>
- * file in order to represent this object.
- *
- * @return the id used to refer to this object
- */
- public String getId() {
- return id;
- }
-
- /**
- * Returns Java code used to refer to this object in the compiled Java file.
- * This is usually the same as its id.
- *
- * @return the Java code for this object
- */
- public String getJavaCode() {
- String result = javaCode;
- if (isOverride()) {
- // handle cases where object is overridden to be a different class
- result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")";
- }
- return result;
- }
-
- public String getJavaCodeForProperty(String property) {
- if (!override) {
- return javaCode;
- }
- String result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")";
-
- String methodName = StringUtils.capitalize(property);
- try {
- MethodDescriptor methodDescriptor = overrideType.getMethodDescriptor("get" + methodName);
- if (methodDescriptor != null) {
- if (overrideType.getMethodDescriptor("set" + methodName, methodDescriptor.getReturnType()) != null) {
- // handle cases where object is overridden to be a different class
- result = javaCode;
- }
- }
- } catch (NoSuchMethodException e) {
- // lazy error, do nothing
- }
- return result;
- }
-
- /**
- * Returns a list of comma-separated Java code snippets that represent the
- * parameters to pass to this object's constructor.
- *
- * @return the raw constructor params
- * @see #setConstructorParams
- */
- public String getConstructorParams() {
- return constructorParams;
- }
-
- /**
- * Sets the parameters to pass to this object's constructor.
- *
- * @param constructorParams comma-separated Java code snippets representing
- * constructor params
- * @see #getConstructorParams
- */
- public void setConstructorParams(String constructorParams) {
- this.constructorParams = constructorParams;
- }
-
- /**
- * Returns the code that performs basic initialization of this object,
- * after it has already been constructed.
- * This basic code should not reference any other
- * <code>CompiledObjects</code> as they may not have been created yet.
- *
- * @param compiler compiler to use
- * @return the code which initializes this object
- */
- public String getInitializationCode(JAXXCompiler compiler) {
- StringBuffer result = new StringBuffer(initializationCode.toString());
- for (Object eventHandler : eventHandlers) {
- EventHandler handler = (EventHandler) eventHandler;
- result.append(getInitializationCode(handler, compiler));
- }
- return result.toString();
- }
-
- protected String getInitializationCode(EventHandler handler, JAXXCompiler compiler) {
- MethodDescriptor addMethod = handler.getAddMethod();
- ClassDescriptor listenerClass = addMethod.getParameterTypes()[0];
- //TC-20091026 use 'this' instead of root object javaCode
- return getJavaCode() + '.' + addMethod.getName() + "((" + JAXXCompiler.getCanonicalName(listenerClass) +
- ") jaxx.runtime.Util.getEventListener(" + JAXXCompiler.getCanonicalName(listenerClass) + ".class, " +
- compiler.getJavaCode(handler.getListenerMethod().getName()) + ", this, " +
- // compiler.getJavaCode(handler.getListenerMethod().getName()) + ", " + compiler.getRootObject().getJavaCode() + ", " +
- compiler.getJavaCode(compiler.getEventHandlerMethodName(handler)) + "));" + JAXXCompiler.getLineSeparator();
- }
-
- /**
- * Returns Java code to complete final setup on this object. This code may
- * reference other <code>CompiledObjects</code>, as they are guaranteed to
- * have all been created by this point.
- *
- * @return code which adds children and performs final setup
- */
- public String getAdditionCode() {
- return additionCode.toString();
- }
-
- /**
- * Appends code to the initialization code block. A line separator is
- * automatically appended to the end.
- *
- * @param code the code to add to the initialization block
- * @see #getInitializationCode
- */
- public void appendInitializationCode(String code) {
- if (!code.isEmpty()) {
- this.initializationCode.append(code);
- this.initializationCode.append(JAXXCompiler.getLineSeparator());
- }
- }
-
- /**
- * Appends code to the addition code block. A line separator is
- * automatically appended to the end.
- *
- * @param code the code to add to the addition block
- * @see #getAdditionCode
- */
- public void appendAdditionCode(String code) {
- if (!code.isEmpty()) {
- this.additionCode.append(code);
- this.additionCode.append(JAXXCompiler.getLineSeparator());
- }
- }
-
- /**
- * Stores a property for this object. The only effect of calling this
- * method is that the property will be returned by {@code getProperties()}.
- *
- * @param property the name of the property
- * @param value the property's value
- * @see #getProperties
- */
- public void addProperty(String property, String value) {
- properties.put(property, value);
- }
-
- public boolean hasClientProperties() {
- return clientProperties != null && !clientProperties.isEmpty();
- }
-
- public void addClientProperty(String property, String value) {
- getClientProperties().put(property, value);
- }
-
- public String getClientProperty(String key) {
- if (!hasClientProperties()) {
- return null;
- }
- return clientProperties.get(key);
- }
-
- public Map<String, String> getClientProperties() {
- if (clientProperties == null) {
- clientProperties = new HashMap<String, String>();
- }
- return clientProperties;
- }
-
- /**
- * Returns all properties which have been set for this object.
- *
- * @return a <code>Map</code> containing all properties defined for this object
- * @see #addProperty
- */
- public Map<?, ?>/*<String, String>*/ getProperties() {
- return properties;
- }
-
- // TODO: remove this temporary method and complete switchover to MethodDescriptors
- public void addEventHandler(String eventId, Method addMethod, Method listenerMethod, String code, JAXXCompiler compiler) {
- try {
- ClassDescriptor descriptor = ClassDescriptorLoader.getClassDescriptor(getObjectClass().getName());
- String listenerClassName = addMethod.getParameterTypes()[0].getName();
- ClassDescriptor listenerDescriptor = ClassDescriptorLoader.getClassDescriptor(listenerClassName);
- MethodDescriptor addMethodDescriptor = descriptor.getMethodDescriptor(addMethod.getName(), listenerDescriptor);
- MethodDescriptor listenerMethodDescriptor = listenerDescriptor.getMethodDescriptor(listenerMethod.getName(), ClassDescriptorLoader.getClassDescriptor(listenerMethod.getParameterTypes()[0].getName()));
- addEventHandler(eventId, addMethodDescriptor, listenerMethodDescriptor, code, compiler);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Adds an event listener to this object. The generated code will appear
- * in the initialization block.
- *
- * @param eventId unique (per CompiledObject) identifier for the event handler
- * @param addMethod the method which adds the event listener
- * @param listenerMethod the method (in the listener class) which is called when the event is fired
- * @param code the Java code for the listenerMethod's body
- * @param compiler the current <code>JAXXCompiler</code>
- * @see #getInitializationCode
- */
- public void addEventHandler(String eventId, MethodDescriptor addMethod, MethodDescriptor listenerMethod, String code, JAXXCompiler compiler) {
- EventHandler handler = new EventHandler(getId() + "." + eventId, getJavaCode(), addMethod, addMethod.getParameterTypes()[0], listenerMethod, code);
- compiler.registerEventHandler(handler);
- eventHandlers.add(handler);
-
- if (getJavaCode().indexOf(".") != -1) {
- // object lives in another JAXX file and consequently its initialization code won't be output
- compiler.appendInitializerCode(getInitializationCode(handler, compiler));
- }
- }
-
- /**
- * Adds a child component to this container. The child is added without
- * layout constraints.
- *
- * @param child the component to add
- * @param compiler the current <code>JAXXCompiler</code>
- * @throws CompilerException if this object is not a container
- * @see #addChild(CompiledObject, String, JAXXCompiler)
- */
- public void addChild(CompiledObject child, JAXXCompiler compiler) throws CompilerException {
- addChild(child, null, compiler);
- }
-
- /**
- * Adds a child component to this container. This variant allows the Java
- * code for a layout constraints object to be specified.
- *
- * @param child the component to add
- * @param constraints Java code for the layout constraints object
- * @param compiler the current <code>JAXXCompiler</code>
- * @throws CompilerException if this object is not a container
- * @see #addChild(CompiledObject, JAXXCompiler)
- */
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- try {
- if (constraints != null) {
- constraints = compiler.checkJavaCode(constraints);
- }
- } catch (CompilerException e) {
- compiler.reportError("While parsing 'constraints' attribute: " + e.getMessage());
- }
-
- if (!child.isOverride()) {
- TagHandler tagHandler = TagManager.getTagHandler(getObjectClass());
- if (tagHandler instanceof DefaultComponentHandler &&
- !((DefaultComponentHandler) tagHandler).isContainer()) {
- compiler.reportError("component " + this + " may not have children");
- }
-
- String containerDelegate = ((DefaultComponentHandler) tagHandler).getContainerDelegate();
- String delegateCode = containerDelegate != null ? "." + containerDelegate + "()" : "";
-
- child.setParent(this);
-
- childs.add(new ChildRef(child, constraints, child.getJavaCode(), delegateCode));
- }
- }
-
- @Override
- public String toString() {
- return getObjectClass().getName() + "[id='" + id + "']";
- }
-
- public String getGenericTypes() {
- if (getGenericTypesLength() == 0) {
- // not using it
- return "";
- }
- String result = "";
- for (int i = 0, j = getGenericTypesLength(); i < j; i++) {
- result += ", " + genericTypes[i];
- }
- return "< " + result.substring(2) + " >";
- }
-
- public void setGenericTypes(String[] genericTypes) {
- if (genericTypes == null) {
- this.genericTypes = null;
- return;
- }
- this.genericTypes = new String[genericTypes.length];
- for (int i = 0, j = genericTypes.length; i < j; i++) {
- this.genericTypes[i] = genericTypes[i].trim();
- }
- }
-
- public boolean isJavaBean() {
- return javaBean;
- }
-
- public void setJavaBean(boolean javaBean) {
- this.javaBean = javaBean;
- }
-
- public ClassDescriptor getOverrideType() {
- return overrideType;
- }
-
- public void setOverrideType(ClassDescriptor overrideType) {
- this.overrideType = overrideType;
- }
-
- public String getJavaBeanInitCode() {
- return javaBeanInitCode;
- }
-
- public void setJavaBeanInitCode(String javaBeanInitCode) {
- this.javaBeanInitCode = javaBeanInitCode;
- }
-
- public List<ChildRef> getChilds() {
- return childs;
- }
-
- public CompiledObjectDecorator getDecorator() {
- return decorator;
- }
-
- public void setDecorator(CompiledObjectDecorator decorator) {
- this.decorator = decorator;
- }
-
- public void finalizeCompiler(JAXXCompiler compiler) {
-
- List<CompiledObject.ChildRef> refList = getChilds();
- if (refList != null && !refList.isEmpty()) {
- // compute additionCode for all childs
- StringBuffer buffer = new StringBuffer();
- for (ChildRef childRef : refList) {
- childRef.addToAdditionCode(buffer, compiler.getRootObject() == this);
- }
- additionCode = buffer.append(additionCode);
- return;
- }
- }
-
- public int getGenericTypesLength() {
- return genericTypes == null ? 0 : genericTypes.length;
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.reflect.MethodDescriptor;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.compiler.tags.TagManager;
+
+import java.awt.Container;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Represents an object in the <code>.java</code> file being generated during compilation. There is
+ * a <code>CompiledObject</code> for each class tag encountered, and certain tags may generate
+ * additional objects for various reasons.
+ */
+public class CompiledObject {
+
+ /**
+ * The object's id.
+ */
+ private String id;
+ /**
+ * Java code referring to the object.
+ */
+ private String javaCode;
+ /**
+ * The object's class.
+ */
+ private ClassDescriptor objectClass;
+ /**
+ * The style class.
+ */
+ private String styleClass;
+ /**
+ * The container containing this CompiledObject.
+ */
+ private CompiledObject parent;
+ /**
+ * true if this object overrides an object of the same id in a superclass
+ * of the object being compiled
+ */
+ private boolean override;
+ /**
+ * Comma-separated Java code snippets representing the parameters that
+ * should be passed to the object's constructor.
+ */
+ private String constructorParams;
+ /**
+ * Java code snippet which performs basic initialization of the object (after it has already been constructed).
+ * Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other
+ * CompiledObjects from initializationCode -- you must refer to them from additionCode instead.
+ */
+ private StringBuffer initializationCode = new StringBuffer();
+ /**
+ * Java code snippet which completes setup by adding any child objects, or otherwise manipulates any refererenced
+ * objects. Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other
+ * CompiledObjects from initializationCode -- you must refer to them from additionCode instead.
+ */
+ private StringBuffer additionCode = new StringBuffer();
+ /**
+ * List of all registered event handlers.
+ */
+ private List<EventHandler> eventHandlers = new ArrayList<EventHandler>();
+ /**
+ * All properties that have been applied to this CompiledObject.
+ */
+ private Map<String, String> properties = new HashMap<String, String>();
+ /**
+ * generic types of the compiled object
+ */
+ private String[] genericTypes;
+ /**
+ * a flag to indicate if javaBean full support must be support for this
+ * object by root object
+ */
+ private boolean javaBean;
+ /**
+ * code to initialize the bean (can be null)
+ */
+ private String javaBeanInitCode;
+ /**
+ * the type of the override object (can be null if no overide)
+ */
+ private ClassDescriptor overrideType;
+ /**
+ * the decorator
+ */
+ private CompiledObjectDecorator decorator;
+ /**
+ * client properties
+ */
+ private Map<String, String> clientProperties;
+
+ public class ChildRef {
+
+ CompiledObject child;
+ String constraints;
+ String childJavaCode;
+ String delegateCode;
+
+ public ChildRef(CompiledObject child, String constraints, String childJavaCode, String delegateCode) {
+ this.child = child;
+ this.constraints = constraints;
+ this.childJavaCode = childJavaCode;
+ this.delegateCode = delegateCode;
+ }
+
+ public CompiledObject getChild() {
+ return child;
+ }
+
+ public void setChild(CompiledObject child) {
+ this.child = child;
+ }
+
+ public String getConstraints() {
+ return constraints;
+ }
+
+ public void setConstraints(String constraints) {
+ this.constraints = constraints;
+ }
+
+ public String getChildJavaCode() {
+ return childJavaCode;
+ }
+
+ public void setChildJavaCode(String childJavaCode) {
+ this.childJavaCode = childJavaCode;
+ }
+
+ public String getDelegateCode() {
+ return delegateCode;
+ }
+
+ public void setDelegateCode(String delegateCode) {
+ this.delegateCode = delegateCode;
+ }
+
+ public void addToAdditionCode(StringBuffer buffer, boolean isRootObject) {
+ //TC-20091026 do not prefix if on root object
+ String prefix;
+ if (isRootObject) {
+ prefix = "";
+ } else {
+ prefix = javaCode + delegateCode + ".";
+ }
+ if (constraints != null) {
+// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(", ").append(constraints).append(");");
+ buffer.append(prefix).append("add(").append(childJavaCode).append(", ").append(constraints).append(");");
+ } else {
+// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(");");
+ buffer.append(prefix).append("add(").append(childJavaCode).append(");");
+ }
+ buffer.append(JAXXCompiler.getLineSeparator());
+ }
+ }
+ private List<ChildRef> childs;
+
+ /**
+ * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a
+ * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}.
+ *
+ * @param id the object's id
+ * @param objectClass the object's class
+ * @param compiler the current <code>JAXXCompiler</code>
+ * @throws NullPointerException if id or class is null
+ */
+ public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler) {
+ this(id, objectClass, compiler, false);
+ }
+
+ /**
+ * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a
+ * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}.
+ *
+ * @param id the object's id
+ * @param objectClass the object's class
+ * @param compiler the current <code>JAXXCompiler</code>
+ * @param force <code>true</code> to force acceptance of invalid ids
+ * @throws NullPointerException if id or class is null
+ */
+ public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) {
+ this(id, id, objectClass, compiler, force);
+ }
+
+ /**
+ * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a
+ * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}.
+ *
+ * @param id the object's id
+ * @param javaCode Java code referring to the object
+ * @param objectClass the object's class
+ * @param force <code>true</code> to force acceptance of invalid ids
+ * @param compiler the current <code>JAXXCompiler</code>
+ * @throws CompilerException if the id is not a valid Java identifier
+ * @throws NullPointerException if id or class is null
+ */
+ public CompiledObject(String id, String javaCode, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) throws CompilerException {
+ if (!force) {
+ if (!isValidID(id)) {
+ compiler.reportError("the id '" + id + "' is not a valid Java identifier");
+ }
+ }
+ this.id = id;
+ this.javaCode = javaCode;
+
+ if (objectClass == null) {
+ throw new NullPointerException();
+ }
+ this.objectClass = objectClass;
+ this.childs = new ArrayList<ChildRef>();
+ }
+
+ public static boolean isValidID(String id) {
+ boolean valid = true;
+ if (id.length() == 0) {
+ valid = false;
+ }
+ if (valid) {
+ if (!Character.isJavaIdentifierStart(id.charAt(0))) {
+ valid = false;
+ }
+ if (valid) {
+ for (int i = 1; i < id.length(); i++) {
+ if (!Character.isJavaIdentifierPart(id.charAt(i))) {
+ valid = false;
+ break;
+ }
+ }
+ }
+ }
+ return valid;
+ }
+
+ /**
+ * True if this object overrides an object in the superclass of the class
+ * being compiled. For this to be true, the class currently being compiled
+ * must be a subclass of another <code>JAXXObject</code> which has an
+ * identically-named object.
+ *
+ * @return <code>true</code> if this object is an override
+ * @see #setOverride
+ */
+ public boolean isOverride() {
+ return override;
+ }
+
+ /**
+ * Sets whether this class overrides an identically-named object in the
+ * parent class.
+ *
+ * @param override <code>true</code> if this object is an override
+ * @see #isOverride
+ */
+ public void setOverride(boolean override) {
+ this.override = override;
+ }
+
+ /**
+ * Returns this object's CSS style class.
+ *
+ * @return the value of the <code>styleClass</code> attribute
+ */
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+ /**
+ * Sets this object's CSS style class.
+ *
+ * @param styleClass the new style class
+ */
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ /**
+ * Returns this object's parent container. Non-visual components (and
+ * the root container) return <code>null</code>.
+ *
+ * @return the object's parent container
+ */
+ public CompiledObject getParent() {
+ return parent;
+ }
+
+ /**
+ * Sets this object's parent container.
+ *
+ * @param parent the parent container
+ * @throws IllegalArgumentException if parent is not a {@link Container}
+ */
+ public void setParent(CompiledObject parent) throws IllegalArgumentException {
+ if (!ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(parent.getObjectClass())) {
+ throw new IllegalArgumentException("parent must descend from java.awt.Container");
+ }
+ this.parent = parent;
+ }
+
+ /**
+ * Returns the name of the method that should be generated in the compiled
+ * <code>.java</code> file
+ * in order to create this object. This is just a suggestion and may be
+ * ignored.
+ *
+ * @return the suggested name of the method which initializes this object
+ */
+ public String getCreationMethodName() {
+ return "create" + StringUtils.capitalize(getId());
+ }
+
+ /**
+ * Returns the name of the method that should be generated in the compiled
+ * <code>.java</code> file in order to add children to this object. This
+ * is just a suggestion and may be ignored.
+ *
+ * @return the suggested name of the method which completes this object's setup
+ */
+ public String getAdditionMethodName() {
+ return "addChildrenTo" + StringUtils.capitalize(getId());
+ }
+
+ /**
+ * Returns the type of this object.
+ *
+ * @return the class this <code>CompiledObject</code> represents
+ */
+ public ClassDescriptor getObjectClass() {
+ return objectClass;
+ }
+
+ /**
+ * Returns this object's id. Generally, a field with this name will be
+ * created in the compiled <code>.java</code>
+ * file in order to represent this object.
+ *
+ * @return the id used to refer to this object
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Returns Java code used to refer to this object in the compiled Java file.
+ * This is usually the same as its id.
+ *
+ * @return the Java code for this object
+ */
+ public String getJavaCode() {
+ String result = javaCode;
+ if (isOverride()) {
+ // handle cases where object is overridden to be a different class
+ result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")";
+ }
+ return result;
+ }
+
+ public String getJavaCodeForProperty(String property) {
+ if (!override) {
+ return javaCode;
+ }
+ String result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")";
+
+ String methodName = StringUtils.capitalize(property);
+ try {
+ MethodDescriptor methodDescriptor = overrideType.getMethodDescriptor("get" + methodName);
+ if (methodDescriptor != null) {
+ if (overrideType.getMethodDescriptor("set" + methodName, methodDescriptor.getReturnType()) != null) {
+ // handle cases where object is overridden to be a different class
+ result = javaCode;
+ }
+ }
+ } catch (NoSuchMethodException e) {
+ // lazy error, do nothing
+ }
+ return result;
+ }
+
+ /**
+ * Returns a list of comma-separated Java code snippets that represent the
+ * parameters to pass to this object's constructor.
+ *
+ * @return the raw constructor params
+ * @see #setConstructorParams
+ */
+ public String getConstructorParams() {
+ return constructorParams;
+ }
+
+ /**
+ * Sets the parameters to pass to this object's constructor.
+ *
+ * @param constructorParams comma-separated Java code snippets representing
+ * constructor params
+ * @see #getConstructorParams
+ */
+ public void setConstructorParams(String constructorParams) {
+ this.constructorParams = constructorParams;
+ }
+
+ /**
+ * Returns the code that performs basic initialization of this object,
+ * after it has already been constructed.
+ * This basic code should not reference any other
+ * <code>CompiledObjects</code> as they may not have been created yet.
+ *
+ * @param compiler compiler to use
+ * @return the code which initializes this object
+ */
+ public String getInitializationCode(JAXXCompiler compiler) {
+ StringBuffer result = new StringBuffer(initializationCode.toString());
+ for (Object eventHandler : eventHandlers) {
+ EventHandler handler = (EventHandler) eventHandler;
+ result.append(getInitializationCode(handler, compiler));
+ }
+ return result.toString();
+ }
+
+ protected String getInitializationCode(EventHandler handler, JAXXCompiler compiler) {
+ MethodDescriptor addMethod = handler.getAddMethod();
+ ClassDescriptor listenerClass = addMethod.getParameterTypes()[0];
+ //TC-20091026 use 'this' instead of root object javaCode
+ return getJavaCode() + '.' + addMethod.getName() + "((" + JAXXCompiler.getCanonicalName(listenerClass) +
+ ") jaxx.runtime.Util.getEventListener(" + JAXXCompiler.getCanonicalName(listenerClass) + ".class, " +
+ compiler.getJavaCode(handler.getListenerMethod().getName()) + ", this, " +
+ // compiler.getJavaCode(handler.getListenerMethod().getName()) + ", " + compiler.getRootObject().getJavaCode() + ", " +
+ compiler.getJavaCode(compiler.getEventHandlerMethodName(handler)) + "));" + JAXXCompiler.getLineSeparator();
+ }
+
+ /**
+ * Returns Java code to complete final setup on this object. This code may
+ * reference other <code>CompiledObjects</code>, as they are guaranteed to
+ * have all been created by this point.
+ *
+ * @return code which adds children and performs final setup
+ */
+ public String getAdditionCode() {
+ return additionCode.toString();
+ }
+
+ /**
+ * Appends code to the initialization code block. A line separator is
+ * automatically appended to the end.
+ *
+ * @param code the code to add to the initialization block
+ * @see #getInitializationCode
+ */
+ public void appendInitializationCode(String code) {
+ if (!code.isEmpty()) {
+ this.initializationCode.append(code);
+ this.initializationCode.append(JAXXCompiler.getLineSeparator());
+ }
+ }
+
+ /**
+ * Appends code to the addition code block. A line separator is
+ * automatically appended to the end.
+ *
+ * @param code the code to add to the addition block
+ * @see #getAdditionCode
+ */
+ public void appendAdditionCode(String code) {
+ if (!code.isEmpty()) {
+ this.additionCode.append(code);
+ this.additionCode.append(JAXXCompiler.getLineSeparator());
+ }
+ }
+
+ /**
+ * Stores a property for this object. The only effect of calling this
+ * method is that the property will be returned by {@code getProperties()}.
+ *
+ * @param property the name of the property
+ * @param value the property's value
+ * @see #getProperties
+ */
+ public void addProperty(String property, String value) {
+ properties.put(property, value);
+ }
+
+ public boolean hasClientProperties() {
+ return clientProperties != null && !clientProperties.isEmpty();
+ }
+
+ public void addClientProperty(String property, String value) {
+ getClientProperties().put(property, value);
+ }
+
+ public String getClientProperty(String key) {
+ if (!hasClientProperties()) {
+ return null;
+ }
+ return clientProperties.get(key);
+ }
+
+ public Map<String, String> getClientProperties() {
+ if (clientProperties == null) {
+ clientProperties = new HashMap<String, String>();
+ }
+ return clientProperties;
+ }
+
+ /**
+ * Returns all properties which have been set for this object.
+ *
+ * @return a <code>Map</code> containing all properties defined for this object
+ * @see #addProperty
+ */
+ public Map<?, ?>/*<String, String>*/ getProperties() {
+ return properties;
+ }
+
+ // TODO: remove this temporary method and complete switchover to MethodDescriptors
+ public void addEventHandler(String eventId, Method addMethod, Method listenerMethod, String code, JAXXCompiler compiler) {
+ try {
+ ClassDescriptor descriptor = ClassDescriptorLoader.getClassDescriptor(getObjectClass().getName());
+ String listenerClassName = addMethod.getParameterTypes()[0].getName();
+ ClassDescriptor listenerDescriptor = ClassDescriptorLoader.getClassDescriptor(listenerClassName);
+ MethodDescriptor addMethodDescriptor = descriptor.getMethodDescriptor(addMethod.getName(), listenerDescriptor);
+ MethodDescriptor listenerMethodDescriptor = listenerDescriptor.getMethodDescriptor(listenerMethod.getName(), ClassDescriptorLoader.getClassDescriptor(listenerMethod.getParameterTypes()[0].getName()));
+ addEventHandler(eventId, addMethodDescriptor, listenerMethodDescriptor, code, compiler);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Adds an event listener to this object. The generated code will appear
+ * in the initialization block.
+ *
+ * @param eventId unique (per CompiledObject) identifier for the event handler
+ * @param addMethod the method which adds the event listener
+ * @param listenerMethod the method (in the listener class) which is called when the event is fired
+ * @param code the Java code for the listenerMethod's body
+ * @param compiler the current <code>JAXXCompiler</code>
+ * @see #getInitializationCode
+ */
+ public void addEventHandler(String eventId, MethodDescriptor addMethod, MethodDescriptor listenerMethod, String code, JAXXCompiler compiler) {
+ EventHandler handler = new EventHandler(getId() + "." + eventId, getJavaCode(), addMethod, addMethod.getParameterTypes()[0], listenerMethod, code);
+ compiler.registerEventHandler(handler);
+ eventHandlers.add(handler);
+
+ if (getJavaCode().indexOf(".") != -1) {
+ // object lives in another JAXX file and consequently its initialization code won't be output
+ compiler.appendInitializerCode(getInitializationCode(handler, compiler));
+ }
+ }
+
+ /**
+ * Adds a child component to this container. The child is added without
+ * layout constraints.
+ *
+ * @param child the component to add
+ * @param compiler the current <code>JAXXCompiler</code>
+ * @throws CompilerException if this object is not a container
+ * @see #addChild(CompiledObject, String, JAXXCompiler)
+ */
+ public void addChild(CompiledObject child, JAXXCompiler compiler) throws CompilerException {
+ addChild(child, null, compiler);
+ }
+
+ /**
+ * Adds a child component to this container. This variant allows the Java
+ * code for a layout constraints object to be specified.
+ *
+ * @param child the component to add
+ * @param constraints Java code for the layout constraints object
+ * @param compiler the current <code>JAXXCompiler</code>
+ * @throws CompilerException if this object is not a container
+ * @see #addChild(CompiledObject, JAXXCompiler)
+ */
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ try {
+ if (constraints != null) {
+ constraints = compiler.checkJavaCode(constraints);
+ }
+ } catch (CompilerException e) {
+ compiler.reportError("While parsing 'constraints' attribute: " + e.getMessage());
+ }
+
+ if (!child.isOverride()) {
+ TagHandler tagHandler = TagManager.getTagHandler(getObjectClass());
+ if (tagHandler instanceof DefaultComponentHandler &&
+ !((DefaultComponentHandler) tagHandler).isContainer()) {
+ compiler.reportError("component " + this + " may not have children");
+ }
+
+ String containerDelegate = ((DefaultComponentHandler) tagHandler).getContainerDelegate();
+ String delegateCode = containerDelegate != null ? "." + containerDelegate + "()" : "";
+
+ child.setParent(this);
+
+ childs.add(new ChildRef(child, constraints, child.getJavaCode(), delegateCode));
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getObjectClass().getName() + "[id='" + id + "']";
+ }
+
+ public String getGenericTypes() {
+ if (getGenericTypesLength() == 0) {
+ // not using it
+ return "";
+ }
+ String result = "";
+ for (int i = 0, j = getGenericTypesLength(); i < j; i++) {
+ result += ", " + genericTypes[i];
+ }
+ return "< " + result.substring(2) + " >";
+ }
+
+ public void setGenericTypes(String[] genericTypes) {
+ if (genericTypes == null) {
+ this.genericTypes = null;
+ return;
+ }
+ this.genericTypes = new String[genericTypes.length];
+ for (int i = 0, j = genericTypes.length; i < j; i++) {
+ this.genericTypes[i] = genericTypes[i].trim();
+ }
+ }
+
+ public boolean isJavaBean() {
+ return javaBean;
+ }
+
+ public void setJavaBean(boolean javaBean) {
+ this.javaBean = javaBean;
+ }
+
+ public ClassDescriptor getOverrideType() {
+ return overrideType;
+ }
+
+ public void setOverrideType(ClassDescriptor overrideType) {
+ this.overrideType = overrideType;
+ }
+
+ public String getJavaBeanInitCode() {
+ return javaBeanInitCode;
+ }
+
+ public void setJavaBeanInitCode(String javaBeanInitCode) {
+ this.javaBeanInitCode = javaBeanInitCode;
+ }
+
+ public List<ChildRef> getChilds() {
+ return childs;
+ }
+
+ public CompiledObjectDecorator getDecorator() {
+ return decorator;
+ }
+
+ public void setDecorator(CompiledObjectDecorator decorator) {
+ this.decorator = decorator;
+ }
+
+ public void finalizeCompiler(JAXXCompiler compiler) {
+
+ List<CompiledObject.ChildRef> refList = getChilds();
+ if (refList != null && !refList.isEmpty()) {
+ // compute additionCode for all childs
+ StringBuffer buffer = new StringBuffer();
+ for (ChildRef childRef : refList) {
+ childRef.addToAdditionCode(buffer, compiler.getRootObject() == this);
+ }
+ additionCode = buffer.append(additionCode);
+ return;
+ }
+ }
+
+ public int getGenericTypesLength() {
+ return genericTypes == null ? 0 : genericTypes.length;
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import jaxx.compiler.java.JavaFile;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,50 +1,66 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-/** Thrown by the compiler when an error occurs. */
-public class CompilerException extends RuntimeException {
-
- private static final long serialVersionUID = -9099889519671482440L;
-
- /** Creates a new <code>ParseException</code>. */
- public CompilerException() {
- }
-
- /**
- * Creates a new <code>ParseException</code> with the specified detail message.
- *
- * @param msg the exception's detail message
- */
- public CompilerException(String msg) {
- super(msg);
- }
-
- /**
- * Creates a new <code>ParseException</code> with the specified cause.
- *
- * @param initCause the exception's initCause
- */
- public CompilerException(Throwable initCause) {
- super(initCause);
- }
-
- /**
- * Creates a new <code>ParseException</code> with the specified detail message and cause.
- *
- * @param msg the exception's detail message
- * @param initCause the exception's initCause
- */
- public CompilerException(String msg, Throwable initCause) {
- super(msg, initCause);
- }
-
- @Override
- public void printStackTrace() {
- super.printStackTrace();
- System.err.println("CompilerException printed from:");
- Thread.dumpStack();
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler;
+
+/** Thrown by the compiler when an error occurs. */
+public class CompilerException extends RuntimeException {
+
+ private static final long serialVersionUID = -9099889519671482440L;
+
+ /** Creates a new <code>ParseException</code>. */
+ public CompilerException() {
+ }
+
+ /**
+ * Creates a new <code>ParseException</code> with the specified detail message.
+ *
+ * @param msg the exception's detail message
+ */
+ public CompilerException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Creates a new <code>ParseException</code> with the specified cause.
+ *
+ * @param initCause the exception's initCause
+ */
+ public CompilerException(Throwable initCause) {
+ super(initCause);
+ }
+
+ /**
+ * Creates a new <code>ParseException</code> with the specified detail message and cause.
+ *
+ * @param msg the exception's detail message
+ * @param initCause the exception's initCause
+ */
+ public CompilerException(String msg, Throwable initCause) {
+ super(msg, initCause);
+ }
+
+ @Override
+ public void printStackTrace() {
+ super.printStackTrace();
+ System.err.println("CompilerException printed from:");
+ Thread.dumpStack();
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import org.apache.commons.logging.Log;
@@ -5,7 +25,8 @@
/**
* Represents a data binding in a JAXX file. <code>DataBinding</code> uses
- * {@link DataSource} to track changes to a source expression and update the destination.
+ * {@link DataSource} to track changes to a source expression and update
+ * the destination.
*/
public class DataBinding {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,469 +1,485 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.compiler.java.JavaField;
-import jaxx.compiler.java.parser.JavaParser;
-import jaxx.compiler.java.parser.JavaParserConstants;
-import jaxx.compiler.java.parser.JavaParserTreeConstants;
-import jaxx.compiler.java.parser.SimpleNode;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.reflect.FieldDescriptor;
-import jaxx.compiler.reflect.MethodDescriptor;
-import jaxx.compiler.tags.DefaultObjectHandler;
-import jaxx.compiler.tags.TagManager;
-import jaxx.compiler.types.TypeManager;
-
-import java.beans.Introspector;
-import java.beans.PropertyChangeListener;
-import java.io.StringReader;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Represents a Java expression which fires a <code>PropertyChangeEvent</code> when it can be
- * determined that its value may have changed. Events are fired on a "best effort" basis, and events
- * may either be fired too often (the value has not actually changed) or not often enough (the value
- * changed but no event was fired).
- */
-public class DataSource {
-
- /**
- * type attached to "null" constants in parsed expressions
- */
- private class NULL {
- }
- /**
- * id of data source
- */
- private String id;
- /**
- * The Java source code for the expression.
- */
- private String source;
- /**
- * The current <code>JAXXCompiler</code>.
- */
- private JAXXCompiler compiler;
- /**
- * List of symbols which this data source expression depends on.
- */
- private List<String> dependencySymbols = new ArrayList<String>();
- /**
- *
- */
- private StringBuffer addListenerCode = new StringBuffer();
- /**
- *
- */
- private StringBuffer removeListenerCode = new StringBuffer();
- /**
- *
- */
- private boolean compiled;
- /**
- * the delegate of property to be required
- */
- private String objectCode;
-
- /**
- * Creates a new data source. After creating a <code>DataSource</code>, use {@link #compile}
- * to cause it to function at runtime.
- *
- * @param id the DataSource's id
- * @param source the Java source code for the data source expression
- * @param compiler the current <code>JAXXCompiler</code>
- */
- public DataSource(String id, String source, JAXXCompiler compiler) {
- this.id = id;
- this.source = source;
- this.compiler = compiler;
- }
-
- public String getId() {
- return id;
- }
-
- public String getSource() {
- return source;
- }
-
- public String getObjectCode() {
- return objectCode;
- }
-
- /**
- * Compiles the data source expression and listener. This method calls methods in <code>JAXXCompiler</code>
- * to add the Java code that performs the data source setup. Adding listeners to <code>DataSource</code> is
- * slightly more complicated than with ordinary classes, because <code>DataSource</code> only exists at compile
- * time. You must pass in a Java expression which evaluates to a <code>PropertyChangeListener</code>; this
- * expression will be compiled and evaluated at runtime to yield the <code>DataSource's</code> listener.
- *
- * @param propertyChangeListenerCode Java code snippet which evaluates to a <code>PropertyChangeListener</code>
- * @return <code>true</code> if the expression has dependencies, <code>false</code> otherwise
- * @throws CompilerException if a compilation error occurs
- * @throws IllegalStateException if data source was already compiled
- */
- public boolean compile(String propertyChangeListenerCode) throws CompilerException, IllegalStateException {
- if (compiled) {
- throw new IllegalStateException(this + " has already been compiled");
- }
- String autoId = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(getClass()));
- JavaParser p = new JavaParser(new StringReader(source + ";"));
- while (!p.Line()) {
- SimpleNode node = p.popNode();
- scanNode(node, autoId);
- }
-
- if (dependencySymbols.size() > 0) {
- //TC 20081108 prefer add a real JavaField instead of raw code
- //compiler.appendBodyCode("private PropertyChangeListener " + id + " = " + propertyChangeListenerCode + ";\n");
- compiler.addSimpleField(new JavaField(Modifier.PRIVATE, PropertyChangeListener.class.getSimpleName(), autoId, false, propertyChangeListenerCode));
- }
-
- compileListeners();
- compiled = true;
-
- return dependencySymbols.size() > 0;
- }
-
- /** @return a list of symbols on which this data source depends. */
- public Collection<String> getDependencies() {
- return Collections.unmodifiableList(dependencySymbols);
- }
-
- /**
- * Examines a node to identify any dependencies it contains.
- *
- * @param node node to scan
- * @param listenerId id of listener
- * @throws CompilerException ?
- */
- private void scanNode(SimpleNode node, String listenerId) throws CompilerException {
- switch (node.getId()) {
- case JavaParserTreeConstants.JJTMETHODDECLARATION:
- break;
- case JavaParserTreeConstants.JJTFIELDDECLARATION:
- break;
-
- default:
- int count = node.jjtGetNumChildren();
- for (int i = 0; i < count; i++) {
- scanNode(node.getChild(i), listenerId);
- }
- determineNodeType(node, listenerId);
- }
- }
-
- private ClassDescriptor determineLiteralType(SimpleNode node) {
- assert node.getId() == JavaParserTreeConstants.JJTLITERAL;
- if (node.jjtGetNumChildren() == 1) {
- int childId = node.getChild(0).getId();
- if (childId == JavaParserTreeConstants.JJTBOOLEANLITERAL) {
- return ClassDescriptorLoader.getClassDescriptor(boolean.class);
- }
- if (childId == JavaParserTreeConstants.JJTNULLLITERAL) {
- return ClassDescriptorLoader.getClassDescriptor(NULL.class);
- }
- throw new RuntimeException("Expected BooleanLiteral or NullLiteral, found " + JavaParserTreeConstants.jjtNodeName[childId]);
- }
- int nodeId = node.firstToken.kind;
- switch (nodeId) {
- case JavaParserConstants.INTEGER_LITERAL:
- if (node.firstToken.image.toLowerCase().endsWith("l")) {
- return ClassDescriptorLoader.getClassDescriptor(long.class);
- }
- return ClassDescriptorLoader.getClassDescriptor(int.class);
- case JavaParserConstants.CHARACTER_LITERAL:
- return ClassDescriptorLoader.getClassDescriptor(char.class);
- case JavaParserConstants.FLOATING_POINT_LITERAL:
- if (node.firstToken.image.toLowerCase().endsWith("f")) {
- return ClassDescriptorLoader.getClassDescriptor(float.class);
- }
- return ClassDescriptorLoader.getClassDescriptor(double.class);
- case JavaParserConstants.STRING_LITERAL:
- return ClassDescriptorLoader.getClassDescriptor(String.class);
- default:
- throw new RuntimeException("Expected literal token, found " + JavaParserConstants.tokenImage[nodeId]);
- }
- }
-
- /**
- * Scans through a compound symbol (foo.bar.baz) to identify and track all trackable pieces of it.
- *
- * @param symbol symbol to scan
- * @param contextClass current class context
- * @param isMethod flag to search a method
- * @param listenerId id of the listener
- * @return the type of the symbol (or null if it could not be determined).
- */
- private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescriptor contextClass, boolean isMethod, String listenerId) {
- String[] tokens = symbol.split("\\s*\\.\\s*");
- StringBuffer currentSymbol = new StringBuffer();
- StringBuffer tokensSeenSoFar = new StringBuffer();
- boolean accepted; // if this ends up false, it means we weren't able to figure out
- // which object the method is being invoked on
- boolean recognizeClassNames = true;
- for (int j = 0; j < tokens.length - (isMethod ? 1 : 0); j++) {
- accepted = false;
-
- if (tokensSeenSoFar.length() > 0) {
- tokensSeenSoFar.append('.');
- }
- tokensSeenSoFar.append(tokens[j]);
- if (currentSymbol.length() > 0) {
- currentSymbol.append('.');
- }
- currentSymbol.append(tokens[j]);
-
- if (currentSymbol.indexOf(".") == -1) {
- String memberName = currentSymbol.toString();
- CompiledObject object = compiler.getCompiledObject(memberName);
- if (object != null) {
- contextClass = object.getObjectClass();
- currentSymbol.setLength(0);
- accepted = true;
- recognizeClassNames = false;
- } else {
- try {
- FieldDescriptor field = contextClass.getFieldDescriptor(memberName);
- trackMemberIfPossible(tokensSeenSoFar.toString(), contextClass, field.getName(), false, listenerId);
- contextClass = field.getType();
- currentSymbol.setLength(0);
- accepted = true;
- recognizeClassNames = false;
- } catch (NoSuchFieldException e) {
- if (j == 0 || j == 1 && tokens[0].equals(compiler.getRootObject().getId())) { // still in root context
- FieldDescriptor[] newFields = compiler.getScriptFields();
- for (FieldDescriptor newField : newFields) {
- if (newField.getName().equals(memberName)) {
- addListener(tokensSeenSoFar.toString(),
- null,
- "addPropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
- "removePropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator());
- contextClass = newField.getType();
- assert contextClass != null : "script field '" + memberName + "' is defined, but has type null";
- currentSymbol.setLength(0);
- accepted = true;
- recognizeClassNames = false;
- break;
- }
- }
- }
- }
- }
- }
- if (currentSymbol.length() > 0 && recognizeClassNames) {
- contextClass = TagManager.resolveClass(currentSymbol.toString(), compiler);
- if (contextClass != null) {
- currentSymbol.setLength(0);
- //accepted = true;
- //recognizeClassNames = false;
- // TODO: for now we don't handle statics
- return null;
- }
- }
- if (!accepted) {
- return null;
- }
- }
-
- return contextClass;
- }
-
- /**
- * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which
- * can be tracked.
- *
- * @param expression the node to scan
- * @param listenerId id of the listener
- * @return the class descriptor of the return type or null
- */
- private ClassDescriptor determineExpressionType(SimpleNode expression, String listenerId) {
- assert expression.getId() == JavaParserTreeConstants.JJTPRIMARYEXPRESSION;
- SimpleNode prefix = expression.getChild(0);
- if (prefix.jjtGetNumChildren() == 1) {
- int type = prefix.getChild(0).getId();
- if (type == JavaParserTreeConstants.JJTLITERAL || type == JavaParserTreeConstants.JJTEXPRESSION) {
- prefix.setJavaType(prefix.getChild(0).getJavaType());
- } else if (type == JavaParserTreeConstants.JJTNAME && expression.jjtGetNumChildren() == 1) // name with no arguments after it
- {
- prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(), compiler.getRootObject().getObjectClass(), false, listenerId));
- }
- }
-
- if (expression.jjtGetNumChildren() == 1) {
- return prefix.getJavaType();
- }
-
- ClassDescriptor contextClass = prefix.getJavaType();
- if (contextClass == null) {
- contextClass = compiler.getRootObject().getObjectClass();
- }
- String lastNode = prefix.getText().trim();
-
- for (int i = 1; i < expression.jjtGetNumChildren(); i++) {
- SimpleNode suffix = expression.getChild(i);
- if (suffix.jjtGetNumChildren() == 1 && suffix.getChild(0).getId() == JavaParserTreeConstants.JJTARGUMENTS) {
- if (suffix.getChild(0).jjtGetNumChildren() == 0) {
- // at the moment only no-argument methods are trackable
- contextClass = scanCompoundSymbol(lastNode, contextClass, true, listenerId);
- if (contextClass == null) {
- return null;
- }
- int dotPos = lastNode.lastIndexOf(".");
- String code = dotPos == -1 ? "" : lastNode.substring(0, dotPos);
- for (int j = i - 2; j >= 0; j--) {
- code = expression.getChild(j).getText() + code;
- }
- if (code.length() == 0) {
- code = compiler.getRootObject().getJavaCode();
- }
- String methodName = lastNode.substring(dotPos + 1).trim();
- try {
- MethodDescriptor method = contextClass.getMethodDescriptor(methodName);
- trackMemberIfPossible(code, contextClass, method.getName(), true, listenerId);
- return method.getReturnType();
- } catch (NoSuchMethodException e) {
- // happens for methods defined in the current JAXX file via scripts
- String propertyName = null;
- if (methodName.startsWith("is")) {
- propertyName = Introspector.decapitalize(methodName.substring("is".length()));
- } else if (methodName.startsWith("get")) {
- propertyName = Introspector.decapitalize(methodName.substring("get".length()));
- }
- if (propertyName != null) {
- MethodDescriptor[] newMethods = compiler.getScriptMethods();
- for (MethodDescriptor newMethod : newMethods) {
- if (newMethod.getName().equals(methodName)) {
- addListener(compiler.getRootObject().getId(),
- null,
- "addPropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
- "removePropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator());
- contextClass = newMethod.getReturnType();
- break;
- }
- }
- }
- }
- }
- }
- lastNode = suffix.getText().trim();
- if (lastNode.startsWith(".")) {
- lastNode = lastNode.substring(1);
- }
- }
-
- return null;
- }
-
- private void trackMemberIfPossible(String objectCode, ClassDescriptor objectClass, String memberName, boolean method, String listenerId) {
- if (objectClass.isInterface()) {
- // might be technically possible to track in some cases, but for now
- // we can't create a DefaultObjectHandler for interfaces
- return;
- }
-
- DefaultObjectHandler handler = TagManager.getTagHandler(objectClass);
- try {
- if (handler.isMemberBound(memberName)) {
- addListener(objectCode + "." + memberName + (method ? "()" : ""),
- objectCode,
- handler.getAddMemberListenerCode(objectCode, id, memberName, listenerId, compiler),
- handler.getRemoveMemberListenerCode(objectCode, id, memberName, listenerId, compiler));
- }
- } catch (UnsupportedAttributeException e) {
- // ignore -- this is thrown for methods like toString(), for which there is no tracking and
- // no setting support
- }
- }
-
- /**
- * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which
- * can be tracked.
- *
- * @param node node to scan
- * @param listenerId the listener id
- */
- private void determineNodeType(SimpleNode node, String listenerId) {
- ClassDescriptor type = null;
- if (node.jjtGetNumChildren() == 1) {
- type = node.getChild(0).getJavaType();
- }
- switch (node.getId()) {
- case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE:
- type = ClassDescriptorLoader.getClassDescriptor(Class.class);
- break;
- case JavaParserTreeConstants.JJTPRIMARYEXPRESSION:
- type = determineExpressionType(node, listenerId);
- break;
- case JavaParserTreeConstants.JJTLITERAL:
- type = determineLiteralType(node);
- break;
- case JavaParserTreeConstants.JJTCASTEXPRESSION:
- type = TagManager.resolveClass(node.getChild(0).getText(), compiler);
- break;
- }
- node.setJavaType(type);
- }
-
- private void addListener(String dependencySymbol, String objectCode, String addCode, String removeCode) {
- this.objectCode = objectCode;
- //TC-20091026 no need to test objectCode not null if on root object
- boolean needTest = objectCode != null && !compiler.getRootObject().getId().equals(objectCode);
-// boolean needTest = objectCode != null;
- if (!dependencySymbols.contains(dependencySymbol)) {
- dependencySymbols.add(dependencySymbol);
- String eol = JAXXCompiler.getLineSeparator();
- addListenerCode.append(eol);
- if (needTest) {
- addListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol);
- addListenerCode.append(" ");
- }
- addListenerCode.append(" ").append(addCode.trim());
- if (needTest) {
- addListenerCode.append(eol).append(" }");
- }
-
- removeListenerCode.append(eol);
- if (needTest) {
- removeListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol);
- removeListenerCode.append(" ");
- }
- removeListenerCode.append(" ").append(removeCode.trim());
- if (needTest) {
- removeListenerCode.append(eol).append(" }");
- }
- }
- }
-
- private void compileListeners() {
- String javaCodeId = TypeManager.getJavaCode(id);
- String eol = JAXXCompiler.getLineSeparator();
- if (addListenerCode.length() > 0) {
- if (compiler.hasApplyDataBinding()) {
- compiler.appendApplyDataBinding(" else ");
- }
-// compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol);
- compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {");
- compiler.appendApplyDataBinding(" " + addListenerCode + eol);
- compiler.appendApplyDataBinding("}");
- }
-
- if (removeListenerCode.length() > 0) {
- if (compiler.hasRemoveDataBinding()) {
- compiler.appendRemoveDataBinding(" else ");
- }
-// compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol);
- compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {");
- compiler.appendRemoveDataBinding(" " + removeListenerCode + eol);
- compiler.appendRemoveDataBinding("}");
- }
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler;
+
+import jaxx.compiler.java.JavaField;
+import jaxx.compiler.java.parser.JavaParser;
+import jaxx.compiler.java.parser.JavaParserConstants;
+import jaxx.compiler.java.parser.JavaParserTreeConstants;
+import jaxx.compiler.java.parser.SimpleNode;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.reflect.FieldDescriptor;
+import jaxx.compiler.reflect.MethodDescriptor;
+import jaxx.compiler.tags.DefaultObjectHandler;
+import jaxx.compiler.tags.TagManager;
+import jaxx.compiler.types.TypeManager;
+
+import java.beans.Introspector;
+import java.beans.PropertyChangeListener;
+import java.io.StringReader;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Represents a Java expression which fires a <code>PropertyChangeEvent</code> when it can be
+ * determined that its value may have changed. Events are fired on a "best effort" basis, and events
+ * may either be fired too often (the value has not actually changed) or not often enough (the value
+ * changed but no event was fired).
+ */
+public class DataSource {
+
+ /**
+ * type attached to "null" constants in parsed expressions
+ */
+ private class NULL {
+ }
+ /**
+ * id of data source
+ */
+ private String id;
+ /**
+ * The Java source code for the expression.
+ */
+ private String source;
+ /**
+ * The current <code>JAXXCompiler</code>.
+ */
+ private JAXXCompiler compiler;
+ /**
+ * List of symbols which this data source expression depends on.
+ */
+ private List<String> dependencySymbols = new ArrayList<String>();
+ /**
+ *
+ */
+ private StringBuffer addListenerCode = new StringBuffer();
+ /**
+ *
+ */
+ private StringBuffer removeListenerCode = new StringBuffer();
+ /**
+ *
+ */
+ private boolean compiled;
+ /**
+ * the delegate of property to be required
+ */
+ private String objectCode;
+
+ /**
+ * Creates a new data source. After creating a <code>DataSource</code>, use {@link #compile}
+ * to cause it to function at runtime.
+ *
+ * @param id the DataSource's id
+ * @param source the Java source code for the data source expression
+ * @param compiler the current <code>JAXXCompiler</code>
+ */
+ public DataSource(String id, String source, JAXXCompiler compiler) {
+ this.id = id;
+ this.source = source;
+ this.compiler = compiler;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public String getObjectCode() {
+ return objectCode;
+ }
+
+ /**
+ * Compiles the data source expression and listener. This method calls methods in <code>JAXXCompiler</code>
+ * to add the Java code that performs the data source setup. Adding listeners to <code>DataSource</code> is
+ * slightly more complicated than with ordinary classes, because <code>DataSource</code> only exists at compile
+ * time. You must pass in a Java expression which evaluates to a <code>PropertyChangeListener</code>; this
+ * expression will be compiled and evaluated at runtime to yield the <code>DataSource's</code> listener.
+ *
+ * @param propertyChangeListenerCode Java code snippet which evaluates to a <code>PropertyChangeListener</code>
+ * @return <code>true</code> if the expression has dependencies, <code>false</code> otherwise
+ * @throws CompilerException if a compilation error occurs
+ * @throws IllegalStateException if data source was already compiled
+ */
+ public boolean compile(String propertyChangeListenerCode) throws CompilerException, IllegalStateException {
+ if (compiled) {
+ throw new IllegalStateException(this + " has already been compiled");
+ }
+ String autoId = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(getClass()));
+ JavaParser p = new JavaParser(new StringReader(source + ";"));
+ while (!p.Line()) {
+ SimpleNode node = p.popNode();
+ scanNode(node, autoId);
+ }
+
+ if (dependencySymbols.size() > 0) {
+ //TC 20081108 prefer add a real JavaField instead of raw code
+ //compiler.appendBodyCode("private PropertyChangeListener " + id + " = " + propertyChangeListenerCode + ";\n");
+ compiler.addSimpleField(new JavaField(Modifier.PRIVATE, PropertyChangeListener.class.getSimpleName(), autoId, false, propertyChangeListenerCode));
+ }
+
+ compileListeners();
+ compiled = true;
+
+ return dependencySymbols.size() > 0;
+ }
+
+ /** @return a list of symbols on which this data source depends. */
+ public Collection<String> getDependencies() {
+ return Collections.unmodifiableList(dependencySymbols);
+ }
+
+ /**
+ * Examines a node to identify any dependencies it contains.
+ *
+ * @param node node to scan
+ * @param listenerId id of listener
+ * @throws CompilerException ?
+ */
+ private void scanNode(SimpleNode node, String listenerId) throws CompilerException {
+ switch (node.getId()) {
+ case JavaParserTreeConstants.JJTMETHODDECLARATION:
+ break;
+ case JavaParserTreeConstants.JJTFIELDDECLARATION:
+ break;
+
+ default:
+ int count = node.jjtGetNumChildren();
+ for (int i = 0; i < count; i++) {
+ scanNode(node.getChild(i), listenerId);
+ }
+ determineNodeType(node, listenerId);
+ }
+ }
+
+ private ClassDescriptor determineLiteralType(SimpleNode node) {
+ assert node.getId() == JavaParserTreeConstants.JJTLITERAL;
+ if (node.jjtGetNumChildren() == 1) {
+ int childId = node.getChild(0).getId();
+ if (childId == JavaParserTreeConstants.JJTBOOLEANLITERAL) {
+ return ClassDescriptorLoader.getClassDescriptor(boolean.class);
+ }
+ if (childId == JavaParserTreeConstants.JJTNULLLITERAL) {
+ return ClassDescriptorLoader.getClassDescriptor(NULL.class);
+ }
+ throw new RuntimeException("Expected BooleanLiteral or NullLiteral, found " + JavaParserTreeConstants.jjtNodeName[childId]);
+ }
+ int nodeId = node.firstToken.kind;
+ switch (nodeId) {
+ case JavaParserConstants.INTEGER_LITERAL:
+ if (node.firstToken.image.toLowerCase().endsWith("l")) {
+ return ClassDescriptorLoader.getClassDescriptor(long.class);
+ }
+ return ClassDescriptorLoader.getClassDescriptor(int.class);
+ case JavaParserConstants.CHARACTER_LITERAL:
+ return ClassDescriptorLoader.getClassDescriptor(char.class);
+ case JavaParserConstants.FLOATING_POINT_LITERAL:
+ if (node.firstToken.image.toLowerCase().endsWith("f")) {
+ return ClassDescriptorLoader.getClassDescriptor(float.class);
+ }
+ return ClassDescriptorLoader.getClassDescriptor(double.class);
+ case JavaParserConstants.STRING_LITERAL:
+ return ClassDescriptorLoader.getClassDescriptor(String.class);
+ default:
+ throw new RuntimeException("Expected literal token, found " + JavaParserConstants.tokenImage[nodeId]);
+ }
+ }
+
+ /**
+ * Scans through a compound symbol (foo.bar.baz) to identify and track all trackable pieces of it.
+ *
+ * @param symbol symbol to scan
+ * @param contextClass current class context
+ * @param isMethod flag to search a method
+ * @param listenerId id of the listener
+ * @return the type of the symbol (or null if it could not be determined).
+ */
+ private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescriptor contextClass, boolean isMethod, String listenerId) {
+ String[] tokens = symbol.split("\\s*\\.\\s*");
+ StringBuffer currentSymbol = new StringBuffer();
+ StringBuffer tokensSeenSoFar = new StringBuffer();
+ boolean accepted; // if this ends up false, it means we weren't able to figure out
+ // which object the method is being invoked on
+ boolean recognizeClassNames = true;
+ for (int j = 0; j < tokens.length - (isMethod ? 1 : 0); j++) {
+ accepted = false;
+
+ if (tokensSeenSoFar.length() > 0) {
+ tokensSeenSoFar.append('.');
+ }
+ tokensSeenSoFar.append(tokens[j]);
+ if (currentSymbol.length() > 0) {
+ currentSymbol.append('.');
+ }
+ currentSymbol.append(tokens[j]);
+
+ if (currentSymbol.indexOf(".") == -1) {
+ String memberName = currentSymbol.toString();
+ CompiledObject object = compiler.getCompiledObject(memberName);
+ if (object != null) {
+ contextClass = object.getObjectClass();
+ currentSymbol.setLength(0);
+ accepted = true;
+ recognizeClassNames = false;
+ } else {
+ try {
+ FieldDescriptor field = contextClass.getFieldDescriptor(memberName);
+ trackMemberIfPossible(tokensSeenSoFar.toString(), contextClass, field.getName(), false, listenerId);
+ contextClass = field.getType();
+ currentSymbol.setLength(0);
+ accepted = true;
+ recognizeClassNames = false;
+ } catch (NoSuchFieldException e) {
+ if (j == 0 || j == 1 && tokens[0].equals(compiler.getRootObject().getId())) { // still in root context
+ FieldDescriptor[] newFields = compiler.getScriptFields();
+ for (FieldDescriptor newField : newFields) {
+ if (newField.getName().equals(memberName)) {
+ addListener(tokensSeenSoFar.toString(),
+ null,
+ "addPropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
+ "removePropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator());
+ contextClass = newField.getType();
+ assert contextClass != null : "script field '" + memberName + "' is defined, but has type null";
+ currentSymbol.setLength(0);
+ accepted = true;
+ recognizeClassNames = false;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (currentSymbol.length() > 0 && recognizeClassNames) {
+ contextClass = TagManager.resolveClass(currentSymbol.toString(), compiler);
+ if (contextClass != null) {
+ currentSymbol.setLength(0);
+ //accepted = true;
+ //recognizeClassNames = false;
+ // TODO: for now we don't handle statics
+ return null;
+ }
+ }
+ if (!accepted) {
+ return null;
+ }
+ }
+
+ return contextClass;
+ }
+
+ /**
+ * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which
+ * can be tracked.
+ *
+ * @param expression the node to scan
+ * @param listenerId id of the listener
+ * @return the class descriptor of the return type or null
+ */
+ private ClassDescriptor determineExpressionType(SimpleNode expression, String listenerId) {
+ assert expression.getId() == JavaParserTreeConstants.JJTPRIMARYEXPRESSION;
+ SimpleNode prefix = expression.getChild(0);
+ if (prefix.jjtGetNumChildren() == 1) {
+ int type = prefix.getChild(0).getId();
+ if (type == JavaParserTreeConstants.JJTLITERAL || type == JavaParserTreeConstants.JJTEXPRESSION) {
+ prefix.setJavaType(prefix.getChild(0).getJavaType());
+ } else if (type == JavaParserTreeConstants.JJTNAME && expression.jjtGetNumChildren() == 1) // name with no arguments after it
+ {
+ prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(), compiler.getRootObject().getObjectClass(), false, listenerId));
+ }
+ }
+
+ if (expression.jjtGetNumChildren() == 1) {
+ return prefix.getJavaType();
+ }
+
+ ClassDescriptor contextClass = prefix.getJavaType();
+ if (contextClass == null) {
+ contextClass = compiler.getRootObject().getObjectClass();
+ }
+ String lastNode = prefix.getText().trim();
+
+ for (int i = 1; i < expression.jjtGetNumChildren(); i++) {
+ SimpleNode suffix = expression.getChild(i);
+ if (suffix.jjtGetNumChildren() == 1 && suffix.getChild(0).getId() == JavaParserTreeConstants.JJTARGUMENTS) {
+ if (suffix.getChild(0).jjtGetNumChildren() == 0) {
+ // at the moment only no-argument methods are trackable
+ contextClass = scanCompoundSymbol(lastNode, contextClass, true, listenerId);
+ if (contextClass == null) {
+ return null;
+ }
+ int dotPos = lastNode.lastIndexOf(".");
+ String code = dotPos == -1 ? "" : lastNode.substring(0, dotPos);
+ for (int j = i - 2; j >= 0; j--) {
+ code = expression.getChild(j).getText() + code;
+ }
+ if (code.length() == 0) {
+ code = compiler.getRootObject().getJavaCode();
+ }
+ String methodName = lastNode.substring(dotPos + 1).trim();
+ try {
+ MethodDescriptor method = contextClass.getMethodDescriptor(methodName);
+ trackMemberIfPossible(code, contextClass, method.getName(), true, listenerId);
+ return method.getReturnType();
+ } catch (NoSuchMethodException e) {
+ // happens for methods defined in the current JAXX file via scripts
+ String propertyName = null;
+ if (methodName.startsWith("is")) {
+ propertyName = Introspector.decapitalize(methodName.substring("is".length()));
+ } else if (methodName.startsWith("get")) {
+ propertyName = Introspector.decapitalize(methodName.substring("get".length()));
+ }
+ if (propertyName != null) {
+ MethodDescriptor[] newMethods = compiler.getScriptMethods();
+ for (MethodDescriptor newMethod : newMethods) {
+ if (newMethod.getName().equals(methodName)) {
+ addListener(compiler.getRootObject().getId(),
+ null,
+ "addPropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
+ "removePropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator());
+ contextClass = newMethod.getReturnType();
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ lastNode = suffix.getText().trim();
+ if (lastNode.startsWith(".")) {
+ lastNode = lastNode.substring(1);
+ }
+ }
+
+ return null;
+ }
+
+ private void trackMemberIfPossible(String objectCode, ClassDescriptor objectClass, String memberName, boolean method, String listenerId) {
+ if (objectClass.isInterface()) {
+ // might be technically possible to track in some cases, but for now
+ // we can't create a DefaultObjectHandler for interfaces
+ return;
+ }
+
+ DefaultObjectHandler handler = TagManager.getTagHandler(objectClass);
+ try {
+ if (handler.isMemberBound(memberName)) {
+ addListener(objectCode + "." + memberName + (method ? "()" : ""),
+ objectCode,
+ handler.getAddMemberListenerCode(objectCode, id, memberName, listenerId, compiler),
+ handler.getRemoveMemberListenerCode(objectCode, id, memberName, listenerId, compiler));
+ }
+ } catch (UnsupportedAttributeException e) {
+ // ignore -- this is thrown for methods like toString(), for which there is no tracking and
+ // no setting support
+ }
+ }
+
+ /**
+ * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which
+ * can be tracked.
+ *
+ * @param node node to scan
+ * @param listenerId the listener id
+ */
+ private void determineNodeType(SimpleNode node, String listenerId) {
+ ClassDescriptor type = null;
+ if (node.jjtGetNumChildren() == 1) {
+ type = node.getChild(0).getJavaType();
+ }
+ switch (node.getId()) {
+ case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE:
+ type = ClassDescriptorLoader.getClassDescriptor(Class.class);
+ break;
+ case JavaParserTreeConstants.JJTPRIMARYEXPRESSION:
+ type = determineExpressionType(node, listenerId);
+ break;
+ case JavaParserTreeConstants.JJTLITERAL:
+ type = determineLiteralType(node);
+ break;
+ case JavaParserTreeConstants.JJTCASTEXPRESSION:
+ type = TagManager.resolveClass(node.getChild(0).getText(), compiler);
+ break;
+ }
+ node.setJavaType(type);
+ }
+
+ private void addListener(String dependencySymbol, String objectCode, String addCode, String removeCode) {
+ this.objectCode = objectCode;
+ //TC-20091026 no need to test objectCode not null if on root object
+ boolean needTest = objectCode != null && !compiler.getRootObject().getId().equals(objectCode);
+// boolean needTest = objectCode != null;
+ if (!dependencySymbols.contains(dependencySymbol)) {
+ dependencySymbols.add(dependencySymbol);
+ String eol = JAXXCompiler.getLineSeparator();
+ addListenerCode.append(eol);
+ if (needTest) {
+ addListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol);
+ addListenerCode.append(" ");
+ }
+ addListenerCode.append(" ").append(addCode.trim());
+ if (needTest) {
+ addListenerCode.append(eol).append(" }");
+ }
+
+ removeListenerCode.append(eol);
+ if (needTest) {
+ removeListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol);
+ removeListenerCode.append(" ");
+ }
+ removeListenerCode.append(" ").append(removeCode.trim());
+ if (needTest) {
+ removeListenerCode.append(eol).append(" }");
+ }
+ }
+ }
+
+ private void compileListeners() {
+ String javaCodeId = TypeManager.getJavaCode(id);
+ String eol = JAXXCompiler.getLineSeparator();
+ if (addListenerCode.length() > 0) {
+ if (compiler.hasApplyDataBinding()) {
+ compiler.appendApplyDataBinding(" else ");
+ }
+// compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol);
+ compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {");
+ compiler.appendApplyDataBinding(" " + addListenerCode + eol);
+ compiler.appendApplyDataBinding("}");
+ }
+
+ if (removeListenerCode.length() > 0) {
+ if (compiler.hasRemoveDataBinding()) {
+ compiler.appendRemoveDataBinding(" else ");
+ }
+// compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol);
+ compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {");
+ compiler.appendRemoveDataBinding(" " + removeListenerCode + eol);
+ compiler.appendRemoveDataBinding("}");
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import org.apache.commons.lang.builder.ToStringBuilder;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,56 +1,72 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.MethodDescriptor;
-
-public class EventHandler {
-
- private String eventId;
- private String objectCode;
- private ClassDescriptor listenerClass;
- private MethodDescriptor addMethod;
- private MethodDescriptor listenerMethod;
- private String javaCode;
-
- public EventHandler(String eventId, String objectCode, MethodDescriptor addMethod, ClassDescriptor listenerClass, MethodDescriptor listenerMethod, String javaCode) {
- this.eventId = eventId;
- this.objectCode = objectCode;
- this.addMethod = addMethod;
- this.listenerClass = listenerClass;
- this.listenerMethod = listenerMethod;
- this.javaCode = javaCode;
- }
-
- public String getEventId() {
- return eventId;
- }
-
- public String getObjectCode() {
- return objectCode;
- }
-
- public MethodDescriptor getAddMethod() {
- return addMethod;
- }
-
- public ClassDescriptor getListenerClass() {
- return listenerClass;
- }
-
- public MethodDescriptor getListenerMethod() {
- return listenerMethod;
- }
-
- public String getJavaCode() {
- return javaCode;
- }
-
- @Override
- public String toString() {
- return "EventHandler[" + eventId + ", " + listenerClass.getName() + ", " + objectCode + ", " + javaCode + "]";
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.MethodDescriptor;
+
+public class EventHandler {
+
+ private String eventId;
+ private String objectCode;
+ private ClassDescriptor listenerClass;
+ private MethodDescriptor addMethod;
+ private MethodDescriptor listenerMethod;
+ private String javaCode;
+
+ public EventHandler(String eventId, String objectCode, MethodDescriptor addMethod, ClassDescriptor listenerClass, MethodDescriptor listenerMethod, String javaCode) {
+ this.eventId = eventId;
+ this.objectCode = objectCode;
+ this.addMethod = addMethod;
+ this.listenerClass = listenerClass;
+ this.listenerMethod = listenerMethod;
+ this.javaCode = javaCode;
+ }
+
+ public String getEventId() {
+ return eventId;
+ }
+
+ public String getObjectCode() {
+ return objectCode;
+ }
+
+ public MethodDescriptor getAddMethod() {
+ return addMethod;
+ }
+
+ public ClassDescriptor getListenerClass() {
+ return listenerClass;
+ }
+
+ public MethodDescriptor getListenerMethod() {
+ return listenerMethod;
+ }
+
+ public String getJavaCode() {
+ return javaCode;
+ }
+
+ @Override
+ public String toString() {
+ return "EventHandler[" + eventId + ", " + listenerClass.getName() + ", " + objectCode + ", " + javaCode + "]";
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import org.apache.commons.logging.Log;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.compiler;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import jaxx.compiler.java.JavaFile;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import jaxx.compiler.java.JavaFileGenerator;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import java.util.Arrays;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import jaxx.compiler.reflect.FieldDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,47 +1,63 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-/**
- * Thrown by <code>TagHandler</code> when an unsupported attribute is encountered.
- *
- * @see jaxx.compiler.tags.TagHandler
- */
-public class UnsupportedAttributeException extends CompilerException {
-
- private static final long serialVersionUID = -6919583037172920343L;
-
- /** Creates a new <code>UnsupportedAttributeException</code>. */
- public UnsupportedAttributeException() {
- }
-
- /**
- * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message.
- *
- * @param msg the exception's detail message
- */
- public UnsupportedAttributeException(String msg) {
- super(msg);
- }
-
- /**
- * Creates a new <code>UnsupportedAttributeException</code> with the specified cause.
- *
- * @param initCause the exception's initCause
- */
- public UnsupportedAttributeException(Throwable initCause) {
- super(initCause);
- }
-
- /**
- * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message and cause.
- *
- * @param msg the exception's detail message
- * @param initCause the exception's initCause
- */
- public UnsupportedAttributeException(String msg, Throwable initCause) {
- super(msg, initCause);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler;
+
+/**
+ * Thrown by <code>TagHandler</code> when an unsupported attribute is encountered.
+ *
+ * @see jaxx.compiler.tags.TagHandler
+ */
+public class UnsupportedAttributeException extends CompilerException {
+
+ private static final long serialVersionUID = -6919583037172920343L;
+
+ /** Creates a new <code>UnsupportedAttributeException</code>. */
+ public UnsupportedAttributeException() {
+ }
+
+ /**
+ * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message.
+ *
+ * @param msg the exception's detail message
+ */
+ public UnsupportedAttributeException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Creates a new <code>UnsupportedAttributeException</code> with the specified cause.
+ *
+ * @param initCause the exception's initCause
+ */
+ public UnsupportedAttributeException(Throwable initCause) {
+ super(initCause);
+ }
+
+ /**
+ * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message and cause.
+ *
+ * @param msg the exception's detail message
+ * @param initCause the exception's initCause
+ */
+ public UnsupportedAttributeException(String msg, Throwable initCause) {
+ super(msg, initCause);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,45 +1,61 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-/** Thrown by the compiler when an unregistered tag is encountered. */
-public class UnsupportedTagException extends CompilerException {
- private static final long serialVersionUID = 3199732135804426699L;
-
- /** Creates a new <code>UnsupportedTagException</code>. */
- public UnsupportedTagException() {
- }
-
-
- /**
- * Creates a new <code>UnsupportedTagException</code> with the specified detail message.
- *
- * @param msg the exception's detail message
- */
- public UnsupportedTagException(String msg) {
- super(msg);
- }
-
-
- /**
- * Creates a new <code>UnsupportedTagException</code> with the specified cause.
- *
- * @param initCause the exception's initCause
- */
- public UnsupportedTagException(Throwable initCause) {
- super(initCause);
- }
-
-
- /**
- * Creates a new <code>UnsupportedTagException</code> with the specified detail message and cause.
- *
- * @param msg the exception's detail message
- * @param initCause the exception's initCause
- */
- public UnsupportedTagException(String msg, Throwable initCause) {
- super(msg, initCause);
- }
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler;
+
+/** Thrown by the compiler when an unregistered tag is encountered. */
+public class UnsupportedTagException extends CompilerException {
+ private static final long serialVersionUID = 3199732135804426699L;
+
+ /** Creates a new <code>UnsupportedTagException</code>. */
+ public UnsupportedTagException() {
+ }
+
+
+ /**
+ * Creates a new <code>UnsupportedTagException</code> with the specified detail message.
+ *
+ * @param msg the exception's detail message
+ */
+ public UnsupportedTagException(String msg) {
+ super(msg);
+ }
+
+
+ /**
+ * Creates a new <code>UnsupportedTagException</code> with the specified cause.
+ *
+ * @param initCause the exception's initCause
+ */
+ public UnsupportedTagException(Throwable initCause) {
+ super(initCause);
+ }
+
+
+ /**
+ * Creates a new <code>UnsupportedTagException</code> with the specified detail message and cause.
+ *
+ * @param msg the exception's detail message
+ * @param initCause the exception's initCause
+ */
+ public UnsupportedTagException(String msg, Throwable initCause) {
+ super(msg, initCause);
+ }
}
\ No newline at end of file
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import java.beans.Introspector;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import jaxx.compiler.reflect.ClassDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import jaxx.compiler.reflect.ClassDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import jaxx.compiler.reflect.ClassDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import jaxx.compiler.reflect.ClassDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import jaxx.compiler.reflect.ClassDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import jaxx.compiler.CompilerException;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.css;
import jaxx.compiler.*;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParser.java */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserConstants.java */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserTokenManager.java */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. .\CSSParserTreeConstants.java */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. .\JJTCSSParserState.java */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. Node.java */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
package jaxx.compiler.css.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.decorators;
import jaxx.compiler.CompiledObject;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.decorators;
import jaxx.compiler.CompiledObject;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.decorators;
import jaxx.compiler.CompiledObject;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.finalizers;
import jaxx.compiler.JAXXCompilerFinalizer;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.finalizers;
import jaxx.compiler.java.JavaArgument;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.finalizers;
import jaxx.compiler.java.JavaArgument;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.java;
/**
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.java;
import java.lang.reflect.Modifier;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.java;
import java.lang.reflect.Modifier;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.java;
import java.lang.reflect.Modifier;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.java;
import java.io.PrintWriter;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.java;
import java.lang.reflect.Modifier;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. .\JJTJavaParserState.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.0 */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParser.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserConstants.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserTokenManager.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. ./JavaParserTreeConstants.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. Node.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
package jaxx.compiler.java.parser;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.reflect;
import jaxx.runtime.JAXXObjectDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.reflect;
import jaxx.compiler.CompilerException;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.reflect;
/**
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.reflect;
import jaxx.compiler.CompilerException;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.reflect;
/**
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.reflect;
import jaxx.compiler.JAXXCompiler;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,23 +1,39 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.script;
-
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-
-/**
- * A dummy CompiledObject which serves to initialize scripted field. This is handled by
- * a CompiledObject rather than (say) simply inlining the initialization code in order to
- * ensure that the field is initialized in document order.
- */
-public class ScriptInitializer extends CompiledObject {
-
- public ScriptInitializer(String initializer, JAXXCompiler compiler) {
- super(compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class)),
- ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class), compiler, false);
- appendInitializationCode(initializer);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.script;
+
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+
+/**
+ * A dummy CompiledObject which serves to initialize scripted field. This is handled by
+ * a CompiledObject rather than (say) simply inlining the initialization code in order to
+ * ensure that the field is initialized in document order.
+ */
+public class ScriptInitializer extends CompiledObject {
+
+ public ScriptInitializer(String initializer, JAXXCompiler compiler) {
+ super(compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class)),
+ ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class), compiler, false);
+ appendInitializationCode(initializer);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.script;
import jaxx.compiler.*;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,203 +1,219 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.spi;
-
-import java.awt.Component;
-import javax.swing.JCheckBox;
-import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JEditorPane;
-import javax.swing.JFormattedTextField;
-import javax.swing.JFrame;
-import javax.swing.JInternalFrame;
-import javax.swing.JList;
-import javax.swing.JMenu;
-import javax.swing.JPasswordField;
-import javax.swing.JPopupMenu;
-import javax.swing.JProgressBar;
-import javax.swing.JRadioButton;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.JScrollPane;
-import javax.swing.JSlider;
-import javax.swing.JSpinner;
-import javax.swing.JSplitPane;
-import javax.swing.JTabbedPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-import javax.swing.JTextPane;
-import javax.swing.JToggleButton;
-import javax.swing.JToolBar;
-import javax.swing.JTree;
-import javax.swing.JWindow;
-import javax.swing.text.JTextComponent;
-
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.beans.BeanInfoUtil;
-
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-
-import jaxx.compiler.tags.DefaultComponentHandler;
-import jaxx.compiler.tags.DefaultObjectHandler;
-import jaxx.compiler.tags.ScriptHandler;
-import jaxx.compiler.tags.StyleHandler;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.compiler.tags.TagManager;
-import jaxx.compiler.tags.swing.ApplicationHandler;
-import jaxx.compiler.tags.swing.CellHandler;
-import jaxx.compiler.tags.swing.ItemHandler;
-import jaxx.compiler.tags.swing.JAXXComboBoxHandler;
-import jaxx.compiler.tags.swing.JAXXListHandler;
-import jaxx.compiler.tags.swing.JAXXTabHandler;
-import jaxx.compiler.tags.swing.JAXXTreeHandler;
-import jaxx.compiler.tags.swing.JCheckBoxHandler;
-import jaxx.compiler.tags.swing.JComboBoxHandler;
-import jaxx.compiler.tags.swing.JInternalFrameHandler;
-import jaxx.compiler.tags.swing.JListHandler;
-import jaxx.compiler.tags.swing.JMenuHandler;
-import jaxx.compiler.tags.swing.JPasswordFieldHandler;
-import jaxx.compiler.tags.swing.JPopupMenuHandler;
-import jaxx.compiler.tags.swing.JProgressBarHandler;
-import jaxx.compiler.tags.swing.JRadioButtonHandler;
-import jaxx.compiler.tags.swing.JScrollPaneHandler;
-import jaxx.compiler.tags.swing.JSliderHandler;
-import jaxx.compiler.tags.swing.JSpinnerHandler;
-import jaxx.compiler.tags.swing.JSplitPaneHandler;
-import jaxx.compiler.tags.swing.JTabbedPaneHandler;
-import jaxx.compiler.tags.swing.JTextComponentHandler;
-import jaxx.compiler.tags.swing.JToolBarHandler;
-import jaxx.compiler.tags.swing.JTreeHandler;
-import jaxx.compiler.tags.swing.JWindowHandler;
-import jaxx.compiler.tags.swing.RowHandler;
-import jaxx.compiler.tags.swing.TabHandler;
-import jaxx.compiler.tags.swing.TableHandler;
-import jaxx.compiler.tags.validator.BeanValidatorHandler;
-import jaxx.compiler.tags.validator.ExcludeFieldValidatorHandler;
-import jaxx.compiler.tags.validator.FieldValidatorHandler;
-
-
-import jaxx.runtime.swing.Application;
-import jaxx.runtime.swing.JAXXButtonGroup;
-import jaxx.runtime.swing.JAXXComboBox;
-import jaxx.runtime.swing.JAXXList;
-import jaxx.runtime.swing.JAXXTab;
-import jaxx.runtime.swing.JAXXTree;
-import jaxx.runtime.swing.Table;
-import jaxx.runtime.swing.editor.EnumEditor;
-import jaxx.runtime.swing.editor.LocaleEditor;
-import jaxx.runtime.validator.swing.SwingValidator;
-
-/**
- * Initializes support provided from JAXX (java, swing and validation).
- *
- */
-public class DefaultInitializer implements Initializer {
-
- @Override
- public void initialize() {
-
- BeanInfoUtil.addJaxxBeanInfoPath("jaxx.runtime.swing");
-
- registerDefaultNamespace("javax.swing.*",
- JEditorPane.class,
- JFormattedTextField.class,
- JPasswordField.class,
- JTextArea.class,
- JTextField.class,
- JTextPane.class);
-
- //
- // Register tags
- //
-
- registerTag(JAXXCompiler.JAXX_NAMESPACE, "script", new ScriptHandler());
- registerTag(JAXXCompiler.JAXX_NAMESPACE, "style", new StyleHandler());
-
- //TC-20091005 why the namespace was on awt ? ButtonGroup is from javax.swing
- registerTag("javax.swing.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class)));
-// TagManager.registerTag("java.awt.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class)));
-
- registerTag(JAXXCompiler.JAXX_NAMESPACE, "tab", new TabHandler());
- registerTag(JAXXCompiler.JAXX_NAMESPACE, "row", new RowHandler());
- registerTag(JAXXCompiler.JAXX_NAMESPACE, "cell", new CellHandler());
- registerTag(JAXXCompiler.JAXX_NAMESPACE, "item", new ItemHandler());
-
-
- registerTag(JAXXCompiler.JAXX_NAMESPACE, BeanValidatorHandler.TAG, new BeanValidatorHandler(ClassDescriptorLoader.getClassDescriptor(SwingValidator.class)));
- registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHandler.TAG, new FieldValidatorHandler());
- registerTag(JAXXCompiler.JAXX_NAMESPACE, ExcludeFieldValidatorHandler.TAG, new FieldValidatorHandler());
-
- //
- // Register beans
- //
-
- registerBean(Object.class, DefaultObjectHandler.class);
- registerBean(Component.class, DefaultComponentHandler.class);
-
- // check boxes
- registerBean(JCheckBox.class, JCheckBoxHandler.class);
- registerBean(JCheckBoxMenuItem.class, JCheckBoxHandler.class);
-
- // combo boxes
- registerBean(JComboBox.class, JComboBoxHandler.class);
- registerBean(EnumEditor.class, JComboBoxHandler.class);
- registerBean(LocaleEditor.class, JComboBoxHandler.class);
- registerBean(JAXXComboBox.class, JAXXComboBoxHandler.class);
-
- // radio boxes
- registerBean(JRadioButton.class, JRadioButtonHandler.class);
- registerBean(JRadioButtonMenuItem.class, JRadioButtonHandler.class);
- registerBean(JToggleButton.class, JRadioButtonHandler.class);
-
- // Lists
- registerBean(JList.class, JListHandler.class);
- registerBean(JAXXList.class, JAXXListHandler.class);
-
- // Trees
- registerBean(JTree.class, JTreeHandler.class);
- registerBean(JAXXTree.class, JAXXTreeHandler.class);
-
- // Windows
- registerBean(JDialog.class, JWindowHandler.class);
- registerBean(JFrame.class, JWindowHandler.class);
- registerBean(JWindow.class, JWindowHandler.class);
-
- registerBean(Application.class, ApplicationHandler.class);
-
- registerBean(JInternalFrame.class, JInternalFrameHandler.class);
- registerBean(JMenu.class, JMenuHandler.class);
- registerBean(JPasswordField.class, JPasswordFieldHandler.class);
- registerBean(JPopupMenu.class, JPopupMenuHandler.class);
- registerBean(JProgressBar.class, JProgressBarHandler.class);
- registerBean(JScrollPane.class, JScrollPaneHandler.class);
- registerBean(JSlider.class, JSliderHandler.class);
- registerBean(JSpinner.class, JSpinnerHandler.class);
- registerBean(JSplitPane.class, JSplitPaneHandler.class);
- registerBean(JTabbedPane.class, JTabbedPaneHandler.class);
- registerBean(JTextComponent.class, JTextComponentHandler.class);
- registerBean(JToolBar.class, JToolBarHandler.class);
-
- registerBean(Table.class, TableHandler.class);
- registerBean(JAXXTab.class, JAXXTabHandler.class);
-
- registerBean(SwingValidator.class, BeanValidatorHandler.class);
-
- }
-
- protected void registerBean(Class<?> beanClass, Class<? extends TagHandler> handlerClass) {
- TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(beanClass), handlerClass);
- }
-
- protected void registerTag(String namespace, String tagName, TagHandler handler) {
- TagManager.registerTag(namespace, tagName, handler);
- }
-
- protected void registerDefaultNamespace(String namespace, Class<?>... beanClass) {
-
- for (Class<?> c : beanClass) {
- TagManager.registerDefaultNamespace(c.getSimpleName(), namespace);
- }
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.spi;
+
+import java.awt.Component;
+import javax.swing.JCheckBox;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JFormattedTextField;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JList;
+import javax.swing.JMenu;
+import javax.swing.JPasswordField;
+import javax.swing.JPopupMenu;
+import javax.swing.JProgressBar;
+import javax.swing.JRadioButton;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JScrollPane;
+import javax.swing.JSlider;
+import javax.swing.JSpinner;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.JToggleButton;
+import javax.swing.JToolBar;
+import javax.swing.JTree;
+import javax.swing.JWindow;
+import javax.swing.text.JTextComponent;
+
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.beans.BeanInfoUtil;
+
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+
+import jaxx.compiler.tags.DefaultComponentHandler;
+import jaxx.compiler.tags.DefaultObjectHandler;
+import jaxx.compiler.tags.ScriptHandler;
+import jaxx.compiler.tags.StyleHandler;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.compiler.tags.TagManager;
+import jaxx.compiler.tags.swing.ApplicationHandler;
+import jaxx.compiler.tags.swing.CellHandler;
+import jaxx.compiler.tags.swing.ItemHandler;
+import jaxx.compiler.tags.swing.JAXXComboBoxHandler;
+import jaxx.compiler.tags.swing.JAXXListHandler;
+import jaxx.compiler.tags.swing.JAXXTabHandler;
+import jaxx.compiler.tags.swing.JAXXTreeHandler;
+import jaxx.compiler.tags.swing.JCheckBoxHandler;
+import jaxx.compiler.tags.swing.JComboBoxHandler;
+import jaxx.compiler.tags.swing.JInternalFrameHandler;
+import jaxx.compiler.tags.swing.JListHandler;
+import jaxx.compiler.tags.swing.JMenuHandler;
+import jaxx.compiler.tags.swing.JPasswordFieldHandler;
+import jaxx.compiler.tags.swing.JPopupMenuHandler;
+import jaxx.compiler.tags.swing.JProgressBarHandler;
+import jaxx.compiler.tags.swing.JRadioButtonHandler;
+import jaxx.compiler.tags.swing.JScrollPaneHandler;
+import jaxx.compiler.tags.swing.JSliderHandler;
+import jaxx.compiler.tags.swing.JSpinnerHandler;
+import jaxx.compiler.tags.swing.JSplitPaneHandler;
+import jaxx.compiler.tags.swing.JTabbedPaneHandler;
+import jaxx.compiler.tags.swing.JTextComponentHandler;
+import jaxx.compiler.tags.swing.JToolBarHandler;
+import jaxx.compiler.tags.swing.JTreeHandler;
+import jaxx.compiler.tags.swing.JWindowHandler;
+import jaxx.compiler.tags.swing.RowHandler;
+import jaxx.compiler.tags.swing.TabHandler;
+import jaxx.compiler.tags.swing.TableHandler;
+import jaxx.compiler.tags.validator.BeanValidatorHandler;
+import jaxx.compiler.tags.validator.ExcludeFieldValidatorHandler;
+import jaxx.compiler.tags.validator.FieldValidatorHandler;
+
+
+import jaxx.runtime.swing.Application;
+import jaxx.runtime.swing.JAXXButtonGroup;
+import jaxx.runtime.swing.JAXXComboBox;
+import jaxx.runtime.swing.JAXXList;
+import jaxx.runtime.swing.JAXXTab;
+import jaxx.runtime.swing.JAXXTree;
+import jaxx.runtime.swing.Table;
+import jaxx.runtime.swing.editor.EnumEditor;
+import jaxx.runtime.swing.editor.LocaleEditor;
+import jaxx.runtime.validator.swing.SwingValidator;
+
+/**
+ * Initializes support provided from JAXX (java, swing and validation).
+ *
+ */
+public class DefaultInitializer implements Initializer {
+
+ @Override
+ public void initialize() {
+
+ BeanInfoUtil.addJaxxBeanInfoPath("jaxx.runtime.swing");
+
+ registerDefaultNamespace("javax.swing.*",
+ JEditorPane.class,
+ JFormattedTextField.class,
+ JPasswordField.class,
+ JTextArea.class,
+ JTextField.class,
+ JTextPane.class);
+
+ //
+ // Register tags
+ //
+
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, "script", new ScriptHandler());
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, "style", new StyleHandler());
+
+ //TC-20091005 why the namespace was on awt ? ButtonGroup is from javax.swing
+ registerTag("javax.swing.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class)));
+// TagManager.registerTag("java.awt.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class)));
+
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, "tab", new TabHandler());
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, "row", new RowHandler());
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, "cell", new CellHandler());
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, "item", new ItemHandler());
+
+
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, BeanValidatorHandler.TAG, new BeanValidatorHandler(ClassDescriptorLoader.getClassDescriptor(SwingValidator.class)));
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHandler.TAG, new FieldValidatorHandler());
+ registerTag(JAXXCompiler.JAXX_NAMESPACE, ExcludeFieldValidatorHandler.TAG, new FieldValidatorHandler());
+
+ //
+ // Register beans
+ //
+
+ registerBean(Object.class, DefaultObjectHandler.class);
+ registerBean(Component.class, DefaultComponentHandler.class);
+
+ // check boxes
+ registerBean(JCheckBox.class, JCheckBoxHandler.class);
+ registerBean(JCheckBoxMenuItem.class, JCheckBoxHandler.class);
+
+ // combo boxes
+ registerBean(JComboBox.class, JComboBoxHandler.class);
+ registerBean(EnumEditor.class, JComboBoxHandler.class);
+ registerBean(LocaleEditor.class, JComboBoxHandler.class);
+ registerBean(JAXXComboBox.class, JAXXComboBoxHandler.class);
+
+ // radio boxes
+ registerBean(JRadioButton.class, JRadioButtonHandler.class);
+ registerBean(JRadioButtonMenuItem.class, JRadioButtonHandler.class);
+ registerBean(JToggleButton.class, JRadioButtonHandler.class);
+
+ // Lists
+ registerBean(JList.class, JListHandler.class);
+ registerBean(JAXXList.class, JAXXListHandler.class);
+
+ // Trees
+ registerBean(JTree.class, JTreeHandler.class);
+ registerBean(JAXXTree.class, JAXXTreeHandler.class);
+
+ // Windows
+ registerBean(JDialog.class, JWindowHandler.class);
+ registerBean(JFrame.class, JWindowHandler.class);
+ registerBean(JWindow.class, JWindowHandler.class);
+
+ registerBean(Application.class, ApplicationHandler.class);
+
+ registerBean(JInternalFrame.class, JInternalFrameHandler.class);
+ registerBean(JMenu.class, JMenuHandler.class);
+ registerBean(JPasswordField.class, JPasswordFieldHandler.class);
+ registerBean(JPopupMenu.class, JPopupMenuHandler.class);
+ registerBean(JProgressBar.class, JProgressBarHandler.class);
+ registerBean(JScrollPane.class, JScrollPaneHandler.class);
+ registerBean(JSlider.class, JSliderHandler.class);
+ registerBean(JSpinner.class, JSpinnerHandler.class);
+ registerBean(JSplitPane.class, JSplitPaneHandler.class);
+ registerBean(JTabbedPane.class, JTabbedPaneHandler.class);
+ registerBean(JTextComponent.class, JTextComponentHandler.class);
+ registerBean(JToolBar.class, JToolBarHandler.class);
+
+ registerBean(Table.class, TableHandler.class);
+ registerBean(JAXXTab.class, JAXXTabHandler.class);
+
+ registerBean(SwingValidator.class, BeanValidatorHandler.class);
+
+ }
+
+ protected void registerBean(Class<?> beanClass, Class<? extends TagHandler> handlerClass) {
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(beanClass), handlerClass);
+ }
+
+ protected void registerTag(String namespace, String tagName, TagHandler handler) {
+ TagManager.registerTag(namespace, tagName, handler);
+ }
+
+ protected void registerDefaultNamespace(String namespace, Class<?>... beanClass) {
+
+ for (Class<?> c : beanClass) {
+ TagManager.registerDefaultNamespace(c.getSimpleName(), namespace);
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.spi;
/**
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,347 +1,363 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.UnsupportedAttributeException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.I18nHelper;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.event.ComponentListener;
-import java.awt.event.ContainerListener;
-import java.awt.event.FocusListener;
-import java.beans.IntrospectionException;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import jaxx.runtime.Util;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-
-public class DefaultComponentHandler extends DefaultObjectHandler {
-
- public static final String ACTION_ICON_ATTRIBUTE = "actionIcon";
- public static final String CONTAINER_DELEGATE_ATTRIBUTE = "containerDelegate";
- public static final String FONT_FACE_ATTRIBUTE = "font-face";
- public static final String FONT_SIZE_ATTRIBUTE = "font-size";
- public static final String FONT_STYLE_ATTRIBUTE = "font-style";
- public static final String FONT_WEIGHT_ATTRIBUTE = "font-weight";
- public static final String HEIGHT_ATTRIBUTE = "height";
- public static final String ICON_ATTRIBUTE = "icon";
- public static final String NAME_ATTRIBUTE = "name";
- public static final String WIDTH_ATTRIBUTE = "width";
- public static final String X_ATTRIBUTE = "x";
- public static final String Y_ATTRIBUTE = "y";
- /**
- * Logger
- */
- protected static final Log log = LogFactory.getLog(DefaultComponentHandler.class);
- /**
- * container delegate (if any)
- */
- private String containerDelegate;
-
- public DefaultComponentHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Component.class);
- }
-
- @Override
- protected void init() throws IntrospectionException {
- if (jaxxBeanInfo == null) {
- super.init();
-
- containerDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE);
- if (containerDelegate == null && ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass().getSuperclass())) {
- containerDelegate = ((DefaultComponentHandler) TagManager.getTagHandler(getBeanClass().getSuperclass())).getContainerDelegate();
- }
- }
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("hasFocus", FocusListener.class);
- addProxyEventInfo("isVisible", ComponentListener.class);
- addProxyEventInfo("getBounds", ComponentListener.class);
- addProxyEventInfo("getLocation", ComponentListener.class);
- addProxyEventInfo("getLocationOnScreen", ComponentListener.class);
- addProxyEventInfo("getSize", ComponentListener.class);
- addProxyEventInfo("getX", ComponentListener.class);
- addProxyEventInfo("getY", ComponentListener.class);
- addProxyEventInfo("getWidth", ComponentListener.class);
- addProxyEventInfo("getHeight", ComponentListener.class);
- if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass())) {
- addProxyEventInfo("getComponentCount", ContainerListener.class);
- }
- }
-
- @Override
- protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- super.setDefaults(object, tag, compiler);
- setAttribute(object, NAME_ATTRIBUTE, object.getId(), false, compiler);
- openComponent(object, tag, compiler);
- }
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- super.compileFirstPass(tag, compiler);
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- super.compileSecondPass(tag, compiler);
- closeComponent(compiler.getOpenComponent(), tag, compiler);
- }
-
- protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- String constraints = tag.getAttribute(CONSTRAINTS_ATTRIBUTE);
- if (constraints != null && constraints.length() > 0) {
- compiler.openComponent(object, constraints);
- } else {
- compiler.openComponent(object);
- }
- }
-
- protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- compiler.closeComponent(object);
- }
-
- @Override
- public boolean isPropertyInherited(String property) throws UnsupportedAttributeException {
- return property.equals("font") || property.startsWith("font-") || property.equals("foreground") || property.equals("enabled");
- }
-
- @Override
- public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException {
- if (propertyName.equals(X_ATTRIBUTE) ||
- propertyName.equals(Y_ATTRIBUTE) ||
- propertyName.equals(WIDTH_ATTRIBUTE) ||
- propertyName.equals(HEIGHT_ATTRIBUTE) ||
- FONT_SIZE_ATTRIBUTE.equals(propertyName)) {
- return ClassDescriptorLoader.getClassDescriptor(Integer.class);
- }
- if (propertyName.equals(FONT_FACE_ATTRIBUTE) ||
- propertyName.equals(FONT_STYLE_ATTRIBUTE) ||
- propertyName.equals(FONT_WEIGHT_ATTRIBUTE)) {
- return ClassDescriptorLoader.getClassDescriptor(String.class);
- }
- return super.getPropertyType(object, propertyName, compiler);
- }
-
- @Override
- public String getGetPropertyCode(String id, String name, JAXXCompiler compiler) throws CompilerException {
- if (name.equals(FONT_FACE_ATTRIBUTE)) {
- return id + ".getFont().getFontName()";
- }
- if (name.equals(FONT_SIZE_ATTRIBUTE)) {
- return id + ".getFont().getSize()";
- }
- if (name.equals(FONT_WEIGHT_ATTRIBUTE)) {
- return "(" + id + ".getFont().getStyle() & Font.BOLD) != 0 ? \"bold\" : \"normal\"";
- }
- if (name.equals(FONT_STYLE_ATTRIBUTE)) {
- return "(" + id + ".getFont().getStyle() & Font.ITALIC) != 0 ? \"italic\" : \"normal\"";
- }
- return super.getGetPropertyCode(id, name, compiler);
- }
-
- @Override
- public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException {
- if (name.equals(X_ATTRIBUTE)) {
- return id + ".setLocation(" + valueCode + ", " + id + ".getY());";
- }
- if (name.equals(Y_ATTRIBUTE)) {
- return id + ".setLocation(" + id + ".getX(), " + valueCode + ");";
- }
- if (name.equals(WIDTH_ATTRIBUTE)) {
- // need to optimize case when both width and height are being assigned
- return Util.class.getName() + ".setComponentWidth(" + id + "," + valueCode + ");";
- }
- if (name.equals(HEIGHT_ATTRIBUTE)) {
- return Util.class.getName() + ".setComponentHeight(" + id + "," + valueCode + ");";
- }
- if (name.equals(FONT_FACE_ATTRIBUTE)) {
- return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(new Font(" + valueCode + ", " + id + ".getFont().getStyle(), " + id + ".getFont().getSize()));\n}";
- }
- if (name.equals(FONT_SIZE_ATTRIBUTE)) {
- return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont((float) " + valueCode + "));\n}";
- }
- if (name.equals(FONT_WEIGHT_ATTRIBUTE)) {
- if (valueCode.equals("\"bold\"")) {
- return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n}";
- }
- if (valueCode.equals("\"normal\"")) {
- return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n}";
- }
- if (!valueCode.startsWith("\"")) {
- return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"bold\")) {\n " +
- id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n } else {\n " +
- id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n }\n}";
- }
- compiler.reportError("font-weight must be either \"normal\" or \"bold\", found " + valueCode);
- return "";
- }
- if (name.equals(FONT_STYLE_ATTRIBUTE)) {
- if (valueCode.equals("\"italic\"")) {
- return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n}";
- }
- if (valueCode.equals("\"normal\"")) {
- return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n}";
- }
- if (!valueCode.startsWith("\"")) {
- return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"italic\")) {\n " +
- id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n } else {\n " +
- id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n }\n}";
- }
- compiler.reportError("font-style must be either \"normal\" or \"italic\", found " + valueCode);
- return "";
- }
- if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass()) && name.equals(LAYOUT_ATTRIBUTE)) {
- // handle containerDelegate (e.g. contentPane on JFrame)
- String cDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE);
- if (cDelegate != null) {
- return id + '.' + cDelegate + "().setLayout(" + valueCode + ");";
- }
- }
- // ajout du support i18n
- if (I18nHelper.isI18nableAttribute(name, compiler)) {
- valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler);
- }
-
- return super.getSetPropertyCode(id, name, valueCode, compiler);
- }
-
- @Override
- public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) {
-
- if (propertyName.startsWith("_")) {
- // client property
- if (stringValue.startsWith("{")) {
- stringValue = stringValue.substring(1, stringValue.length() - 1);
- }
- object.addClientProperty(propertyName.substring(1), stringValue);
- //TC-20090327 rather not generating code here
- //object.appendAdditionCode(object.getJavaCode() + ".putClientProperty(\"" + propertyName.substring(1) + "\", " + stringValue + ");");
- return;
- }
- if (ICON_ATTRIBUTE.equals(propertyName)) {
- if (!(stringValue.startsWith("{") || stringValue.endsWith("}"))) {
- // this is a customized icon, add the icon creation code
- if (compiler.getConfiguration().isUseUIManagerForIcon()) {
- stringValue = "{" + Util.class.getName() + ".getUIManagerIcon(\"" + stringValue + "\")}";
- } else {
- stringValue = "{" + Util.class.getName() + ".createImageIcon(\"" + stringValue + "\")}";
- }
- }
- } else if (ACTION_ICON_ATTRIBUTE.equals(propertyName)) {
- // customized actionIcon property
- if (stringValue.startsWith("{") && stringValue.endsWith("}")) {
- // there is a script to define the action icon, this is forbidden
- compiler.reportError("the actionIcon does not support script, remove braces..., fix the file " + compiler.getOutputClassName());
- return;
- }
- propertyName = ICON_ATTRIBUTE;
- if (compiler.getConfiguration().isUseUIManagerForIcon()) {
- stringValue = "{" + Util.class.getName() + ".getUIManagerActionIcon(\"" + stringValue + "\")}";
- } else {
- stringValue = "{" + Util.class.getName() + ".createActionIcon(\"" + stringValue + "\")}";
- }
- }
- super.setAttribute(object, propertyName, stringValue, inline, compiler);
- }
-
- @Override
- protected void scanAttributesForDependencies(Element tag, JAXXCompiler compiler) {
- super.scanAttributesForDependencies(tag, compiler);
- // check for clientProperty attributes
- //FIXME make this works,... it seems jaxx compiler does not come here ?
- //FIXME see the the firstPassHandler in JAXXCompiler ?
- NamedNodeMap children = tag.getAttributes();
- for (int i = 0, max = children.getLength(); i < max; i++) {
- Attr attr = (Attr) children.item(i);
- String name = attr.getName();
- if (!name.startsWith("_")) {
- continue;
- }
- String value = attr.getValue();
- if (value.startsWith("{")) {
- compiler.reportWarning(tag, "an clientProperty attribute " + name.substring(1) + " does not required curly value but was : " + value, 0);
- }
- }
-
- }
-
- /**
- * Maps string values onto integers, so that int-valued enumeration properties can be specified by strings. For
- * example, when passed a key of 'alignment', this method should normally map the values 'left', 'center', and
- * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingConstants.RIGHT respectively.
- * <p/>
- * You do not normally need to call this method yourself; it is invoked by {@link #convertFromString} when an
- * int-valued property has a value which is not a valid number. By default, this method looks at the
- * <code>enumerationValues</code> value of the <code>JAXXPropertyDescriptor</code>.
- *
- * @param key the name of the int-typed property
- * @param value the non-numeric value that was specified for the property
- * @throws IllegalArgumentException if the property is an enumeration, but the value is not valid
- * @throws NumberFormatException if the property is not an enumeration
- */
- @Override
- protected int constantValue(String key, String value) {
- if ((key.equals(MNEMONIC_ATTRIBUTE) || key.equals(DISPLAYED_MNEMONIC_ATTRIBUTE))) {
- if (value.length() == 1) {
- return value.charAt(0);
- }
- try {
- Field vk = java.awt.event.KeyEvent.class.getField(value);
- return (Integer) vk.get(null);
- } catch (NoSuchFieldException e) {
- throw new IllegalArgumentException("mnemonics must be either a single character or the name of a field in KeyEvent (found: '" + value + "')");
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- }
- return super.constantValue(key, value);
- }
-
- /**
- * Returns <code>true</code> if this component can contain other components. For children to be
- * allowed, the component must be a subclass of <code>Container</code> and its <code>JAXXBeanInfo</code>
- * must not have the value <code>false</code> for its <code>isContainer</code> value.
- *
- * @return <code>true</code> if children are allowed
- */
- public boolean isContainer() {
- boolean container = ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass());
- if (container) {
- try {
- init();
- if (Boolean.FALSE.equals(getJAXXBeanInfo().getJAXXBeanDescriptor().getValue("isContainer"))) {
- container = false;
- }
- } catch (IntrospectionException e) {
- throw new RuntimeException(e);
- }
- }
- return container;
- }
-
- public String getContainerDelegate() {
- try {
- init();
- return containerDelegate;
- } catch (IntrospectionException e) {
- throw new RuntimeException(e);
- }
-
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.I18nHelper;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.event.ComponentListener;
+import java.awt.event.ContainerListener;
+import java.awt.event.FocusListener;
+import java.beans.IntrospectionException;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import jaxx.runtime.Util;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+
+public class DefaultComponentHandler extends DefaultObjectHandler {
+
+ public static final String ACTION_ICON_ATTRIBUTE = "actionIcon";
+ public static final String CONTAINER_DELEGATE_ATTRIBUTE = "containerDelegate";
+ public static final String FONT_FACE_ATTRIBUTE = "font-face";
+ public static final String FONT_SIZE_ATTRIBUTE = "font-size";
+ public static final String FONT_STYLE_ATTRIBUTE = "font-style";
+ public static final String FONT_WEIGHT_ATTRIBUTE = "font-weight";
+ public static final String HEIGHT_ATTRIBUTE = "height";
+ public static final String ICON_ATTRIBUTE = "icon";
+ public static final String NAME_ATTRIBUTE = "name";
+ public static final String WIDTH_ATTRIBUTE = "width";
+ public static final String X_ATTRIBUTE = "x";
+ public static final String Y_ATTRIBUTE = "y";
+ /**
+ * Logger
+ */
+ protected static final Log log = LogFactory.getLog(DefaultComponentHandler.class);
+ /**
+ * container delegate (if any)
+ */
+ private String containerDelegate;
+
+ public DefaultComponentHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Component.class);
+ }
+
+ @Override
+ protected void init() throws IntrospectionException {
+ if (jaxxBeanInfo == null) {
+ super.init();
+
+ containerDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE);
+ if (containerDelegate == null && ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass().getSuperclass())) {
+ containerDelegate = ((DefaultComponentHandler) TagManager.getTagHandler(getBeanClass().getSuperclass())).getContainerDelegate();
+ }
+ }
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("hasFocus", FocusListener.class);
+ addProxyEventInfo("isVisible", ComponentListener.class);
+ addProxyEventInfo("getBounds", ComponentListener.class);
+ addProxyEventInfo("getLocation", ComponentListener.class);
+ addProxyEventInfo("getLocationOnScreen", ComponentListener.class);
+ addProxyEventInfo("getSize", ComponentListener.class);
+ addProxyEventInfo("getX", ComponentListener.class);
+ addProxyEventInfo("getY", ComponentListener.class);
+ addProxyEventInfo("getWidth", ComponentListener.class);
+ addProxyEventInfo("getHeight", ComponentListener.class);
+ if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass())) {
+ addProxyEventInfo("getComponentCount", ContainerListener.class);
+ }
+ }
+
+ @Override
+ protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ super.setDefaults(object, tag, compiler);
+ setAttribute(object, NAME_ATTRIBUTE, object.getId(), false, compiler);
+ openComponent(object, tag, compiler);
+ }
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ super.compileFirstPass(tag, compiler);
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ super.compileSecondPass(tag, compiler);
+ closeComponent(compiler.getOpenComponent(), tag, compiler);
+ }
+
+ protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ String constraints = tag.getAttribute(CONSTRAINTS_ATTRIBUTE);
+ if (constraints != null && constraints.length() > 0) {
+ compiler.openComponent(object, constraints);
+ } else {
+ compiler.openComponent(object);
+ }
+ }
+
+ protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ compiler.closeComponent(object);
+ }
+
+ @Override
+ public boolean isPropertyInherited(String property) throws UnsupportedAttributeException {
+ return property.equals("font") || property.startsWith("font-") || property.equals("foreground") || property.equals("enabled");
+ }
+
+ @Override
+ public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException {
+ if (propertyName.equals(X_ATTRIBUTE) ||
+ propertyName.equals(Y_ATTRIBUTE) ||
+ propertyName.equals(WIDTH_ATTRIBUTE) ||
+ propertyName.equals(HEIGHT_ATTRIBUTE) ||
+ FONT_SIZE_ATTRIBUTE.equals(propertyName)) {
+ return ClassDescriptorLoader.getClassDescriptor(Integer.class);
+ }
+ if (propertyName.equals(FONT_FACE_ATTRIBUTE) ||
+ propertyName.equals(FONT_STYLE_ATTRIBUTE) ||
+ propertyName.equals(FONT_WEIGHT_ATTRIBUTE)) {
+ return ClassDescriptorLoader.getClassDescriptor(String.class);
+ }
+ return super.getPropertyType(object, propertyName, compiler);
+ }
+
+ @Override
+ public String getGetPropertyCode(String id, String name, JAXXCompiler compiler) throws CompilerException {
+ if (name.equals(FONT_FACE_ATTRIBUTE)) {
+ return id + ".getFont().getFontName()";
+ }
+ if (name.equals(FONT_SIZE_ATTRIBUTE)) {
+ return id + ".getFont().getSize()";
+ }
+ if (name.equals(FONT_WEIGHT_ATTRIBUTE)) {
+ return "(" + id + ".getFont().getStyle() & Font.BOLD) != 0 ? \"bold\" : \"normal\"";
+ }
+ if (name.equals(FONT_STYLE_ATTRIBUTE)) {
+ return "(" + id + ".getFont().getStyle() & Font.ITALIC) != 0 ? \"italic\" : \"normal\"";
+ }
+ return super.getGetPropertyCode(id, name, compiler);
+ }
+
+ @Override
+ public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException {
+ if (name.equals(X_ATTRIBUTE)) {
+ return id + ".setLocation(" + valueCode + ", " + id + ".getY());";
+ }
+ if (name.equals(Y_ATTRIBUTE)) {
+ return id + ".setLocation(" + id + ".getX(), " + valueCode + ");";
+ }
+ if (name.equals(WIDTH_ATTRIBUTE)) {
+ // need to optimize case when both width and height are being assigned
+ return Util.class.getName() + ".setComponentWidth(" + id + "," + valueCode + ");";
+ }
+ if (name.equals(HEIGHT_ATTRIBUTE)) {
+ return Util.class.getName() + ".setComponentHeight(" + id + "," + valueCode + ");";
+ }
+ if (name.equals(FONT_FACE_ATTRIBUTE)) {
+ return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(new Font(" + valueCode + ", " + id + ".getFont().getStyle(), " + id + ".getFont().getSize()));\n}";
+ }
+ if (name.equals(FONT_SIZE_ATTRIBUTE)) {
+ return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont((float) " + valueCode + "));\n}";
+ }
+ if (name.equals(FONT_WEIGHT_ATTRIBUTE)) {
+ if (valueCode.equals("\"bold\"")) {
+ return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n}";
+ }
+ if (valueCode.equals("\"normal\"")) {
+ return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n}";
+ }
+ if (!valueCode.startsWith("\"")) {
+ return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"bold\")) {\n " +
+ id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n } else {\n " +
+ id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n }\n}";
+ }
+ compiler.reportError("font-weight must be either \"normal\" or \"bold\", found " + valueCode);
+ return "";
+ }
+ if (name.equals(FONT_STYLE_ATTRIBUTE)) {
+ if (valueCode.equals("\"italic\"")) {
+ return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n}";
+ }
+ if (valueCode.equals("\"normal\"")) {
+ return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n}";
+ }
+ if (!valueCode.startsWith("\"")) {
+ return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"italic\")) {\n " +
+ id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n } else {\n " +
+ id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n }\n}";
+ }
+ compiler.reportError("font-style must be either \"normal\" or \"italic\", found " + valueCode);
+ return "";
+ }
+ if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass()) && name.equals(LAYOUT_ATTRIBUTE)) {
+ // handle containerDelegate (e.g. contentPane on JFrame)
+ String cDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE);
+ if (cDelegate != null) {
+ return id + '.' + cDelegate + "().setLayout(" + valueCode + ");";
+ }
+ }
+ // ajout du support i18n
+ if (I18nHelper.isI18nableAttribute(name, compiler)) {
+ valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler);
+ }
+
+ return super.getSetPropertyCode(id, name, valueCode, compiler);
+ }
+
+ @Override
+ public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) {
+
+ if (propertyName.startsWith("_")) {
+ // client property
+ if (stringValue.startsWith("{")) {
+ stringValue = stringValue.substring(1, stringValue.length() - 1);
+ }
+ object.addClientProperty(propertyName.substring(1), stringValue);
+ //TC-20090327 rather not generating code here
+ //object.appendAdditionCode(object.getJavaCode() + ".putClientProperty(\"" + propertyName.substring(1) + "\", " + stringValue + ");");
+ return;
+ }
+ if (ICON_ATTRIBUTE.equals(propertyName)) {
+ if (!(stringValue.startsWith("{") || stringValue.endsWith("}"))) {
+ // this is a customized icon, add the icon creation code
+ if (compiler.getConfiguration().isUseUIManagerForIcon()) {
+ stringValue = "{" + Util.class.getName() + ".getUIManagerIcon(\"" + stringValue + "\")}";
+ } else {
+ stringValue = "{" + Util.class.getName() + ".createImageIcon(\"" + stringValue + "\")}";
+ }
+ }
+ } else if (ACTION_ICON_ATTRIBUTE.equals(propertyName)) {
+ // customized actionIcon property
+ if (stringValue.startsWith("{") && stringValue.endsWith("}")) {
+ // there is a script to define the action icon, this is forbidden
+ compiler.reportError("the actionIcon does not support script, remove braces..., fix the file " + compiler.getOutputClassName());
+ return;
+ }
+ propertyName = ICON_ATTRIBUTE;
+ if (compiler.getConfiguration().isUseUIManagerForIcon()) {
+ stringValue = "{" + Util.class.getName() + ".getUIManagerActionIcon(\"" + stringValue + "\")}";
+ } else {
+ stringValue = "{" + Util.class.getName() + ".createActionIcon(\"" + stringValue + "\")}";
+ }
+ }
+ super.setAttribute(object, propertyName, stringValue, inline, compiler);
+ }
+
+ @Override
+ protected void scanAttributesForDependencies(Element tag, JAXXCompiler compiler) {
+ super.scanAttributesForDependencies(tag, compiler);
+ // check for clientProperty attributes
+ //FIXME make this works,... it seems jaxx compiler does not come here ?
+ //FIXME see the the firstPassHandler in JAXXCompiler ?
+ NamedNodeMap children = tag.getAttributes();
+ for (int i = 0, max = children.getLength(); i < max; i++) {
+ Attr attr = (Attr) children.item(i);
+ String name = attr.getName();
+ if (!name.startsWith("_")) {
+ continue;
+ }
+ String value = attr.getValue();
+ if (value.startsWith("{")) {
+ compiler.reportWarning(tag, "an clientProperty attribute " + name.substring(1) + " does not required curly value but was : " + value, 0);
+ }
+ }
+
+ }
+
+ /**
+ * Maps string values onto integers, so that int-valued enumeration properties can be specified by strings. For
+ * example, when passed a key of 'alignment', this method should normally map the values 'left', 'center', and
+ * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingConstants.RIGHT respectively.
+ * <p/>
+ * You do not normally need to call this method yourself; it is invoked by {@link #convertFromString} when an
+ * int-valued property has a value which is not a valid number. By default, this method looks at the
+ * <code>enumerationValues</code> value of the <code>JAXXPropertyDescriptor</code>.
+ *
+ * @param key the name of the int-typed property
+ * @param value the non-numeric value that was specified for the property
+ * @throws IllegalArgumentException if the property is an enumeration, but the value is not valid
+ * @throws NumberFormatException if the property is not an enumeration
+ */
+ @Override
+ protected int constantValue(String key, String value) {
+ if ((key.equals(MNEMONIC_ATTRIBUTE) || key.equals(DISPLAYED_MNEMONIC_ATTRIBUTE))) {
+ if (value.length() == 1) {
+ return value.charAt(0);
+ }
+ try {
+ Field vk = java.awt.event.KeyEvent.class.getField(value);
+ return (Integer) vk.get(null);
+ } catch (NoSuchFieldException e) {
+ throw new IllegalArgumentException("mnemonics must be either a single character or the name of a field in KeyEvent (found: '" + value + "')");
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return super.constantValue(key, value);
+ }
+
+ /**
+ * Returns <code>true</code> if this component can contain other components. For children to be
+ * allowed, the component must be a subclass of <code>Container</code> and its <code>JAXXBeanInfo</code>
+ * must not have the value <code>false</code> for its <code>isContainer</code> value.
+ *
+ * @return <code>true</code> if children are allowed
+ */
+ public boolean isContainer() {
+ boolean container = ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass());
+ if (container) {
+ try {
+ init();
+ if (Boolean.FALSE.equals(getJAXXBeanInfo().getJAXXBeanDescriptor().getValue("isContainer"))) {
+ container = false;
+ }
+ } catch (IntrospectionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return container;
+ }
+
+ public String getContainerDelegate() {
+ try {
+ init();
+ return containerDelegate;
+ } catch (IntrospectionException e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.compiler.tags;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,85 +1,101 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.UnsupportedAttributeException;
-import jaxx.compiler.JAXXCompiler;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.StringWriter;
-
-/**
- * Handles the <code><script></code> tag.
- *
- * @author Ethan Nicholas
- */
-public class ScriptHandler implements TagHandler {
-
- public static final String SOURCE_ATTRIBUTE = "source";
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- File scriptFile = null;
- NamedNodeMap attributes = tag.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attribute = (Attr) attributes.item(i);
- String name = attribute.getName();
- String attrValue = attribute.getValue();
- if (name.equals(SOURCE_ATTRIBUTE)) {
- scriptFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar));
- StringWriter scriptBuffer = new StringWriter();
- try {
- FileReader in = new FileReader(scriptFile);
- char[] readBuffer = new char[2048];
- int c;
- while ((c = in.read(readBuffer)) > 0) {
- scriptBuffer.write(readBuffer, 0, c);
- }
- } catch (FileNotFoundException e) {
- compiler.reportError("script file not found: " + scriptFile);
- }
- compiler.registerScript(scriptBuffer.toString(), scriptFile);
- } else if (!name.startsWith(XMLNS_ATTRIBUTE) &&
- !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
- throw new UnsupportedAttributeException(name);
- }
- }
-
- StringBuffer script = new StringBuffer();
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- switch (child.getNodeType()) {
- case Node.ELEMENT_NODE:
- compiler.reportError("<script> tag may not contain child elements: " + tag);
- case Node.TEXT_NODE: // fall through
- case Node.CDATA_SECTION_NODE:
- script.append(((Text) child).getData());
- }
- }
-
- String scriptString = script.toString().trim();
- if (scriptString.length() > 0) {
- if (scriptFile != null) {
- compiler.reportError("<script> tag has both a source attribute and an inline script");
- }
- compiler.registerScript(script.toString());
- }
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.JAXXCompiler;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringWriter;
+
+/**
+ * Handles the <code><script></code> tag.
+ *
+ * @author Ethan Nicholas
+ */
+public class ScriptHandler implements TagHandler {
+
+ public static final String SOURCE_ATTRIBUTE = "source";
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ File scriptFile = null;
+ NamedNodeMap attributes = tag.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attribute = (Attr) attributes.item(i);
+ String name = attribute.getName();
+ String attrValue = attribute.getValue();
+ if (name.equals(SOURCE_ATTRIBUTE)) {
+ scriptFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar));
+ StringWriter scriptBuffer = new StringWriter();
+ try {
+ FileReader in = new FileReader(scriptFile);
+ char[] readBuffer = new char[2048];
+ int c;
+ while ((c = in.read(readBuffer)) > 0) {
+ scriptBuffer.write(readBuffer, 0, c);
+ }
+ } catch (FileNotFoundException e) {
+ compiler.reportError("script file not found: " + scriptFile);
+ }
+ compiler.registerScript(scriptBuffer.toString(), scriptFile);
+ } else if (!name.startsWith(XMLNS_ATTRIBUTE) &&
+ !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
+ throw new UnsupportedAttributeException(name);
+ }
+ }
+
+ StringBuffer script = new StringBuffer();
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ switch (child.getNodeType()) {
+ case Node.ELEMENT_NODE:
+ compiler.reportError("<script> tag may not contain child elements: " + tag);
+ case Node.TEXT_NODE: // fall through
+ case Node.CDATA_SECTION_NODE:
+ script.append(((Text) child).getData());
+ }
+ }
+
+ String scriptString = script.toString().trim();
+ if (scriptString.length() > 0) {
+ if (scriptFile != null) {
+ compiler.reportError("<script> tag has both a source attribute and an inline script");
+ }
+ compiler.registerScript(script.toString());
+ }
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,184 +1,200 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.UnsupportedAttributeException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.css.parser.CSSParser;
-import jaxx.compiler.css.parser.CSSParserConstants;
-import jaxx.compiler.css.parser.CSSParserTreeConstants;
-import jaxx.compiler.css.parser.SimpleNode;
-import jaxx.runtime.css.Rule;
-import jaxx.runtime.css.Selector;
-import jaxx.runtime.css.Stylesheet;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Handles the <code><style></code> tag.
- *
- * @author Ethan Nicholas
- */
-public class StyleHandler implements TagHandler {
- public static final String SOURCE_ATTRIBUTE = "source";
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- boolean source = false;
- NamedNodeMap attributes = tag.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attribute = (Attr) attributes.item(i);
- String name = attribute.getName();
- String attrValue = attribute.getValue();
- if (name.equals(SOURCE_ATTRIBUTE)) {
- source = true;
- File styleFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar));
- StringWriter styleBuffer = new StringWriter();
- try {
- FileReader in = new FileReader(styleFile);
- char[] readBuffer = new char[2048];
- int c;
- while ((c = in.read(readBuffer)) > 0) {
- styleBuffer.write(readBuffer, 0, c);
- }
- } catch (FileNotFoundException e) {
- compiler.reportError("stylesheet file not found: " + styleFile);
- }
- compiler.getSourceFiles().push(styleFile);
- compiler.registerStylesheet(processStylesheet(styleBuffer.toString()));
- compiler.getSourceFiles().pop();
- } else if (!name.startsWith(XMLNS_ATTRIBUTE) &&
- !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
- throw new UnsupportedAttributeException(name);
- }
- }
-
- StringBuffer style = new StringBuffer();
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- switch (child.getNodeType()) {
- case Node.ELEMENT_NODE:
- compiler.reportError("<style> tag may not contain child elements: " + tag);
- case Node.TEXT_NODE: // fall through
- case Node.CDATA_SECTION_NODE:
- style.append(((Text) child).getData());
- }
- }
-
- String styleString = style.toString().trim();
- if (styleString.length() > 0) {
- if (source) {
- compiler.reportError("<style> tag has both a source attribute and an inline stylesheet");
- }
- compiler.registerStylesheet(processStylesheet(style.toString()));
- }
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- }
-
- protected Selector processSelector(SimpleNode selector) {
- if (selector.getId() != CSSParserTreeConstants.JJTSELECTOR) {
- throw new IllegalArgumentException("argument node is not a Selector");
- }
- String javaClassName = null;
- String styleClass = null;
- String pseudoClass = null;
- String id = null;
-
- for (int i = 0; i < selector.jjtGetNumChildren(); i++) {
- SimpleNode child = selector.getChild(i);
- switch (child.getId()) {
- case CSSParserTreeConstants.JJTJAVACLASS:
- if (!child.getText().trim().equals("*")) {
- javaClassName = child.getText();
- }
- break;
- case CSSParserTreeConstants.JJTCLASS:
- styleClass = child.getText().substring(1);
- break;
- case CSSParserTreeConstants.JJTPSEUDOCLASS:
- pseudoClass = child.getText().substring(1);
- break;
- case CSSParserTreeConstants.JJTID:
- id = child.getText().substring(1);
- break;
-
- default:
- throw new IllegalStateException("unexpected child of Selector node, type=" + child.getId());
- }
- }
-
- return new Selector(javaClassName, styleClass, pseudoClass, id);
- }
-
- protected Rule processRule(SimpleNode ruleNode) {
- if (ruleNode.getId() != CSSParserTreeConstants.JJTRULE) {
- throw new IllegalArgumentException("argument node is not a Rule");
- }
- SimpleNode selectorsNode = ruleNode.getChild(0);
- assert selectorsNode.getId() == CSSParserTreeConstants.JJTSELECTORS : "expected node to be of type Selectors";
-
- List<Selector> selectors = new ArrayList<Selector>();
- for (int i = 0; i < selectorsNode.jjtGetNumChildren(); i++) {
- SimpleNode selectorNode = selectorsNode.getChild(i);
- selectors.add(processSelector(selectorNode));
- }
-
- Map<String, String> properties = new HashMap<String, String>();
- for (int i = 1; i < ruleNode.jjtGetNumChildren(); i++) {
- SimpleNode declarationNode = ruleNode.getChild(i);
- if (declarationNode.getId() == CSSParserTreeConstants.JJTDECLARATION) {
- String key = declarationNode.getChild(0).getText();
- SimpleNode valueNode = declarationNode.getChild(1);
- String value = valueNode.getText();
- if (valueNode.firstToken.kind == CSSParserConstants.STRING) {
- value = value.substring(1, value.length() - 1);
- }
- properties.put(key, value);
- }
- }
- Rule rule;
- rule = new Rule(selectors.toArray(new Selector[selectors.size()]), properties);
- return rule;
- }
-
- protected Stylesheet processStylesheet(String stylesheetText) throws CompilerException {
- CSSParser p = new CSSParser(new StringReader(stylesheetText));
- SimpleNode node;
- try {
- node = p.Stylesheet();
- } catch (Error e) {
- throw new CompilerException(e);
- }
- List<Rule> rules = new ArrayList<Rule>();
- for (int i = 0; i < node.jjtGetNumChildren(); i++) {
- SimpleNode ruleNode = node.getChild(i);
- Rule rule = processRule(ruleNode);
- rules.add(rule);
- }
- Stylesheet stylesheet;
- stylesheet = new Stylesheet(rules.toArray(new Rule[rules.size()]));
- return stylesheet;
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.css.parser.CSSParser;
+import jaxx.compiler.css.parser.CSSParserConstants;
+import jaxx.compiler.css.parser.CSSParserTreeConstants;
+import jaxx.compiler.css.parser.SimpleNode;
+import jaxx.runtime.css.Rule;
+import jaxx.runtime.css.Selector;
+import jaxx.runtime.css.Stylesheet;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Handles the <code><style></code> tag.
+ *
+ * @author Ethan Nicholas
+ */
+public class StyleHandler implements TagHandler {
+ public static final String SOURCE_ATTRIBUTE = "source";
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ boolean source = false;
+ NamedNodeMap attributes = tag.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attribute = (Attr) attributes.item(i);
+ String name = attribute.getName();
+ String attrValue = attribute.getValue();
+ if (name.equals(SOURCE_ATTRIBUTE)) {
+ source = true;
+ File styleFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar));
+ StringWriter styleBuffer = new StringWriter();
+ try {
+ FileReader in = new FileReader(styleFile);
+ char[] readBuffer = new char[2048];
+ int c;
+ while ((c = in.read(readBuffer)) > 0) {
+ styleBuffer.write(readBuffer, 0, c);
+ }
+ } catch (FileNotFoundException e) {
+ compiler.reportError("stylesheet file not found: " + styleFile);
+ }
+ compiler.getSourceFiles().push(styleFile);
+ compiler.registerStylesheet(processStylesheet(styleBuffer.toString()));
+ compiler.getSourceFiles().pop();
+ } else if (!name.startsWith(XMLNS_ATTRIBUTE) &&
+ !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
+ throw new UnsupportedAttributeException(name);
+ }
+ }
+
+ StringBuffer style = new StringBuffer();
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ switch (child.getNodeType()) {
+ case Node.ELEMENT_NODE:
+ compiler.reportError("<style> tag may not contain child elements: " + tag);
+ case Node.TEXT_NODE: // fall through
+ case Node.CDATA_SECTION_NODE:
+ style.append(((Text) child).getData());
+ }
+ }
+
+ String styleString = style.toString().trim();
+ if (styleString.length() > 0) {
+ if (source) {
+ compiler.reportError("<style> tag has both a source attribute and an inline stylesheet");
+ }
+ compiler.registerStylesheet(processStylesheet(style.toString()));
+ }
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ }
+
+ protected Selector processSelector(SimpleNode selector) {
+ if (selector.getId() != CSSParserTreeConstants.JJTSELECTOR) {
+ throw new IllegalArgumentException("argument node is not a Selector");
+ }
+ String javaClassName = null;
+ String styleClass = null;
+ String pseudoClass = null;
+ String id = null;
+
+ for (int i = 0; i < selector.jjtGetNumChildren(); i++) {
+ SimpleNode child = selector.getChild(i);
+ switch (child.getId()) {
+ case CSSParserTreeConstants.JJTJAVACLASS:
+ if (!child.getText().trim().equals("*")) {
+ javaClassName = child.getText();
+ }
+ break;
+ case CSSParserTreeConstants.JJTCLASS:
+ styleClass = child.getText().substring(1);
+ break;
+ case CSSParserTreeConstants.JJTPSEUDOCLASS:
+ pseudoClass = child.getText().substring(1);
+ break;
+ case CSSParserTreeConstants.JJTID:
+ id = child.getText().substring(1);
+ break;
+
+ default:
+ throw new IllegalStateException("unexpected child of Selector node, type=" + child.getId());
+ }
+ }
+
+ return new Selector(javaClassName, styleClass, pseudoClass, id);
+ }
+
+ protected Rule processRule(SimpleNode ruleNode) {
+ if (ruleNode.getId() != CSSParserTreeConstants.JJTRULE) {
+ throw new IllegalArgumentException("argument node is not a Rule");
+ }
+ SimpleNode selectorsNode = ruleNode.getChild(0);
+ assert selectorsNode.getId() == CSSParserTreeConstants.JJTSELECTORS : "expected node to be of type Selectors";
+
+ List<Selector> selectors = new ArrayList<Selector>();
+ for (int i = 0; i < selectorsNode.jjtGetNumChildren(); i++) {
+ SimpleNode selectorNode = selectorsNode.getChild(i);
+ selectors.add(processSelector(selectorNode));
+ }
+
+ Map<String, String> properties = new HashMap<String, String>();
+ for (int i = 1; i < ruleNode.jjtGetNumChildren(); i++) {
+ SimpleNode declarationNode = ruleNode.getChild(i);
+ if (declarationNode.getId() == CSSParserTreeConstants.JJTDECLARATION) {
+ String key = declarationNode.getChild(0).getText();
+ SimpleNode valueNode = declarationNode.getChild(1);
+ String value = valueNode.getText();
+ if (valueNode.firstToken.kind == CSSParserConstants.STRING) {
+ value = value.substring(1, value.length() - 1);
+ }
+ properties.put(key, value);
+ }
+ }
+ Rule rule;
+ rule = new Rule(selectors.toArray(new Selector[selectors.size()]), properties);
+ return rule;
+ }
+
+ protected Stylesheet processStylesheet(String stylesheetText) throws CompilerException {
+ CSSParser p = new CSSParser(new StringReader(stylesheetText));
+ SimpleNode node;
+ try {
+ node = p.Stylesheet();
+ } catch (Error e) {
+ throw new CompilerException(e);
+ }
+ List<Rule> rules = new ArrayList<Rule>();
+ for (int i = 0; i < node.jjtGetNumChildren(); i++) {
+ SimpleNode ruleNode = node.getChild(i);
+ Rule rule = processRule(ruleNode);
+ rules.add(rule);
+ }
+ Stylesheet stylesheet;
+ stylesheet = new Stylesheet(rules.toArray(new Rule[rules.size()]));
+ return stylesheet;
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,48 +1,64 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.JAXXCompiler;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-
-/**
- * Implementations of <code>TagHandler</code> produce Java source code from XML tags.
- * <code>TagHandlers</code> are mapped to particular XML tags (such as <JFrame>) in {@link JAXXCompiler}.
- * There is only one <code>TagHandler</code> for any given XML tag, and therefore implementations must be
- * stateless.
- *
- * @author Ethan Nicholas
- */
-public interface TagHandler {
-
- String XMLNS_ATTRIBUTE = "xmlns";
-
- /**
- * Performs the first pass of compilation on an XML tag from a JAXX source file.
- * <code>TagHandler</code> implementations affect the generated <code>.java</code>
- * file by calling methods in the <code>JAXXCompiler</code>.
- *
- * @param tag the XML tag to compile
- * @param compiler the active JAXXCompiler
- * @throws CompilerException if a compilation error occurs
- * @throws IOException if an I/O error occurs
- */
- void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException;
-
- /**
- * Performs the second pass of compilation on an XML tag from a JAXX source file.
- * <code>TagHandler</code> implementations affect the generated <code>.java</code>
- * file by calling methods in the <code>JAXXCompiler</code>.
- *
- * @param tag the XML tag to compile
- * @param compiler the active JAXXCompiler
- * @throws CompilerException if a compilation error occurs
- * @throws IOException if an I/O error occurs
- */
- void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException;
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+
+/**
+ * Implementations of <code>TagHandler</code> produce Java source code from XML tags.
+ * <code>TagHandlers</code> are mapped to particular XML tags (such as <JFrame>) in {@link JAXXCompiler}.
+ * There is only one <code>TagHandler</code> for any given XML tag, and therefore implementations must be
+ * stateless.
+ *
+ * @author Ethan Nicholas
+ */
+public interface TagHandler {
+
+ String XMLNS_ATTRIBUTE = "xmlns";
+
+ /**
+ * Performs the first pass of compilation on an XML tag from a JAXX source file.
+ * <code>TagHandler</code> implementations affect the generated <code>.java</code>
+ * file by calling methods in the <code>JAXXCompiler</code>.
+ *
+ * @param tag the XML tag to compile
+ * @param compiler the active JAXXCompiler
+ * @throws CompilerException if a compilation error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException;
+
+ /**
+ * Performs the second pass of compilation on an XML tag from a JAXX source file.
+ * <code>TagHandler</code> implementations affect the generated <code>.java</code>
+ * file by calling methods in the <code>JAXXCompiler</code>.
+ *
+ * @param tag the XML tag to compile
+ * @param compiler the active JAXXCompiler
+ * @throws CompilerException if a compilation error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException;
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.compiler.tags;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,39 +1,55 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.runtime.swing.Application;
-import jaxx.compiler.types.TypeManager;
-import org.w3c.dom.Element;
-
-import javax.swing.WindowConstants;
-
-public class ApplicationHandler extends JWindowHandler {
-
- public ApplicationHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Application.class);
- }
-
- @Override
- public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException {
- if (propertyName.equals("lookAndFeel") && stringValue != null && !stringValue.trim().startsWith("{")) {
- compiler.appendBodyCode("{ " + object.getJavaCode() + ".setLookAndFeel(" + compiler.getJavaCode(stringValue) + "); }" + JAXXCompiler.getLineSeparator());
- } else {
- super.setAttribute(object, propertyName, stringValue, inline, compiler);
- }
- }
-
- @Override
- protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- super.setDefaults(object, tag, compiler);
- setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.EXIT_ON_CLOSE), false, compiler);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.runtime.swing.Application;
+import jaxx.compiler.types.TypeManager;
+import org.w3c.dom.Element;
+
+import javax.swing.WindowConstants;
+
+public class ApplicationHandler extends JWindowHandler {
+
+ public ApplicationHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Application.class);
+ }
+
+ @Override
+ public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException {
+ if (propertyName.equals("lookAndFeel") && stringValue != null && !stringValue.trim().startsWith("{")) {
+ compiler.appendBodyCode("{ " + object.getJavaCode() + ".setLookAndFeel(" + compiler.getJavaCode(stringValue) + "); }" + JAXXCompiler.getLineSeparator());
+ } else {
+ super.setAttribute(object, propertyName, stringValue, inline, compiler);
+ }
+ }
+
+ @Override
+ protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ super.setDefaults(object, tag, compiler);
+ setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.EXIT_ON_CLOSE), false, compiler);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,150 +1,166 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.UnsupportedAttributeException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.compiler.types.TypeManager;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.io.IOException;
-
-public class CellHandler implements TagHandler {
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compileChildrenFirstPass(tag, compiler);
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- Node parent = tag.getParentNode();
- if (parent.getNodeType() != Node.ELEMENT_NODE || !parent.getLocalName().equals("row")) {
- compiler.reportError("cell tag may only appear within row tag");
- return;
- }
-
- TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent();
- table.newCell();
- GridBagConstraints c = table.getCellConstraints();
- setAttributes(c, tag);
- compileChildrenSecondPass(tag, compiler);
- }
-
- public static void setAttribute(GridBagConstraints c, String name, String value) throws CompilerException {
- value = value.trim();
- if (name.equals("insets")) {
- c.insets = (Insets) TypeManager.convertFromString(value, Insets.class);
- } else if (name.equals("weightx")) {
- c.weightx = Double.parseDouble(value);
- } else if (name.equals("weighty")) {
- c.weighty = Double.parseDouble(value);
- } else if (name.equals("columns")) {
- c.gridwidth = Integer.parseInt(value);
- } else if (name.equals("rows")) {
- c.gridheight = Integer.parseInt(value);
- } else if (name.equals("fill")) {
- if (value.equals("none")) {
- c.fill = GridBagConstraints.NONE;
- } else if (value.equals("horizontal")) {
- c.fill = GridBagConstraints.HORIZONTAL;
- } else if (value.equals("vertical")) {
- c.fill = GridBagConstraints.VERTICAL;
- } else if (value.equals("both")) {
- c.fill = GridBagConstraints.BOTH;
- } else {
- throw new IllegalArgumentException("invalid value for fill attribute: '" + value + "'");
- }
- } else if (name.equals("anchor")) {
- //todo use a converter
- if (value.equals("north")) {
- c.anchor = GridBagConstraints.NORTH;
- } else if (value.equals("northeast")) {
- c.anchor = GridBagConstraints.NORTHEAST;
- } else if (value.equals("east")) {
- c.anchor = GridBagConstraints.EAST;
- } else if (value.equals("southeast")) {
- c.anchor = GridBagConstraints.SOUTHEAST;
- } else if (value.equals("south")) {
- c.anchor = GridBagConstraints.SOUTH;
- } else if (value.equals("southwest")) {
- c.anchor = GridBagConstraints.SOUTHWEST;
- } else if (value.equals("west")) {
- c.anchor = GridBagConstraints.WEST;
- } else if (value.equals("northwest")) {
- c.anchor = GridBagConstraints.NORTHWEST;
- } else if (value.equals("center")) {
- c.anchor = GridBagConstraints.CENTER;
- } else {
- throw new IllegalArgumentException("invalid value for anchor attribute: '" + value + "'");
- }
- } else {
- throw new UnsupportedAttributeException(name);
- }
- }
-
- public static void setAttributes(GridBagConstraints c, Element tag) throws CompilerException {
- NamedNodeMap children = tag.getAttributes();
- for (int i = 0; i < children.getLength(); i++) {
- Attr attribute = (Attr) children.item(i);
- String name = attribute.getName();
- String value = attribute.getValue();
- if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
- setAttribute(c, name, value);
- }
- }
- }
-
- protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- compileChildTagFirstPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- compileChildTagSecondPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileFirstPass(tag);
- }
-
- protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileSecondPass(tag);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.compiler.types.TypeManager;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.io.IOException;
+
+public class CellHandler implements TagHandler {
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compileChildrenFirstPass(tag, compiler);
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ Node parent = tag.getParentNode();
+ if (parent.getNodeType() != Node.ELEMENT_NODE || !parent.getLocalName().equals("row")) {
+ compiler.reportError("cell tag may only appear within row tag");
+ return;
+ }
+
+ TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent();
+ table.newCell();
+ GridBagConstraints c = table.getCellConstraints();
+ setAttributes(c, tag);
+ compileChildrenSecondPass(tag, compiler);
+ }
+
+ public static void setAttribute(GridBagConstraints c, String name, String value) throws CompilerException {
+ value = value.trim();
+ if (name.equals("insets")) {
+ c.insets = (Insets) TypeManager.convertFromString(value, Insets.class);
+ } else if (name.equals("weightx")) {
+ c.weightx = Double.parseDouble(value);
+ } else if (name.equals("weighty")) {
+ c.weighty = Double.parseDouble(value);
+ } else if (name.equals("columns")) {
+ c.gridwidth = Integer.parseInt(value);
+ } else if (name.equals("rows")) {
+ c.gridheight = Integer.parseInt(value);
+ } else if (name.equals("fill")) {
+ if (value.equals("none")) {
+ c.fill = GridBagConstraints.NONE;
+ } else if (value.equals("horizontal")) {
+ c.fill = GridBagConstraints.HORIZONTAL;
+ } else if (value.equals("vertical")) {
+ c.fill = GridBagConstraints.VERTICAL;
+ } else if (value.equals("both")) {
+ c.fill = GridBagConstraints.BOTH;
+ } else {
+ throw new IllegalArgumentException("invalid value for fill attribute: '" + value + "'");
+ }
+ } else if (name.equals("anchor")) {
+ //todo use a converter
+ if (value.equals("north")) {
+ c.anchor = GridBagConstraints.NORTH;
+ } else if (value.equals("northeast")) {
+ c.anchor = GridBagConstraints.NORTHEAST;
+ } else if (value.equals("east")) {
+ c.anchor = GridBagConstraints.EAST;
+ } else if (value.equals("southeast")) {
+ c.anchor = GridBagConstraints.SOUTHEAST;
+ } else if (value.equals("south")) {
+ c.anchor = GridBagConstraints.SOUTH;
+ } else if (value.equals("southwest")) {
+ c.anchor = GridBagConstraints.SOUTHWEST;
+ } else if (value.equals("west")) {
+ c.anchor = GridBagConstraints.WEST;
+ } else if (value.equals("northwest")) {
+ c.anchor = GridBagConstraints.NORTHWEST;
+ } else if (value.equals("center")) {
+ c.anchor = GridBagConstraints.CENTER;
+ } else {
+ throw new IllegalArgumentException("invalid value for anchor attribute: '" + value + "'");
+ }
+ } else {
+ throw new UnsupportedAttributeException(name);
+ }
+ }
+
+ public static void setAttributes(GridBagConstraints c, Element tag) throws CompilerException {
+ NamedNodeMap children = tag.getAttributes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Attr attribute = (Attr) children.item(i);
+ String name = attribute.getName();
+ String value = attribute.getValue();
+ if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
+ setAttribute(c, name, value);
+ }
+ }
+ }
+
+ protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ compileChildTagFirstPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ compileChildTagSecondPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileFirstPass(tag);
+ }
+
+ protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileSecondPass(tag);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,50 +1,66 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.runtime.swing.Item;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Stack;
-
-/** Compiled representation of a class that contains Items arranged in a list or tree structure (JComboBox, JList, JTree). */
-class CompiledItemContainer extends CompiledObject {
-
- private List<Item> items = new ArrayList<Item>();
- private Stack<Item> openNodes = new Stack<Item>();
-
- public CompiledItemContainer(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
- super(id, objectClass, compiler);
- }
-
- public void openItem(Item item) {
- if (openNodes.isEmpty()) {
- items.add(item);
- } else {
- Item openNode = openNodes.peek();
- openNode.addChild(item);
- }
- openNodes.add(item);
- }
-
- public void closeItem(Item item) {
- if (openNodes.pop() != item) {
- throw new IllegalArgumentException(item + " was not at the top of the item stack");
- }
- }
-
- public List<Item> getItems() {
- return items;
- }
-
- public void setItems(List<Item> items) {
- this.items = items;
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.runtime.swing.Item;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+
+/** Compiled representation of a class that contains Items arranged in a list or tree structure (JComboBox, JList, JTree). */
+class CompiledItemContainer extends CompiledObject {
+
+ private List<Item> items = new ArrayList<Item>();
+ private Stack<Item> openNodes = new Stack<Item>();
+
+ public CompiledItemContainer(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
+ super(id, objectClass, compiler);
+ }
+
+ public void openItem(Item item) {
+ if (openNodes.isEmpty()) {
+ items.add(item);
+ } else {
+ Item openNode = openNodes.peek();
+ openNode.addChild(item);
+ }
+ openNodes.add(item);
+ }
+
+ public void closeItem(Item item) {
+ if (openNodes.pop() != item) {
+ throw new IllegalArgumentException(item + " was not at the top of the item stack");
+ }
+ }
+
+ public List<Item> getItems() {
+ return items;
+ }
+
+ public void setItems(List<Item> items) {
+ this.items = items;
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,147 +1,163 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.UnsupportedAttributeException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.compiler.types.TypeManager;
-import jaxx.runtime.swing.Item;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.io.IOException;
-import java.util.List;
-
-public class ItemHandler implements TagHandler {
-
- private String DATA_BINDING = "<data binding has not been processed yet>";
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compileChildrenFirstPass(tag, compiler);
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- String id = tag.getAttribute("id");
- if (id == null || id.length() == 0) {
- id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(Item.class));
- }
- String label = null;
- String value = null;
- boolean selected = false;
- NamedNodeMap children = tag.getAttributes();
-
- for (int i = 0; i < children.getLength(); i++) {
- Attr attribute = (Attr) children.item(i);
- String name = attribute.getName();
- String attrValue = attribute.getValue();
- if (name.equals("id")) {
- // already handled
- continue;
- }
- if (name.equals(Item.LABEL_PROPERTY)) {
- String labelBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(String.class));
- if (labelBinding != null) {
- compiler.registerDataBinding(labelBinding, id + ".label", id + ".setLabel(" + labelBinding + ");");
- } else {
- label = attrValue;
- }
- continue;
- }
- if (name.equals(Item.VALUE_PROPERTY)) {
- String valueBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Object.class));
- if (valueBinding != null) {
- value = DATA_BINDING;
- compiler.registerDataBinding(valueBinding, id + ".value", id + ".setValue(" + valueBinding + ");");
- } else {
- value = attrValue;
- }
- continue;
- }
- if (name.equals(Item.SELECTED_PROPERTY)) {
- String selectedBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Boolean.class));
- if (selectedBinding != null) {
- compiler.registerDataBinding(selectedBinding, id + ".selected", id + ".setSelected(" + selectedBinding + ");");
- } else {
- selected = (Boolean) TypeManager.convertFromString(attrValue, Boolean.class);
- }
- continue;
- }
-
- if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
- throw new UnsupportedAttributeException(name);
- }
- }
-
- Item item = new Item(id, label, value, selected);
- CompiledItemContainer list = (CompiledItemContainer) compiler.getOpenComponent();
- if (value == null) {
- compiler.reportError("<item> tag is missing required 'value' attribute");
- } else {
- if (!value.equals(DATA_BINDING)) {
- List<Item> items = list.getItems();
- for (Item item1 : items) {
- if (item1.getValue().equals(value)) {
- compiler.reportError("This container already has an <item> tag with the value '" + value + "'");
- break;
- }
- }
- }
- list.openItem(item);
- compileChildrenSecondPass(tag, compiler);
- list.closeItem(item);
- }
- }
-
- protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- compileChildTagFirstPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- compileChildTagSecondPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileFirstPass(tag);
- }
-
- protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileSecondPass(tag);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.compiler.types.TypeManager;
+import jaxx.runtime.swing.Item;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.io.IOException;
+import java.util.List;
+
+public class ItemHandler implements TagHandler {
+
+ private String DATA_BINDING = "<data binding has not been processed yet>";
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compileChildrenFirstPass(tag, compiler);
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ String id = tag.getAttribute("id");
+ if (id == null || id.length() == 0) {
+ id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(Item.class));
+ }
+ String label = null;
+ String value = null;
+ boolean selected = false;
+ NamedNodeMap children = tag.getAttributes();
+
+ for (int i = 0; i < children.getLength(); i++) {
+ Attr attribute = (Attr) children.item(i);
+ String name = attribute.getName();
+ String attrValue = attribute.getValue();
+ if (name.equals("id")) {
+ // already handled
+ continue;
+ }
+ if (name.equals(Item.LABEL_PROPERTY)) {
+ String labelBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(String.class));
+ if (labelBinding != null) {
+ compiler.registerDataBinding(labelBinding, id + ".label", id + ".setLabel(" + labelBinding + ");");
+ } else {
+ label = attrValue;
+ }
+ continue;
+ }
+ if (name.equals(Item.VALUE_PROPERTY)) {
+ String valueBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Object.class));
+ if (valueBinding != null) {
+ value = DATA_BINDING;
+ compiler.registerDataBinding(valueBinding, id + ".value", id + ".setValue(" + valueBinding + ");");
+ } else {
+ value = attrValue;
+ }
+ continue;
+ }
+ if (name.equals(Item.SELECTED_PROPERTY)) {
+ String selectedBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Boolean.class));
+ if (selectedBinding != null) {
+ compiler.registerDataBinding(selectedBinding, id + ".selected", id + ".setSelected(" + selectedBinding + ");");
+ } else {
+ selected = (Boolean) TypeManager.convertFromString(attrValue, Boolean.class);
+ }
+ continue;
+ }
+
+ if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
+ throw new UnsupportedAttributeException(name);
+ }
+ }
+
+ Item item = new Item(id, label, value, selected);
+ CompiledItemContainer list = (CompiledItemContainer) compiler.getOpenComponent();
+ if (value == null) {
+ compiler.reportError("<item> tag is missing required 'value' attribute");
+ } else {
+ if (!value.equals(DATA_BINDING)) {
+ List<Item> items = list.getItems();
+ for (Item item1 : items) {
+ if (item1.getValue().equals(value)) {
+ compiler.reportError("This container already has an <item> tag with the value '" + value + "'");
+ break;
+ }
+ }
+ }
+ list.openItem(item);
+ compileChildrenSecondPass(tag, compiler);
+ list.closeItem(item);
+ }
+ }
+
+ protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ compileChildTagFirstPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ compileChildTagSecondPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileFirstPass(tag);
+ }
+
+ protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileSecondPass(tag);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.compiler.tags.swing;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.compiler.tags.swing;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tags.swing;
import jaxx.compiler.reflect.ClassDescriptor;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.compiler.tags.swing;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,26 +1,42 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-
-import javax.swing.AbstractButton;
-import javax.swing.event.ChangeListener;
-
-public class JCheckBoxHandler extends DefaultComponentHandler {
-
- public JCheckBoxHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("isSelected", ChangeListener.class, "model");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+
+import javax.swing.AbstractButton;
+import javax.swing.event.ChangeListener;
+
+public class JCheckBoxHandler extends DefaultComponentHandler {
+
+ public JCheckBoxHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("isSelected", ChangeListener.class, "model");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,44 +1,60 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import java.io.IOException;
-import java.awt.event.ItemListener;
-import javax.swing.JComboBox;
-
-public class JComboBoxHandler extends DefaultComponentHandler {
-
- public JComboBoxHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JComboBox.class);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("getSelectedIndex", ItemListener.class);
- addProxyEventInfo("getSelectedItem", ItemListener.class);
- }
-
- @Override
- public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- if (children.getLength() > 0) {
- compiler.reportError("JComboBox does not accept childs");
- throw new CompilerException("JComboBox does not accept childs");
- }
- }
-}
-
-
-
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.io.IOException;
+import java.awt.event.ItemListener;
+import javax.swing.JComboBox;
+
+public class JComboBoxHandler extends DefaultComponentHandler {
+
+ public JComboBoxHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JComboBox.class);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("getSelectedIndex", ItemListener.class);
+ addProxyEventInfo("getSelectedItem", ItemListener.class);
+ }
+
+ @Override
+ public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ if (children.getLength() > 0) {
+ compiler.reportError("JComboBox does not accept childs");
+ throw new CompilerException("JComboBox does not accept childs");
+ }
+ }
+}
+
+
+
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,54 +1,70 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-
-import javax.swing.JInternalFrame;
-import javax.swing.JMenuBar;
-import javax.swing.WindowConstants;
-
-public class JInternalFrameHandler extends DefaultComponentHandler {
-
- public JInternalFrameHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JInternalFrame.class);
- }
-
- @Override
- public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
- return new CompiledObject(id, getBeanClass(), compiler) {
-
- @Override
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) {
- appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");");
- } else {
- super.addChild(child, constraints, compiler);
- }
- }
- };
- }
-
- @Override
- protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- super.setDefaults(object, tag, compiler);
- setAttribute(object, "visible", "true", false, compiler);
- setAttribute(object, "closable", "true", false, compiler);
- setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.DISPOSE_ON_CLOSE), false, compiler);
- }
-
- @Override
- public void setAttributes(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- super.setAttributes(object, tag, compiler);
- compiler.appendInitializerCode(object.getId() + ".pack();\n");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+
+import javax.swing.JInternalFrame;
+import javax.swing.JMenuBar;
+import javax.swing.WindowConstants;
+
+public class JInternalFrameHandler extends DefaultComponentHandler {
+
+ public JInternalFrameHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JInternalFrame.class);
+ }
+
+ @Override
+ public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
+ return new CompiledObject(id, getBeanClass(), compiler) {
+
+ @Override
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) {
+ appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");");
+ } else {
+ super.addChild(child, constraints, compiler);
+ }
+ }
+ };
+ }
+
+ @Override
+ protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ super.setDefaults(object, tag, compiler);
+ setAttribute(object, "visible", "true", false, compiler);
+ setAttribute(object, "closable", "true", false, compiler);
+ setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.DISPOSE_ON_CLOSE), false, compiler);
+ }
+
+ @Override
+ public void setAttributes(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ super.setAttributes(object, tag, compiler);
+ compiler.appendInitializerCode(object.getId() + ".pack();\n");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tags.swing;
import jaxx.compiler.CompilerException;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,26 +1,42 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-
-import javax.swing.JMenu;
-import javax.swing.event.MenuListener;
-
-public class JMenuHandler extends DefaultComponentHandler {
-
- public JMenuHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JMenu.class);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("isSelected", MenuListener.class);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+
+import javax.swing.JMenu;
+import javax.swing.event.MenuListener;
+
+public class JMenuHandler extends DefaultComponentHandler {
+
+ public JMenuHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JMenu.class);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("isSelected", MenuListener.class);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,25 +1,41 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-
-import javax.swing.JPasswordField;
-import javax.swing.event.DocumentListener;
-
-public class JPasswordFieldHandler extends JTextComponentHandler {
-
- public JPasswordFieldHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPasswordField.class);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("getPassword", DocumentListener.class, "document");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+
+import javax.swing.JPasswordField;
+import javax.swing.event.DocumentListener;
+
+public class JPasswordFieldHandler extends JTextComponentHandler {
+
+ public JPasswordFieldHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPasswordField.class);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("getPassword", DocumentListener.class, "document");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,32 +1,48 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-
-import javax.swing.JPopupMenu;
-
-public class JPopupMenuHandler extends DefaultComponentHandler {
-
- public JPopupMenuHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPopupMenu.class);
- }
-
- @Override
- public boolean isContainer() {
- return true;
- }
-
- @Override
- protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) {
- compiler.openInvisibleComponent(object);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+
+import javax.swing.JPopupMenu;
+
+public class JPopupMenuHandler extends DefaultComponentHandler {
+
+ public JPopupMenuHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPopupMenu.class);
+ }
+
+ @Override
+ public boolean isContainer() {
+ return true;
+ }
+
+ @Override
+ protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) {
+ compiler.openInvisibleComponent(object);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,26 +1,42 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-
-import javax.swing.JProgressBar;
-import javax.swing.event.ChangeListener;
-
-public class JProgressBarHandler extends DefaultComponentHandler {
-
- public JProgressBarHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JProgressBar.class);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("getValue", ChangeListener.class, "change");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+
+import javax.swing.JProgressBar;
+import javax.swing.event.ChangeListener;
+
+public class JProgressBarHandler extends DefaultComponentHandler {
+
+ public JProgressBarHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JProgressBar.class);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("getValue", ChangeListener.class, "change");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,80 +1,96 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.UnsupportedAttributeException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import jaxx.runtime.swing.JAXXButtonGroup;
-
-import javax.swing.AbstractButton;
-import javax.swing.event.ChangeListener;
-
-public class JRadioButtonHandler extends DefaultComponentHandler {
-
- private static final String VALUE_PROPERTY = JAXXButtonGroup.VALUE_CLIENT_PROPERTY.substring(1);
- private static final String BUTTON_GROUP_PROPERTY = JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY.substring(1);
-
- public JRadioButtonHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("isSelected", ChangeListener.class, "model");
- }
-
- @Override
- public ClassDescriptor getPropertyType(CompiledObject object, String name, JAXXCompiler compiler) throws CompilerException {
- if (name.equals(BUTTON_GROUP_PROPERTY)) {
- return null; // accepts either a String or a ButtonGroup
- } else if (name.equals(VALUE_PROPERTY)) {
- return ClassDescriptorLoader.getClassDescriptor(Object.class);
- } else {
- return super.getPropertyType(object, name, compiler);
- }
- }
-
- @Override
- public boolean isMemberBound(String name) throws UnsupportedAttributeException {
- return !(name.equals(BUTTON_GROUP_PROPERTY) || name.equals(VALUE_PROPERTY)) && super.isMemberBound(name);
- }
-
- // handle buttonGroup assignment in addition block rather than initialization block
- @Override
- public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) {
- if (name.equals(BUTTON_GROUP_PROPERTY)) {
- object.appendAdditionCode(getSetPropertyCode(object.getJavaCode(), name, compiler.getJavaCode(value), compiler));
- } else {
- super.setProperty(object, name, value, compiler);
- }
- }
-
- @Override
- public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException {
- if (name.equals(BUTTON_GROUP_PROPERTY)) {
- if (valueCode.startsWith("\"") && valueCode.endsWith("\"")) {
- valueCode = valueCode.substring(1, valueCode.length() - 1);
- CompiledObject buttonGroup = compiler.getCompiledObject(valueCode);
- if (buttonGroup == null) {
- buttonGroup = new CompiledObject(valueCode, ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class), compiler);
- compiler.registerCompiledObject(buttonGroup);
- }
- }
- return "{ javax.swing.ButtonGroup $buttonGroup = " + valueCode + "; " + id + ".putClientProperty(\"$buttonGroup\", $buttonGroup); $buttonGroup.add(" + id + "); }\n";
- } else if (name.equals(VALUE_PROPERTY)) {
- return "{ " + id + ".putClientProperty(\"" + JAXXButtonGroup.VALUE_CLIENT_PROPERTY + "\", " + valueCode + "); Object $buttonGroup = " + id + ".getClientProperty(\"" + JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY + "\");" +
- " if ($buttonGroup instanceof jaxx.runtime.swing.JAXXButtonGroup) { ((jaxx.runtime.swing.JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }\n";
- } else {
- return super.getSetPropertyCode(id, name, valueCode, compiler);
- }
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import jaxx.runtime.swing.JAXXButtonGroup;
+
+import javax.swing.AbstractButton;
+import javax.swing.event.ChangeListener;
+
+public class JRadioButtonHandler extends DefaultComponentHandler {
+
+ private static final String VALUE_PROPERTY = JAXXButtonGroup.VALUE_CLIENT_PROPERTY.substring(1);
+ private static final String BUTTON_GROUP_PROPERTY = JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY.substring(1);
+
+ public JRadioButtonHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("isSelected", ChangeListener.class, "model");
+ }
+
+ @Override
+ public ClassDescriptor getPropertyType(CompiledObject object, String name, JAXXCompiler compiler) throws CompilerException {
+ if (name.equals(BUTTON_GROUP_PROPERTY)) {
+ return null; // accepts either a String or a ButtonGroup
+ } else if (name.equals(VALUE_PROPERTY)) {
+ return ClassDescriptorLoader.getClassDescriptor(Object.class);
+ } else {
+ return super.getPropertyType(object, name, compiler);
+ }
+ }
+
+ @Override
+ public boolean isMemberBound(String name) throws UnsupportedAttributeException {
+ return !(name.equals(BUTTON_GROUP_PROPERTY) || name.equals(VALUE_PROPERTY)) && super.isMemberBound(name);
+ }
+
+ // handle buttonGroup assignment in addition block rather than initialization block
+ @Override
+ public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) {
+ if (name.equals(BUTTON_GROUP_PROPERTY)) {
+ object.appendAdditionCode(getSetPropertyCode(object.getJavaCode(), name, compiler.getJavaCode(value), compiler));
+ } else {
+ super.setProperty(object, name, value, compiler);
+ }
+ }
+
+ @Override
+ public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException {
+ if (name.equals(BUTTON_GROUP_PROPERTY)) {
+ if (valueCode.startsWith("\"") && valueCode.endsWith("\"")) {
+ valueCode = valueCode.substring(1, valueCode.length() - 1);
+ CompiledObject buttonGroup = compiler.getCompiledObject(valueCode);
+ if (buttonGroup == null) {
+ buttonGroup = new CompiledObject(valueCode, ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class), compiler);
+ compiler.registerCompiledObject(buttonGroup);
+ }
+ }
+ return "{ javax.swing.ButtonGroup $buttonGroup = " + valueCode + "; " + id + ".putClientProperty(\"$buttonGroup\", $buttonGroup); $buttonGroup.add(" + id + "); }\n";
+ } else if (name.equals(VALUE_PROPERTY)) {
+ return "{ " + id + ".putClientProperty(\"" + JAXXButtonGroup.VALUE_CLIENT_PROPERTY + "\", " + valueCode + "); Object $buttonGroup = " + id + ".getClientProperty(\"" + JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY + "\");" +
+ " if ($buttonGroup instanceof jaxx.runtime.swing.JAXXButtonGroup) { ((jaxx.runtime.swing.JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }\n";
+ } else {
+ return super.getSetPropertyCode(id, name, valueCode, compiler);
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,42 +1,58 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-
-import javax.swing.JScrollPane;
-
-public class JScrollPaneHandler extends DefaultComponentHandler {
-
- public JScrollPaneHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JScrollPane.class);
- }
-
- @Override
- public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
- return new CompiledObject(id, getBeanClass(), compiler) {
-
- boolean hasChild;
-
- @Override
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- if (constraints != null) {
- compiler.reportError("JScrollPane does not accept constraints");
- }
- if (hasChild) {
- compiler.reportError("JScrollPane may only have one child");
- }
- super.addChild(child, constraints, compiler);
- hasChild = true;
- }
- };
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+
+import javax.swing.JScrollPane;
+
+public class JScrollPaneHandler extends DefaultComponentHandler {
+
+ public JScrollPaneHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JScrollPane.class);
+ }
+
+ @Override
+ public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
+ return new CompiledObject(id, getBeanClass(), compiler) {
+
+ boolean hasChild;
+
+ @Override
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ if (constraints != null) {
+ compiler.reportError("JScrollPane does not accept constraints");
+ }
+ if (hasChild) {
+ compiler.reportError("JScrollPane may only have one child");
+ }
+ super.addChild(child, constraints, compiler);
+ hasChild = true;
+ }
+ };
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,48 +1,64 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import javax.swing.JSlider;
-import javax.swing.event.ChangeListener;
-
-public class JSliderHandler extends DefaultComponentHandler {
-
- public JSliderHandler(ClassDescriptor beanClass) {
- super(beanClass);
- if (!ClassDescriptorLoader.getClassDescriptor(JSlider.class).isAssignableFrom(beanClass)) {
- throw new IllegalArgumentException(getClass().getName() + " does not support the class " + beanClass.getName());
- }
- }
-
- @Override
- protected int getAttributeOrdering(Attr attr) {
- if (attr.getName().equals("value")) {
- return 1;
- } else {
- return super.getAttributeOrdering(attr);
- }
- }
-
- @Override
- protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- super.setDefaults(object, tag, compiler);
- setAttribute(object, "value", "0", false, compiler);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("getValue", ChangeListener.class, "model");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+import javax.swing.JSlider;
+import javax.swing.event.ChangeListener;
+
+public class JSliderHandler extends DefaultComponentHandler {
+
+ public JSliderHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ if (!ClassDescriptorLoader.getClassDescriptor(JSlider.class).isAssignableFrom(beanClass)) {
+ throw new IllegalArgumentException(getClass().getName() + " does not support the class " + beanClass.getName());
+ }
+ }
+
+ @Override
+ protected int getAttributeOrdering(Attr attr) {
+ if (attr.getName().equals("value")) {
+ return 1;
+ } else {
+ return super.getAttributeOrdering(attr);
+ }
+ }
+
+ @Override
+ protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ super.setDefaults(object, tag, compiler);
+ setAttribute(object, "value", "0", false, compiler);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("getValue", ChangeListener.class, "model");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,94 +1,110 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-
-import javax.swing.JSpinner;
-import javax.swing.event.ChangeListener;
-
-public class JSpinnerHandler extends DefaultComponentHandler {
-
- public static String MINIMUM_PROPERTY = "minimum";
- public static String MAXIMUM_PROPERTY = "maximum";
- public static String VALUE_PROPERTY = "value";
-
- public JSpinnerHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSpinner.class);
- }
-
- public static class CompiledSpinner extends CompiledObject {
-
- Integer minimum = null;
- Integer maximum = null;
- Integer value = null;
-
- public CompiledSpinner(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
- super(id, objectClass, compiler);
- }
- }
-
- @Override
- public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
- return new CompiledSpinner(id, getBeanClass(), compiler);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("getValue", ChangeListener.class, "model");
- }
-
- @Override
- public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException {
- if (propertyName.equals(MINIMUM_PROPERTY) || propertyName.equals(MAXIMUM_PROPERTY) ||
- propertyName.equals(VALUE_PROPERTY)) {
- return ClassDescriptorLoader.getClassDescriptor(Integer.class);
- }
- return super.getPropertyType(object, propertyName, compiler);
- }
-
- @Override
- public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) throws CompilerException {
- if (name.equals(MINIMUM_PROPERTY)) {
- ((CompiledSpinner) object).minimum = (Integer) value;
- } else if (name.equals(MAXIMUM_PROPERTY)) {
- ((CompiledSpinner) object).maximum = (Integer) value;
- } else if (name.equals(VALUE_PROPERTY)) {
- ((CompiledSpinner) object).value = (Integer) value;
- } else {
- super.setProperty(object, name, value, compiler);
- }
- }
-
- @Override
- protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- CompiledSpinner spinner = (CompiledSpinner) object;
- if (spinner.minimum != null || spinner.maximum != null || spinner.value != null) {
- if (spinner.getConstructorParams() != null) {
- compiler.reportError("constructorParams and minimum/maximum may not both be specified for the same JSpinner");
- }
- if (spinner.minimum == null) {
- spinner.minimum = Math.min(0, spinner.maximum != null ? spinner.maximum.intValue() : 0);
- }
- if (spinner.maximum == null) {
- spinner.maximum = Math.max(100, spinner.minimum.intValue());
- }
- if (spinner.value == null) {
- spinner.value = spinner.minimum;
- }
- spinner.setConstructorParams("new SpinnerNumberModel(" + spinner.value + ", " + spinner.minimum + ", " + spinner.maximum + ", 1)");
- }
-
- super.closeComponent(object, tag, compiler);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+
+import javax.swing.JSpinner;
+import javax.swing.event.ChangeListener;
+
+public class JSpinnerHandler extends DefaultComponentHandler {
+
+ public static String MINIMUM_PROPERTY = "minimum";
+ public static String MAXIMUM_PROPERTY = "maximum";
+ public static String VALUE_PROPERTY = "value";
+
+ public JSpinnerHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSpinner.class);
+ }
+
+ public static class CompiledSpinner extends CompiledObject {
+
+ Integer minimum = null;
+ Integer maximum = null;
+ Integer value = null;
+
+ public CompiledSpinner(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
+ super(id, objectClass, compiler);
+ }
+ }
+
+ @Override
+ public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
+ return new CompiledSpinner(id, getBeanClass(), compiler);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("getValue", ChangeListener.class, "model");
+ }
+
+ @Override
+ public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException {
+ if (propertyName.equals(MINIMUM_PROPERTY) || propertyName.equals(MAXIMUM_PROPERTY) ||
+ propertyName.equals(VALUE_PROPERTY)) {
+ return ClassDescriptorLoader.getClassDescriptor(Integer.class);
+ }
+ return super.getPropertyType(object, propertyName, compiler);
+ }
+
+ @Override
+ public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) throws CompilerException {
+ if (name.equals(MINIMUM_PROPERTY)) {
+ ((CompiledSpinner) object).minimum = (Integer) value;
+ } else if (name.equals(MAXIMUM_PROPERTY)) {
+ ((CompiledSpinner) object).maximum = (Integer) value;
+ } else if (name.equals(VALUE_PROPERTY)) {
+ ((CompiledSpinner) object).value = (Integer) value;
+ } else {
+ super.setProperty(object, name, value, compiler);
+ }
+ }
+
+ @Override
+ protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ CompiledSpinner spinner = (CompiledSpinner) object;
+ if (spinner.minimum != null || spinner.maximum != null || spinner.value != null) {
+ if (spinner.getConstructorParams() != null) {
+ compiler.reportError("constructorParams and minimum/maximum may not both be specified for the same JSpinner");
+ }
+ if (spinner.minimum == null) {
+ spinner.minimum = Math.min(0, spinner.maximum != null ? spinner.maximum.intValue() : 0);
+ }
+ if (spinner.maximum == null) {
+ spinner.maximum = Math.max(100, spinner.minimum.intValue());
+ }
+ if (spinner.value == null) {
+ spinner.value = spinner.minimum;
+ }
+ spinner.setConstructorParams("new SpinnerNumberModel(" + spinner.value + ", " + spinner.minimum + ", " + spinner.maximum + ", 1)");
+ }
+
+ super.closeComponent(object, tag, compiler);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,71 +1,87 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-
-import javax.swing.JSplitPane;
-import java.awt.Component;
-
-public class JSplitPaneHandler extends DefaultComponentHandler {
-
- public JSplitPaneHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSplitPane.class);
- }
-
- protected Component createRawComponent(Element tag) {
- return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
- }
-
- /**
- * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. The
- * values required by the JAXXBeanInfo are the unwieldy <code>vertical_split</code> and <code>horizontal_split</code>
- * (which are also recognized).
- */
- @Override
- protected int constantValue(String key, String value) {
- if (key.equals("orientation")) {
- value = value.trim().toLowerCase();
- if (value.equals("horizontal") || value.equals("horizontal_split")) {
- return JSplitPane.HORIZONTAL_SPLIT;
- }
- if (value.equals("vertical") || value.equals("vertical_split")) {
- return JSplitPane.VERTICAL_SPLIT;
- }
- throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'");
- }
- return super.constantValue(key, value);
- }
-
- @Override
- public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
- return new CompiledObject(id, getBeanClass(), compiler) {
-
- private int count;
-
- @Override
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- if (constraints != null) {
- compiler.reportError("JSplitPane does not accept constraints");
- }
- if (count == 0) {
- super.addChild(child, "JSplitPane.LEFT", compiler);
- } else if (count == 1) {
- super.addChild(child, "JSplitPane.RIGHT", compiler);
- } else {
- compiler.reportError("JSplitPane is limited to two children");
- }
- count++;
- }
- };
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+
+import javax.swing.JSplitPane;
+import java.awt.Component;
+
+public class JSplitPaneHandler extends DefaultComponentHandler {
+
+ public JSplitPaneHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSplitPane.class);
+ }
+
+ protected Component createRawComponent(Element tag) {
+ return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+ }
+
+ /**
+ * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. The
+ * values required by the JAXXBeanInfo are the unwieldy <code>vertical_split</code> and <code>horizontal_split</code>
+ * (which are also recognized).
+ */
+ @Override
+ protected int constantValue(String key, String value) {
+ if (key.equals("orientation")) {
+ value = value.trim().toLowerCase();
+ if (value.equals("horizontal") || value.equals("horizontal_split")) {
+ return JSplitPane.HORIZONTAL_SPLIT;
+ }
+ if (value.equals("vertical") || value.equals("vertical_split")) {
+ return JSplitPane.VERTICAL_SPLIT;
+ }
+ throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'");
+ }
+ return super.constantValue(key, value);
+ }
+
+ @Override
+ public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
+ return new CompiledObject(id, getBeanClass(), compiler) {
+
+ private int count;
+
+ @Override
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ if (constraints != null) {
+ compiler.reportError("JSplitPane does not accept constraints");
+ }
+ if (count == 0) {
+ super.addChild(child, "JSplitPane.LEFT", compiler);
+ } else if (count == 1) {
+ super.addChild(child, "JSplitPane.RIGHT", compiler);
+ } else {
+ compiler.reportError("JSplitPane is limited to two children");
+ }
+ count++;
+ }
+ };
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,135 +1,151 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.I18nHelper;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import jaxx.runtime.swing.TabInfo;
-
-import javax.swing.Icon;
-import javax.swing.JTabbedPane;
-import javax.swing.event.ChangeListener;
-import java.awt.Color;
-import java.awt.event.ContainerListener;
-
-public class JTabbedPaneHandler extends DefaultComponentHandler {
-
- public JTabbedPaneHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTabbedPane.class);
- }
-
- public static class CompiledTabbedPane extends CompiledObject {
-
- private static final TabInfo USED = new TabInfo("ALREADY USED");
- int tabCount;
- TabInfo tabInfo;
-
- public CompiledTabbedPane(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
- super(id, objectClass, compiler);
- }
-
- @Override
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- if (constraints != null) {
- compiler.reportError("JTabbedPane tabs may not have constraints");
- }
-
- super.addChild(child, constraints, compiler);
-
- if (tabInfo == null) {
- compiler.reportError("JTabbedPaneHandler may only have 'tab' tags as children (found " + child.getObjectClass() + ")");
- return;
- } else if (tabInfo == USED) {
- compiler.reportError("<tab> tags may only have one child component");
- return;
- }
-
- int tabIndex = ++tabCount - 1;
- appendAdditionCode(tabInfo.getId() + ".addPropertyChangeListener(new jaxx.runtime.swing.TabInfoPropertyChangeListener(" + getId() + ", " + tabIndex + "));");
-
- String title = tabInfo.getTitle();
- if (title != null) {
- if (I18nHelper.isI18nAttribute("title")) {
- if (!title.startsWith("_(\"")) {
- // we did not have the invocation code, add it
- title = I18nHelper.addI18nInvocation(getId(), "title", compiler.getJavaCode(title), compiler);
- }
- } else {
- title = compiler.getJavaCode(title);
- }
- appendAdditionCode(getId() + ".setTitleAt(" + tabIndex + ", " + title + ");");
- }
-
- String toolTipText = tabInfo.getToolTipText();
- if (toolTipText != null) {
- if (I18nHelper.isI18nAttribute("toolTipText")) {
- if (!toolTipText.startsWith("_(\"")) {
- // we did not have the invocation code, add it
- toolTipText = I18nHelper.addI18nInvocation(getId(), "toolTipText", compiler.getJavaCode(toolTipText), compiler);
- }
- } else {
- toolTipText = compiler.getJavaCode(toolTipText);
- }
- appendAdditionCode(getId() + ".setToolTipTextAt(" + tabIndex + ", " + toolTipText + ");");
- }
-
- boolean enabled = tabInfo.isEnabled();
- if (!enabled) {
- appendAdditionCode(getId() + ".setEnabledAt(" + tabIndex + ", false);");
- }
-
- Color foreground = tabInfo.getForeground();
- if (foreground != null) {
- appendAdditionCode(getId() + ".setForegroundAt(" + tabIndex + ", " + compiler.getJavaCode(foreground) + ");");
- }
-
- Color background = tabInfo.getBackground();
- if (background != null) {
- appendAdditionCode(getId() + ".setBackgroundAt(" + tabIndex + ", " + compiler.getJavaCode(background) + ");");
- }
-
- int mnemonic = tabInfo.getMnemonic();
- if (mnemonic != -1) {
- appendAdditionCode(getId() + ".setMnemonicAt(" + tabIndex + ", " + mnemonic + ");");
- }
-
- int displayedMnemonicIndex = tabInfo.getDisplayedMnemonicIndex();
- if (displayedMnemonicIndex != -1) {
- appendAdditionCode(getId() + ".setDisplayedMnemonicIndexAt(" + tabIndex + ", " + displayedMnemonicIndex + ");");
- }
-
- Icon icon = tabInfo.getIcon();
- if (icon != null) {
- appendAdditionCode(getId() + ".setIconAt(" + tabIndex + ", " + icon + ");");
- }
-
- Icon disabledIcon = tabInfo.getDisabledIcon();
- if (disabledIcon != null) {
- appendAdditionCode(getId() + ".setDisabledIconAt(" + tabIndex + ", " + disabledIcon + ");");
- }
-
- tabInfo = USED;
- }
- }
-
- @Override
- public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
- return new CompiledTabbedPane(id, getBeanClass(), compiler);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("getSelectedIndex", ChangeListener.class);
- addProxyEventInfo("getSelectedComponent", ChangeListener.class);
- addProxyEventInfo("getTabCount", ContainerListener.class);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.I18nHelper;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import jaxx.runtime.swing.TabInfo;
+
+import javax.swing.Icon;
+import javax.swing.JTabbedPane;
+import javax.swing.event.ChangeListener;
+import java.awt.Color;
+import java.awt.event.ContainerListener;
+
+public class JTabbedPaneHandler extends DefaultComponentHandler {
+
+ public JTabbedPaneHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTabbedPane.class);
+ }
+
+ public static class CompiledTabbedPane extends CompiledObject {
+
+ private static final TabInfo USED = new TabInfo("ALREADY USED");
+ int tabCount;
+ TabInfo tabInfo;
+
+ public CompiledTabbedPane(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
+ super(id, objectClass, compiler);
+ }
+
+ @Override
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ if (constraints != null) {
+ compiler.reportError("JTabbedPane tabs may not have constraints");
+ }
+
+ super.addChild(child, constraints, compiler);
+
+ if (tabInfo == null) {
+ compiler.reportError("JTabbedPaneHandler may only have 'tab' tags as children (found " + child.getObjectClass() + ")");
+ return;
+ } else if (tabInfo == USED) {
+ compiler.reportError("<tab> tags may only have one child component");
+ return;
+ }
+
+ int tabIndex = ++tabCount - 1;
+ appendAdditionCode(tabInfo.getId() + ".addPropertyChangeListener(new jaxx.runtime.swing.TabInfoPropertyChangeListener(" + getId() + ", " + tabIndex + "));");
+
+ String title = tabInfo.getTitle();
+ if (title != null) {
+ if (I18nHelper.isI18nAttribute("title")) {
+ if (!title.startsWith("_(\"")) {
+ // we did not have the invocation code, add it
+ title = I18nHelper.addI18nInvocation(getId(), "title", compiler.getJavaCode(title), compiler);
+ }
+ } else {
+ title = compiler.getJavaCode(title);
+ }
+ appendAdditionCode(getId() + ".setTitleAt(" + tabIndex + ", " + title + ");");
+ }
+
+ String toolTipText = tabInfo.getToolTipText();
+ if (toolTipText != null) {
+ if (I18nHelper.isI18nAttribute("toolTipText")) {
+ if (!toolTipText.startsWith("_(\"")) {
+ // we did not have the invocation code, add it
+ toolTipText = I18nHelper.addI18nInvocation(getId(), "toolTipText", compiler.getJavaCode(toolTipText), compiler);
+ }
+ } else {
+ toolTipText = compiler.getJavaCode(toolTipText);
+ }
+ appendAdditionCode(getId() + ".setToolTipTextAt(" + tabIndex + ", " + toolTipText + ");");
+ }
+
+ boolean enabled = tabInfo.isEnabled();
+ if (!enabled) {
+ appendAdditionCode(getId() + ".setEnabledAt(" + tabIndex + ", false);");
+ }
+
+ Color foreground = tabInfo.getForeground();
+ if (foreground != null) {
+ appendAdditionCode(getId() + ".setForegroundAt(" + tabIndex + ", " + compiler.getJavaCode(foreground) + ");");
+ }
+
+ Color background = tabInfo.getBackground();
+ if (background != null) {
+ appendAdditionCode(getId() + ".setBackgroundAt(" + tabIndex + ", " + compiler.getJavaCode(background) + ");");
+ }
+
+ int mnemonic = tabInfo.getMnemonic();
+ if (mnemonic != -1) {
+ appendAdditionCode(getId() + ".setMnemonicAt(" + tabIndex + ", " + mnemonic + ");");
+ }
+
+ int displayedMnemonicIndex = tabInfo.getDisplayedMnemonicIndex();
+ if (displayedMnemonicIndex != -1) {
+ appendAdditionCode(getId() + ".setDisplayedMnemonicIndexAt(" + tabIndex + ", " + displayedMnemonicIndex + ");");
+ }
+
+ Icon icon = tabInfo.getIcon();
+ if (icon != null) {
+ appendAdditionCode(getId() + ".setIconAt(" + tabIndex + ", " + icon + ");");
+ }
+
+ Icon disabledIcon = tabInfo.getDisabledIcon();
+ if (disabledIcon != null) {
+ appendAdditionCode(getId() + ".setDisabledIconAt(" + tabIndex + ", " + disabledIcon + ");");
+ }
+
+ tabInfo = USED;
+ }
+ }
+
+ @Override
+ public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
+ return new CompiledTabbedPane(id, getBeanClass(), compiler);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("getSelectedIndex", ChangeListener.class);
+ addProxyEventInfo("getSelectedComponent", ChangeListener.class);
+ addProxyEventInfo("getTabCount", ContainerListener.class);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,70 +1,86 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import jaxx.runtime.SwingUtil;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import javax.swing.JTextArea;
-import javax.swing.event.DocumentListener;
-import javax.swing.text.JTextComponent;
-
-public class JTextComponentHandler extends DefaultComponentHandler {
-
- private static final int DEFAULT_COLUMNS = 15;
-
- public JTextComponentHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTextComponent.class);
- }
-
- @Override
- protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- super.setDefaults(object, tag, compiler);
- try {
- object.getObjectClass().getMethodDescriptor("setColumns", ClassDescriptorLoader.getClassDescriptor(int.class));
- setAttribute(object, "columns", String.valueOf(DEFAULT_COLUMNS), false, compiler);
- } catch (NoSuchMethodException e) {
- // ignore ?
- }
-
- if (ClassDescriptorLoader.getClassDescriptor(JTextArea.class).isAssignableFrom(object.getObjectClass())) {
- setAttribute(object, "lineWrap", "true", false, compiler);
- setAttribute(object, "wrapStyleWord", "true", false, compiler);
- }
- }
-
- @Override
- public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException {
- if (name.equals("text")) {
- return SwingUtil.class.getName() + ".setText(" + id + ", " + valueCode + ");\n";
- //return "jaxx.runtime.swing.Utils.setText(" + id + ", " + valueCode + ");\n";
- }
- return super.getSetPropertyCode(id, name, valueCode, compiler);
- }
-
- @Override
- protected int getAttributeOrdering(Attr attr) {
- // delay text in case other attributes affect how it's processed, as is the case
- // with JEditorPane's contentType
- if (attr.getName().equals("text")) {
- return 1;
- }
- return super.getAttributeOrdering(attr);
- }
-
- @Override
- protected void configureProxyEventInfo() {
- super.configureProxyEventInfo();
- addProxyEventInfo("getText", DocumentListener.class, "document");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import jaxx.runtime.SwingUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+import javax.swing.JTextArea;
+import javax.swing.event.DocumentListener;
+import javax.swing.text.JTextComponent;
+
+public class JTextComponentHandler extends DefaultComponentHandler {
+
+ private static final int DEFAULT_COLUMNS = 15;
+
+ public JTextComponentHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTextComponent.class);
+ }
+
+ @Override
+ protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ super.setDefaults(object, tag, compiler);
+ try {
+ object.getObjectClass().getMethodDescriptor("setColumns", ClassDescriptorLoader.getClassDescriptor(int.class));
+ setAttribute(object, "columns", String.valueOf(DEFAULT_COLUMNS), false, compiler);
+ } catch (NoSuchMethodException e) {
+ // ignore ?
+ }
+
+ if (ClassDescriptorLoader.getClassDescriptor(JTextArea.class).isAssignableFrom(object.getObjectClass())) {
+ setAttribute(object, "lineWrap", "true", false, compiler);
+ setAttribute(object, "wrapStyleWord", "true", false, compiler);
+ }
+ }
+
+ @Override
+ public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException {
+ if (name.equals("text")) {
+ return SwingUtil.class.getName() + ".setText(" + id + ", " + valueCode + ");\n";
+ //return "jaxx.runtime.swing.Utils.setText(" + id + ", " + valueCode + ");\n";
+ }
+ return super.getSetPropertyCode(id, name, valueCode, compiler);
+ }
+
+ @Override
+ protected int getAttributeOrdering(Attr attr) {
+ // delay text in case other attributes affect how it's processed, as is the case
+ // with JEditorPane's contentType
+ if (attr.getName().equals("text")) {
+ return 1;
+ }
+ return super.getAttributeOrdering(attr);
+ }
+
+ @Override
+ protected void configureProxyEventInfo() {
+ super.configureProxyEventInfo();
+ addProxyEventInfo("getText", DocumentListener.class, "document");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,39 +1,55 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-
-import javax.swing.JToolBar;
-
-public class JToolBarHandler extends DefaultComponentHandler {
-
- public JToolBarHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JToolBar.class);
- }
-
- /**
- * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. These values should
- * have been supported without any special effort on my part, but JToolBar's BeanInfo doesn't contain the enum attribute
- * for the orientation property.
- */
- @Override
- protected int constantValue(String key, String value) {
- if (key.equals("orientation")) {
- value = value.trim().toLowerCase();
- if (value.equals("horizontal")) {
- return JToolBar.HORIZONTAL;
- }
- if (value.equals("vertical")) {
- return JToolBar.VERTICAL;
- }
- throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'");
- }
- return super.constantValue(key, value);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+
+import javax.swing.JToolBar;
+
+public class JToolBarHandler extends DefaultComponentHandler {
+
+ public JToolBarHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JToolBar.class);
+ }
+
+ /**
+ * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. These values should
+ * have been supported without any special effort on my part, but JToolBar's BeanInfo doesn't contain the enum attribute
+ * for the orientation property.
+ */
+ @Override
+ protected int constantValue(String key, String value) {
+ if (key.equals("orientation")) {
+ value = value.trim().toLowerCase();
+ if (value.equals("horizontal")) {
+ return JToolBar.HORIZONTAL;
+ }
+ if (value.equals("vertical")) {
+ return JToolBar.VERTICAL;
+ }
+ throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'");
+ }
+ return super.constantValue(key, value);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tags.swing;
import jaxx.compiler.CompilerException;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,62 +1,78 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JMenuBar;
-import javax.swing.JWindow;
-import java.io.IOException;
-import java.util.Map;
-
-public class JWindowHandler extends DefaultComponentHandler {
-
- public JWindowHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JWindow.class, JFrame.class, JDialog.class);
- }
-
- @Override
- public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
- return new CompiledObject(id, getBeanClass(), compiler) {
-
- @Override
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) {
- appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");");
- } else {
- super.addChild(child, constraints, compiler);
- }
- }
- };
- }
-
- @Override
- protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
- if (compiler.getOpenComponent() != null) {
- compiler.openInvisibleComponent(object);
- } else {
- super.openComponent(object, tag, compiler);
- }
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- super.compileSecondPass(tag, compiler);
- CompiledObject object = objectMap.get(tag);
- Map<?, ?> properties = object.getProperties();
- if (!properties.containsKey("width") && !properties.containsKey("height")) {
- compiler.appendLateInitializer(object.getId() + ".pack();\n");
- }
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JMenuBar;
+import javax.swing.JWindow;
+import java.io.IOException;
+import java.util.Map;
+
+public class JWindowHandler extends DefaultComponentHandler {
+
+ public JWindowHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JWindow.class, JFrame.class, JDialog.class);
+ }
+
+ @Override
+ public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
+ return new CompiledObject(id, getBeanClass(), compiler) {
+
+ @Override
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) {
+ appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");");
+ } else {
+ super.addChild(child, constraints, compiler);
+ }
+ }
+ };
+ }
+
+ @Override
+ protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException {
+ if (compiler.getOpenComponent() != null) {
+ compiler.openInvisibleComponent(object);
+ } else {
+ super.openComponent(object, tag, compiler);
+ }
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ super.compileSecondPass(tag, compiler);
+ CompiledObject object = objectMap.get(tag);
+ Map<?, ?> properties = object.getProperties();
+ if (!properties.containsKey("width") && !properties.containsKey("height")) {
+ compiler.appendLateInitializer(object.getId() + ".pack();\n");
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,88 +1,104 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.runtime.swing.Table;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.awt.GridBagConstraints;
-import java.io.IOException;
-
-public class RowHandler implements TagHandler {
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compileChildrenFirstPass(tag, compiler);
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- if (!ClassDescriptorLoader.getClassDescriptor(Table.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
- compiler.reportError("row tag may only appear within Table tag");
- return;
- }
-
- TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent();
- table.newRow();
- GridBagConstraints c = table.getRowConstraints();
- CellHandler.setAttributes(c, tag);
- compileChildrenSecondPass(tag, compiler);
- }
-
- public void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- if (!child.getLocalName().equals("cell")) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children");
- }
- compileChildTagFirstPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- if (!child.getLocalName().equals("cell")) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children");
- }
- compileChildTagSecondPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileFirstPass(tag);
- }
-
- protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileSecondPass(tag);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.runtime.swing.Table;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.awt.GridBagConstraints;
+import java.io.IOException;
+
+public class RowHandler implements TagHandler {
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compileChildrenFirstPass(tag, compiler);
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ if (!ClassDescriptorLoader.getClassDescriptor(Table.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
+ compiler.reportError("row tag may only appear within Table tag");
+ return;
+ }
+
+ TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent();
+ table.newRow();
+ GridBagConstraints c = table.getRowConstraints();
+ CellHandler.setAttributes(c, tag);
+ compileChildrenSecondPass(tag, compiler);
+ }
+
+ public void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ if (!child.getLocalName().equals("cell")) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children");
+ }
+ compileChildTagFirstPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ if (!child.getLocalName().equals("cell")) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children");
+ }
+ compileChildTagSecondPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileFirstPass(tag);
+ }
+
+ protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileSecondPass(tag);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,169 +1,185 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.I18nHelper;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.runtime.swing.TabInfo;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import javax.swing.Icon;
-import javax.swing.JTabbedPane;
-import java.awt.Color;
-import java.io.IOException;
-
-public class TabHandler implements TagHandler {
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compileChildrenFirstPass(tag, compiler);
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- if (!ClassDescriptorLoader.getClassDescriptor(JTabbedPane.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
- compiler.reportError("tab tag may only appear within JTabbedPane tag");
- return;
- }
-
- JTabbedPaneHandler.CompiledTabbedPane tabs = (JTabbedPaneHandler.CompiledTabbedPane) compiler.getOpenComponent();
-
- String id = tag.getAttribute("id");
- if (id == null || id.length() == 0) {
- id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(TabInfo.class));
- }
- TabInfo tabInfo = new TabInfo(id);
- CompiledObject compiledTabInfo = new CompiledObject(id, ClassDescriptorLoader.getClassDescriptor(TabInfo.class), compiler);
- compiler.registerCompiledObject(compiledTabInfo);
- //id = tabInfo.getId();
- tabs.tabInfo = tabInfo;
- setAttributes(compiledTabInfo, tabs, tag, compiler);
- compileChildrenSecondPass(tag, compiler);
- tabs.tabInfo = null;
- }
-
- public static void setAttribute(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, String name, String value, JAXXCompiler compiler) throws CompilerException {
- value = value.trim();
- TabInfo tabInfo = tabs.tabInfo;
- String id = tabInfo.getId();
- String binding = compiler.processDataBindings(value, ClassDescriptorLoader.getClassDescriptor(Object.class));
- if (binding != null) {
- compiler.registerDataBinding(binding, id + "." + name, id + ".set" + org.apache.commons.lang.StringUtils.capitalize(name) + "(" + binding + ");");
- return;
- }
-
- String valueCode = compiler.getJavaCode(value);
-
- // add i18n support
- if (I18nHelper.isI18nableAttribute(name, compiler)) {
- value = valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler);
- }
-
- if (name.equals("title")) {
- tabInfo.setTitle(value);
- compiledTabInfo.appendInitializationCode(id + ".setTitle(" + valueCode + ");");
- //compiledTabInfo.appendInitializationCode(id + ".setTitle(" + TypeManager.getJavaCode(value) + ");");
- } else if (name.equals("toolTipText")) {
- tabInfo.setToolTipText(value);
- compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + valueCode + ");");
- //compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + TypeManager.getJavaCode(value) + ");");
- } else if (name.equals("icon")) {
- Icon icon = (Icon) compiler.convertFromString(value, Icon.class);
- tabInfo.setIcon(icon);
- compiledTabInfo.appendInitializationCode(id + ".setIcon(" + compiler.getJavaCode(icon) + ");");
- } else if (name.equals("enabled")) {
- boolean enabled = (Boolean) compiler.convertFromString(value, Boolean.class);
- tabInfo.setEnabled(enabled);
- compiledTabInfo.appendInitializationCode(id + ".setEnabled(" + enabled + ");");
- } else if (name.equals("disabledIcon")) {
- Icon disabledIcon = (Icon) compiler.convertFromString(value, Icon.class);
- tabInfo.setDisabledIcon(disabledIcon);
- compiledTabInfo.appendInitializationCode(id + ".setDisabledIcon(" + compiler.getJavaCode(disabledIcon) + ");");
- } else if (name.equals("mnemonic")) {
- int mnemonic = (Character) compiler.convertFromString(value, char.class);
- tabInfo.setMnemonic(mnemonic);
- compiledTabInfo.appendInitializationCode(id + ".setMnemonic(" + mnemonic + ");");
- } else if (name.equals("displayedMnemonicIndex")) {
- int displayedMnemonicIndex = (Integer) compiler.convertFromString(value, int.class);
- tabInfo.setDisplayedMnemonicIndex(displayedMnemonicIndex);
- compiledTabInfo.appendInitializationCode(id + ".setDisplayedMnemonicIndex(" + displayedMnemonicIndex + ");");
- } else if (name.equals("foreground")) {
- Color foreground = (Color) compiler.convertFromString(value, Color.class);
- tabInfo.setForeground(foreground);
- compiledTabInfo.appendInitializationCode(id + ".setForeground(" + compiler.getJavaCode(foreground) + ");");
- } else if (name.equals("background")) {
- Color background = (Color) compiler.convertFromString(value, Color.class);
- tabInfo.setBackground(background);
- compiledTabInfo.appendInitializationCode(id + ".setBackground(" + compiler.getJavaCode(background) + ");");
- } else if (name.equals("id")) {
- // ignore, already handled
- } else {
- compiler.reportError("The <tab> tag does not support the attribute '" + name + "'");
- }
- }
-
- public void setAttributes(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, Element tag, JAXXCompiler compiler) throws CompilerException {
- NamedNodeMap children = tag.getAttributes();
- for (int i = 0; i < children.getLength(); i++) {
- Attr attribute = (Attr) children.item(i);
- String name = attribute.getName();
- String value = attribute.getValue();
- if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
- setAttribute(compiledTabInfo, tabs, name, value, compiler);
- }
- }
- }
-
- protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- compileChildTagFirstPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileFirstPass(tag);
- }
-
- protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- NodeList children = tag.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- Element child = (Element) node;
- compileChildTagSecondPass(child, compiler);
- } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- String text = ((Text) node).getData().trim();
- if (text.length() > 0) {
- compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
- }
- }
- }
- }
-
- protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- compiler.compileSecondPass(tag);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.I18nHelper;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.runtime.swing.TabInfo;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import javax.swing.Icon;
+import javax.swing.JTabbedPane;
+import java.awt.Color;
+import java.io.IOException;
+
+public class TabHandler implements TagHandler {
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compileChildrenFirstPass(tag, compiler);
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ if (!ClassDescriptorLoader.getClassDescriptor(JTabbedPane.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
+ compiler.reportError("tab tag may only appear within JTabbedPane tag");
+ return;
+ }
+
+ JTabbedPaneHandler.CompiledTabbedPane tabs = (JTabbedPaneHandler.CompiledTabbedPane) compiler.getOpenComponent();
+
+ String id = tag.getAttribute("id");
+ if (id == null || id.length() == 0) {
+ id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(TabInfo.class));
+ }
+ TabInfo tabInfo = new TabInfo(id);
+ CompiledObject compiledTabInfo = new CompiledObject(id, ClassDescriptorLoader.getClassDescriptor(TabInfo.class), compiler);
+ compiler.registerCompiledObject(compiledTabInfo);
+ //id = tabInfo.getId();
+ tabs.tabInfo = tabInfo;
+ setAttributes(compiledTabInfo, tabs, tag, compiler);
+ compileChildrenSecondPass(tag, compiler);
+ tabs.tabInfo = null;
+ }
+
+ public static void setAttribute(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, String name, String value, JAXXCompiler compiler) throws CompilerException {
+ value = value.trim();
+ TabInfo tabInfo = tabs.tabInfo;
+ String id = tabInfo.getId();
+ String binding = compiler.processDataBindings(value, ClassDescriptorLoader.getClassDescriptor(Object.class));
+ if (binding != null) {
+ compiler.registerDataBinding(binding, id + "." + name, id + ".set" + org.apache.commons.lang.StringUtils.capitalize(name) + "(" + binding + ");");
+ return;
+ }
+
+ String valueCode = compiler.getJavaCode(value);
+
+ // add i18n support
+ if (I18nHelper.isI18nableAttribute(name, compiler)) {
+ value = valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler);
+ }
+
+ if (name.equals("title")) {
+ tabInfo.setTitle(value);
+ compiledTabInfo.appendInitializationCode(id + ".setTitle(" + valueCode + ");");
+ //compiledTabInfo.appendInitializationCode(id + ".setTitle(" + TypeManager.getJavaCode(value) + ");");
+ } else if (name.equals("toolTipText")) {
+ tabInfo.setToolTipText(value);
+ compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + valueCode + ");");
+ //compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + TypeManager.getJavaCode(value) + ");");
+ } else if (name.equals("icon")) {
+ Icon icon = (Icon) compiler.convertFromString(value, Icon.class);
+ tabInfo.setIcon(icon);
+ compiledTabInfo.appendInitializationCode(id + ".setIcon(" + compiler.getJavaCode(icon) + ");");
+ } else if (name.equals("enabled")) {
+ boolean enabled = (Boolean) compiler.convertFromString(value, Boolean.class);
+ tabInfo.setEnabled(enabled);
+ compiledTabInfo.appendInitializationCode(id + ".setEnabled(" + enabled + ");");
+ } else if (name.equals("disabledIcon")) {
+ Icon disabledIcon = (Icon) compiler.convertFromString(value, Icon.class);
+ tabInfo.setDisabledIcon(disabledIcon);
+ compiledTabInfo.appendInitializationCode(id + ".setDisabledIcon(" + compiler.getJavaCode(disabledIcon) + ");");
+ } else if (name.equals("mnemonic")) {
+ int mnemonic = (Character) compiler.convertFromString(value, char.class);
+ tabInfo.setMnemonic(mnemonic);
+ compiledTabInfo.appendInitializationCode(id + ".setMnemonic(" + mnemonic + ");");
+ } else if (name.equals("displayedMnemonicIndex")) {
+ int displayedMnemonicIndex = (Integer) compiler.convertFromString(value, int.class);
+ tabInfo.setDisplayedMnemonicIndex(displayedMnemonicIndex);
+ compiledTabInfo.appendInitializationCode(id + ".setDisplayedMnemonicIndex(" + displayedMnemonicIndex + ");");
+ } else if (name.equals("foreground")) {
+ Color foreground = (Color) compiler.convertFromString(value, Color.class);
+ tabInfo.setForeground(foreground);
+ compiledTabInfo.appendInitializationCode(id + ".setForeground(" + compiler.getJavaCode(foreground) + ");");
+ } else if (name.equals("background")) {
+ Color background = (Color) compiler.convertFromString(value, Color.class);
+ tabInfo.setBackground(background);
+ compiledTabInfo.appendInitializationCode(id + ".setBackground(" + compiler.getJavaCode(background) + ");");
+ } else if (name.equals("id")) {
+ // ignore, already handled
+ } else {
+ compiler.reportError("The <tab> tag does not support the attribute '" + name + "'");
+ }
+ }
+
+ public void setAttributes(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, Element tag, JAXXCompiler compiler) throws CompilerException {
+ NamedNodeMap children = tag.getAttributes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Attr attribute = (Attr) children.item(i);
+ String name = attribute.getName();
+ String value = attribute.getValue();
+ if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
+ setAttribute(compiledTabInfo, tabs, name, value, compiler);
+ }
+ }
+ }
+
+ protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ compileChildTagFirstPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileFirstPass(tag);
+ }
+
+ protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ NodeList children = tag.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ Element child = (Element) node;
+ compileChildTagSecondPass(child, compiler);
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ String text = ((Text) node).getData().trim();
+ if (text.length() > 0) {
+ compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
+ }
+ }
+ }
+
+ protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ compiler.compileSecondPass(tag);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,123 +1,139 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.swing;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.UnsupportedAttributeException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultComponentHandler;
-import jaxx.runtime.swing.Table;
-
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.util.ArrayList;
-import java.util.List;
-
-public class TableHandler extends DefaultComponentHandler {
-
- public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3);
-
- public TableHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Table.class);
- }
-
- @Override
- public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException {
- try {
- if (object instanceof CompiledTable) {
- CellHandler.setAttribute(((CompiledTable) object).getTableConstraints(), propertyName, stringValue);
- } else {
- super.setAttribute(object, propertyName, stringValue, inline, compiler);
- }
- } catch (UnsupportedAttributeException e) {
- super.setAttribute(object, propertyName, stringValue, inline, compiler);
- }
- }
-
- class CompiledTable extends CompiledObject {
-
- private List<Integer> rowSpans = new ArrayList<Integer>();
- private GridBagConstraints tableConstraints;
- private GridBagConstraints rowConstraints = null;
- private GridBagConstraints cellConstraints = null;
- private boolean emptyCell;
-
- public CompiledTable(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
- super(id, objectClass, compiler);
- tableConstraints = new GridBagConstraints();
- tableConstraints.gridx = -1;
- tableConstraints.gridy = -1;
- tableConstraints.insets = DEFAULT_INSETS;
- }
-
- @Override
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- if (constraints != null) {
- compiler.reportError("Table does not accept constraints");
- }
- GridBagConstraints c = getCellConstraints();
- if (c == null) {
- compiler.reportError("Table tag may only contain row tags");
- return;
- }
- if (!emptyCell) {
- compiler.reportError("Table cells may only have one child component");
- }
- while (rowSpans.size() < c.gridx + c.gridwidth) {
- rowSpans.add(null);
- }
- for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) {
- rowSpans.set(x, c.gridheight);
- }
-
- super.addChild(child, compiler.getJavaCode(c), compiler);
-
- emptyCell = false;
- }
-
- public GridBagConstraints getTableConstraints() {
- return tableConstraints;
- }
-
- public GridBagConstraints getRowConstraints() {
- return rowConstraints;
- }
-
- public GridBagConstraints getCellConstraints() {
- return cellConstraints;
- }
-
- public void newRow() {
- tableConstraints.gridy++;
- tableConstraints.gridx = -1;
- rowConstraints = (GridBagConstraints) tableConstraints.clone();
-
- for (int x = 0; x < rowSpans.size(); x++) {
- int rowSpan = rowSpans.get(x);
- if (rowSpan > 0) {
- rowSpans.set(x, rowSpan - 1);
- }
- }
- }
-
- public void newCell() {
- emptyCell = true;
- rowConstraints.gridx++;
- while (rowConstraints.gridx < rowSpans.size() && rowSpans.get(rowConstraints.gridx) > 0) {
- rowConstraints.gridx++;
- }
- cellConstraints = (GridBagConstraints) rowConstraints.clone();
- }
- }
-
- @Override
- public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
- return new CompiledTable(id, getBeanClass(), compiler);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.swing;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.UnsupportedAttributeException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultComponentHandler;
+import jaxx.runtime.swing.Table;
+
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.util.ArrayList;
+import java.util.List;
+
+public class TableHandler extends DefaultComponentHandler {
+
+ public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3);
+
+ public TableHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Table.class);
+ }
+
+ @Override
+ public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException {
+ try {
+ if (object instanceof CompiledTable) {
+ CellHandler.setAttribute(((CompiledTable) object).getTableConstraints(), propertyName, stringValue);
+ } else {
+ super.setAttribute(object, propertyName, stringValue, inline, compiler);
+ }
+ } catch (UnsupportedAttributeException e) {
+ super.setAttribute(object, propertyName, stringValue, inline, compiler);
+ }
+ }
+
+ class CompiledTable extends CompiledObject {
+
+ private List<Integer> rowSpans = new ArrayList<Integer>();
+ private GridBagConstraints tableConstraints;
+ private GridBagConstraints rowConstraints = null;
+ private GridBagConstraints cellConstraints = null;
+ private boolean emptyCell;
+
+ public CompiledTable(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException {
+ super(id, objectClass, compiler);
+ tableConstraints = new GridBagConstraints();
+ tableConstraints.gridx = -1;
+ tableConstraints.gridy = -1;
+ tableConstraints.insets = DEFAULT_INSETS;
+ }
+
+ @Override
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ if (constraints != null) {
+ compiler.reportError("Table does not accept constraints");
+ }
+ GridBagConstraints c = getCellConstraints();
+ if (c == null) {
+ compiler.reportError("Table tag may only contain row tags");
+ return;
+ }
+ if (!emptyCell) {
+ compiler.reportError("Table cells may only have one child component");
+ }
+ while (rowSpans.size() < c.gridx + c.gridwidth) {
+ rowSpans.add(null);
+ }
+ for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) {
+ rowSpans.set(x, c.gridheight);
+ }
+
+ super.addChild(child, compiler.getJavaCode(c), compiler);
+
+ emptyCell = false;
+ }
+
+ public GridBagConstraints getTableConstraints() {
+ return tableConstraints;
+ }
+
+ public GridBagConstraints getRowConstraints() {
+ return rowConstraints;
+ }
+
+ public GridBagConstraints getCellConstraints() {
+ return cellConstraints;
+ }
+
+ public void newRow() {
+ tableConstraints.gridy++;
+ tableConstraints.gridx = -1;
+ rowConstraints = (GridBagConstraints) tableConstraints.clone();
+
+ for (int x = 0; x < rowSpans.size(); x++) {
+ int rowSpan = rowSpans.get(x);
+ if (rowSpan > 0) {
+ rowSpans.set(x, rowSpan - 1);
+ }
+ }
+ }
+
+ public void newCell() {
+ emptyCell = true;
+ rowConstraints.gridx++;
+ while (rowConstraints.gridx < rowSpans.size() && rowSpans.get(rowConstraints.gridx) > 0) {
+ rowConstraints.gridx++;
+ }
+ cellConstraints = (GridBagConstraints) rowConstraints.clone();
+ }
+ }
+
+ @Override
+ public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException {
+ return new CompiledTable(id, getBeanClass(), compiler);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,715 +1,731 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.validator;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.beans.JAXXBeanInfo;
-import jaxx.compiler.beans.JAXXPropertyDescriptor;
-import jaxx.compiler.reflect.ClassDescriptor;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.DefaultObjectHandler;
-import jaxx.compiler.types.TypeManager;
-import jaxx.runtime.validator.swing.SwingValidatorUtil;
-import jaxx.runtime.validator.swing.SwingValidator;
-import jaxx.runtime.validator.swing.ui.AbstractBeanValidatorUI;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.beans.IntrospectionException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-public class BeanValidatorHandler extends DefaultObjectHandler {
-
- public static final String TAG = "BeanValidator";
- public static final String BEAN_ATTRIBUTE = "bean";
- public static final String BEAN_CLASS_ATTRIBUTE = "beanClass";
- public static final String BEAN_INITIALIZER_ATTRIBUTE = "beanInitializer";
- public static final String ERROR_LIST_MODEL_ATTRIBUTE = "errorListModel";
- public static final String ERROR_TABLE_MODEL_ATTRIBUTE = "errorTableModel";
- public static final String ERROR_LIST_ATTRIBUTE = "errorList";
- public static final String ERROR_TABLE_ATTRIBUTE = "errorTable";
- //TODO-TC20091024 should change this default value to errorListModel
- public static final String ERROR_LIST_MODEL_DEFAULT = "errors";
- //TODO-TC20091024 should change this default value to errorTableModel
- public static final String ERROR_TABLE_MODEL_DEFAULT = "errors2";
- public static final String ERROR_LIST_DEFAULT = "errorList";
- public static final String ERROR_TABLE_DEFAULT = "errorTable";
- public static final String AUTOFIELD_ATTRIBUTE = "autoField";
- public static final String UI_CLASS_ATTRIBUTE = "uiClass";
- public static final String STRICT_MODE_ATTRIBUTE = "strictMode";
- public static final String CONTEXT_NAME_ATTRIBUTE = "contextName";
- //public static final String SCOPE_ATTRIBUTE = "scope";
- public static final String PARENT_VALIDATOR_ATTRIBUTE = "parentValidator";
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static Log log = LogFactory.getLog(BeanValidatorHandler.class);
- protected static Map<JAXXCompiler, List<CompiledBeanValidator>> validators = new HashMap<JAXXCompiler, List<CompiledBeanValidator>>();
- protected static Map<JAXXCompiler, List<String>> validatedComponents = new HashMap<JAXXCompiler, List<String>>();
-
- public BeanValidatorHandler(ClassDescriptor beanClass) {
- super(beanClass);
- ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, SwingValidator.class);
- }
-
- @Override
- protected CompiledObject createCompiledObject(String id, JAXXCompiler compiler) {
- return new CompiledBeanValidator(id, getBeanClass(), compiler);
- }
-
- @Override
- protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- if (log.isDebugEnabled()) {
- log.debug(tag);
- }
- if (!tag.getLocalName().equals(FieldValidatorHandler.TAG)) {
- compiler.reportError("tag '" + tag.getParentNode().getLocalName() + "' may only contain " + FieldValidatorHandler.TAG + " as children, but found : " + tag.getLocalName());
- } else {
- compiler.compileFirstPass(tag);
- }
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
-
- super.compileSecondPass(tag, compiler);
-
- CompiledBeanValidator info = (CompiledBeanValidator) objectMap.get(tag);
-
- boolean error = info.addErrorListModel(tag, this, compiler);
-
- if (!error) {
- error = info.addErrorList(tag, compiler);
- }
-
- if (!error) {
- error = info.addErrorTableModel(tag, this, compiler);
- }
-
- if (!error) {
- error = info.addErrorTable(tag, compiler);
- }
-
- if (!error) {
- error = info.addUiClass(this, compiler);
- }
-
- if (!error) {
- error = info.addBean(tag, this, compiler);
- }
-
- /*if (!error) {
- error = info.addContextName(this, compiler);
- }*/
-
- /*if (!error) {
- error = info.addScope(this, compiler);
- }*/
-
- if (!error) {
- error = info.addParentValidator(tag, this, compiler);
- }
-
- if (error) {
- log.warn("error were detected in second compile pass of CompiledObject [" + info + "]");
- }
-
- // close the compiled object
- compiler.closeComponent(info);
- }
-
- @Override
- protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) {
- // open the compiled object
- compiler.openInvisibleComponent(object);
- }
-
- @Override
- public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) {
- if (log.isDebugEnabled()) {
- log.debug(propertyName + " : " + stringValue + " for " + object);
- }
- // delegate to the compiled object with is statefull (but not the tag handler)
- object.addProperty(propertyName, stringValue);
- }
-
- /**
- * The compiled objet representing a BeanValidator to be generated in JAXXObject
- *
- * @author chemit
- */
- public static class CompiledBeanValidator extends CompiledObject {
-
- protected Map<String, String> fields;
- protected Map<String, String> excludeFields;
- protected String bean;
- protected String beanClass;
- protected String contextName;
- protected String uiClass;
- protected String errorListModel;
- protected String errorList;
- protected Boolean autoField;
- protected Boolean strictMode;
- protected JAXXBeanInfo beanDescriptor;
- protected String errorTableModel;
- protected String errorTable;
- protected String parentValidator;
-
- public CompiledBeanValidator(String id, ClassDescriptor objectClass, JAXXCompiler compiler) {
- //TC-20090524 Use the real class descriptor, not the one by default,
- //TC-20090524 otherwise can not override the validator class while generation
- //super(id, objectClass, compiler);
- super(id, getDescriptor(objectClass, compiler), compiler);
- fields = new TreeMap<String, String>();
- excludeFields = new TreeMap<String, String>();
- if (log.isDebugEnabled()) {
- log.debug("validator objectClass " + super.getObjectClass());
- }
- }
-
- protected static ClassDescriptor getDescriptor(ClassDescriptor objectClass, JAXXCompiler compiler) {
- ClassDescriptor result = objectClass;
- Class<?> validatorClass = compiler.getConfiguration().getValidatorClass();
- result = ClassDescriptorLoader.getClassDescriptor(validatorClass);
- return result;
- }
-
- public Map<String, String> getFields() {
- return fields;
- }
-
- public Map<String, String> getExcludeFields() {
- return excludeFields;
- }
-
- public void setFields(Map<String, String> fields) {
- this.fields = fields;
- }
-
- public void setExcludeFields(Map<String, String> excludeFields) {
- this.excludeFields = excludeFields;
- }
-
- @Override
- public void addProperty(String property, String value) {
-
- if (BEAN_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- bean = value.trim();
- }
- return;
- }
-
- if (CONTEXT_NAME_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- contextName = value.trim();
- }
- return;
- }
-
- if (BEAN_CLASS_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- beanClass = value.trim();
- }
- return;
- }
-
- if (ERROR_LIST_MODEL_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- errorListModel = value.trim();
- }
- return;
- }
-
- if (ERROR_LIST_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- errorList = value.trim();
- }
- return;
- }
-
- if (ERROR_TABLE_MODEL_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- errorTableModel = value.trim();
- }
- return;
- }
-
- if (ERROR_TABLE_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- errorTable = value.trim();
- }
- return;
- }
-
- if (UI_CLASS_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- uiClass = value.trim();
- }
- return;
- }
-
- if (AUTOFIELD_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- autoField = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class);
- }
- return;
- }
-
- if (STRICT_MODE_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- strictMode = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class);
- }
- return;
- }
-
- if (PARENT_VALIDATOR_ATTRIBUTE.equals(property)) {
- if (value != null && !value.trim().isEmpty()) {
- parentValidator = value.trim();
- }
- return;
- }
-
- throw new CompilerException("property " + property + " is not allowed on object " + this);
- }
-
- public String getBean() {
- return bean;
- }
-
- public String getErrorListModel() {
- return errorListModel;
- }
-
- public boolean getAutoField() {
- return autoField != null && autoField;
- }
-
- public boolean getStrictMode() {
- return strictMode != null && strictMode;
- }
-
- public String getUiClass() {
- return uiClass;
- }
-
- public String getBeanClass() {
- return beanClass;
- }
-
- public String getContextName() {
- return contextName;
- }
-
- public String getParentValidator() {
- return parentValidator;
- }
-
- public JAXXBeanInfo getBeanDescriptor(JAXXCompiler compiler) {
- if (beanDescriptor == null && foundBean()) {
-
- String beanClassName = null;
- try {
- //TC-20090111 beanClass is mandatory
- // get the real bean class name (from bean or beanClass)
- /*if (beanClass != null) {
- beanClassName = beanClass;
- } else {
- beanClassName = compiler.getSymbolTable().getClassTagIds().get(bean);
- if (beanClassName == null) {
- compiler.reportError("could not find class of the bean '" + bean + "'");
- return null;
- }
- }*/
- ClassDescriptor beanClassDescriptor = ClassDescriptorLoader.getClassDescriptor(beanClass);
- beanDescriptor = DefaultObjectHandler.getJAXXBeanInfo(beanClassDescriptor);
- } catch (ClassNotFoundException e) {
- compiler.reportError("could not load class " + beanClassName);
- } catch (IntrospectionException e) {
- compiler.reportError("could not load class " + beanClassName);
- }
- }
- return beanDescriptor;
- }
-
- @Override
- public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
- // do nothing
- compiler.reportError("can not add CompiledObject in the tag '" + TAG + " (only field tags)");
- }
-
- public boolean foundBean() {
- return !(beanClass == null || beanClass.isEmpty());
- }
-
- protected boolean addUiClass(BeanValidatorHandler handler, JAXXCompiler compiler) {
- boolean withError = false;
- if (uiClass == null && compiler.getConfiguration().getDefaultErrorUI() != null) {
- uiClass = compiler.getConfiguration().getDefaultErrorUI().getName();
- }
- if (uiClass != null) {
- try {
- ClassDescriptor uiClazz = ClassDescriptorLoader.getClassDescriptor(uiClass);
- if (!ClassDescriptorLoader.getClassDescriptor(AbstractBeanValidatorUI.class).isAssignableFrom(uiClazz)) {
- compiler.reportError("attribute 'ui' :'" + uiClass + "' is not assignable from class " + AbstractBeanValidatorUI.class);
- withError = true;
- } else {
- String code = handler.getSetPropertyCode(getJavaCode(), UI_CLASS_ATTRIBUTE, uiClazz.getName() + ".class", compiler);
- appendAdditionCode(code);
- }
- } catch (ClassNotFoundException e) {
- compiler.reportError("class not found '" + uiClass + "'");
- withError = true;
- }
- }
-
- return withError;
- }
-
- protected boolean addErrorListModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
- if (errorListModel == null) {
- // try with the default "errors"
- if (!compiler.checkReference(tag, ERROR_LIST_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) {
- return false;
- }
- errorListModel = ERROR_LIST_MODEL_DEFAULT;
- } else {
- if (errorListModel.startsWith("{") && errorListModel.endsWith("}")) {
- // this is a script, no check here
- errorListModel = errorListModel.substring(1, errorListModel.length() - 1).trim();
- } else if (!compiler.checkReference(tag, errorListModel, true, ERROR_LIST_MODEL_ATTRIBUTE)) {
- // errorListModel is not defined
- return true;
- }
- }
-
- String code = handler.getSetPropertyCode(getJavaCode(), ERROR_LIST_MODEL_ATTRIBUTE, errorListModel, compiler);
- appendAdditionCode(code);
-
- return false;
- }
-
- protected boolean addErrorTableModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
- if (errorTableModel == null) {
- // try with the default "errors"
- if (!compiler.checkReference(tag, ERROR_TABLE_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) {
- return false;
- }
- errorTableModel = ERROR_TABLE_MODEL_DEFAULT;
- } else {
- if (errorTableModel.startsWith("{") && errorTableModel.endsWith("}")) {
- // this is a script, no check here
- errorTableModel = errorTableModel.substring(1, errorTableModel.length() - 1).trim();
- } else if (!compiler.checkReference(tag, errorTableModel, true, ERROR_TABLE_MODEL_ATTRIBUTE)) {
- // errorListModel is not defined
- return true;
- }
- }
-
- String code = handler.getSetPropertyCode(getJavaCode(), ERROR_TABLE_MODEL_ATTRIBUTE, errorTableModel, compiler);
- appendAdditionCode(code);
-
- return false;
-
- }
-
- protected boolean addParentValidator(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
- if (parentValidator != null) {
- String initializer;
- if (parentValidator.startsWith("{") && parentValidator.endsWith("}")) {
-
- // todo : should be able to bind
- initializer = parentValidator.substring(1, parentValidator.length() - 1);
-
- } else {
- // the attribute referes an existing widget
- if (!compiler.checkReference(tag, parentValidator, true, PARENT_VALIDATOR_ATTRIBUTE)) {
- // parentValidator is not defined
- return true;
- }
- initializer = parentValidator;
- }
- String code = handler.getSetPropertyCode(getJavaCode(), PARENT_VALIDATOR_ATTRIBUTE, initializer, compiler);
- appendAdditionCode(code);
- }
- return false;
- }
-
- protected boolean addErrorList(Element tag, JAXXCompiler compiler) {
-
- if (errorList == null) {
- // try with the default "errorList"
- if (!compiler.checkReference(tag, ERROR_LIST_DEFAULT, false, ERROR_LIST_ATTRIBUTE)) {
- return false;
- }
- errorList = ERROR_LIST_DEFAULT;
- } else {
- if (!compiler.checkReference(tag, errorList, true, ERROR_LIST_ATTRIBUTE)) {
- return true;
- }
- }
-
- String code = SwingValidatorUtil.class.getName() + ".registerErrorListMouseListener(" + errorList + ");";
- appendAdditionCode(code);
-
- return false;
- }
-
- protected boolean addErrorTable(Element tag, JAXXCompiler compiler) {
-
- if (errorTable == null) {
- // try with the default "errorList"
- if (!compiler.checkReference(tag, ERROR_TABLE_DEFAULT, false, ERROR_TABLE_ATTRIBUTE)) {
- return false;
- }
- errorTable = ERROR_TABLE_DEFAULT;
- } else {
- if (!compiler.checkReference(tag, errorTable, true, ERROR_TABLE_ATTRIBUTE)) {
- return true;
- }
- }
-
- String code = SwingValidatorUtil.class.getName() + ".registerErrorTableMouseListener(" + errorTable + ");";
- appendAdditionCode(code);
-
- return false;
- }
-
- protected boolean addBean(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
-
- if (beanClass == null || beanClass.isEmpty()) {
- // try to guest beanClass from bean attribute
- if (bean != null && !bean.isEmpty()) {
- beanClass = compiler.getSymbolTable().getClassTagIds().get(bean);
- if (beanClass == null) {
- compiler.reportError("could not find class of the bean '" + bean + "', and no beanClass was setted");
- return true;
- }
- }
- }
- if (beanClass == null) {
- compiler.reportError("tag '" + tag + "' requires a 'beanClass' attribute, and could not guest it from 'bean' attribute (no bean attribute setted...)");
- return true;
- }
-
- JAXXBeanInfo beanInfo = getBeanDescriptor(compiler);
- if (beanInfo == null) {
- compiler.reportError(tag, "could not find descriptor of class " + beanClass);
- return true;
- }
-
- String beanInitializer = null;
- if (bean != null) {
-
- if (bean.startsWith("{") && bean.endsWith("}")) {
-
- // just has an intializer
- beanInitializer = bean.substring(1, bean.length() - 1);
- // this is not a real bean, so delete it
- bean = null;
- } else {
-
- if (!compiler.checkReference(tag, bean, true, BEAN_ATTRIBUTE)) {
- // could not find bean in compiled object
- return true;
- }
-
- if (isBeanUsedByValidator(compiler, bean)) {
- compiler.reportError("the bean '" + bean + "' is already used in another the validator, can not used it in '" + tag + "'");
- return true;
- }
-
- /*if (beanInitializer != null) {
- compiler.reportWarning("tag '" + tag + "' found a 'bean' and a 'beanInitializer' attributes, 'beanInitializer' is skipped");
- }*/
- beanInitializer = bean;
- }
- }
-
- if (beanInitializer != null) {
- String code = handler.getSetPropertyCode(getJavaCode(), BEAN_ATTRIBUTE, compiler.checkJavaCode(beanInitializer), compiler);
- appendAdditionCode(code);
- }
-
- String beanClassName = beanInfo.getJAXXBeanDescriptor().getClassDescriptor().getName();
- // contextName must be in constructor to able to init validator with his correct contextName
- setConstructorParams(beanClassName + ".class, " + compiler.getJavaCode(contextName));
- // add generic type to validator
- setGenericTypes(new String[]{beanClassName});
-
- if (getAutoField()) {
- registerAutoFieldBean(tag, compiler, beanInfo);
- }
-
- if (getBeanDescriptor(compiler) != null) {
-
- // add fieldrepresentation invocations
- addFieldRepresentations(tag, compiler);
-
- // register the validator in compiler
- registerValidator(compiler, this);
-
- }
-
- return false;
- }
-
- private void registerValidator(JAXXCompiler compiler, CompiledBeanValidator compiledBeanValidator) {
- List<CompiledBeanValidator> vals = validators.get(compiler);
- if (vals == null) {
- vals = new ArrayList<CompiledBeanValidator>();
- validators.put(compiler, vals);
- }
- vals.add(compiledBeanValidator);
- List<String> ids = validatedComponents.get(compiler);
- if (ids == null) {
- ids = new ArrayList<String>();
- validatedComponents.put(compiler, ids);
- }
- ids.addAll(compiledBeanValidator.getFields().values());
- }
-
- protected void addFieldRepresentations(Element tag, JAXXCompiler compiler) {
- for (Entry<String, String> entry : fields.entrySet()) {
- String propertyName = entry.getKey();
- String component = entry.getValue();
- if (!checkBeanProperty(compiler, propertyName)) {
- // property not find on bean
- continue;
- }
- if (!compiler.checkReference(tag, component, true, null)) {
- // editor component not find on ui
- continue;
- }
- String keyCode = compiler.getJavaCode(propertyName);
- appendAdditionCode(getJavaCode() + ".setFieldRepresentation(" + keyCode + ", " + component + ");");
- }
- }
-
- protected void registerAutoFieldBean(Element tag, JAXXCompiler compiler, JAXXBeanInfo beanInfo) {
- for (JAXXPropertyDescriptor beanProperty : beanInfo.getJAXXPropertyDescriptors()) {
- String descriptionName = beanProperty.getName();
- if (log.isDebugEnabled()) {
- log.debug("try to bind on bean " + beanInfo.getJAXXBeanDescriptor().getName() + " property " + descriptionName);
- }
- if (beanProperty.getWriteMethodDescriptor() == null) {
- // read-only property
- continue;
- }
- if (fields.containsKey(descriptionName)) {
- // already defined in field
- continue;
- }
- if (excludeFields.containsKey(descriptionName)) {
- // exclude field
- continue;
- }
- if (!compiler.checkReference(tag, descriptionName, getStrictMode(), null)) {
- // no editor component found
- continue;
- }
- // ok add the field mapping
- registerField(descriptionName, descriptionName, compiler);
- }
-
- for (Entry<String, String> entry : excludeFields.entrySet()) {
- String key = entry.getKey();
- if (fields.containsKey(key)) {
- compiler.reportWarning("field '" + key + "' can not be used and excluded at same time ! (field is skipped) for validator " + this);
- fields.remove(key);
- }
- }
- }
-
- public void registerField(String id, String component, JAXXCompiler compiler) {
- if (fields.containsKey(id)) {
- compiler.reportError("duplicate field '" + id + "' for validator " + this);
- } else {
- if (log.isDebugEnabled()) {
- log.debug("add field <" + id + ":" + component + ">");
- }
- fields.put(id, component);
- }
- }
-
- public void registerExcludeField(String id, String component, JAXXCompiler compiler) {
- if (excludeFields.containsKey(id)) {
- compiler.reportError("duplicate field '" + id + "' for validator " + this);
- } else {
- if (log.isDebugEnabled()) {
- log.debug("add excludeField <" + id + ":" + component + ">");
- }
- excludeFields.put(id, component);
- }
- }
-
- protected boolean checkBeanProperty(JAXXCompiler compiler, String propertyName) {
-
- for (JAXXPropertyDescriptor beanProperty : getBeanDescriptor(compiler).getJAXXPropertyDescriptors()) {
- if (beanProperty.getName().equals(propertyName)) {
- if (beanProperty.getWriteMethodDescriptor() == null) {
- // read-onlyproperty
- compiler.reportError("could not bind the readonly property '" + propertyName + "' on bean [" + getBean() + "] ");
- return false;
- }
- return true;
- }
- }
- compiler.reportError("could not find the property '" + propertyName + "' on bean [" + getBean() + "] ");
- return false;
- }
- }
-
- /**
- * Test if a given bean is attached to a validator.
- *
- * @param compiler current compiler to use
- * @param beanId the bean to test
- * @return <code>true</code> if the given bean is attached to a validator, <code>false</code> otherwise
- */
- public static boolean isBeanUsedByValidator(JAXXCompiler compiler, String beanId) {
- List<CompiledBeanValidator> beanValidatorList = validators.get(compiler);
- if (beanValidatorList != null) {
- for (CompiledBeanValidator validator : beanValidatorList) {
- if (beanId.equals(validator.getBean())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * @param compiler compiler to use
- * @return <code>true</code> if some validators were detected, <code>false</code> otherwise
- */
- public static boolean hasValidator(JAXXCompiler compiler) {
- List<CompiledBeanValidator> beanValidatorList = validators.get(compiler);
- return beanValidatorList != null && !beanValidatorList.isEmpty();
- }
-
- /**
- * Test if a given CompiledObject is attached to a validator.
- *
- * @param compiler compiler to use
- * @param componentId the compiled object to test
- * @return <code>true</code> if the given compiled object is attached to a validator, <code>false</code> otherwise
- */
- public static boolean isComponentUsedByValidator(JAXXCompiler compiler, String componentId) {
- List<String> ids = validatedComponents.get(compiler);
- return ids != null && ids.contains(componentId);
- }
-
- public static List<CompiledBeanValidator> getValidators(JAXXCompiler compiler) {
- return validators.get(compiler);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.validator;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.beans.JAXXBeanInfo;
+import jaxx.compiler.beans.JAXXPropertyDescriptor;
+import jaxx.compiler.reflect.ClassDescriptor;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.DefaultObjectHandler;
+import jaxx.compiler.types.TypeManager;
+import jaxx.runtime.validator.swing.SwingValidatorUtil;
+import jaxx.runtime.validator.swing.SwingValidator;
+import jaxx.runtime.validator.swing.ui.AbstractBeanValidatorUI;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+
+import java.beans.IntrospectionException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
+
+public class BeanValidatorHandler extends DefaultObjectHandler {
+
+ public static final String TAG = "BeanValidator";
+ public static final String BEAN_ATTRIBUTE = "bean";
+ public static final String BEAN_CLASS_ATTRIBUTE = "beanClass";
+ public static final String BEAN_INITIALIZER_ATTRIBUTE = "beanInitializer";
+ public static final String ERROR_LIST_MODEL_ATTRIBUTE = "errorListModel";
+ public static final String ERROR_TABLE_MODEL_ATTRIBUTE = "errorTableModel";
+ public static final String ERROR_LIST_ATTRIBUTE = "errorList";
+ public static final String ERROR_TABLE_ATTRIBUTE = "errorTable";
+ //TODO-TC20091024 should change this default value to errorListModel
+ public static final String ERROR_LIST_MODEL_DEFAULT = "errors";
+ //TODO-TC20091024 should change this default value to errorTableModel
+ public static final String ERROR_TABLE_MODEL_DEFAULT = "errors2";
+ public static final String ERROR_LIST_DEFAULT = "errorList";
+ public static final String ERROR_TABLE_DEFAULT = "errorTable";
+ public static final String AUTOFIELD_ATTRIBUTE = "autoField";
+ public static final String UI_CLASS_ATTRIBUTE = "uiClass";
+ public static final String STRICT_MODE_ATTRIBUTE = "strictMode";
+ public static final String CONTEXT_NAME_ATTRIBUTE = "contextName";
+ //public static final String SCOPE_ATTRIBUTE = "scope";
+ public static final String PARENT_VALIDATOR_ATTRIBUTE = "parentValidator";
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static Log log = LogFactory.getLog(BeanValidatorHandler.class);
+ protected static Map<JAXXCompiler, List<CompiledBeanValidator>> validators = new HashMap<JAXXCompiler, List<CompiledBeanValidator>>();
+ protected static Map<JAXXCompiler, List<String>> validatedComponents = new HashMap<JAXXCompiler, List<String>>();
+
+ public BeanValidatorHandler(ClassDescriptor beanClass) {
+ super(beanClass);
+ ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, SwingValidator.class);
+ }
+
+ @Override
+ protected CompiledObject createCompiledObject(String id, JAXXCompiler compiler) {
+ return new CompiledBeanValidator(id, getBeanClass(), compiler);
+ }
+
+ @Override
+ protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ if (log.isDebugEnabled()) {
+ log.debug(tag);
+ }
+ if (!tag.getLocalName().equals(FieldValidatorHandler.TAG)) {
+ compiler.reportError("tag '" + tag.getParentNode().getLocalName() + "' may only contain " + FieldValidatorHandler.TAG + " as children, but found : " + tag.getLocalName());
+ } else {
+ compiler.compileFirstPass(tag);
+ }
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+
+ super.compileSecondPass(tag, compiler);
+
+ CompiledBeanValidator info = (CompiledBeanValidator) objectMap.get(tag);
+
+ boolean error = info.addErrorListModel(tag, this, compiler);
+
+ if (!error) {
+ error = info.addErrorList(tag, compiler);
+ }
+
+ if (!error) {
+ error = info.addErrorTableModel(tag, this, compiler);
+ }
+
+ if (!error) {
+ error = info.addErrorTable(tag, compiler);
+ }
+
+ if (!error) {
+ error = info.addUiClass(this, compiler);
+ }
+
+ if (!error) {
+ error = info.addBean(tag, this, compiler);
+ }
+
+ /*if (!error) {
+ error = info.addContextName(this, compiler);
+ }*/
+
+ /*if (!error) {
+ error = info.addScope(this, compiler);
+ }*/
+
+ if (!error) {
+ error = info.addParentValidator(tag, this, compiler);
+ }
+
+ if (error) {
+ log.warn("error were detected in second compile pass of CompiledObject [" + info + "]");
+ }
+
+ // close the compiled object
+ compiler.closeComponent(info);
+ }
+
+ @Override
+ protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) {
+ // open the compiled object
+ compiler.openInvisibleComponent(object);
+ }
+
+ @Override
+ public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) {
+ if (log.isDebugEnabled()) {
+ log.debug(propertyName + " : " + stringValue + " for " + object);
+ }
+ // delegate to the compiled object with is statefull (but not the tag handler)
+ object.addProperty(propertyName, stringValue);
+ }
+
+ /**
+ * The compiled objet representing a BeanValidator to be generated in JAXXObject
+ *
+ * @author chemit
+ */
+ public static class CompiledBeanValidator extends CompiledObject {
+
+ protected Map<String, String> fields;
+ protected Map<String, String> excludeFields;
+ protected String bean;
+ protected String beanClass;
+ protected String contextName;
+ protected String uiClass;
+ protected String errorListModel;
+ protected String errorList;
+ protected Boolean autoField;
+ protected Boolean strictMode;
+ protected JAXXBeanInfo beanDescriptor;
+ protected String errorTableModel;
+ protected String errorTable;
+ protected String parentValidator;
+
+ public CompiledBeanValidator(String id, ClassDescriptor objectClass, JAXXCompiler compiler) {
+ //TC-20090524 Use the real class descriptor, not the one by default,
+ //TC-20090524 otherwise can not override the validator class while generation
+ //super(id, objectClass, compiler);
+ super(id, getDescriptor(objectClass, compiler), compiler);
+ fields = new TreeMap<String, String>();
+ excludeFields = new TreeMap<String, String>();
+ if (log.isDebugEnabled()) {
+ log.debug("validator objectClass " + super.getObjectClass());
+ }
+ }
+
+ protected static ClassDescriptor getDescriptor(ClassDescriptor objectClass, JAXXCompiler compiler) {
+ ClassDescriptor result = objectClass;
+ Class<?> validatorClass = compiler.getConfiguration().getValidatorClass();
+ result = ClassDescriptorLoader.getClassDescriptor(validatorClass);
+ return result;
+ }
+
+ public Map<String, String> getFields() {
+ return fields;
+ }
+
+ public Map<String, String> getExcludeFields() {
+ return excludeFields;
+ }
+
+ public void setFields(Map<String, String> fields) {
+ this.fields = fields;
+ }
+
+ public void setExcludeFields(Map<String, String> excludeFields) {
+ this.excludeFields = excludeFields;
+ }
+
+ @Override
+ public void addProperty(String property, String value) {
+
+ if (BEAN_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ bean = value.trim();
+ }
+ return;
+ }
+
+ if (CONTEXT_NAME_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ contextName = value.trim();
+ }
+ return;
+ }
+
+ if (BEAN_CLASS_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ beanClass = value.trim();
+ }
+ return;
+ }
+
+ if (ERROR_LIST_MODEL_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ errorListModel = value.trim();
+ }
+ return;
+ }
+
+ if (ERROR_LIST_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ errorList = value.trim();
+ }
+ return;
+ }
+
+ if (ERROR_TABLE_MODEL_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ errorTableModel = value.trim();
+ }
+ return;
+ }
+
+ if (ERROR_TABLE_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ errorTable = value.trim();
+ }
+ return;
+ }
+
+ if (UI_CLASS_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ uiClass = value.trim();
+ }
+ return;
+ }
+
+ if (AUTOFIELD_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ autoField = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class);
+ }
+ return;
+ }
+
+ if (STRICT_MODE_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ strictMode = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class);
+ }
+ return;
+ }
+
+ if (PARENT_VALIDATOR_ATTRIBUTE.equals(property)) {
+ if (value != null && !value.trim().isEmpty()) {
+ parentValidator = value.trim();
+ }
+ return;
+ }
+
+ throw new CompilerException("property " + property + " is not allowed on object " + this);
+ }
+
+ public String getBean() {
+ return bean;
+ }
+
+ public String getErrorListModel() {
+ return errorListModel;
+ }
+
+ public boolean getAutoField() {
+ return autoField != null && autoField;
+ }
+
+ public boolean getStrictMode() {
+ return strictMode != null && strictMode;
+ }
+
+ public String getUiClass() {
+ return uiClass;
+ }
+
+ public String getBeanClass() {
+ return beanClass;
+ }
+
+ public String getContextName() {
+ return contextName;
+ }
+
+ public String getParentValidator() {
+ return parentValidator;
+ }
+
+ public JAXXBeanInfo getBeanDescriptor(JAXXCompiler compiler) {
+ if (beanDescriptor == null && foundBean()) {
+
+ String beanClassName = null;
+ try {
+ //TC-20090111 beanClass is mandatory
+ // get the real bean class name (from bean or beanClass)
+ /*if (beanClass != null) {
+ beanClassName = beanClass;
+ } else {
+ beanClassName = compiler.getSymbolTable().getClassTagIds().get(bean);
+ if (beanClassName == null) {
+ compiler.reportError("could not find class of the bean '" + bean + "'");
+ return null;
+ }
+ }*/
+ ClassDescriptor beanClassDescriptor = ClassDescriptorLoader.getClassDescriptor(beanClass);
+ beanDescriptor = DefaultObjectHandler.getJAXXBeanInfo(beanClassDescriptor);
+ } catch (ClassNotFoundException e) {
+ compiler.reportError("could not load class " + beanClassName);
+ } catch (IntrospectionException e) {
+ compiler.reportError("could not load class " + beanClassName);
+ }
+ }
+ return beanDescriptor;
+ }
+
+ @Override
+ public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
+ // do nothing
+ compiler.reportError("can not add CompiledObject in the tag '" + TAG + " (only field tags)");
+ }
+
+ public boolean foundBean() {
+ return !(beanClass == null || beanClass.isEmpty());
+ }
+
+ protected boolean addUiClass(BeanValidatorHandler handler, JAXXCompiler compiler) {
+ boolean withError = false;
+ if (uiClass == null && compiler.getConfiguration().getDefaultErrorUI() != null) {
+ uiClass = compiler.getConfiguration().getDefaultErrorUI().getName();
+ }
+ if (uiClass != null) {
+ try {
+ ClassDescriptor uiClazz = ClassDescriptorLoader.getClassDescriptor(uiClass);
+ if (!ClassDescriptorLoader.getClassDescriptor(AbstractBeanValidatorUI.class).isAssignableFrom(uiClazz)) {
+ compiler.reportError("attribute 'ui' :'" + uiClass + "' is not assignable from class " + AbstractBeanValidatorUI.class);
+ withError = true;
+ } else {
+ String code = handler.getSetPropertyCode(getJavaCode(), UI_CLASS_ATTRIBUTE, uiClazz.getName() + ".class", compiler);
+ appendAdditionCode(code);
+ }
+ } catch (ClassNotFoundException e) {
+ compiler.reportError("class not found '" + uiClass + "'");
+ withError = true;
+ }
+ }
+
+ return withError;
+ }
+
+ protected boolean addErrorListModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
+ if (errorListModel == null) {
+ // try with the default "errors"
+ if (!compiler.checkReference(tag, ERROR_LIST_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) {
+ return false;
+ }
+ errorListModel = ERROR_LIST_MODEL_DEFAULT;
+ } else {
+ if (errorListModel.startsWith("{") && errorListModel.endsWith("}")) {
+ // this is a script, no check here
+ errorListModel = errorListModel.substring(1, errorListModel.length() - 1).trim();
+ } else if (!compiler.checkReference(tag, errorListModel, true, ERROR_LIST_MODEL_ATTRIBUTE)) {
+ // errorListModel is not defined
+ return true;
+ }
+ }
+
+ String code = handler.getSetPropertyCode(getJavaCode(), ERROR_LIST_MODEL_ATTRIBUTE, errorListModel, compiler);
+ appendAdditionCode(code);
+
+ return false;
+ }
+
+ protected boolean addErrorTableModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
+ if (errorTableModel == null) {
+ // try with the default "errors"
+ if (!compiler.checkReference(tag, ERROR_TABLE_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) {
+ return false;
+ }
+ errorTableModel = ERROR_TABLE_MODEL_DEFAULT;
+ } else {
+ if (errorTableModel.startsWith("{") && errorTableModel.endsWith("}")) {
+ // this is a script, no check here
+ errorTableModel = errorTableModel.substring(1, errorTableModel.length() - 1).trim();
+ } else if (!compiler.checkReference(tag, errorTableModel, true, ERROR_TABLE_MODEL_ATTRIBUTE)) {
+ // errorListModel is not defined
+ return true;
+ }
+ }
+
+ String code = handler.getSetPropertyCode(getJavaCode(), ERROR_TABLE_MODEL_ATTRIBUTE, errorTableModel, compiler);
+ appendAdditionCode(code);
+
+ return false;
+
+ }
+
+ protected boolean addParentValidator(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
+ if (parentValidator != null) {
+ String initializer;
+ if (parentValidator.startsWith("{") && parentValidator.endsWith("}")) {
+
+ // todo : should be able to bind
+ initializer = parentValidator.substring(1, parentValidator.length() - 1);
+
+ } else {
+ // the attribute referes an existing widget
+ if (!compiler.checkReference(tag, parentValidator, true, PARENT_VALIDATOR_ATTRIBUTE)) {
+ // parentValidator is not defined
+ return true;
+ }
+ initializer = parentValidator;
+ }
+ String code = handler.getSetPropertyCode(getJavaCode(), PARENT_VALIDATOR_ATTRIBUTE, initializer, compiler);
+ appendAdditionCode(code);
+ }
+ return false;
+ }
+
+ protected boolean addErrorList(Element tag, JAXXCompiler compiler) {
+
+ if (errorList == null) {
+ // try with the default "errorList"
+ if (!compiler.checkReference(tag, ERROR_LIST_DEFAULT, false, ERROR_LIST_ATTRIBUTE)) {
+ return false;
+ }
+ errorList = ERROR_LIST_DEFAULT;
+ } else {
+ if (!compiler.checkReference(tag, errorList, true, ERROR_LIST_ATTRIBUTE)) {
+ return true;
+ }
+ }
+
+ String code = SwingValidatorUtil.class.getName() + ".registerErrorListMouseListener(" + errorList + ");";
+ appendAdditionCode(code);
+
+ return false;
+ }
+
+ protected boolean addErrorTable(Element tag, JAXXCompiler compiler) {
+
+ if (errorTable == null) {
+ // try with the default "errorList"
+ if (!compiler.checkReference(tag, ERROR_TABLE_DEFAULT, false, ERROR_TABLE_ATTRIBUTE)) {
+ return false;
+ }
+ errorTable = ERROR_TABLE_DEFAULT;
+ } else {
+ if (!compiler.checkReference(tag, errorTable, true, ERROR_TABLE_ATTRIBUTE)) {
+ return true;
+ }
+ }
+
+ String code = SwingValidatorUtil.class.getName() + ".registerErrorTableMouseListener(" + errorTable + ");";
+ appendAdditionCode(code);
+
+ return false;
+ }
+
+ protected boolean addBean(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) {
+
+ if (beanClass == null || beanClass.isEmpty()) {
+ // try to guest beanClass from bean attribute
+ if (bean != null && !bean.isEmpty()) {
+ beanClass = compiler.getSymbolTable().getClassTagIds().get(bean);
+ if (beanClass == null) {
+ compiler.reportError("could not find class of the bean '" + bean + "', and no beanClass was setted");
+ return true;
+ }
+ }
+ }
+ if (beanClass == null) {
+ compiler.reportError("tag '" + tag + "' requires a 'beanClass' attribute, and could not guest it from 'bean' attribute (no bean attribute setted...)");
+ return true;
+ }
+
+ JAXXBeanInfo beanInfo = getBeanDescriptor(compiler);
+ if (beanInfo == null) {
+ compiler.reportError(tag, "could not find descriptor of class " + beanClass);
+ return true;
+ }
+
+ String beanInitializer = null;
+ if (bean != null) {
+
+ if (bean.startsWith("{") && bean.endsWith("}")) {
+
+ // just has an intializer
+ beanInitializer = bean.substring(1, bean.length() - 1);
+ // this is not a real bean, so delete it
+ bean = null;
+ } else {
+
+ if (!compiler.checkReference(tag, bean, true, BEAN_ATTRIBUTE)) {
+ // could not find bean in compiled object
+ return true;
+ }
+
+ if (isBeanUsedByValidator(compiler, bean)) {
+ compiler.reportError("the bean '" + bean + "' is already used in another the validator, can not used it in '" + tag + "'");
+ return true;
+ }
+
+ /*if (beanInitializer != null) {
+ compiler.reportWarning("tag '" + tag + "' found a 'bean' and a 'beanInitializer' attributes, 'beanInitializer' is skipped");
+ }*/
+ beanInitializer = bean;
+ }
+ }
+
+ if (beanInitializer != null) {
+ String code = handler.getSetPropertyCode(getJavaCode(), BEAN_ATTRIBUTE, compiler.checkJavaCode(beanInitializer), compiler);
+ appendAdditionCode(code);
+ }
+
+ String beanClassName = beanInfo.getJAXXBeanDescriptor().getClassDescriptor().getName();
+ // contextName must be in constructor to able to init validator with his correct contextName
+ setConstructorParams(beanClassName + ".class, " + compiler.getJavaCode(contextName));
+ // add generic type to validator
+ setGenericTypes(new String[]{beanClassName});
+
+ if (getAutoField()) {
+ registerAutoFieldBean(tag, compiler, beanInfo);
+ }
+
+ if (getBeanDescriptor(compiler) != null) {
+
+ // add fieldrepresentation invocations
+ addFieldRepresentations(tag, compiler);
+
+ // register the validator in compiler
+ registerValidator(compiler, this);
+
+ }
+
+ return false;
+ }
+
+ private void registerValidator(JAXXCompiler compiler, CompiledBeanValidator compiledBeanValidator) {
+ List<CompiledBeanValidator> vals = validators.get(compiler);
+ if (vals == null) {
+ vals = new ArrayList<CompiledBeanValidator>();
+ validators.put(compiler, vals);
+ }
+ vals.add(compiledBeanValidator);
+ List<String> ids = validatedComponents.get(compiler);
+ if (ids == null) {
+ ids = new ArrayList<String>();
+ validatedComponents.put(compiler, ids);
+ }
+ ids.addAll(compiledBeanValidator.getFields().values());
+ }
+
+ protected void addFieldRepresentations(Element tag, JAXXCompiler compiler) {
+ for (Entry<String, String> entry : fields.entrySet()) {
+ String propertyName = entry.getKey();
+ String component = entry.getValue();
+ if (!checkBeanProperty(compiler, propertyName)) {
+ // property not find on bean
+ continue;
+ }
+ if (!compiler.checkReference(tag, component, true, null)) {
+ // editor component not find on ui
+ continue;
+ }
+ String keyCode = compiler.getJavaCode(propertyName);
+ appendAdditionCode(getJavaCode() + ".setFieldRepresentation(" + keyCode + ", " + component + ");");
+ }
+ }
+
+ protected void registerAutoFieldBean(Element tag, JAXXCompiler compiler, JAXXBeanInfo beanInfo) {
+ for (JAXXPropertyDescriptor beanProperty : beanInfo.getJAXXPropertyDescriptors()) {
+ String descriptionName = beanProperty.getName();
+ if (log.isDebugEnabled()) {
+ log.debug("try to bind on bean " + beanInfo.getJAXXBeanDescriptor().getName() + " property " + descriptionName);
+ }
+ if (beanProperty.getWriteMethodDescriptor() == null) {
+ // read-only property
+ continue;
+ }
+ if (fields.containsKey(descriptionName)) {
+ // already defined in field
+ continue;
+ }
+ if (excludeFields.containsKey(descriptionName)) {
+ // exclude field
+ continue;
+ }
+ if (!compiler.checkReference(tag, descriptionName, getStrictMode(), null)) {
+ // no editor component found
+ continue;
+ }
+ // ok add the field mapping
+ registerField(descriptionName, descriptionName, compiler);
+ }
+
+ for (Entry<String, String> entry : excludeFields.entrySet()) {
+ String key = entry.getKey();
+ if (fields.containsKey(key)) {
+ compiler.reportWarning("field '" + key + "' can not be used and excluded at same time ! (field is skipped) for validator " + this);
+ fields.remove(key);
+ }
+ }
+ }
+
+ public void registerField(String id, String component, JAXXCompiler compiler) {
+ if (fields.containsKey(id)) {
+ compiler.reportError("duplicate field '" + id + "' for validator " + this);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("add field <" + id + ":" + component + ">");
+ }
+ fields.put(id, component);
+ }
+ }
+
+ public void registerExcludeField(String id, String component, JAXXCompiler compiler) {
+ if (excludeFields.containsKey(id)) {
+ compiler.reportError("duplicate field '" + id + "' for validator " + this);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("add excludeField <" + id + ":" + component + ">");
+ }
+ excludeFields.put(id, component);
+ }
+ }
+
+ protected boolean checkBeanProperty(JAXXCompiler compiler, String propertyName) {
+
+ for (JAXXPropertyDescriptor beanProperty : getBeanDescriptor(compiler).getJAXXPropertyDescriptors()) {
+ if (beanProperty.getName().equals(propertyName)) {
+ if (beanProperty.getWriteMethodDescriptor() == null) {
+ // read-onlyproperty
+ compiler.reportError("could not bind the readonly property '" + propertyName + "' on bean [" + getBean() + "] ");
+ return false;
+ }
+ return true;
+ }
+ }
+ compiler.reportError("could not find the property '" + propertyName + "' on bean [" + getBean() + "] ");
+ return false;
+ }
+ }
+
+ /**
+ * Test if a given bean is attached to a validator.
+ *
+ * @param compiler current compiler to use
+ * @param beanId the bean to test
+ * @return <code>true</code> if the given bean is attached to a validator, <code>false</code> otherwise
+ */
+ public static boolean isBeanUsedByValidator(JAXXCompiler compiler, String beanId) {
+ List<CompiledBeanValidator> beanValidatorList = validators.get(compiler);
+ if (beanValidatorList != null) {
+ for (CompiledBeanValidator validator : beanValidatorList) {
+ if (beanId.equals(validator.getBean())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @param compiler compiler to use
+ * @return <code>true</code> if some validators were detected, <code>false</code> otherwise
+ */
+ public static boolean hasValidator(JAXXCompiler compiler) {
+ List<CompiledBeanValidator> beanValidatorList = validators.get(compiler);
+ return beanValidatorList != null && !beanValidatorList.isEmpty();
+ }
+
+ /**
+ * Test if a given CompiledObject is attached to a validator.
+ *
+ * @param compiler compiler to use
+ * @param componentId the compiled object to test
+ * @return <code>true</code> if the given compiled object is attached to a validator, <code>false</code> otherwise
+ */
+ public static boolean isComponentUsedByValidator(JAXXCompiler compiler, String componentId) {
+ List<String> ids = validatedComponents.get(compiler);
+ return ids != null && ids.contains(componentId);
+ }
+
+ public static List<CompiledBeanValidator> getValidators(JAXXCompiler compiler) {
+ return validators.get(compiler);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,85 +1,101 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.validator;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-
-public class ExcludeFieldValidatorHandler implements TagHandler {
-
- public static final String TAG = "excludeField";
- public static final String NAME_ATTRIBUTE = "name";
- public static final String COMPONENT_ATTRIBUTE = "component";
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(ExcludeFieldValidatorHandler.class);
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- if (compiler.getConfiguration().isVerbose()) {
- log.info(tag);
- }
- //todo check there is no child
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- if (compiler.getConfiguration().isVerbose()) {
- log.debug(tag);
- }
-
- if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
- compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag);
- return;
- }
-
- CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent();
- if (!info.getAutoField()) {
- compiler.reportError(TAG + " tag can not be used without an 'autoField' validator : " + tag);
- return;
- }
- String name = tag.getAttribute(NAME_ATTRIBUTE);
- String component = tag.getAttribute(COMPONENT_ATTRIBUTE);
- if (name == null || name.trim().isEmpty()) {
- compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute");
- return;
- }
- name = name.trim();
- if (component == null || component.trim().isEmpty()) {
- // try to use the name as component
- if (!compiler.checkReference(tag, name, false, name)) {
- compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found");
- return;
- }
- component = name;
- }
- component = component.trim();
-
- // check component is not already used by this compiled object
- if (info.getFields().containsValue(component)) {
- compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator");
- return;
- }
- if (info.getExcludeFields().containsValue(component)) {
- compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator");
- return;
- }
- // check component exist (again perharps, but let the error knows exactly which tag failed...)
- if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) {
- // add a field
- info.registerField(name, component, compiler);
- }
-
-
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.validator;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+
+public class ExcludeFieldValidatorHandler implements TagHandler {
+
+ public static final String TAG = "excludeField";
+ public static final String NAME_ATTRIBUTE = "name";
+ public static final String COMPONENT_ATTRIBUTE = "component";
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(ExcludeFieldValidatorHandler.class);
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ if (compiler.getConfiguration().isVerbose()) {
+ log.info(tag);
+ }
+ //todo check there is no child
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ if (compiler.getConfiguration().isVerbose()) {
+ log.debug(tag);
+ }
+
+ if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
+ compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag);
+ return;
+ }
+
+ CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent();
+ if (!info.getAutoField()) {
+ compiler.reportError(TAG + " tag can not be used without an 'autoField' validator : " + tag);
+ return;
+ }
+ String name = tag.getAttribute(NAME_ATTRIBUTE);
+ String component = tag.getAttribute(COMPONENT_ATTRIBUTE);
+ if (name == null || name.trim().isEmpty()) {
+ compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute");
+ return;
+ }
+ name = name.trim();
+ if (component == null || component.trim().isEmpty()) {
+ // try to use the name as component
+ if (!compiler.checkReference(tag, name, false, name)) {
+ compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found");
+ return;
+ }
+ component = name;
+ }
+ component = component.trim();
+
+ // check component is not already used by this compiled object
+ if (info.getFields().containsValue(component)) {
+ compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator");
+ return;
+ }
+ if (info.getExcludeFields().containsValue(component)) {
+ compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator");
+ return;
+ }
+ // check component exist (again perharps, but let the error knows exactly which tag failed...)
+ if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) {
+ // add a field
+ info.registerField(name, component, compiler);
+ }
+
+
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,78 +1,94 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.tags.validator;
-
-import jaxx.compiler.CompilerException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.reflect.ClassDescriptorLoader;
-import jaxx.compiler.tags.TagHandler;
-import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-
-public class FieldValidatorHandler implements TagHandler {
-
- public static final String TAG = "field";
- public static final String NAME_ATTRIBUTE = "name";
- public static final String COMPONENT_ATTRIBUTE = "component";
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(FieldValidatorHandler.class);
-
- @Override
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- if (compiler.getConfiguration().isVerbose()) {
- log.debug(tag);
- }
- //todo check there is no child
- }
-
- @Override
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
- if (compiler.getConfiguration().isVerbose()) {
- log.debug(tag);
- }
-
- if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
- compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag);
- return;
- }
-
- CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent();
-
- String name = tag.getAttribute(NAME_ATTRIBUTE);
- String component = tag.getAttribute(COMPONENT_ATTRIBUTE);
- if (name == null || name.trim().isEmpty()) {
- compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute");
- return;
- }
- name = name.trim();
- if (component == null || component.trim().isEmpty()) {
- // try to use the name as component
- if (!compiler.checkReference(tag, name, false, name)) {
- compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found");
- return;
- }
- component = name;
- }
- component = component.trim();
-
- // check component is not already used by this compiled object
- if (info.getFields().containsValue(component)) {
- compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator");
- return;
- }
- // check component exist (again perharps, but let the error knows exactly which tag failed...)
- if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) {
- // add a field
- info.registerField(name, component, compiler);
- }
-
-
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.tags.validator;
+
+import jaxx.compiler.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.reflect.ClassDescriptorLoader;
+import jaxx.compiler.tags.TagHandler;
+import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+
+public class FieldValidatorHandler implements TagHandler {
+
+ public static final String TAG = "field";
+ public static final String NAME_ATTRIBUTE = "name";
+ public static final String COMPONENT_ATTRIBUTE = "component";
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(FieldValidatorHandler.class);
+
+ @Override
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ if (compiler.getConfiguration().isVerbose()) {
+ log.debug(tag);
+ }
+ //todo check there is no child
+ }
+
+ @Override
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ if (compiler.getConfiguration().isVerbose()) {
+ log.debug(tag);
+ }
+
+ if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
+ compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag);
+ return;
+ }
+
+ CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent();
+
+ String name = tag.getAttribute(NAME_ATTRIBUTE);
+ String component = tag.getAttribute(COMPONENT_ATTRIBUTE);
+ if (name == null || name.trim().isEmpty()) {
+ compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute");
+ return;
+ }
+ name = name.trim();
+ if (component == null || component.trim().isEmpty()) {
+ // try to use the name as component
+ if (!compiler.checkReference(tag, name, false, name)) {
+ compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found");
+ return;
+ }
+ component = name;
+ }
+ component = component.trim();
+
+ // check component is not already used by this compiled object
+ if (info.getFields().containsValue(component)) {
+ compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator");
+ return;
+ }
+ // check component exist (again perharps, but let the error knows exactly which tag failed...)
+ if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) {
+ // add a field
+ info.registerField(name, component, compiler);
+ }
+
+
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools;
import jaxx.compiler.tags.*;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
import java.util.ArrayList;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
import jaxx.compiler.JAXXCompiler;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
public interface ContextNode {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
import jaxx.compiler.ClassMap;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
public class LiteralNode extends AbstractContextNode {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
public class MethodNode extends AbstractContextNode {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
public class PropertyNode extends AbstractContextNode {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture;
public class ValueNode extends AbstractContextNode {
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture.handlers;
import jaxx.compiler.tools.jaxxcapture.ContextNode;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture.handlers;
import jaxx.compiler.JAXXCompiler;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tools.jaxxcapture.handlers;
import jaxx.compiler.tools.jaxxcapture.CapturedObject;
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,42 +1,58 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.types;
-
-import java.awt.Color;
-import java.lang.reflect.Field;
-
-public class ColorConverter implements TypeConverter {
-
- @Override
- public Class<?>[] getSupportedTypes() {
- return new Class<?>[]{
- Color.class
- };
- }
-
- @Override
- public String getJavaCode(Object object) {
- Color color = (Color) object;
- return "new Color(" + color.getRed() + ", " + color.getGreen() + ", " + color.getBlue() + ")";
- }
-
- @Override
- public Object convertFromString(String string, Class<?> type) {
- if (type != Color.class) {
- throw new IllegalArgumentException("unsupported type: " + type);
- }
- if (string.length() == 7 && string.charAt(0) == '#') {
- return new Color(Integer.parseInt(string.substring(1), 16));
- }
- try {
- Field color = Color.class.getField(string);
- return color.get(null);
- } catch (NoSuchFieldException e) {
- throw new IllegalArgumentException("colors must be of the form #xxxxxx ('#' followed by six hexadecimal digits), or the name of a constant field in java.awt.Color (found: '" + string + "')");
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.types;
+
+import java.awt.Color;
+import java.lang.reflect.Field;
+
+public class ColorConverter implements TypeConverter {
+
+ @Override
+ public Class<?>[] getSupportedTypes() {
+ return new Class<?>[]{
+ Color.class
+ };
+ }
+
+ @Override
+ public String getJavaCode(Object object) {
+ Color color = (Color) object;
+ return "new Color(" + color.getRed() + ", " + color.getGreen() + ", " + color.getBlue() + ")";
+ }
+
+ @Override
+ public Object convertFromString(String string, Class<?> type) {
+ if (type != Color.class) {
+ throw new IllegalArgumentException("unsupported type: " + type);
+ }
+ if (string.length() == 7 && string.charAt(0) == '#') {
+ return new Color(Integer.parseInt(string.substring(1), 16));
+ }
+ try {
+ Field color = Color.class.getField(string);
+ return color.get(null);
+ } catch (NoSuchFieldException e) {
+ throw new IllegalArgumentException("colors must be of the form #xxxxxx ('#' followed by six hexadecimal digits), or the name of a constant field in java.awt.Color (found: '" + string + "')");
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,30 +1,46 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.types;
-
-import java.awt.GridBagConstraints;
-
-public class GridBagConstraintsConverter implements TypeConverter {
-
- @Override
- public Class<?>[] getSupportedTypes() {
- return new Class<?>[] {
- GridBagConstraints.class
- };
- }
-
- @Override
- public String getJavaCode(Object object) {
- GridBagConstraints g = (GridBagConstraints) object;
- return "new GridBagConstraints(" + g.gridx + ", " + g.gridy + ", " + g.gridwidth + ", " + g.gridheight + ", " +
- g.weightx + ", " + g.weighty + ", " + g.anchor + ", " + g.fill + ", " +
- TypeManager.getJavaCode(g.insets) + ", " + g.ipadx + ", " + g.ipady + ")";
- }
-
- @Override
- public Object convertFromString(String string, Class<?> type) {
- throw new UnsupportedOperationException("GridBagConstraints must be represented using Java code");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.types;
+
+import java.awt.GridBagConstraints;
+
+public class GridBagConstraintsConverter implements TypeConverter {
+
+ @Override
+ public Class<?>[] getSupportedTypes() {
+ return new Class<?>[] {
+ GridBagConstraints.class
+ };
+ }
+
+ @Override
+ public String getJavaCode(Object object) {
+ GridBagConstraints g = (GridBagConstraints) object;
+ return "new GridBagConstraints(" + g.gridx + ", " + g.gridy + ", " + g.gridwidth + ", " + g.gridheight + ", " +
+ g.weightx + ", " + g.weighty + ", " + g.anchor + ", " + g.fill + ", " +
+ TypeManager.getJavaCode(g.insets) + ", " + g.ipadx + ", " + g.ipady + ")";
+ }
+
+ @Override
+ public Object convertFromString(String string, Class<?> type) {
+ throw new UnsupportedOperationException("GridBagConstraints must be represented using Java code");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,43 +1,59 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.types;
-
-import java.awt.Insets;
-import java.util.StringTokenizer;
-
-public class InsetsConverter implements TypeConverter {
-
- @Override
- public Class<?>[] getSupportedTypes() {
- return new Class<?>[]{Insets.class};
- }
-
- @Override
- public String getJavaCode(Object object) {
- Insets insets = (Insets) object;
- return "new Insets(" + insets.top + ", " + insets.left + ", " + insets.bottom + ", " + insets.right + ")";
- }
-
- @Override
- public Object convertFromString(String string, Class<?> type) {
- if (type != Insets.class) {
- throw new IllegalArgumentException("unsupported type: " + type);
- }
- StringTokenizer tokenizer = new StringTokenizer(string, ",");
- int count = tokenizer.countTokens();
- if (count == 1) {
- int i = Integer.parseInt(tokenizer.nextToken().trim());
- return new Insets(i, i, i, i);
- }
- if (count == 4) {
- int[] insets = new int[count];
- for (int i = 0; tokenizer.hasMoreTokens(); i++) {
- insets[i] = Integer.parseInt(tokenizer.nextToken().trim());
- }
- return new Insets(insets[0], insets[1], insets[2], insets[3]);
- }
- throw new IllegalArgumentException("unable to convert string '" + string + "' to Insets");
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.types;
+
+import java.awt.Insets;
+import java.util.StringTokenizer;
+
+public class InsetsConverter implements TypeConverter {
+
+ @Override
+ public Class<?>[] getSupportedTypes() {
+ return new Class<?>[]{Insets.class};
+ }
+
+ @Override
+ public String getJavaCode(Object object) {
+ Insets insets = (Insets) object;
+ return "new Insets(" + insets.top + ", " + insets.left + ", " + insets.bottom + ", " + insets.right + ")";
+ }
+
+ @Override
+ public Object convertFromString(String string, Class<?> type) {
+ if (type != Insets.class) {
+ throw new IllegalArgumentException("unsupported type: " + type);
+ }
+ StringTokenizer tokenizer = new StringTokenizer(string, ",");
+ int count = tokenizer.countTokens();
+ if (count == 1) {
+ int i = Integer.parseInt(tokenizer.nextToken().trim());
+ return new Insets(i, i, i, i);
+ }
+ if (count == 4) {
+ int[] insets = new int[count];
+ for (int i = 0; tokenizer.hasMoreTokens(); i++) {
+ insets[i] = Integer.parseInt(tokenizer.nextToken().trim());
+ }
+ return new Insets(insets[0], insets[1], insets[2], insets[3]);
+ }
+ throw new IllegalArgumentException("unable to convert string '" + string + "' to Insets");
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,28 +1,44 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.types;
-
-import javax.swing.KeyStroke;
-
-public class KeyStrokeConverter implements TypeConverter {
-
- @Override
- public Class<?>[] getSupportedTypes() {
- return new Class<?>[]{KeyStroke.class};
- }
-
- @Override
- public String getJavaCode(Object object) {
- return "KeyStroke.getKeyStroke(\"" + object.toString() + "\")";
- }
-
- @Override
- public Object convertFromString(String string, Class<?> type) {
- if (type != KeyStroke.class) {
- throw new IllegalArgumentException("unsupported type: " + type);
- }
- return KeyStroke.getKeyStroke(string);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.types;
+
+import javax.swing.KeyStroke;
+
+public class KeyStrokeConverter implements TypeConverter {
+
+ @Override
+ public Class<?>[] getSupportedTypes() {
+ return new Class<?>[]{KeyStroke.class};
+ }
+
+ @Override
+ public String getJavaCode(Object object) {
+ return "KeyStroke.getKeyStroke(\"" + object.toString() + "\")";
+ }
+
+ @Override
+ public Object convertFromString(String string, Class<?> type) {
+ if (type != KeyStroke.class) {
+ throw new IllegalArgumentException("unsupported type: " + type);
+ }
+ return KeyStroke.getKeyStroke(string);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,104 +1,120 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.types;
-
-import jaxx.compiler.JAXXCompiler;
-
-public class PrimitiveConverter implements TypeConverter {
-
- @Override
- public Class<?>[] getSupportedTypes() {
-
- return new Class<?>[]{
- boolean.class,
- Boolean.class,
- byte.class,
- Byte.class,
- short.class,
- Short.class,
- int.class,
- Integer.class,
- long.class,
- Long.class,
- float.class,
- Float.class,
- double.class,
- Double.class,
- char.class,
- Character.class,
- String.class
- };
- }
-
- @Override
- public String getJavaCode(Object object) {
- if (object instanceof Boolean) {
- return String.valueOf(((Boolean) object).booleanValue());
- }
- if (object instanceof Byte) {
- return String.valueOf(((Byte) object).byteValue());
- }
- if (object instanceof Short) {
- return String.valueOf(((Short) object).shortValue());
- }
- if (object instanceof Integer) {
- return String.valueOf(((Integer) object).intValue());
- }
- if (object instanceof Long) {
- return String.valueOf(((Long) object).longValue()) + "L";
- }
- if (object instanceof Float) {
- return String.valueOf(((Float) object).floatValue()) + "F";
- }
- if (object instanceof Double) {
- return String.valueOf(((Double) object).doubleValue());
- }
- if (object instanceof String) {
- return '"' + JAXXCompiler.escapeJavaString((String) object) + '"';
- }
- throw new IllegalArgumentException("unsupported object: " + object);
- }
-
- @Override
- public Object convertFromString(String string, Class<?> type) {
- if (type == String.class || type == Object.class || type == null) {
- return string;
- }
- if (type == int.class || type == Integer.class) {
- return Integer.valueOf(string);
- }
- if (type == boolean.class || type == Boolean.class) {
- if (string.toLowerCase().equals("true")) {
- return Boolean.TRUE;
- }
- if (string.toLowerCase().equals("false")) {
- return Boolean.FALSE;
- }
- throw new IllegalArgumentException("expected 'true' or 'false', found '" + string + "'");
- }
- if (type == byte.class || type == Byte.class) {
- return Byte.valueOf(string);
- }
- if (type == short.class || type == Short.class) {
- return Short.valueOf(string);
- }
- if (type == long.class || type == Long.class) {
- return Long.valueOf(string);
- }
- if (type == float.class || type == Float.class) {
- return Float.valueOf(string);
- }
- if (type == double.class || type == Double.class) {
- return Double.valueOf(string);
- }
- if (type == char.class || type == Character.class) {
- if (string.length() == 1) {
- return string.charAt(0);
- }
- throw new IllegalArgumentException("expected a single character, found '" + string + "'");
- }
- throw new IllegalArgumentException("unsupported type: " + type);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.types;
+
+import jaxx.compiler.JAXXCompiler;
+
+public class PrimitiveConverter implements TypeConverter {
+
+ @Override
+ public Class<?>[] getSupportedTypes() {
+
+ return new Class<?>[]{
+ boolean.class,
+ Boolean.class,
+ byte.class,
+ Byte.class,
+ short.class,
+ Short.class,
+ int.class,
+ Integer.class,
+ long.class,
+ Long.class,
+ float.class,
+ Float.class,
+ double.class,
+ Double.class,
+ char.class,
+ Character.class,
+ String.class
+ };
+ }
+
+ @Override
+ public String getJavaCode(Object object) {
+ if (object instanceof Boolean) {
+ return String.valueOf(((Boolean) object).booleanValue());
+ }
+ if (object instanceof Byte) {
+ return String.valueOf(((Byte) object).byteValue());
+ }
+ if (object instanceof Short) {
+ return String.valueOf(((Short) object).shortValue());
+ }
+ if (object instanceof Integer) {
+ return String.valueOf(((Integer) object).intValue());
+ }
+ if (object instanceof Long) {
+ return String.valueOf(((Long) object).longValue()) + "L";
+ }
+ if (object instanceof Float) {
+ return String.valueOf(((Float) object).floatValue()) + "F";
+ }
+ if (object instanceof Double) {
+ return String.valueOf(((Double) object).doubleValue());
+ }
+ if (object instanceof String) {
+ return '"' + JAXXCompiler.escapeJavaString((String) object) + '"';
+ }
+ throw new IllegalArgumentException("unsupported object: " + object);
+ }
+
+ @Override
+ public Object convertFromString(String string, Class<?> type) {
+ if (type == String.class || type == Object.class || type == null) {
+ return string;
+ }
+ if (type == int.class || type == Integer.class) {
+ return Integer.valueOf(string);
+ }
+ if (type == boolean.class || type == Boolean.class) {
+ if (string.toLowerCase().equals("true")) {
+ return Boolean.TRUE;
+ }
+ if (string.toLowerCase().equals("false")) {
+ return Boolean.FALSE;
+ }
+ throw new IllegalArgumentException("expected 'true' or 'false', found '" + string + "'");
+ }
+ if (type == byte.class || type == Byte.class) {
+ return Byte.valueOf(string);
+ }
+ if (type == short.class || type == Short.class) {
+ return Short.valueOf(string);
+ }
+ if (type == long.class || type == Long.class) {
+ return Long.valueOf(string);
+ }
+ if (type == float.class || type == Float.class) {
+ return Float.valueOf(string);
+ }
+ if (type == double.class || type == Double.class) {
+ return Double.valueOf(string);
+ }
+ if (type == char.class || type == Character.class) {
+ if (string.length() == 1) {
+ return string.charAt(0);
+ }
+ throw new IllegalArgumentException("expected a single character, found '" + string + "'");
+ }
+ throw new IllegalArgumentException("unsupported type: " + type);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,14 +1,30 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.types;
-
-public interface TypeConverter {
-
- Class<?>[] getSupportedTypes();
-
- String getJavaCode(Object object);
-
- Object convertFromString(String string, Class<?> type);
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.types;
+
+public interface TypeConverter {
+
+ Class<?>[] getSupportedTypes();
+
+ String getJavaCode(Object object);
+
+ Object convertFromString(String string, Class<?> type);
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,54 +1,70 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler.types;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ServiceLoader;
-
-public class TypeManager {
-
- private static Map<Class<?>, TypeConverter> converters;
-
- public static Map<Class<?>, TypeConverter> getConverters() {
- if (converters == null) {
- converters = new HashMap<Class<?>, TypeConverter>();
- // load converters
- ServiceLoader<TypeConverter> loader = ServiceLoader.load(TypeConverter.class);
- for (TypeConverter c : loader) {
- // for each supported type, register the converter
- for (Class<?> type : c.getSupportedTypes()) {
- converters.put(type, c);
- }
- }
- }
- return converters;
- }
-
- private TypeManager() { /* not instantiable */ }
-
- public static TypeConverter getTypeConverter(Class<?> type) {
- return getConverters().get(type);
- }
-
- public static String getJavaCode(Object object) {
- if (object == null) {
- return "null";
- }
- TypeConverter converter = getTypeConverter(object.getClass());
- if (converter == null) {
- throw new IllegalArgumentException("unsupported type: " + object.getClass());
- }
- return converter.getJavaCode(object);
- }
-
- public static Object convertFromString(String string, Class<?> type) {
- TypeConverter converter = getTypeConverter(type);
- if (converter == null) {
- throw new IllegalArgumentException("unsupported type: " + type);
- }
- return converter.convertFromString(string, type);
- }
-}
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.compiler.types;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ServiceLoader;
+
+public class TypeManager {
+
+ private static Map<Class<?>, TypeConverter> converters;
+
+ public static Map<Class<?>, TypeConverter> getConverters() {
+ if (converters == null) {
+ converters = new HashMap<Class<?>, TypeConverter>();
+ // load converters
+ ServiceLoader<TypeConverter> loader = ServiceLoader.load(TypeConverter.class);
+ for (TypeConverter c : loader) {
+ // for each supported type, register the converter
+ for (Class<?> type : c.getSupportedTypes()) {
+ converters.put(type, c);
+ }
+ }
+ }
+ return converters;
+ }
+
+ private TypeManager() { /* not instantiable */ }
+
+ public static TypeConverter getTypeConverter(Class<?> type) {
+ return getConverters().get(type);
+ }
+
+ public static String getJavaCode(Object object) {
+ if (object == null) {
+ return "null";
+ }
+ TypeConverter converter = getTypeConverter(object.getClass());
+ if (converter == null) {
+ throw new IllegalArgumentException("unsupported type: " + object.getClass());
+ }
+ return converter.getJavaCode(object);
+ }
+
+ public static Object convertFromString(String string, Class<?> type) {
+ TypeConverter converter = getTypeConverter(type);
+ if (converter == null) {
+ throw new IllegalArgumentException("unsupported type: " + type);
+ }
+ return converter.convertFromString(string, type);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import jaxx.compiler.CompilerException;
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler;
import jaxx.compiler.java.JavaMethod;
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.beans;
import org.junit.Assert;
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.reflect;
import static org.junit.Assert.assertEquals;
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.tags;
import jaxx.compiler.JAXXCompiler;
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.types;
import jaxx.compiler.types.ColorConverter;
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.types;
import jaxx.compiler.types.InsetsConverter;
Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.compiler.types;
import jaxx.compiler.types.PrimitiveConverter;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime;
import java.io.ByteArrayInputStream;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,49 +1,65 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime;
-
-import java.io.Serializable;
-
-public class ComponentDescriptor implements Serializable {
- String id;
- String javaClassName;
- String styleClass;
- ComponentDescriptor parent;
- private static final long serialVersionUID = 1L;
-
-
- public ComponentDescriptor(String id, String javaClassName, String styleClass, ComponentDescriptor parent) {
- this.id = id;
- this.javaClassName = javaClassName;
- this.styleClass = styleClass;
- this.parent = parent;
- }
-
-
- public String getId() {
- return id;
- }
-
-
- public String getJavaClassName() {
- return javaClassName;
- }
-
-
- public String getStyleClass() {
- return styleClass;
- }
-
-
- public ComponentDescriptor getParent() {
- return parent;
- }
-
-
- @Override
- public String toString() {
- return "ComponentDescriptor[" + id + ", " + javaClassName + ", " + styleClass + "]";
- }
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime;
+
+import java.io.Serializable;
+
+public class ComponentDescriptor implements Serializable {
+ String id;
+ String javaClassName;
+ String styleClass;
+ ComponentDescriptor parent;
+ private static final long serialVersionUID = 1L;
+
+
+ public ComponentDescriptor(String id, String javaClassName, String styleClass, ComponentDescriptor parent) {
+ this.id = id;
+ this.javaClassName = javaClassName;
+ this.styleClass = styleClass;
+ this.parent = parent;
+ }
+
+
+ public String getId() {
+ return id;
+ }
+
+
+ public String getJavaClassName() {
+ return javaClassName;
+ }
+
+
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+
+ public ComponentDescriptor getParent() {
+ return parent;
+ }
+
+
+ @Override
+ public String toString() {
+ return "ComponentDescriptor[" + id + ", " + javaClassName + ", " + styleClass + "]";
+ }
}
\ No newline at end of file
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,47 +1,63 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-
-/**
- * A <code>PropertyChangeListener</code> which processes a data binding when it receives a
- * <code>PropertyChangeEvent</code>.
- */
-public class DataBindingListener implements PropertyChangeListener {
- private JAXXObject object;
- private String dest;
-
- /**
- * Creates a new <code>DataBindingListener</code> which will run the given data binding
- * when it receives a <code>PropertyChangeEvent</code>.
- *
- * @param object the object in which the data binding exists
- * @param dest the name of the data binding to run
- */
- public DataBindingListener(JAXXObject object, String dest) {
- this.object = object;
- this.dest = dest;
- }
-
-
- /**
- * Processes the data binding in response to a <code>PropertyChangeEvent</code>.
- *
- * @param e the event which triggered the binding
- */
- @Override
- public void propertyChange(PropertyChangeEvent e) {
- object.processDataBinding(dest);
-
- // for now, handle dependency changes by always removing & reapplying
- // the binding. We should be more efficient and only do this when it's
- // actually necessary
- object.removeDataBinding(dest);
- object.applyDataBinding(dest);
- }
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+
+/**
+ * A <code>PropertyChangeListener</code> which processes a data binding when it receives a
+ * <code>PropertyChangeEvent</code>.
+ */
+public class DataBindingListener implements PropertyChangeListener {
+ private JAXXObject object;
+ private String dest;
+
+ /**
+ * Creates a new <code>DataBindingListener</code> which will run the given data binding
+ * when it receives a <code>PropertyChangeEvent</code>.
+ *
+ * @param object the object in which the data binding exists
+ * @param dest the name of the data binding to run
+ */
+ public DataBindingListener(JAXXObject object, String dest) {
+ this.object = object;
+ this.dest = dest;
+ }
+
+
+ /**
+ * Processes the data binding in response to a <code>PropertyChangeEvent</code>.
+ *
+ * @param e the event which triggered the binding
+ */
+ @Override
+ public void propertyChange(PropertyChangeEvent e) {
+ object.processDataBinding(dest);
+
+ // for now, handle dependency changes by always removing & reapplying
+ // the binding. We should be more efficient and only do this when it's
+ // actually necessary
+ object.removeDataBinding(dest);
+ object.applyDataBinding(dest);
+ }
}
\ No newline at end of file
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,47 +1,63 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-
-/**
- * A <code>PropertyChangeListener</code> which removes and re-applies a data binding
- * when it receives a <code>PropertyChangeEvent</code>.
- */
-public class DataBindingUpdateListener implements PropertyChangeListener {
- private JAXXObject object;
- private String dest;
-
- /**
- * Creates a new <code>DataBindingUpdateListener</code> which will remove and re-apply a
- * data binding when it receives a <code>PropertyChangeEvent</code>.
- *
- * @param object the object in which the data binding exists
- * @param dest the name of the data binding to reapply
- */
- public DataBindingUpdateListener(JAXXObject object, String dest) {
- this.object = object;
- this.dest = dest;
- }
-
-
- public String getBindingName() {
- return dest;
- }
-
-
- /**
- * Updates the data binding in response to a <code>PropertyChangeEvent</code>.
- *
- * @param e the event which triggered the binding
- */
- @Override
- public void propertyChange(PropertyChangeEvent e) {
- object.removeDataBinding(dest);
- object.applyDataBinding(dest);
- }
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+
+/**
+ * A <code>PropertyChangeListener</code> which removes and re-applies a data binding
+ * when it receives a <code>PropertyChangeEvent</code>.
+ */
+public class DataBindingUpdateListener implements PropertyChangeListener {
+ private JAXXObject object;
+ private String dest;
+
+ /**
+ * Creates a new <code>DataBindingUpdateListener</code> which will remove and re-apply a
+ * data binding when it receives a <code>PropertyChangeEvent</code>.
+ *
+ * @param object the object in which the data binding exists
+ * @param dest the name of the data binding to reapply
+ */
+ public DataBindingUpdateListener(JAXXObject object, String dest) {
+ this.object = object;
+ this.dest = dest;
+ }
+
+
+ public String getBindingName() {
+ return dest;
+ }
+
+
+ /**
+ * Updates the data binding in response to a <code>PropertyChangeEvent</code>.
+ *
+ * @param e the event which triggered the binding
+ */
+ @Override
+ public void propertyChange(PropertyChangeEvent e) {
+ object.removeDataBinding(dest);
+ object.applyDataBinding(dest);
+ }
}
\ No newline at end of file
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime;
import jaxx.runtime.context.JAXXInitialContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime;
import java.awt.Container;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,70 +1,86 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime;
-
-import java.io.Serializable;
-import java.util.Map;
-
-/**
- * The <code>JAXXObject</code> interface is implemented by all classes
- * produced by the JAXX compiler.
- */
-public interface JAXXObject extends JAXXContext, Serializable {
-
- /**
- * Retrieves an object defined in an XML tag by its ID.
- *
- * @param id the id of the component to retrieve
- * @return the object
- */
- Object getObjectById(String id);
-
- /**
- * Pretrieves the dictonary of knwon objects indexed by their ids.
- *
- * @return the dictonary of objects.
- */
- Map<String, Object> get$objectMap();
-
- /**
- *
- * @return the {@link JAXXContext} attached to the object
- */
- JAXXContext getDelegateContext();
-
- /**
- * Apply the data bind by name and then process it.
- * @param id the id of the databinding
- */
- void applyDataBinding(String id);
-
- /**
- * Processes a data binding by name. Data binding names are comprised of an object ID and a property name:
- * for example, the data binding in the tag <code><JLabel id='label' text='{foo.getText()}'/></code> is
- * named <code>"label.text"</code>. Processing a data binding causes it to reevaluate its expression, in this
- * case <code>foo.getText()</code>.
- *
- * @param dest the name of the data binding to run
- */
- void processDataBinding(String dest);
-
- /**
- * Remove a databinding by name.
- *
- * @param id the name of databinding to remove
- */
- void removeDataBinding(String id);
-
- /**
- * All <code>JAXXObject</code> implements are capable of broadcasting <code>PropertyChangeEvent</code>, and
- * furthermore (for technical reasons) must allow code in outside packages, specifically the JAXX runtime,
- * to trigger these events.
- *
- * @param name the name of the property which changed
- * @param oldValue the old value of the property
- * @param newValue the new value of the property
- */
- void firePropertyChange(String name, Object oldValue, Object newValue);
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * The <code>JAXXObject</code> interface is implemented by all classes
+ * produced by the JAXX compiler.
+ */
+public interface JAXXObject extends JAXXContext, Serializable {
+
+ /**
+ * Retrieves an object defined in an XML tag by its ID.
+ *
+ * @param id the id of the component to retrieve
+ * @return the object
+ */
+ Object getObjectById(String id);
+
+ /**
+ * Pretrieves the dictonary of knwon objects indexed by their ids.
+ *
+ * @return the dictonary of objects.
+ */
+ Map<String, Object> get$objectMap();
+
+ /**
+ *
+ * @return the {@link JAXXContext} attached to the object
+ */
+ JAXXContext getDelegateContext();
+
+ /**
+ * Apply the data bind by name and then process it.
+ * @param id the id of the databinding
+ */
+ void applyDataBinding(String id);
+
+ /**
+ * Processes a data binding by name. Data binding names are comprised of an object ID and a property name:
+ * for example, the data binding in the tag <code><JLabel id='label' text='{foo.getText()}'/></code> is
+ * named <code>"label.text"</code>. Processing a data binding causes it to reevaluate its expression, in this
+ * case <code>foo.getText()</code>.
+ *
+ * @param dest the name of the data binding to run
+ */
+ void processDataBinding(String dest);
+
+ /**
+ * Remove a databinding by name.
+ *
+ * @param id the name of databinding to remove
+ */
+ void removeDataBinding(String id);
+
+ /**
+ * All <code>JAXXObject</code> implements are capable of broadcasting <code>PropertyChangeEvent</code>, and
+ * furthermore (for technical reasons) must allow code in outside packages, specifically the JAXX runtime,
+ * to trigger these events.
+ *
+ * @param name the name of the property which changed
+ * @param oldValue the old value of the property
+ * @param newValue the new value of the property
+ */
+ void firePropertyChange(String name, Object oldValue, Object newValue);
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,42 +1,58 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime;
-
-import jaxx.runtime.css.Stylesheet;
-
-import java.io.Serializable;
-
-public class JAXXObjectDescriptor implements Serializable {
- private ComponentDescriptor[] descriptors;
- private Stylesheet stylesheet;
- private static final long serialVersionUID = 1L;
-
-
- public JAXXObjectDescriptor(ComponentDescriptor[] descriptors,
- Stylesheet stylesheet) {
- this.descriptors = descriptors;
- this.stylesheet = stylesheet;
- }
-
-
- public ComponentDescriptor[] getComponentDescriptors() {
- return descriptors;
- }
-
-
- public Stylesheet getStylesheet() {
- return stylesheet;
- }
-
- @Override
- public String toString() {
- StringBuilder buffer = new StringBuilder();
- for (ComponentDescriptor descriptor : descriptors) {
- buffer.append("\n").append(descriptor);
- }
- buffer.append("\n").append(stylesheet);
- return buffer.toString();
- }
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime;
+
+import jaxx.runtime.css.Stylesheet;
+
+import java.io.Serializable;
+
+public class JAXXObjectDescriptor implements Serializable {
+ private ComponentDescriptor[] descriptors;
+ private Stylesheet stylesheet;
+ private static final long serialVersionUID = 1L;
+
+
+ public JAXXObjectDescriptor(ComponentDescriptor[] descriptors,
+ Stylesheet stylesheet) {
+ this.descriptors = descriptors;
+ this.stylesheet = stylesheet;
+ }
+
+
+ public ComponentDescriptor[] getComponentDescriptors() {
+ return descriptors;
+ }
+
+
+ public Stylesheet getStylesheet() {
+ return stylesheet;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder buffer = new StringBuilder();
+ for (ComponentDescriptor descriptor : descriptors) {
+ buffer.append("\n").append(descriptor);
+ }
+ buffer.append("\n").append(stylesheet);
+ return buffer.toString();
+ }
}
\ No newline at end of file
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime;
import java.awt.Color;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime;
import jaxx.runtime.context.JAXXContextEntryDef;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.context;
import jaxx.runtime.JAXXContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.context;
import jaxx.runtime.*;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.context;
import jaxx.runtime.*;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.context;
import java.util.List;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.context;
import jaxx.runtime.JAXXContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,32 +1,48 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.css;
-
-/**
- * Represents a data binding bound to an attribute at runtime. Used by {@link Pseudoclasses} to keep
- * track of which data bindings are in effect.
- */
-public class DataBinding {
-
- private String id;
-
- public DataBinding(String id) {
- this.id = id;
- }
-
- public String getId() {
- return id;
- }
-
- @Override
- public boolean equals(Object o) {
- return o instanceof DataBinding && ((DataBinding) o).getId().equals(getId());
- }
-
- @Override
- public int hashCode() {
- return id.hashCode();
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.css;
+
+/**
+ * Represents a data binding bound to an attribute at runtime. Used by {@link Pseudoclasses} to keep
+ * track of which data bindings are in effect.
+ */
+public class DataBinding {
+
+ private String id;
+
+ public DataBinding(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return o instanceof DataBinding && ((DataBinding) o).getId().equals(getId());
+ }
+
+ @Override
+ public int hashCode() {
+ return id.hashCode();
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.css;
import jaxx.runtime.JAXXObject;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,52 +1,68 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.css;
-
-import java.util.Map;
-
-public class Rule implements java.io.Serializable, Comparable<Rule> {
-
- public static final String INLINE_ATTRIBUTE = "<inline attribute>";
- public static final String DATA_BINDING = "<data binding>";
- private Selector[] selectors;
- private Map<String, String> properties;
- private static final long serialVersionUID = 1L;
-
- public Rule(Selector[] selectors, Map<String, String> properties) {
- this.selectors = selectors;
- java.util.Arrays.sort(selectors);
- this.properties = properties;
- }
-
- public Rule(Selector[] selectors, String[] keys, String[] values) {
- this.selectors = selectors;
- java.util.Arrays.sort(selectors);
- this.properties = new java.util.HashMap<String, String>();
- if (keys.length != values.length) {
- throw new IllegalArgumentException("keys and values must have the same number of entries");
- }
- for (int i = 0; i < keys.length; i++) {
- properties.put(keys[i], values[i]);
- }
- }
-
- public Selector[] getSelectors() {
- return selectors;
- }
-
- public Map<String, String> getProperties() {
- return properties;
- }
-
- @Override
- public int compareTo(Rule o) {
- return selectors[0].compareTo(o.selectors[0]); // they are already sorted so we only need to compare the highest-ranked from each one
- }
-
- @Override
- public String toString() {
- return "Rule[" + java.util.Arrays.asList(selectors) + ", " + properties + "]";
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.css;
+
+import java.util.Map;
+
+public class Rule implements java.io.Serializable, Comparable<Rule> {
+
+ public static final String INLINE_ATTRIBUTE = "<inline attribute>";
+ public static final String DATA_BINDING = "<data binding>";
+ private Selector[] selectors;
+ private Map<String, String> properties;
+ private static final long serialVersionUID = 1L;
+
+ public Rule(Selector[] selectors, Map<String, String> properties) {
+ this.selectors = selectors;
+ java.util.Arrays.sort(selectors);
+ this.properties = properties;
+ }
+
+ public Rule(Selector[] selectors, String[] keys, String[] values) {
+ this.selectors = selectors;
+ java.util.Arrays.sort(selectors);
+ this.properties = new java.util.HashMap<String, String>();
+ if (keys.length != values.length) {
+ throw new IllegalArgumentException("keys and values must have the same number of entries");
+ }
+ for (int i = 0; i < keys.length; i++) {
+ properties.put(keys[i], values[i]);
+ }
+ }
+
+ public Selector[] getSelectors() {
+ return selectors;
+ }
+
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public int compareTo(Rule o) {
+ return selectors[0].compareTo(o.selectors[0]); // they are already sorted so we only need to compare the highest-ranked from each one
+ }
+
+ @Override
+ public String toString() {
+ return "Rule[" + java.util.Arrays.asList(selectors) + ", " + properties + "]";
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,92 +1,108 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.css;
-
-public class Selector implements java.io.Serializable, Comparable<Selector> {
-
- public static final int NEVER_APPLIES = 0;
- public static final int PSEUDOCLASS_APPLIES_INHERIT_ONLY = 1;
- public static final int PSEUDOCLASS_APPLIES = 2;
- public static final int ALWAYS_APPLIES_INHERIT_ONLY = 3;
- public static final int ALWAYS_APPLIES = 4;
- private String javaClassName;
- private String styleClass;
- private String pseudoClass;
- private String id;
- private boolean inline;
- private static final long serialVersionUID = 1L;
-
- public Selector(String javaClassName, String styleClass, String pseudoClass, String id) {
- this(javaClassName, styleClass, pseudoClass, id, false);
- }
-
- public Selector(String javaClassName, String styleClass, String pseudoClass, String id, boolean inline) {
- this.javaClassName = javaClassName;
- this.styleClass = styleClass;
- this.pseudoClass = pseudoClass;
- this.id = id;
- this.inline = inline;
- }
-
- public String getJavaClassName() {
- return javaClassName;
- }
-
- public String getStyleClass() {
- return styleClass;
- }
-
- public String getPseudoClass() {
- return pseudoClass;
- }
-
- public String getId() {
- return id;
- }
-
- public boolean isInline() {
- return inline;
- }
-
- @Override
- public int compareTo(Selector selector) {
- if (inline && !selector.inline) {
- return 1;
- }
- if (!inline && selector.inline) {
- return -1;
- }
- if (pseudoClass != null && selector.pseudoClass == null) {
- return 1;
- }
- if (pseudoClass == null && selector.pseudoClass != null) {
- return -1;
- }
- if (id != null && selector.id == null) {
- return 1;
- }
- if (id == null && selector.id != null) {
- return -1;
- }
- if (styleClass != null && selector.styleClass == null) {
- return 1;
- }
- if (styleClass == null && selector.styleClass != null) {
- return -1;
- }
- if (javaClassName != null && selector.javaClassName == null) {
- return 1;
- }
- if (javaClassName == null && selector.javaClassName != null) {
- return -1;
- }
- return 0;
- }
-
- @Override
- public String toString() {
- return "Selector[" + javaClassName + ", " + styleClass + ", " + pseudoClass + ", " + id + "]";
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.css;
+
+public class Selector implements java.io.Serializable, Comparable<Selector> {
+
+ public static final int NEVER_APPLIES = 0;
+ public static final int PSEUDOCLASS_APPLIES_INHERIT_ONLY = 1;
+ public static final int PSEUDOCLASS_APPLIES = 2;
+ public static final int ALWAYS_APPLIES_INHERIT_ONLY = 3;
+ public static final int ALWAYS_APPLIES = 4;
+ private String javaClassName;
+ private String styleClass;
+ private String pseudoClass;
+ private String id;
+ private boolean inline;
+ private static final long serialVersionUID = 1L;
+
+ public Selector(String javaClassName, String styleClass, String pseudoClass, String id) {
+ this(javaClassName, styleClass, pseudoClass, id, false);
+ }
+
+ public Selector(String javaClassName, String styleClass, String pseudoClass, String id, boolean inline) {
+ this.javaClassName = javaClassName;
+ this.styleClass = styleClass;
+ this.pseudoClass = pseudoClass;
+ this.id = id;
+ this.inline = inline;
+ }
+
+ public String getJavaClassName() {
+ return javaClassName;
+ }
+
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+ public String getPseudoClass() {
+ return pseudoClass;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public boolean isInline() {
+ return inline;
+ }
+
+ @Override
+ public int compareTo(Selector selector) {
+ if (inline && !selector.inline) {
+ return 1;
+ }
+ if (!inline && selector.inline) {
+ return -1;
+ }
+ if (pseudoClass != null && selector.pseudoClass == null) {
+ return 1;
+ }
+ if (pseudoClass == null && selector.pseudoClass != null) {
+ return -1;
+ }
+ if (id != null && selector.id == null) {
+ return 1;
+ }
+ if (id == null && selector.id != null) {
+ return -1;
+ }
+ if (styleClass != null && selector.styleClass == null) {
+ return 1;
+ }
+ if (styleClass == null && selector.styleClass != null) {
+ return -1;
+ }
+ if (javaClassName != null && selector.javaClassName == null) {
+ return 1;
+ }
+ if (javaClassName == null && selector.javaClassName != null) {
+ return -1;
+ }
+ return 0;
+ }
+
+ @Override
+ public String toString() {
+ return "Selector[" + javaClassName + ", " + styleClass + ", " + pseudoClass + ", " + id + "]";
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,45 +1,61 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.css;
-
-public class Stylesheet implements java.io.Serializable {
-
- private Rule[] rules;
- private static final long serialVersionUID = 1L;
-
- public Stylesheet() {
- rules = new Rule[0];
- }
-
- public Stylesheet(Rule[] rules) {
- this.rules = rules;
- java.util.Arrays.sort(rules);
- }
-
- public Rule[] getRules() {
- return rules;
- }
-
- public void add(Rule newRule) {
- Rule[] oldRules = rules;
- rules = new Rule[oldRules.length + 1];
- System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
- rules[rules.length - 1] = newRule;
- java.util.Arrays.sort(rules);
- }
-
- public void add(Rule[] newRules) {
- Rule[] oldRules = rules;
- rules = new Rule[oldRules.length + newRules.length];
- System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
- System.arraycopy(newRules, 0, rules, oldRules.length, newRules.length);
- java.util.Arrays.sort(rules);
- }
-
- @Override
- public String toString() {
- return "Stylesheet" + java.util.Arrays.asList(rules);
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.css;
+
+public class Stylesheet implements java.io.Serializable {
+
+ private Rule[] rules;
+ private static final long serialVersionUID = 1L;
+
+ public Stylesheet() {
+ rules = new Rule[0];
+ }
+
+ public Stylesheet(Rule[] rules) {
+ this.rules = rules;
+ java.util.Arrays.sort(rules);
+ }
+
+ public Rule[] getRules() {
+ return rules;
+ }
+
+ public void add(Rule newRule) {
+ Rule[] oldRules = rules;
+ rules = new Rule[oldRules.length + 1];
+ System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
+ rules[rules.length - 1] = newRule;
+ java.util.Arrays.sort(rules);
+ }
+
+ public void add(Rule[] newRules) {
+ Rule[] oldRules = rules;
+ rules = new Rule[oldRules.length + newRules.length];
+ System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
+ System.arraycopy(newRules, 0, rules, oldRules.length, newRules.length);
+ java.util.Arrays.sort(rules);
+ }
+
+ @Override
+ public String toString() {
+ return "Stylesheet" + java.util.Arrays.asList(rules);
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
import java.util.ArrayList;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
import org.apache.commons.jxpath.JXPathContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
import org.apache.commons.logging.Log;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
import org.apache.commons.beanutils.PropertyUtils;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator.swing;
import jaxx.runtime.decorator.*;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator.swing;
import jaxx.runtime.decorator.*;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,56 +1,71 @@
-package jaxx.runtime.swing;
-
-import javax.swing.JFrame;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-import java.awt.GraphicsConfiguration;
-
-public class Application extends JFrame {
- // Special: jaxxc will automatically add a main() method to any components which
- // extend <Application>
-
-
- public Application() {
- }
-
-
- public Application(GraphicsConfiguration gc) {
- super(gc);
- }
-
-
- public Application(String title) {
- super(title);
- }
-
-
- public Application(String title, GraphicsConfiguration gc) {
- super(title, gc);
- }
-
-
- public void setLookAndFeel(String lookAndFeel) {
- if (lookAndFeel.equals("system"))
- lookAndFeel = UIManager.getSystemLookAndFeelClassName();
- else if (lookAndFeel.equals("cross_platform"))
- lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
- try {
- UIManager.setLookAndFeel(lookAndFeel);
- if (isDisplayable())
- SwingUtilities.updateComponentTreeUI(this);
- }
- catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
- catch (InstantiationException e) {
- throw new RuntimeException(e);
- }
- catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- catch (UnsupportedLookAndFeelException e) {
- throw new RuntimeException(e);
- }
- }
-}
\ No newline at end of file
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import java.awt.GraphicsConfiguration;
+
+public class Application extends JFrame {
+
+ private static final long serialVersionUID = 1L;
+ // Special: jaxxc will automatically add a main() method to any components which
+ // extend <Application>
+
+ public Application() {
+ }
+
+ public Application(GraphicsConfiguration gc) {
+ super(gc);
+ }
+
+ public Application(String title) {
+ super(title);
+ }
+
+ public Application(String title, GraphicsConfiguration gc) {
+ super(title, gc);
+ }
+
+ public void setLookAndFeel(String lookAndFeel) {
+ if (lookAndFeel.equals("system")) {
+ lookAndFeel = UIManager.getSystemLookAndFeelClassName();
+ } else if (lookAndFeel.equals("cross_platform")) {
+ lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
+ }
+ try {
+ UIManager.setLookAndFeel(lookAndFeel);
+ if (isDisplayable()) {
+ SwingUtilities.updateComponentTreeUI(this);
+ }
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ } catch (InstantiationException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (UnsupportedLookAndFeelException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing;
import java.awt.AlphaComposite;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing;
import java.awt.AlphaComposite;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing;
import org.apache.commons.logging.Log;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing;
import java.awt.Container;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,7 @@
/**
- * *##% Lutin I18n Editor
- * Copyright (C) 2008 CodeLutin
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
/*
GBC - A convenience class to tame the GridBagLayout
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,94 +1,110 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.JPanel;
-import java.awt.Insets;
-
-/**
- * Panel which uses an {@link HBoxLayout} by default.
- *
- * @author Ethan Nicholas
- */
-public class HBox extends JPanel {
-
- private static final long serialVersionUID = 1L;
- public static final String SPACING_PROPERTY = "spacing";
- public static final String MARGIN_PROPERTY = "margin";
- public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment";
- public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment";
- private Insets margin;
-
- public HBox() {
- super(new HBoxLayout());
- }
-
- /**
- * Returns the spacing between components, in pixels. Spacing is applied between components only,
- * not to the top or bottom of the container.
- *
- * @return spacing between components
- */
- public int getSpacing() {
- return ((HBoxLayout) getLayout()).getSpacing();
- }
-
- /**
- * Sets the spacing between components. Spacing is applied between components only,
- * not to the top or bottom of the container.
- *
- * @param spacing new spacing value
- */
- public void setSpacing(int spacing) {
- int oldValue = getSpacing();
- ((HBoxLayout) getLayout()).setSpacing(spacing);
- firePropertyChange(SPACING_PROPERTY, oldValue, spacing);
- revalidate();
- }
-
- public int getHorizontalAlignment() {
- return ((HBoxLayout) getLayout()).getHorizontalAlignment();
- }
-
- public void setHorizontalAlignment(int horizontalAlignment) {
- int oldValue = getHorizontalAlignment();
- ((HBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment);
- firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment);
- revalidate();
- }
-
- public int getVerticalAlignment() {
- return ((HBoxLayout) getLayout()).getVerticalAlignment();
- }
-
- public void setVerticalAlignment(int verticalAlignment) {
- int oldValue = getVerticalAlignment();
- ((HBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment);
- firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment);
- revalidate();
- }
-
- public Insets getMargin() {
- return margin;
- }
-
- public void setMargin(Insets margin) {
- Insets oldValue = this.margin;
- this.margin = (Insets) margin.clone();
- firePropertyChange(MARGIN_PROPERTY, oldValue, margin);
- }
-
- @Override
- public Insets getInsets() {
- Insets result = super.getInsets();
- if (margin != null) {
- result.top += margin.top;
- result.left += margin.left;
- result.right += margin.right;
- result.bottom += margin.bottom;
- }
- return result;
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.JPanel;
+import java.awt.Insets;
+
+/**
+ * Panel which uses an {@link HBoxLayout} by default.
+ *
+ * @author Ethan Nicholas
+ */
+public class HBox extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+ public static final String SPACING_PROPERTY = "spacing";
+ public static final String MARGIN_PROPERTY = "margin";
+ public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment";
+ public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment";
+ private Insets margin;
+
+ public HBox() {
+ super(new HBoxLayout());
+ }
+
+ /**
+ * Returns the spacing between components, in pixels. Spacing is applied between components only,
+ * not to the top or bottom of the container.
+ *
+ * @return spacing between components
+ */
+ public int getSpacing() {
+ return ((HBoxLayout) getLayout()).getSpacing();
+ }
+
+ /**
+ * Sets the spacing between components. Spacing is applied between components only,
+ * not to the top or bottom of the container.
+ *
+ * @param spacing new spacing value
+ */
+ public void setSpacing(int spacing) {
+ int oldValue = getSpacing();
+ ((HBoxLayout) getLayout()).setSpacing(spacing);
+ firePropertyChange(SPACING_PROPERTY, oldValue, spacing);
+ revalidate();
+ }
+
+ public int getHorizontalAlignment() {
+ return ((HBoxLayout) getLayout()).getHorizontalAlignment();
+ }
+
+ public void setHorizontalAlignment(int horizontalAlignment) {
+ int oldValue = getHorizontalAlignment();
+ ((HBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment);
+ firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment);
+ revalidate();
+ }
+
+ public int getVerticalAlignment() {
+ return ((HBoxLayout) getLayout()).getVerticalAlignment();
+ }
+
+ public void setVerticalAlignment(int verticalAlignment) {
+ int oldValue = getVerticalAlignment();
+ ((HBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment);
+ firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment);
+ revalidate();
+ }
+
+ public Insets getMargin() {
+ return margin;
+ }
+
+ public void setMargin(Insets margin) {
+ Insets oldValue = this.margin;
+ this.margin = (Insets) margin.clone();
+ firePropertyChange(MARGIN_PROPERTY, oldValue, margin);
+ }
+
+ @Override
+ public Insets getInsets() {
+ Insets result = super.getInsets();
+ if (margin != null) {
+ result.top += margin.top;
+ result.left += margin.left;
+ result.right += margin.right;
+ result.bottom += margin.bottom;
+ }
+ return result;
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.runtime.swing;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,127 +1,143 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.SwingConstants;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-
-/**
- * Horizontal box layout. The layout rules followed by this class are quite different than the core BoxLayout class,
- * and in general represent a more useful algorithm.
- *
- * @author Ethan Nicholas
- */
-public class HBoxLayout implements LayoutManager {
-
- private int spacing = 6;
- private int horizontalAlignment = SwingConstants.LEFT;
- private int verticalAlignment = SwingConstants.TOP;
-
- public int getSpacing() {
- return spacing;
- }
-
- public void setSpacing(int spacing) {
- this.spacing = spacing;
- }
-
- public int getHorizontalAlignment() {
- return horizontalAlignment;
- }
-
- public void setHorizontalAlignment(int horizontalAlignment) {
- this.horizontalAlignment = horizontalAlignment;
- }
-
- public int getVerticalAlignment() {
- return verticalAlignment;
- }
-
- public void setVerticalAlignment(int verticalAlignment) {
- this.verticalAlignment = verticalAlignment;
- }
-
- @Override
- public void addLayoutComponent(String name, Component comp) {
- }
-
- @Override
- public void layoutContainer(Container parent) {
- Insets insets = parent.getInsets();
- int parentHeight = parent.getSize().height - insets.top - insets.bottom;
- int count = parent.getComponentCount();
- Dimension preferredSize = parent.getPreferredSize();
- int x;
- switch (horizontalAlignment) {
- case SwingConstants.LEFT:
- x = insets.left;
- break;
- case SwingConstants.CENTER:
- x = insets.left + (parent.getWidth() - preferredSize.width) / 2;
- break;
- case SwingConstants.RIGHT:
- x = insets.left + (parent.getWidth() - preferredSize.width);
- break;
- default:
- throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment);
- }
-
- for (int i = 0; i < count; i++) {
- Component component = parent.getComponent(i);
- Dimension childPreferredSize = component.getPreferredSize();
- int height = Math.min(childPreferredSize.height, parentHeight);
- int y;
- switch (verticalAlignment) {
- case SwingConstants.TOP:
- y = insets.top;
- break;
- case SwingConstants.CENTER:
- y = insets.top + (parentHeight - childPreferredSize.height) / 2;
- break;
- case SwingConstants.BOTTOM:
- y = insets.top + (parentHeight - childPreferredSize.height);
- break;
- default:
- throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment);
- }
- component.setBounds(x, y, childPreferredSize.width, height);
- x += childPreferredSize.width + spacing;
- }
- }
-
- @Override
- public Dimension minimumLayoutSize(Container parent) {
- int width = (parent.getComponentCount() - 1) * spacing;
- int height = 0;
- for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
- Dimension minimumSize = parent.getComponent(i).getMinimumSize();
- width += minimumSize.width;
- height = Math.max(height, minimumSize.height);
- }
- Insets insets = parent.getInsets();
- return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
- }
-
- @Override
- public Dimension preferredLayoutSize(Container parent) {
- int width = (parent.getComponentCount() - 1) * spacing;
- int height = 0;
- for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
- Dimension preferredSize = parent.getComponent(i).getPreferredSize();
- width += preferredSize.width;
- height = Math.max(height, preferredSize.height);
- }
- Insets insets = parent.getInsets();
- return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
- }
-
- @Override
- public void removeLayoutComponent(Component comp) {
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.SwingConstants;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+
+/**
+ * Horizontal box layout. The layout rules followed by this class are quite different than the core BoxLayout class,
+ * and in general represent a more useful algorithm.
+ *
+ * @author Ethan Nicholas
+ */
+public class HBoxLayout implements LayoutManager {
+
+ private int spacing = 6;
+ private int horizontalAlignment = SwingConstants.LEFT;
+ private int verticalAlignment = SwingConstants.TOP;
+
+ public int getSpacing() {
+ return spacing;
+ }
+
+ public void setSpacing(int spacing) {
+ this.spacing = spacing;
+ }
+
+ public int getHorizontalAlignment() {
+ return horizontalAlignment;
+ }
+
+ public void setHorizontalAlignment(int horizontalAlignment) {
+ this.horizontalAlignment = horizontalAlignment;
+ }
+
+ public int getVerticalAlignment() {
+ return verticalAlignment;
+ }
+
+ public void setVerticalAlignment(int verticalAlignment) {
+ this.verticalAlignment = verticalAlignment;
+ }
+
+ @Override
+ public void addLayoutComponent(String name, Component comp) {
+ }
+
+ @Override
+ public void layoutContainer(Container parent) {
+ Insets insets = parent.getInsets();
+ int parentHeight = parent.getSize().height - insets.top - insets.bottom;
+ int count = parent.getComponentCount();
+ Dimension preferredSize = parent.getPreferredSize();
+ int x;
+ switch (horizontalAlignment) {
+ case SwingConstants.LEFT:
+ x = insets.left;
+ break;
+ case SwingConstants.CENTER:
+ x = insets.left + (parent.getWidth() - preferredSize.width) / 2;
+ break;
+ case SwingConstants.RIGHT:
+ x = insets.left + (parent.getWidth() - preferredSize.width);
+ break;
+ default:
+ throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment);
+ }
+
+ for (int i = 0; i < count; i++) {
+ Component component = parent.getComponent(i);
+ Dimension childPreferredSize = component.getPreferredSize();
+ int height = Math.min(childPreferredSize.height, parentHeight);
+ int y;
+ switch (verticalAlignment) {
+ case SwingConstants.TOP:
+ y = insets.top;
+ break;
+ case SwingConstants.CENTER:
+ y = insets.top + (parentHeight - childPreferredSize.height) / 2;
+ break;
+ case SwingConstants.BOTTOM:
+ y = insets.top + (parentHeight - childPreferredSize.height);
+ break;
+ default:
+ throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment);
+ }
+ component.setBounds(x, y, childPreferredSize.width, height);
+ x += childPreferredSize.width + spacing;
+ }
+ }
+
+ @Override
+ public Dimension minimumLayoutSize(Container parent) {
+ int width = (parent.getComponentCount() - 1) * spacing;
+ int height = 0;
+ for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
+ Dimension minimumSize = parent.getComponent(i).getMinimumSize();
+ width += minimumSize.width;
+ height = Math.max(height, minimumSize.height);
+ }
+ Insets insets = parent.getInsets();
+ return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
+ }
+
+ @Override
+ public Dimension preferredLayoutSize(Container parent) {
+ int width = (parent.getComponentCount() - 1) * spacing;
+ int height = 0;
+ for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
+ Dimension preferredSize = parent.getComponent(i).getPreferredSize();
+ width += preferredSize.width;
+ height = Math.max(height, preferredSize.height);
+ }
+ Insets insets = parent.getInsets();
+ return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
+ }
+
+ @Override
+ public void removeLayoutComponent(Component comp) {
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,223 +1,239 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.event.SwingPropertyChangeSupport;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.ArrayList;
-import java.util.List;
-
-// This needs to be split into two classes, Item and TreeItem
-/**
- * An item in a component such as <code>JComboBox</code> or <code>JTree</code>. The <code>Item</code>
- * class corresponds to the <code><item></code> tag in JAXX source files.
- */
-public class Item {
-
- public static final String LABEL_PROPERTY = "label";
- public static final String VALUE_PROPERTY = "value";
- public static final String SELECTED_PROPERTY = "selected";
- private String id;
- private String label;
- private Object value;
- private boolean selected;
- private List<Item> children;
- private Item parent;
- private PropertyChangeSupport propertyChangeSupport;
-
- /**
- * Creates a new Item. This should only be called from compiled JAXX files.
- *
- * @param id the item's ID
- * @param label the string that should be used to represent the item visually
- * @param value the item's actual value
- * @param selected <code>true</code> if the item should be selected by default
- */
- public Item(String id, String label, Object value, boolean selected) {
- this.id = id;
- this.label = label;
- this.value = value;
- this.selected = selected;
- }
-
- /**
- * Returns this item's ID.
- *
- * @return the JAXX ID attribute
- */
- public String getId() {
- return id;
- }
-
- /**
- * Returns the string that should be used to represent the item at display time. If <code>null</code>,
- * <code>String.valueOf(getValue())</code> will be used instead.
- *
- * @return this item's display string
- * @see #setLabel
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * Sets the item's display string. If <code>null, String.valueOf(getValue())</code> will be used instead.
- *
- * @param label the new display string
- * @see #getLabel
- */
- public void setLabel(String label) {
- String oldLabel = this.label;
- this.label = label;
- firePropertyChange(LABEL_PROPERTY, oldLabel, label);
- }
-
- /**
- * Returns the item's actual value as it appears in the component's model. The <code>Item</code> itself is not
- * visible from the model, only the value.
- *
- * @return the item's value
- * @see #setValue
- */
- public Object getValue() {
- return value;
- }
-
- /**
- * Sets the item's value as it appears in the component's model. The <code>Item</code> itself is not
- * visible from the model, only the value.
- *
- * @param value the new value
- * @see #getValue
- */
- public void setValue(Object value) {
- Object oldValue = this.value;
- this.value = value;
- firePropertyChange(VALUE_PROPERTY, oldValue, value);
- }
-
- /**
- * Returns <code>true</code> if this item is currently selected. This is a bound property.
- *
- * @return <code>true</code> if item is selected
- * @see #setSelected
- */
- public boolean isSelected() {
- return selected;
- }
-
- /**
- * Sets the item's selection state. This is a bound property.
- *
- * @param selected the new selection state
- * @see #isSelected
- */
- public void setSelected(boolean selected) {
- boolean oldSelected = this.selected;
- this.selected = selected;
- firePropertyChange(SELECTED_PROPERTY, oldSelected, selected);
- }
-
- /**
- * Adds a new child node (Items can be nested in trees).
- *
- * @param item the new child item
- */
- public void addChild(Item item) {
- if (children == null) {
- children = new ArrayList<Item>();
- }
- children.add(item);
- item.parent = this;
- }
-
- /**
- * Remove child node a new child node
- *
- * @param item to remove
- */
- public void removeChild(Item item) {
- if (children != null) {
- children.remove(item);
- }
- }
-
- /**
- * Remove all childs nodes
- *
- * @param items list of items to remove
- */
- public void removeChilds(List<Item> items) {
- if (children != null) {
- children.removeAll(items);
- }
- }
-
- /**
- * Returns a list of this item's children.
- *
- * @return a list of all nested child nodes
- */
- public List<Item> getChildren() {
- if (children == null) {
- children = new ArrayList<Item>();
- }
- return children;
- }
-
- /**
- * Returns the <code>Item</code> containing this <code>Item</code>, or <code>null</code> for a top-level
- * <code>Item</code>.
- *
- * @return the item parent (or null)
- */
- public Item getParent() {
- return parent;
- }
-
- /**
- * Set the parent of this item
- *
- * @param parent the item parent (or null)
- */
- public void setParent(Item parent) {
- this.parent = parent;
- }
-
- private PropertyChangeSupport getPropertyChangeSupport() {
- if (propertyChangeSupport == null) {
- propertyChangeSupport = new SwingPropertyChangeSupport(this);
- }
- return propertyChangeSupport;
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- getPropertyChangeSupport().addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
- getPropertyChangeSupport().addPropertyChangeListener(property, listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- getPropertyChangeSupport().removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
- getPropertyChangeSupport().removePropertyChangeListener(property, listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
- if (propertyChangeSupport != null) {
- getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue);
- }
- }
-
- @Override
- public String toString() {
- return getClass().getName() + "[" + value + "]";
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.event.SwingPropertyChangeSupport;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.ArrayList;
+import java.util.List;
+
+// This needs to be split into two classes, Item and TreeItem
+/**
+ * An item in a component such as <code>JComboBox</code> or <code>JTree</code>. The <code>Item</code>
+ * class corresponds to the <code><item></code> tag in JAXX source files.
+ */
+public class Item {
+
+ public static final String LABEL_PROPERTY = "label";
+ public static final String VALUE_PROPERTY = "value";
+ public static final String SELECTED_PROPERTY = "selected";
+ private String id;
+ private String label;
+ private Object value;
+ private boolean selected;
+ private List<Item> children;
+ private Item parent;
+ private PropertyChangeSupport propertyChangeSupport;
+
+ /**
+ * Creates a new Item. This should only be called from compiled JAXX files.
+ *
+ * @param id the item's ID
+ * @param label the string that should be used to represent the item visually
+ * @param value the item's actual value
+ * @param selected <code>true</code> if the item should be selected by default
+ */
+ public Item(String id, String label, Object value, boolean selected) {
+ this.id = id;
+ this.label = label;
+ this.value = value;
+ this.selected = selected;
+ }
+
+ /**
+ * Returns this item's ID.
+ *
+ * @return the JAXX ID attribute
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Returns the string that should be used to represent the item at display time. If <code>null</code>,
+ * <code>String.valueOf(getValue())</code> will be used instead.
+ *
+ * @return this item's display string
+ * @see #setLabel
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * Sets the item's display string. If <code>null, String.valueOf(getValue())</code> will be used instead.
+ *
+ * @param label the new display string
+ * @see #getLabel
+ */
+ public void setLabel(String label) {
+ String oldLabel = this.label;
+ this.label = label;
+ firePropertyChange(LABEL_PROPERTY, oldLabel, label);
+ }
+
+ /**
+ * Returns the item's actual value as it appears in the component's model. The <code>Item</code> itself is not
+ * visible from the model, only the value.
+ *
+ * @return the item's value
+ * @see #setValue
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the item's value as it appears in the component's model. The <code>Item</code> itself is not
+ * visible from the model, only the value.
+ *
+ * @param value the new value
+ * @see #getValue
+ */
+ public void setValue(Object value) {
+ Object oldValue = this.value;
+ this.value = value;
+ firePropertyChange(VALUE_PROPERTY, oldValue, value);
+ }
+
+ /**
+ * Returns <code>true</code> if this item is currently selected. This is a bound property.
+ *
+ * @return <code>true</code> if item is selected
+ * @see #setSelected
+ */
+ public boolean isSelected() {
+ return selected;
+ }
+
+ /**
+ * Sets the item's selection state. This is a bound property.
+ *
+ * @param selected the new selection state
+ * @see #isSelected
+ */
+ public void setSelected(boolean selected) {
+ boolean oldSelected = this.selected;
+ this.selected = selected;
+ firePropertyChange(SELECTED_PROPERTY, oldSelected, selected);
+ }
+
+ /**
+ * Adds a new child node (Items can be nested in trees).
+ *
+ * @param item the new child item
+ */
+ public void addChild(Item item) {
+ if (children == null) {
+ children = new ArrayList<Item>();
+ }
+ children.add(item);
+ item.parent = this;
+ }
+
+ /**
+ * Remove child node a new child node
+ *
+ * @param item to remove
+ */
+ public void removeChild(Item item) {
+ if (children != null) {
+ children.remove(item);
+ }
+ }
+
+ /**
+ * Remove all childs nodes
+ *
+ * @param items list of items to remove
+ */
+ public void removeChilds(List<Item> items) {
+ if (children != null) {
+ children.removeAll(items);
+ }
+ }
+
+ /**
+ * Returns a list of this item's children.
+ *
+ * @return a list of all nested child nodes
+ */
+ public List<Item> getChildren() {
+ if (children == null) {
+ children = new ArrayList<Item>();
+ }
+ return children;
+ }
+
+ /**
+ * Returns the <code>Item</code> containing this <code>Item</code>, or <code>null</code> for a top-level
+ * <code>Item</code>.
+ *
+ * @return the item parent (or null)
+ */
+ public Item getParent() {
+ return parent;
+ }
+
+ /**
+ * Set the parent of this item
+ *
+ * @param parent the item parent (or null)
+ */
+ public void setParent(Item parent) {
+ this.parent = parent;
+ }
+
+ private PropertyChangeSupport getPropertyChangeSupport() {
+ if (propertyChangeSupport == null) {
+ propertyChangeSupport = new SwingPropertyChangeSupport(this);
+ }
+ return propertyChangeSupport;
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ getPropertyChangeSupport().addPropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
+ getPropertyChangeSupport().addPropertyChangeListener(property, listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ getPropertyChangeSupport().removePropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
+ getPropertyChangeSupport().removePropertyChangeListener(property, listener);
+ }
+
+ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ if (propertyChangeSupport != null) {
+ getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getName() + "[" + value + "]";
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.runtime.swing;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,292 +1,308 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.AbstractListModel;
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JComboBox;
-import javax.swing.JList;
-import javax.swing.ListModel;
-import java.awt.Component;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class JAXXComboBox extends JComboBox {
-
- private static final long serialVersionUID = 1L;
-
- public class JAXXComboBoxModel extends AbstractListModel implements ComboBoxModel {
-
- private List<Item> items;
- private Object selectedItem;
- private static final long serialVersionUID = -8940733376638766414L;
-
- public JAXXComboBoxModel(List<Item> items) {
- this.items = items;
-
- PropertyChangeListener listener = new PropertyChangeListener() {
-
- @Override
- public void propertyChange(PropertyChangeEvent e) {
- if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) {
- Item item = (Item) e.getSource();
- int itemIndex = JAXXComboBoxModel.this.items.indexOf(item);
- // TODO: fix cut-and-pasting badness
- int[] oldSelection = new int[]{getSelectedIndex()};
- int[] newSelection;
- int index = -1;
- for (int i = 0; i < oldSelection.length; i++) {
- if (oldSelection[i] == itemIndex) {
- index = i;
- break;
- }
- }
- if (item.isSelected()) {
- if (index != -1) // it was already selected
- {
- return;
- }
- newSelection = new int[oldSelection.length + 1];
- System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length);
- newSelection[newSelection.length - 1] = itemIndex;
- } else {
- if (index == -1) // it already wasn't selected
- {
- return;
- }
- newSelection = new int[oldSelection.length - 1];
- System.arraycopy(oldSelection, 0, newSelection, 0, index);
- System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index);
- }
- if (newSelection.length > 0) {
- setSelectedIndex(newSelection[0]);
- }
- } else {
- // TODO: more cut-and-pasting badness
- for (int i = 0; i < getSize(); i++) {
- if (getElementAt(i) == ((Item) e.getSource()).getValue()) {
- fireContentsChanged(JAXXComboBoxModel.this, i, i);
- if (getSelectedIndex() == i) {
- fireItemStateChanged(new ItemEvent(JAXXComboBox.this, ItemEvent.ITEM_STATE_CHANGED, getElementAt(i), ItemEvent.DESELECTED));
- }
- return;
- }
- }
- }
- }
- };
- for (Item item : items) {
- item.addPropertyChangeListener(listener);
- }
- }
-
- public List<Item> getItems() {
- return items;
- }
-
- @Override
- public Object getElementAt(int i) {
- return items.get(i).getValue();
- }
-
- @Override
- public int getSize() {
- return items.size();
- }
-
- @Override
- public Object getSelectedItem() {
- return selectedItem;
- }
-
- @Override
- public void setSelectedItem(Object selectedItem) {
- if ((this.selectedItem != null && !this.selectedItem.equals(selectedItem)) ||
- this.selectedItem == null && selectedItem != null) {
- this.selectedItem = selectedItem;
- fireContentsChanged(this, -1, -1);
- }
- }
- }
-
- public JAXXComboBox() {
- setRenderer(new DefaultListCellRenderer() {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- ListModel model = list.getModel();
- if (model instanceof JAXXComboBoxModel) {
- List/*<Item>*/ items = ((JAXXComboBoxModel) model).items;
- Item item = null;
- if (index == -1) {
- for (Object item1 : items) {
- Item testItem = (Item) item1;
- if (testItem.getValue() == value) {
- item = testItem;
- break;
- }
- }
- } else {
- item = (Item) items.get(index);
- }
-
- if (item != null) {
- String label = item.getLabel();
- if (label != null) {
- value = label;
- }
- }
- }
- return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- });
-
- addItemListener(new ItemListener() {
-
- @Override
- public void itemStateChanged(ItemEvent e) {
- ListModel model = getModel();
- if (model instanceof JAXXComboBoxModel) {
- List<Item> items = ((JAXXComboBoxModel) model).items;
- for (int i = items.size() - 1; i >= 0; i--) {
- boolean selected = getSelectedIndex() == i;
- Item item = items.get(i);
- if (selected != item.isSelected()) {
- item.setSelected(selected);
- }
- }
- }
- }
- });
- }
-
- /**
- * Fill a combo box model with some datas, and select after all the given object
- *
- * @param data data ot inject in combo
- * @param select the object to select in combo after reflling his model
- * @param methodName method to invoke to display data's name
- */
- public void fillComboBox(Collection<?> data, Object select, String methodName) {
- // prepare method to use
- Method m;
- try {
- m = select.getClass().getMethod(methodName);
- m.setAccessible(true);
- } catch (NoSuchMethodException e) {
- throw new IllegalArgumentException("could not find method " + methodName + " on " + select.getClass());
- }
-
- List<Item> items = new ArrayList<Item>();
- for (Object o : data) {
- boolean selected = o.equals(select);
- try {
- items.add(new Item(o.toString(), (String) m.invoke(o), o, selected));
- } catch (IllegalAccessException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- }
- }
- setItems(items);
- }
-
- // this way we can keep it marked protected and still allow code in this file to call it
- @Override
- protected void fireItemStateChanged(ItemEvent e) {
- super.fireItemStateChanged(e);
- }
-
- public void setItems(List<Item> items) {
- setModel(new JAXXComboBoxModel(items));
- List<Integer> selectedIndexList = new ArrayList<Integer>();
- for (int i = 0; i < items.size(); i++) {
- if (items.get(i).isSelected()) {
- selectedIndexList.add(i);
- }
- }
- int[] selectedIndices = new int[selectedIndexList.size()];
- for (int i = 0; i < selectedIndexList.size(); i++) {
- selectedIndices[i] = selectedIndexList.get(i);
- }
- if (selectedIndices.length > 0) {
- setSelectedIndex(selectedIndices[0]);
- }
- }
-
- public List<Item> getItems() {
- if (getModel() instanceof JAXXComboBoxModel) {
- return ((JAXXComboBoxModel) getModel()).getItems();
- }
- return null;
- }
-
- public void setSelectedItem(Item item) {
- //TC-20092004 Anomalie #73 fix npe when want to call with a null
- // value
- super.setSelectedItem(item == null ? null : item.getValue());
- }
-
- public Item getSelectedJaxxItem() {
- Object selected = super.getSelectedItem();
- return findItem(selected);
- }
-
- public Item findItem(Object value) {
- List<Item> items = getItems();
- if (items != null) {
- for (Item i : items) {
- if (i.getValue().equals(value)) {
- return i;
- }
- }
- }
- return null;
- }
-
- public void addItem(Item item) {
- List<Item> items = getItems();
- if (items != null) {
- items.add(item);
- setItems(items);
- }
- }
-
- public void addAllItems(Collection<Item> itemsToAdd) {
- List<Item> items = getItems();
- if (items != null) {
- items.addAll(itemsToAdd);
- setItems(items);
- }
- }
-
- public void removeItem(Item item) {
- List<Item> items = getItems();
- if (items != null) {
- items.remove(item);
- setItems(items);
- }
- }
-
- public void removeAllItems(Collection<Item> itemsToRemove) {
- List<Item> items = getItems();
- if (items != null) {
- items.removeAll(itemsToRemove);
- setItems(items);
- }
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.AbstractListModel;
+import javax.swing.ComboBoxModel;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.ListModel;
+import java.awt.Component;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class JAXXComboBox extends JComboBox {
+
+ private static final long serialVersionUID = 1L;
+
+ public class JAXXComboBoxModel extends AbstractListModel implements ComboBoxModel {
+
+ private List<Item> items;
+ private Object selectedItem;
+ private static final long serialVersionUID = -8940733376638766414L;
+
+ public JAXXComboBoxModel(List<Item> items) {
+ this.items = items;
+
+ PropertyChangeListener listener = new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent e) {
+ if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) {
+ Item item = (Item) e.getSource();
+ int itemIndex = JAXXComboBoxModel.this.items.indexOf(item);
+ // TODO: fix cut-and-pasting badness
+ int[] oldSelection = new int[]{getSelectedIndex()};
+ int[] newSelection;
+ int index = -1;
+ for (int i = 0; i < oldSelection.length; i++) {
+ if (oldSelection[i] == itemIndex) {
+ index = i;
+ break;
+ }
+ }
+ if (item.isSelected()) {
+ if (index != -1) // it was already selected
+ {
+ return;
+ }
+ newSelection = new int[oldSelection.length + 1];
+ System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length);
+ newSelection[newSelection.length - 1] = itemIndex;
+ } else {
+ if (index == -1) // it already wasn't selected
+ {
+ return;
+ }
+ newSelection = new int[oldSelection.length - 1];
+ System.arraycopy(oldSelection, 0, newSelection, 0, index);
+ System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index);
+ }
+ if (newSelection.length > 0) {
+ setSelectedIndex(newSelection[0]);
+ }
+ } else {
+ // TODO: more cut-and-pasting badness
+ for (int i = 0; i < getSize(); i++) {
+ if (getElementAt(i) == ((Item) e.getSource()).getValue()) {
+ fireContentsChanged(JAXXComboBoxModel.this, i, i);
+ if (getSelectedIndex() == i) {
+ fireItemStateChanged(new ItemEvent(JAXXComboBox.this, ItemEvent.ITEM_STATE_CHANGED, getElementAt(i), ItemEvent.DESELECTED));
+ }
+ return;
+ }
+ }
+ }
+ }
+ };
+ for (Item item : items) {
+ item.addPropertyChangeListener(listener);
+ }
+ }
+
+ public List<Item> getItems() {
+ return items;
+ }
+
+ @Override
+ public Object getElementAt(int i) {
+ return items.get(i).getValue();
+ }
+
+ @Override
+ public int getSize() {
+ return items.size();
+ }
+
+ @Override
+ public Object getSelectedItem() {
+ return selectedItem;
+ }
+
+ @Override
+ public void setSelectedItem(Object selectedItem) {
+ if ((this.selectedItem != null && !this.selectedItem.equals(selectedItem)) ||
+ this.selectedItem == null && selectedItem != null) {
+ this.selectedItem = selectedItem;
+ fireContentsChanged(this, -1, -1);
+ }
+ }
+ }
+
+ public JAXXComboBox() {
+ setRenderer(new DefaultListCellRenderer() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ ListModel model = list.getModel();
+ if (model instanceof JAXXComboBoxModel) {
+ List/*<Item>*/ items = ((JAXXComboBoxModel) model).items;
+ Item item = null;
+ if (index == -1) {
+ for (Object item1 : items) {
+ Item testItem = (Item) item1;
+ if (testItem.getValue() == value) {
+ item = testItem;
+ break;
+ }
+ }
+ } else {
+ item = (Item) items.get(index);
+ }
+
+ if (item != null) {
+ String label = item.getLabel();
+ if (label != null) {
+ value = label;
+ }
+ }
+ }
+ return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ }
+ });
+
+ addItemListener(new ItemListener() {
+
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+ ListModel model = getModel();
+ if (model instanceof JAXXComboBoxModel) {
+ List<Item> items = ((JAXXComboBoxModel) model).items;
+ for (int i = items.size() - 1; i >= 0; i--) {
+ boolean selected = getSelectedIndex() == i;
+ Item item = items.get(i);
+ if (selected != item.isSelected()) {
+ item.setSelected(selected);
+ }
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Fill a combo box model with some datas, and select after all the given object
+ *
+ * @param data data ot inject in combo
+ * @param select the object to select in combo after reflling his model
+ * @param methodName method to invoke to display data's name
+ */
+ public void fillComboBox(Collection<?> data, Object select, String methodName) {
+ // prepare method to use
+ Method m;
+ try {
+ m = select.getClass().getMethod(methodName);
+ m.setAccessible(true);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalArgumentException("could not find method " + methodName + " on " + select.getClass());
+ }
+
+ List<Item> items = new ArrayList<Item>();
+ for (Object o : data) {
+ boolean selected = o.equals(select);
+ try {
+ items.add(new Item(o.toString(), (String) m.invoke(o), o, selected));
+ } catch (IllegalAccessException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ }
+ }
+ setItems(items);
+ }
+
+ // this way we can keep it marked protected and still allow code in this file to call it
+ @Override
+ protected void fireItemStateChanged(ItemEvent e) {
+ super.fireItemStateChanged(e);
+ }
+
+ public void setItems(List<Item> items) {
+ setModel(new JAXXComboBoxModel(items));
+ List<Integer> selectedIndexList = new ArrayList<Integer>();
+ for (int i = 0; i < items.size(); i++) {
+ if (items.get(i).isSelected()) {
+ selectedIndexList.add(i);
+ }
+ }
+ int[] selectedIndices = new int[selectedIndexList.size()];
+ for (int i = 0; i < selectedIndexList.size(); i++) {
+ selectedIndices[i] = selectedIndexList.get(i);
+ }
+ if (selectedIndices.length > 0) {
+ setSelectedIndex(selectedIndices[0]);
+ }
+ }
+
+ public List<Item> getItems() {
+ if (getModel() instanceof JAXXComboBoxModel) {
+ return ((JAXXComboBoxModel) getModel()).getItems();
+ }
+ return null;
+ }
+
+ public void setSelectedItem(Item item) {
+ //TC-20092004 Anomalie #73 fix npe when want to call with a null
+ // value
+ super.setSelectedItem(item == null ? null : item.getValue());
+ }
+
+ public Item getSelectedJaxxItem() {
+ Object selected = super.getSelectedItem();
+ return findItem(selected);
+ }
+
+ public Item findItem(Object value) {
+ List<Item> items = getItems();
+ if (items != null) {
+ for (Item i : items) {
+ if (i.getValue().equals(value)) {
+ return i;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void addItem(Item item) {
+ List<Item> items = getItems();
+ if (items != null) {
+ items.add(item);
+ setItems(items);
+ }
+ }
+
+ public void addAllItems(Collection<Item> itemsToAdd) {
+ List<Item> items = getItems();
+ if (items != null) {
+ items.addAll(itemsToAdd);
+ setItems(items);
+ }
+ }
+
+ public void removeItem(Item item) {
+ List<Item> items = getItems();
+ if (items != null) {
+ items.remove(item);
+ setItems(items);
+ }
+ }
+
+ public void removeAllItems(Collection<Item> itemsToRemove) {
+ List<Item> items = getItems();
+ if (items != null) {
+ items.removeAll(itemsToRemove);
+ setItems(items);
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,396 +1,412 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.AbstractListModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JList;
-import javax.swing.ListModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import java.awt.Component;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class JAXXList extends JList {
-
- private static final long serialVersionUID = 1L;
-
- public class JAXXListModel extends AbstractListModel {
-
- private List<Item> items;
- private static final long serialVersionUID = -1598924187490122036L;
-
- public JAXXListModel(List<Item> items) {
- this.items = items;
-
- PropertyChangeListener listener = new PropertyChangeListener() {
-
- @Override
- public void propertyChange(PropertyChangeEvent e) {
- if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) {
- Item item = (Item) e.getSource();
- int itemIndex = JAXXListModel.this.items.indexOf(item);
- int[] oldSelection = getSelectedIndices();
- int[] newSelection;
- int index = -1;
- for (int i = 0; i < oldSelection.length; i++) {
- if (oldSelection[i] == itemIndex) {
- index = i;
- break;
- }
- }
- if (item.isSelected()) {
- if (index != -1) // it was already selected
- {
- return;
- }
- newSelection = new int[oldSelection.length + 1];
- System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length);
- newSelection[newSelection.length - 1] = itemIndex;
- } else {
- if (index == -1) // it already wasn't selected
- {
- return;
- }
- newSelection = new int[oldSelection.length - 1];
- System.arraycopy(oldSelection, 0, newSelection, 0, index);
- System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index);
- }
- setSelectedIndices(newSelection);
- } else {
- for (int i = 0; i < getSize(); i++) {
- if (getElementAt(i) == ((Item) e.getSource()).getValue()) {
- fireContentsChanged(JAXXListModel.this, i, i);
- if (isSelectedIndex(i)) {
- fireSelectionValueChanged(i, i, false);
- }
- return;
- }
- }
- }
- }
- };
- for (Item item : items) {
- item.addPropertyChangeListener(listener);
- }
- }
-
- public List<Item> getItems(){
- return items;
- }
-
- @Override
- public Object getElementAt(int i) {
- return items.get(i).getValue();
- }
-
- @Override
- public int getSize() {
- return items.size();
- }
- }
-
- public JAXXList() {
- setCellRenderer(new DefaultListCellRenderer() {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- ListModel model = list.getModel();
- if (model instanceof JAXXListModel) {
- Item item = ((JAXXListModel) model).items.get(index);
- String label = item.getLabel();
- if (label != null) {
- value = label;
- }
- }
- return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- });
-
- addListSelectionListener(new ListSelectionListener() {
-
- @Override
- public void valueChanged(ListSelectionEvent e) {
- ListModel model = getModel();
- if (model instanceof JAXXListModel) {
- List<Item> items = ((JAXXListModel) model).items;
- for (int i = items.size() - 1; i >= 0; i--) {
- boolean selected = isSelectedIndex(i);
- Item item = items.get(i);
- if (selected != item.isSelected()) {
- item.setSelected(selected);
- }
- }
- }
- }
- });
- }
-
- // this way we can keep it marked protected and still allow code in this file to call it
- @Override
- protected void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting) {
- super.fireSelectionValueChanged(firstIndex, lastIndex, isAdjusting);
- }
-
- public void setItems(List<Item> items) {
- setModel(new JAXXListModel(items));
- List<Integer> selectedIndexList = new ArrayList<Integer>();
- for (int i = 0; i < items.size(); i++) {
- if (items.get(i).isSelected()) {
- selectedIndexList.add(i);
- }
- }
- int[] selectedIndices = new int[selectedIndexList.size()];
- for (int i = 0; i < selectedIndexList.size(); i++) {
- selectedIndices[i] = selectedIndexList.get(i);
- }
- setSelectedIndices(selectedIndices);
- }
-
- public List<Item> getItems(){
- if (getModel() instanceof JAXXListModel){
- return ((JAXXListModel)getModel()).getItems();
- }
- return null;
- }
-
- public void setSelectedValue(Object value) {
- super.setSelectedValue(value, true);
- }
-
- /**
- * Set the selected Objects
- *
- * @param values Objects must be selected in the list
- */
- public void setSelectedValues(Object[] values) {
- if (values != null){
- List<Integer> selectedIndices = new ArrayList<Integer>();
- ListModel model = getModel();
- for (int i = 0; i < model.getSize(); i++) {
- Object o = model.getElementAt(i);
- for (Object value : values) {
- if (o.equals(value)) {
- selectedIndices.add(i);
- break;
- }
- }
- }
- int[] ints = new int[selectedIndices.size()];
- for (int i = 0; i < ints.length; i++) {
- ints[i] = selectedIndices.get(i).intValue();
- }
- setSelectedIndices(ints);
- }
- else{
- // No selection if values is null
- setSelectedIndex(-1);
- }
- }
-
- public void setSelectedItem(Item item) {
- super.setSelectedValue(item.getValue(), true);
- }
-
- public void setSelectedItems(List<Item> itemsToSelect) {
- if (itemsToSelect != null){
- List<Item> items = getItems();
- int[] indices = new int[itemsToSelect.size()];
- int i = 0;
- for (Item item : itemsToSelect){
- indices[i] = items.indexOf(item);
- i++;
- }
- super.setSelectedIndices(indices);
- }
- }
-
- public Item getSelectedItem(){
- Object selected = super.getSelectedValue();
- return findItem(selected);
- }
-
- public List<Item> getSelectedItems(){
- Object[] selected = super.getSelectedValues();
- java.util.List<Item> itemsSelected = new ArrayList<Item>();
- for (Object s : selected){
- itemsSelected.add(findItem(s));
- }
- return itemsSelected;
- }
-
- public Item findItem(Object value){
- List<Item> items = getItems();
- if (items != null){
- for (Item i : items){
- if (i.getValue().equals(value)){
- return i;
- }
- }
- }
- return null;
- }
-
- public void addItem(Item item){
- List<Item> items = getItems();
- if (items != null){
- items.add(item);
- setItems(items);
- }
- }
-
- public void addAllItems(Collection<Item> itemsToAdd){
- List<Item> items = getItems();
- if (items != null){
- items.addAll(itemsToAdd);
- setItems(items);
- }
- }
-
- public void removeItem(Item item){
- List<Item> items = getItems();
- if (items != null){
- items.remove(item);
- setItems(items);
- }
- }
-
- public void removeAllItems(Collection<Item> itemsToRemove){
- List<Item> items = getItems();
- if (items != null){
- items.removeAll(itemsToRemove);
- setItems(items);
- }
- }
-
- /**
- * Fill a list model with some datas, and select after all the given object
- *
- * @param data data ot inject in combo
- * @param selects the objects to select in list after reflling his model
- */
- public void fillList(Collection<?> data, Collection<?> selects) {
- if (selects == null) {
- selects = java.util.Collections.EMPTY_LIST;
- }
- List<Item> items = new ArrayList<Item>();
- for (Object o : data) {
- boolean selected = false;
- for (Object select : selects) {
- if (selected = o.equals(select)) {
- break;
- }
- }
- items.add(new Item(o.toString(), o.toString(), o, selected));
- }
- setItems(items);
- }
-
- /**
- * Fill a list model with some datas, and select after all the given object
- *
- * @param data data ot inject in combo
- * @param select object to select in list after reflling his model
- */
- public void fillList(Collection<?> data, Object select) {
- List<Item> items = new ArrayList<Item>();
- for (Object o : data) {
- boolean selected = o.equals(select);
- items.add(new Item(o.toString(), o.toString(), o, selected));
- }
- setItems(items);
- }
-
- /**
- * Fill a list model with some datas, and select after all the given object
- *
- * @param data data ot inject in combo
- * @param select object to select in list after reflling his model
- * @param methodName method to invoke to display data's name
- */
- public void fillList(Collection<?> data, Object select, String methodName) {
- // prepare method to use
- Method m = null;
-
- List<Item> items = new ArrayList<Item>();
- for (Object o : data) {
- boolean selected = o.equals(select);
- if (m == null) {
- try {
- m = o.getClass().getMethod(methodName);
- m.setAccessible(true);
- } catch (NoSuchMethodException e) {
- throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass());
- }
- }
- try {
- items.add(new Item(o.toString(), (String) m.invoke(o), o, selected));
- } catch (SecurityException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- } catch (IllegalArgumentException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- }
- }
- setItems(items);
- }
-
- /**
- * Fill a list model with some datas, and select after all the given object
- *
- * @param data data ot inject in combo
- * @param selects the objects to select in list after reflling his model
- * @param methodName method to invoke to display data's name
- */
- public void fillList(Collection<?> data, Collection<?> selects, String methodName) {
- // prepare method to use
- Method m = null;
-
- List<Item> items = new ArrayList<Item>();
- for (Object o : data) {
- boolean selected = selects.contains(o);
- if (m == null) {
- try {
- m = o.getClass().getMethod(methodName);
- m.setAccessible(true);
- } catch (NoSuchMethodException e) {
- throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass());
- }
- }
- try {
- items.add(new Item(o.toString(), (String) m.invoke(o), o, selected));
- } catch (SecurityException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- } catch (IllegalArgumentException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- // shoudl never happen ?
- throw new RuntimeException(e);
- }
- }
- setItems(items);
- }
-
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.AbstractListModel;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+import javax.swing.ListModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import java.awt.Component;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class JAXXList extends JList {
+
+ private static final long serialVersionUID = 1L;
+
+ public class JAXXListModel extends AbstractListModel {
+
+ private List<Item> items;
+ private static final long serialVersionUID = -1598924187490122036L;
+
+ public JAXXListModel(List<Item> items) {
+ this.items = items;
+
+ PropertyChangeListener listener = new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent e) {
+ if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) {
+ Item item = (Item) e.getSource();
+ int itemIndex = JAXXListModel.this.items.indexOf(item);
+ int[] oldSelection = getSelectedIndices();
+ int[] newSelection;
+ int index = -1;
+ for (int i = 0; i < oldSelection.length; i++) {
+ if (oldSelection[i] == itemIndex) {
+ index = i;
+ break;
+ }
+ }
+ if (item.isSelected()) {
+ if (index != -1) // it was already selected
+ {
+ return;
+ }
+ newSelection = new int[oldSelection.length + 1];
+ System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length);
+ newSelection[newSelection.length - 1] = itemIndex;
+ } else {
+ if (index == -1) // it already wasn't selected
+ {
+ return;
+ }
+ newSelection = new int[oldSelection.length - 1];
+ System.arraycopy(oldSelection, 0, newSelection, 0, index);
+ System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index);
+ }
+ setSelectedIndices(newSelection);
+ } else {
+ for (int i = 0; i < getSize(); i++) {
+ if (getElementAt(i) == ((Item) e.getSource()).getValue()) {
+ fireContentsChanged(JAXXListModel.this, i, i);
+ if (isSelectedIndex(i)) {
+ fireSelectionValueChanged(i, i, false);
+ }
+ return;
+ }
+ }
+ }
+ }
+ };
+ for (Item item : items) {
+ item.addPropertyChangeListener(listener);
+ }
+ }
+
+ public List<Item> getItems(){
+ return items;
+ }
+
+ @Override
+ public Object getElementAt(int i) {
+ return items.get(i).getValue();
+ }
+
+ @Override
+ public int getSize() {
+ return items.size();
+ }
+ }
+
+ public JAXXList() {
+ setCellRenderer(new DefaultListCellRenderer() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ ListModel model = list.getModel();
+ if (model instanceof JAXXListModel) {
+ Item item = ((JAXXListModel) model).items.get(index);
+ String label = item.getLabel();
+ if (label != null) {
+ value = label;
+ }
+ }
+ return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ }
+ });
+
+ addListSelectionListener(new ListSelectionListener() {
+
+ @Override
+ public void valueChanged(ListSelectionEvent e) {
+ ListModel model = getModel();
+ if (model instanceof JAXXListModel) {
+ List<Item> items = ((JAXXListModel) model).items;
+ for (int i = items.size() - 1; i >= 0; i--) {
+ boolean selected = isSelectedIndex(i);
+ Item item = items.get(i);
+ if (selected != item.isSelected()) {
+ item.setSelected(selected);
+ }
+ }
+ }
+ }
+ });
+ }
+
+ // this way we can keep it marked protected and still allow code in this file to call it
+ @Override
+ protected void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting) {
+ super.fireSelectionValueChanged(firstIndex, lastIndex, isAdjusting);
+ }
+
+ public void setItems(List<Item> items) {
+ setModel(new JAXXListModel(items));
+ List<Integer> selectedIndexList = new ArrayList<Integer>();
+ for (int i = 0; i < items.size(); i++) {
+ if (items.get(i).isSelected()) {
+ selectedIndexList.add(i);
+ }
+ }
+ int[] selectedIndices = new int[selectedIndexList.size()];
+ for (int i = 0; i < selectedIndexList.size(); i++) {
+ selectedIndices[i] = selectedIndexList.get(i);
+ }
+ setSelectedIndices(selectedIndices);
+ }
+
+ public List<Item> getItems(){
+ if (getModel() instanceof JAXXListModel){
+ return ((JAXXListModel)getModel()).getItems();
+ }
+ return null;
+ }
+
+ public void setSelectedValue(Object value) {
+ super.setSelectedValue(value, true);
+ }
+
+ /**
+ * Set the selected Objects
+ *
+ * @param values Objects must be selected in the list
+ */
+ public void setSelectedValues(Object[] values) {
+ if (values != null){
+ List<Integer> selectedIndices = new ArrayList<Integer>();
+ ListModel model = getModel();
+ for (int i = 0; i < model.getSize(); i++) {
+ Object o = model.getElementAt(i);
+ for (Object value : values) {
+ if (o.equals(value)) {
+ selectedIndices.add(i);
+ break;
+ }
+ }
+ }
+ int[] ints = new int[selectedIndices.size()];
+ for (int i = 0; i < ints.length; i++) {
+ ints[i] = selectedIndices.get(i).intValue();
+ }
+ setSelectedIndices(ints);
+ }
+ else{
+ // No selection if values is null
+ setSelectedIndex(-1);
+ }
+ }
+
+ public void setSelectedItem(Item item) {
+ super.setSelectedValue(item.getValue(), true);
+ }
+
+ public void setSelectedItems(List<Item> itemsToSelect) {
+ if (itemsToSelect != null){
+ List<Item> items = getItems();
+ int[] indices = new int[itemsToSelect.size()];
+ int i = 0;
+ for (Item item : itemsToSelect){
+ indices[i] = items.indexOf(item);
+ i++;
+ }
+ super.setSelectedIndices(indices);
+ }
+ }
+
+ public Item getSelectedItem(){
+ Object selected = super.getSelectedValue();
+ return findItem(selected);
+ }
+
+ public List<Item> getSelectedItems(){
+ Object[] selected = super.getSelectedValues();
+ java.util.List<Item> itemsSelected = new ArrayList<Item>();
+ for (Object s : selected){
+ itemsSelected.add(findItem(s));
+ }
+ return itemsSelected;
+ }
+
+ public Item findItem(Object value){
+ List<Item> items = getItems();
+ if (items != null){
+ for (Item i : items){
+ if (i.getValue().equals(value)){
+ return i;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void addItem(Item item){
+ List<Item> items = getItems();
+ if (items != null){
+ items.add(item);
+ setItems(items);
+ }
+ }
+
+ public void addAllItems(Collection<Item> itemsToAdd){
+ List<Item> items = getItems();
+ if (items != null){
+ items.addAll(itemsToAdd);
+ setItems(items);
+ }
+ }
+
+ public void removeItem(Item item){
+ List<Item> items = getItems();
+ if (items != null){
+ items.remove(item);
+ setItems(items);
+ }
+ }
+
+ public void removeAllItems(Collection<Item> itemsToRemove){
+ List<Item> items = getItems();
+ if (items != null){
+ items.removeAll(itemsToRemove);
+ setItems(items);
+ }
+ }
+
+ /**
+ * Fill a list model with some datas, and select after all the given object
+ *
+ * @param data data ot inject in combo
+ * @param selects the objects to select in list after reflling his model
+ */
+ public void fillList(Collection<?> data, Collection<?> selects) {
+ if (selects == null) {
+ selects = java.util.Collections.EMPTY_LIST;
+ }
+ List<Item> items = new ArrayList<Item>();
+ for (Object o : data) {
+ boolean selected = false;
+ for (Object select : selects) {
+ if (selected = o.equals(select)) {
+ break;
+ }
+ }
+ items.add(new Item(o.toString(), o.toString(), o, selected));
+ }
+ setItems(items);
+ }
+
+ /**
+ * Fill a list model with some datas, and select after all the given object
+ *
+ * @param data data ot inject in combo
+ * @param select object to select in list after reflling his model
+ */
+ public void fillList(Collection<?> data, Object select) {
+ List<Item> items = new ArrayList<Item>();
+ for (Object o : data) {
+ boolean selected = o.equals(select);
+ items.add(new Item(o.toString(), o.toString(), o, selected));
+ }
+ setItems(items);
+ }
+
+ /**
+ * Fill a list model with some datas, and select after all the given object
+ *
+ * @param data data ot inject in combo
+ * @param select object to select in list after reflling his model
+ * @param methodName method to invoke to display data's name
+ */
+ public void fillList(Collection<?> data, Object select, String methodName) {
+ // prepare method to use
+ Method m = null;
+
+ List<Item> items = new ArrayList<Item>();
+ for (Object o : data) {
+ boolean selected = o.equals(select);
+ if (m == null) {
+ try {
+ m = o.getClass().getMethod(methodName);
+ m.setAccessible(true);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass());
+ }
+ }
+ try {
+ items.add(new Item(o.toString(), (String) m.invoke(o), o, selected));
+ } catch (SecurityException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ } catch (IllegalArgumentException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ }
+ }
+ setItems(items);
+ }
+
+ /**
+ * Fill a list model with some datas, and select after all the given object
+ *
+ * @param data data ot inject in combo
+ * @param selects the objects to select in list after reflling his model
+ * @param methodName method to invoke to display data's name
+ */
+ public void fillList(Collection<?> data, Collection<?> selects, String methodName) {
+ // prepare method to use
+ Method m = null;
+
+ List<Item> items = new ArrayList<Item>();
+ for (Object o : data) {
+ boolean selected = selects.contains(o);
+ if (m == null) {
+ try {
+ m = o.getClass().getMethod(methodName);
+ m.setAccessible(true);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass());
+ }
+ }
+ try {
+ items.add(new Item(o.toString(), (String) m.invoke(o), o, selected));
+ } catch (SecurityException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ } catch (IllegalArgumentException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ // shoudl never happen ?
+ throw new RuntimeException(e);
+ }
+ }
+ setItems(items);
+ }
+
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,21 +1,23 @@
-/*
- * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
- * Tony Chemit
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
*
- * 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 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 Public License for more details.
+ * GNU General Lesser 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.
- * ##% */
+ * 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>.
+ * ##%*
+ */
package jaxx.runtime.swing;
/** @author chemit */
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing;
public class JAXXToggleButton extends javax.swing.JToggleButton {
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.runtime.swing;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing;
import org.apache.commons.logging.Log;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,12 +1,28 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.JComponent;
-
-public class Spacer extends JComponent {
-
- private static final long serialVersionUID = 1L;
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.JComponent;
+
+public class Spacer extends JComponent {
+
+ private static final long serialVersionUID = 1L;
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,165 +1,181 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.Icon;
-import javax.swing.event.SwingPropertyChangeSupport;
-import java.awt.Color;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
-public class TabInfo {
-
- public static String BACKGROUND_PROPERTY = "background";
- public static String DISABLED_ICON_PROPERTY = "disabledIcon";
- public static String DISPLAYED_MNEMONIC_INDEX_PROPERTY = "displayedMnemonicIndex";
- public static String ENABLED_PROPERTY = "enabled";
- public static String FOREGROUND_PROPERTY = "foreground";
- public static String ICON_PROPERTY = "icon";
- public static String MNEMONIC_PROPERTY = "mnemonic";
- public static String TITLE_PROPERTY = "title";
- public static String TOOL_TIP_TEXT_PROPERTY = "toolTipText";
- private String id;
- private Color background;
- private Icon disabledIcon;
- private int displayedMnemonicIndex = -1;
- private boolean enabled = true;
- private Color foreground;
- private Icon icon;
- private int mnemonic = -1;
- private String title;
- private String toolTipText;
- private PropertyChangeSupport propertyChangeSupport;
-
- public TabInfo() {
- }
-
- public TabInfo(String id) {
- this.id = id;
- }
-
- public String getId() {
- return id;
- }
-
- public Color getBackground() {
- return background;
- }
-
- public void setBackground(Color background) {
- Color oldValue = this.background;
- this.background = background;
- firePropertyChange(BACKGROUND_PROPERTY, oldValue, background);
- }
-
- public Icon getDisabledIcon() {
- return disabledIcon;
- }
-
- public void setDisabledIcon(Icon disabledIcon) {
- Icon oldValue = this.disabledIcon;
- this.disabledIcon = disabledIcon;
- firePropertyChange(DISABLED_ICON_PROPERTY, oldValue, disabledIcon);
- }
-
- public int getDisplayedMnemonicIndex() {
- return displayedMnemonicIndex;
- }
-
- public void setDisplayedMnemonicIndex(int displayedMnemonicIndex) {
- int oldValue = this.displayedMnemonicIndex;
- this.displayedMnemonicIndex = displayedMnemonicIndex;
- firePropertyChange(DISPLAYED_MNEMONIC_INDEX_PROPERTY, oldValue, displayedMnemonicIndex);
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public void setEnabled(boolean enabled) {
- boolean oldValue = this.enabled;
- this.enabled = enabled;
- firePropertyChange(ENABLED_PROPERTY, oldValue, enabled);
- }
-
- public Color getForeground() {
- return foreground;
- }
-
- public void setForeground(Color foreground) {
- Color oldValue = this.foreground;
- this.foreground = foreground;
- firePropertyChange(FOREGROUND_PROPERTY, oldValue, foreground);
- }
-
- public Icon getIcon() {
- return icon;
- }
-
- public void setIcon(Icon icon) {
- Icon oldValue = this.icon;
- this.icon = icon;
- firePropertyChange(ICON_PROPERTY, oldValue, icon);
- }
-
- public int getMnemonic() {
- return mnemonic;
- }
-
- public void setMnemonic(int mnemonic) {
- int oldValue = this.mnemonic;
- this.mnemonic = mnemonic;
- firePropertyChange(MNEMONIC_PROPERTY, oldValue, mnemonic);
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- String oldValue = this.title;
- this.title = title;
- firePropertyChange(TITLE_PROPERTY, oldValue, title);
- }
-
- public String getToolTipText() {
- return toolTipText;
- }
-
- public void setToolTipText(String toolTipText) {
- String oldValue = this.toolTipText;
- this.toolTipText = toolTipText;
- firePropertyChange(TOOL_TIP_TEXT_PROPERTY, oldValue, toolTipText);
- }
-
- private PropertyChangeSupport getPropertyChangeSupport() {
- if (propertyChangeSupport == null) {
- propertyChangeSupport = new SwingPropertyChangeSupport(this);
- }
- return propertyChangeSupport;
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- getPropertyChangeSupport().addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
- getPropertyChangeSupport().addPropertyChangeListener(property, listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- getPropertyChangeSupport().removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
- getPropertyChangeSupport().removePropertyChangeListener(property, listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
- if (propertyChangeSupport != null) {
- getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue);
- }
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.Icon;
+import javax.swing.event.SwingPropertyChangeSupport;
+import java.awt.Color;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+public class TabInfo {
+
+ public static String BACKGROUND_PROPERTY = "background";
+ public static String DISABLED_ICON_PROPERTY = "disabledIcon";
+ public static String DISPLAYED_MNEMONIC_INDEX_PROPERTY = "displayedMnemonicIndex";
+ public static String ENABLED_PROPERTY = "enabled";
+ public static String FOREGROUND_PROPERTY = "foreground";
+ public static String ICON_PROPERTY = "icon";
+ public static String MNEMONIC_PROPERTY = "mnemonic";
+ public static String TITLE_PROPERTY = "title";
+ public static String TOOL_TIP_TEXT_PROPERTY = "toolTipText";
+ private String id;
+ private Color background;
+ private Icon disabledIcon;
+ private int displayedMnemonicIndex = -1;
+ private boolean enabled = true;
+ private Color foreground;
+ private Icon icon;
+ private int mnemonic = -1;
+ private String title;
+ private String toolTipText;
+ private PropertyChangeSupport propertyChangeSupport;
+
+ public TabInfo() {
+ }
+
+ public TabInfo(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public Color getBackground() {
+ return background;
+ }
+
+ public void setBackground(Color background) {
+ Color oldValue = this.background;
+ this.background = background;
+ firePropertyChange(BACKGROUND_PROPERTY, oldValue, background);
+ }
+
+ public Icon getDisabledIcon() {
+ return disabledIcon;
+ }
+
+ public void setDisabledIcon(Icon disabledIcon) {
+ Icon oldValue = this.disabledIcon;
+ this.disabledIcon = disabledIcon;
+ firePropertyChange(DISABLED_ICON_PROPERTY, oldValue, disabledIcon);
+ }
+
+ public int getDisplayedMnemonicIndex() {
+ return displayedMnemonicIndex;
+ }
+
+ public void setDisplayedMnemonicIndex(int displayedMnemonicIndex) {
+ int oldValue = this.displayedMnemonicIndex;
+ this.displayedMnemonicIndex = displayedMnemonicIndex;
+ firePropertyChange(DISPLAYED_MNEMONIC_INDEX_PROPERTY, oldValue, displayedMnemonicIndex);
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ boolean oldValue = this.enabled;
+ this.enabled = enabled;
+ firePropertyChange(ENABLED_PROPERTY, oldValue, enabled);
+ }
+
+ public Color getForeground() {
+ return foreground;
+ }
+
+ public void setForeground(Color foreground) {
+ Color oldValue = this.foreground;
+ this.foreground = foreground;
+ firePropertyChange(FOREGROUND_PROPERTY, oldValue, foreground);
+ }
+
+ public Icon getIcon() {
+ return icon;
+ }
+
+ public void setIcon(Icon icon) {
+ Icon oldValue = this.icon;
+ this.icon = icon;
+ firePropertyChange(ICON_PROPERTY, oldValue, icon);
+ }
+
+ public int getMnemonic() {
+ return mnemonic;
+ }
+
+ public void setMnemonic(int mnemonic) {
+ int oldValue = this.mnemonic;
+ this.mnemonic = mnemonic;
+ firePropertyChange(MNEMONIC_PROPERTY, oldValue, mnemonic);
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ String oldValue = this.title;
+ this.title = title;
+ firePropertyChange(TITLE_PROPERTY, oldValue, title);
+ }
+
+ public String getToolTipText() {
+ return toolTipText;
+ }
+
+ public void setToolTipText(String toolTipText) {
+ String oldValue = this.toolTipText;
+ this.toolTipText = toolTipText;
+ firePropertyChange(TOOL_TIP_TEXT_PROPERTY, oldValue, toolTipText);
+ }
+
+ private PropertyChangeSupport getPropertyChangeSupport() {
+ if (propertyChangeSupport == null) {
+ propertyChangeSupport = new SwingPropertyChangeSupport(this);
+ }
+ return propertyChangeSupport;
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ getPropertyChangeSupport().addPropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
+ getPropertyChangeSupport().addPropertyChangeListener(property, listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ getPropertyChangeSupport().removePropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
+ getPropertyChangeSupport().removePropertyChangeListener(property, listener);
+ }
+
+ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ if (propertyChangeSupport != null) {
+ getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue);
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,44 +1,60 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.Icon;
-import javax.swing.JTabbedPane;
-import java.awt.Color;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-public class TabInfoPropertyChangeListener implements PropertyChangeListener {
-
- private JTabbedPane tabs;
- private int tabIndex;
-
- public TabInfoPropertyChangeListener(JTabbedPane tabs, int tabIndex) {
- this.tabs = tabs;
- this.tabIndex = tabIndex;
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent e) {
- String name = e.getPropertyName();
- if (name.equals(TabInfo.TITLE_PROPERTY)) {
- tabs.setTitleAt(tabIndex, (String) e.getNewValue());
- } else if (name.equals(TabInfo.TOOL_TIP_TEXT_PROPERTY)) {
- tabs.setToolTipTextAt(tabIndex, (String) e.getNewValue());
- } else if (name.equals(TabInfo.FOREGROUND_PROPERTY)) {
- tabs.setForegroundAt(tabIndex, (Color) e.getNewValue());
- } else if (name.equals(TabInfo.BACKGROUND_PROPERTY)) {
- tabs.setBackgroundAt(tabIndex, (Color) e.getNewValue());
- } else if (name.equals(TabInfo.MNEMONIC_PROPERTY)) {
- tabs.setMnemonicAt(tabIndex, (Integer) e.getNewValue());
- } else if (name.equals(TabInfo.DISPLAYED_MNEMONIC_INDEX_PROPERTY)) {
- tabs.setDisplayedMnemonicIndexAt(tabIndex, (Integer) e.getNewValue());
- } else if (name.equals(TabInfo.ICON_PROPERTY)) {
- tabs.setIconAt(tabIndex, (Icon) e.getNewValue());
- } else if (name.equals(TabInfo.DISABLED_ICON_PROPERTY)) {
- tabs.setDisabledIconAt(tabIndex, (Icon) e.getNewValue());
- }
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.Icon;
+import javax.swing.JTabbedPane;
+import java.awt.Color;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+public class TabInfoPropertyChangeListener implements PropertyChangeListener {
+
+ private JTabbedPane tabs;
+ private int tabIndex;
+
+ public TabInfoPropertyChangeListener(JTabbedPane tabs, int tabIndex) {
+ this.tabs = tabs;
+ this.tabIndex = tabIndex;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent e) {
+ String name = e.getPropertyName();
+ if (name.equals(TabInfo.TITLE_PROPERTY)) {
+ tabs.setTitleAt(tabIndex, (String) e.getNewValue());
+ } else if (name.equals(TabInfo.TOOL_TIP_TEXT_PROPERTY)) {
+ tabs.setToolTipTextAt(tabIndex, (String) e.getNewValue());
+ } else if (name.equals(TabInfo.FOREGROUND_PROPERTY)) {
+ tabs.setForegroundAt(tabIndex, (Color) e.getNewValue());
+ } else if (name.equals(TabInfo.BACKGROUND_PROPERTY)) {
+ tabs.setBackgroundAt(tabIndex, (Color) e.getNewValue());
+ } else if (name.equals(TabInfo.MNEMONIC_PROPERTY)) {
+ tabs.setMnemonicAt(tabIndex, (Integer) e.getNewValue());
+ } else if (name.equals(TabInfo.DISPLAYED_MNEMONIC_INDEX_PROPERTY)) {
+ tabs.setDisplayedMnemonicIndexAt(tabIndex, (Integer) e.getNewValue());
+ } else if (name.equals(TabInfo.ICON_PROPERTY)) {
+ tabs.setIconAt(tabIndex, (Icon) e.getNewValue());
+ } else if (name.equals(TabInfo.DISABLED_ICON_PROPERTY)) {
+ tabs.setDisabledIconAt(tabIndex, (Icon) e.getNewValue());
+ }
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,58 +1,74 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.JPanel;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-
-/**
- * Panel which uses a {@link GridBagLayout} by default.
- *
- * @author Ethan Nicholas
- */
-public class Table extends JPanel {
-
- private static final long serialVersionUID = 1L;
- public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3);
- private GridBagConstraints tableConstraints = new GridBagConstraints();
- private GridBagConstraints rowConstraints = null;
- private GridBagConstraints cellConstraints = null;
-
- public Table() {
- super.setLayout(new GridBagLayout());
-
- tableConstraints.insets = DEFAULT_INSETS;
- }
-
- @Override
- public void setLayout(LayoutManager layout) {
- // do nothing
- }
-
- public GridBagConstraints getTableConstraints() {
- return tableConstraints;
- }
-
- public GridBagConstraints getRowConstraints() {
- return rowConstraints;
- }
-
- public GridBagConstraints getCellConstraints() {
- return cellConstraints;
- }
-
- public void newRow() {
- tableConstraints.gridy++;
- rowConstraints = (GridBagConstraints) tableConstraints.clone();
- }
-
- public void newCell() {
- rowConstraints.gridx++;
- cellConstraints = (GridBagConstraints) rowConstraints.clone();
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.JPanel;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+
+/**
+ * Panel which uses a {@link GridBagLayout} by default.
+ *
+ * @author Ethan Nicholas
+ */
+public class Table extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+ public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3);
+ private GridBagConstraints tableConstraints = new GridBagConstraints();
+ private GridBagConstraints rowConstraints = null;
+ private GridBagConstraints cellConstraints = null;
+
+ public Table() {
+ super.setLayout(new GridBagLayout());
+
+ tableConstraints.insets = DEFAULT_INSETS;
+ }
+
+ @Override
+ public void setLayout(LayoutManager layout) {
+ // do nothing
+ }
+
+ public GridBagConstraints getTableConstraints() {
+ return tableConstraints;
+ }
+
+ public GridBagConstraints getRowConstraints() {
+ return rowConstraints;
+ }
+
+ public GridBagConstraints getCellConstraints() {
+ return cellConstraints;
+ }
+
+ public void newRow() {
+ tableConstraints.gridy++;
+ rowConstraints = (GridBagConstraints) tableConstraints.clone();
+ }
+
+ public void newCell() {
+ rowConstraints.gridx++;
+ cellConstraints = (GridBagConstraints) rowConstraints.clone();
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,94 +1,110 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.JPanel;
-import java.awt.Insets;
-
-/**
- * Panel which uses a {@link VBoxLayout} by default.
- *
- * @author Ethan Nicholas
- */
-public class VBox extends JPanel {
-
- private static final long serialVersionUID = 1L;
- public static final String SPACING_PROPERTY = "spacing";
- public static final String MARGIN_PROPERTY = "margin";
- public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment";
- public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment";
- private Insets margin;
-
- public VBox() {
- super(new VBoxLayout());
- }
-
- /**
- * Returns the spacing between components, in pixels. Spacing is applied between components only,
- * not to the top or bottom of the container.
- *
- * @return spacing between components
- */
- public int getSpacing() {
- return ((VBoxLayout) getLayout()).getSpacing();
- }
-
- /**
- * Sets the spacing between components. Spacing is applied between components only,
- * not to the top or bottom of the container.
- *
- * @param spacing new spacing value
- */
- public void setSpacing(int spacing) {
- int oldValue = getSpacing();
- ((VBoxLayout) getLayout()).setSpacing(spacing);
- firePropertyChange(SPACING_PROPERTY, oldValue, spacing);
- revalidate();
- }
-
- public int getHorizontalAlignment() {
- return ((VBoxLayout) getLayout()).getHorizontalAlignment();
- }
-
- public void setHorizontalAlignment(int horizontalAlignment) {
- int oldValue = getHorizontalAlignment();
- ((VBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment);
- firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment);
- revalidate();
- }
-
- public int getVerticalAlignment() {
- return ((VBoxLayout) getLayout()).getVerticalAlignment();
- }
-
- public void setVerticalAlignment(int verticalAlignment) {
- int oldValue = getVerticalAlignment();
- ((VBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment);
- firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment);
- revalidate();
- }
-
- public Insets getMargin() {
- return margin;
- }
-
- public void setMargin(Insets margin) {
- Insets oldValue = this.margin;
- this.margin = (Insets) margin.clone();
- firePropertyChange(MARGIN_PROPERTY, oldValue, margin);
- }
-
- @Override
- public Insets getInsets() {
- Insets result = super.getInsets();
- if (margin != null) {
- result.top += margin.top;
- result.left += margin.left;
- result.right += margin.right;
- result.bottom += margin.bottom;
- }
- return result;
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.JPanel;
+import java.awt.Insets;
+
+/**
+ * Panel which uses a {@link VBoxLayout} by default.
+ *
+ * @author Ethan Nicholas
+ */
+public class VBox extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+ public static final String SPACING_PROPERTY = "spacing";
+ public static final String MARGIN_PROPERTY = "margin";
+ public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment";
+ public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment";
+ private Insets margin;
+
+ public VBox() {
+ super(new VBoxLayout());
+ }
+
+ /**
+ * Returns the spacing between components, in pixels. Spacing is applied between components only,
+ * not to the top or bottom of the container.
+ *
+ * @return spacing between components
+ */
+ public int getSpacing() {
+ return ((VBoxLayout) getLayout()).getSpacing();
+ }
+
+ /**
+ * Sets the spacing between components. Spacing is applied between components only,
+ * not to the top or bottom of the container.
+ *
+ * @param spacing new spacing value
+ */
+ public void setSpacing(int spacing) {
+ int oldValue = getSpacing();
+ ((VBoxLayout) getLayout()).setSpacing(spacing);
+ firePropertyChange(SPACING_PROPERTY, oldValue, spacing);
+ revalidate();
+ }
+
+ public int getHorizontalAlignment() {
+ return ((VBoxLayout) getLayout()).getHorizontalAlignment();
+ }
+
+ public void setHorizontalAlignment(int horizontalAlignment) {
+ int oldValue = getHorizontalAlignment();
+ ((VBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment);
+ firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment);
+ revalidate();
+ }
+
+ public int getVerticalAlignment() {
+ return ((VBoxLayout) getLayout()).getVerticalAlignment();
+ }
+
+ public void setVerticalAlignment(int verticalAlignment) {
+ int oldValue = getVerticalAlignment();
+ ((VBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment);
+ firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment);
+ revalidate();
+ }
+
+ public Insets getMargin() {
+ return margin;
+ }
+
+ public void setMargin(Insets margin) {
+ Insets oldValue = this.margin;
+ this.margin = (Insets) margin.clone();
+ firePropertyChange(MARGIN_PROPERTY, oldValue, margin);
+ }
+
+ @Override
+ public Insets getInsets() {
+ Insets result = super.getInsets();
+ if (margin != null) {
+ result.top += margin.top;
+ result.left += margin.left;
+ result.right += margin.right;
+ result.bottom += margin.bottom;
+ }
+ return result;
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.runtime.swing;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,127 +1,143 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime.swing;
-
-import javax.swing.SwingConstants;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-
-/**
- * Vertical box layout. The layout rules followed by this class are quite different than the core BoxLayout class,
- * and in general represent a more useful algorithm.
- *
- * @author Ethan Nicholas
- */
-public class VBoxLayout implements LayoutManager {
-
- private int spacing = 6;
- private int horizontalAlignment = SwingConstants.LEFT;
- private int verticalAlignment = SwingConstants.TOP;
-
- public int getSpacing() {
- return spacing;
- }
-
- public void setSpacing(int spacing) {
- this.spacing = spacing;
- }
-
- public int getHorizontalAlignment() {
- return horizontalAlignment;
- }
-
- public void setHorizontalAlignment(int horizontalAlignment) {
- this.horizontalAlignment = horizontalAlignment;
- }
-
- public int getVerticalAlignment() {
- return verticalAlignment;
- }
-
- public void setVerticalAlignment(int verticalAlignment) {
- this.verticalAlignment = verticalAlignment;
- }
-
- @Override
- public void addLayoutComponent(String name, Component comp) {
- }
-
- @Override
- public void layoutContainer(Container parent) {
- Insets insets = parent.getInsets();
- int parentWidth = parent.getSize().width - insets.left - insets.right;
- int count = parent.getComponentCount();
- Dimension preferredSize = parent.getPreferredSize();
- int y;
- switch (verticalAlignment) {
- case SwingConstants.TOP:
- y = insets.top;
- break;
- case SwingConstants.CENTER:
- y = insets.top + (parent.getHeight() - preferredSize.height) / 2;
- break;
- case SwingConstants.BOTTOM:
- y = insets.top + (parent.getHeight() - preferredSize.height);
- break;
- default:
- throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment);
- }
-
- for (int i = 0; i < count; i++) {
- Component component = parent.getComponent(i);
- Dimension childPreferredSize = component.getPreferredSize();
- int width = Math.min(childPreferredSize.width, parentWidth);
- int x;
- switch (horizontalAlignment) {
- case SwingConstants.LEFT:
- x = insets.left;
- break;
- case SwingConstants.CENTER:
- x = insets.left + (parentWidth - childPreferredSize.width) / 2;
- break;
- case SwingConstants.RIGHT:
- x = insets.left + (parentWidth - childPreferredSize.width);
- break;
- default:
- throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment);
- }
- component.setBounds(x, y, width, childPreferredSize.height);
- y += childPreferredSize.height + spacing;
- }
- }
-
- @Override
- public Dimension minimumLayoutSize(Container parent) {
- int width = 0;
- int height = (parent.getComponentCount() - 1) * spacing;
- for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
- Dimension minimumSize = parent.getComponent(i).getMinimumSize();
- width = Math.max(width, minimumSize.width);
- height += minimumSize.height;
- }
- Insets insets = parent.getInsets();
- return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
- }
-
- @Override
- public Dimension preferredLayoutSize(Container parent) {
- int width = 0;
- int height = (parent.getComponentCount() - 1) * spacing;
- for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
- Dimension preferredSize = parent.getComponent(i).getPreferredSize();
- width = Math.max(width, preferredSize.width);
- height += preferredSize.height;
- }
- Insets insets = parent.getInsets();
- return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
- }
-
- @Override
- public void removeLayoutComponent(Component comp) {
- }
-}
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
+package jaxx.runtime.swing;
+
+import javax.swing.SwingConstants;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+
+/**
+ * Vertical box layout. The layout rules followed by this class are quite different than the core BoxLayout class,
+ * and in general represent a more useful algorithm.
+ *
+ * @author Ethan Nicholas
+ */
+public class VBoxLayout implements LayoutManager {
+
+ private int spacing = 6;
+ private int horizontalAlignment = SwingConstants.LEFT;
+ private int verticalAlignment = SwingConstants.TOP;
+
+ public int getSpacing() {
+ return spacing;
+ }
+
+ public void setSpacing(int spacing) {
+ this.spacing = spacing;
+ }
+
+ public int getHorizontalAlignment() {
+ return horizontalAlignment;
+ }
+
+ public void setHorizontalAlignment(int horizontalAlignment) {
+ this.horizontalAlignment = horizontalAlignment;
+ }
+
+ public int getVerticalAlignment() {
+ return verticalAlignment;
+ }
+
+ public void setVerticalAlignment(int verticalAlignment) {
+ this.verticalAlignment = verticalAlignment;
+ }
+
+ @Override
+ public void addLayoutComponent(String name, Component comp) {
+ }
+
+ @Override
+ public void layoutContainer(Container parent) {
+ Insets insets = parent.getInsets();
+ int parentWidth = parent.getSize().width - insets.left - insets.right;
+ int count = parent.getComponentCount();
+ Dimension preferredSize = parent.getPreferredSize();
+ int y;
+ switch (verticalAlignment) {
+ case SwingConstants.TOP:
+ y = insets.top;
+ break;
+ case SwingConstants.CENTER:
+ y = insets.top + (parent.getHeight() - preferredSize.height) / 2;
+ break;
+ case SwingConstants.BOTTOM:
+ y = insets.top + (parent.getHeight() - preferredSize.height);
+ break;
+ default:
+ throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment);
+ }
+
+ for (int i = 0; i < count; i++) {
+ Component component = parent.getComponent(i);
+ Dimension childPreferredSize = component.getPreferredSize();
+ int width = Math.min(childPreferredSize.width, parentWidth);
+ int x;
+ switch (horizontalAlignment) {
+ case SwingConstants.LEFT:
+ x = insets.left;
+ break;
+ case SwingConstants.CENTER:
+ x = insets.left + (parentWidth - childPreferredSize.width) / 2;
+ break;
+ case SwingConstants.RIGHT:
+ x = insets.left + (parentWidth - childPreferredSize.width);
+ break;
+ default:
+ throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment);
+ }
+ component.setBounds(x, y, width, childPreferredSize.height);
+ y += childPreferredSize.height + spacing;
+ }
+ }
+
+ @Override
+ public Dimension minimumLayoutSize(Container parent) {
+ int width = 0;
+ int height = (parent.getComponentCount() - 1) * spacing;
+ for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
+ Dimension minimumSize = parent.getComponent(i).getMinimumSize();
+ width = Math.max(width, minimumSize.width);
+ height += minimumSize.height;
+ }
+ Insets insets = parent.getInsets();
+ return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
+ }
+
+ @Override
+ public Dimension preferredLayoutSize(Container parent) {
+ int width = 0;
+ int height = (parent.getComponentCount() - 1) * spacing;
+ for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
+ Dimension preferredSize = parent.getComponent(i).getPreferredSize();
+ width = Math.max(width, preferredSize.width);
+ height += preferredSize.height;
+ }
+ Insets insets = parent.getInsets();
+ return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
+ }
+
+ @Override
+ public void removeLayoutComponent(Component comp) {
+ }
+}
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,7 @@
/*
-* *##% ui
- * Copyright (C) 2008 CodeLutin
+* *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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
@@ -14,7 +15,8 @@
*
* 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>. ##%* */
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%* */
package jaxx.runtime.swing.editor;
import org.apache.commons.beanutils.Converter;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,7 @@
/*
- * *##% Lutin utilities library
- * Copyright (C) 2004 - 2008 CodeLutin
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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
@@ -14,7 +15,8 @@
*
* 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>. ##%* */
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%* */
package jaxx.runtime.swing.editor;
import javax.swing.JComboBox;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,7 @@
/*
-* *##% Lutin utilities library
- * Copyright (C) 2004 - 2008 CodeLutin
+* *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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
@@ -14,7 +15,8 @@
*
* 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>. ##%* */
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%* */
package jaxx.runtime.swing.editor;
import javax.swing.JComboBox;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.editor;
import javax.swing.DefaultCellEditor;
@@ -8,7 +28,6 @@
import javax.swing.JTextField;
import javax.swing.table.TableCellEditor;
import java.awt.Component;
-import jaxx.runtime.swing.editor.EnumEditor;
/**
* @author chemit
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.help;
import java.applet.Applet;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.help;
import java.awt.Component;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.help;
import jaxx.runtime.JAXXContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import java.awt.CardLayout;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,6 +1,22 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
*/
package jaxx.runtime.swing.navigation;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import javax.swing.event.TreeSelectionEvent;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import javax.swing.JTree;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import java.awt.Component;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import jaxx.runtime.JAXXContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import java.lang.reflect.InvocationTargetException;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import jaxx.runtime.JAXXContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import java.util.Enumeration;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import java.util.Enumeration;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import javax.swing.tree.TreeCellRenderer;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import jaxx.runtime.decorator.Decorator;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import static org.nuiton.i18n.I18n._;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.renderer;
import javax.swing.Icon;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.renderer;
import javax.swing.JTable;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.renderer;
import javax.swing.JTable;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.renderer;
import static org.nuiton.i18n.I18n._;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.renderer;
import java.awt.Component;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import java.beans.PropertyChangeListener;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import javax.swing.SwingWorker;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import java.beans.PropertyChangeEvent;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import java.util.Arrays;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import java.io.Serializable;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import javax.swing.JTabbedPane;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import java.awt.Window;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.wizard;
import java.awt.Component;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import java.beans.EventSetDescriptor;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import static org.nuiton.i18n.I18n._;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import static org.nuiton.i18n.I18n.n_;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import jaxx.runtime.*;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import com.opensymphony.xwork2.ActionContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.util.ValueStack;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.validator.ValidationException;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.validator.ValidationException;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.validator.ValidationException;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.util.ValueStack;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.validator.ValidationException;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.validator.ValidationException;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import com.opensymphony.xwork2.validator.ValidationException;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import jaxx.runtime.validator.swing.ui.AbstractBeanValidatorUI;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import javax.swing.JComponent;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import jaxx.runtime.validator.BeanValidatorEvent;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import org.apache.commons.logging.Log;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import javax.swing.ImageIcon;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import jaxx.runtime.validator.BeanValidatorEvent;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import org.apache.commons.logging.Log;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import javax.swing.ImageIcon;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,7 +1,26 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing;
import jaxx.runtime.*;
-import jaxx.runtime.validator.BeanValidatorUtil;
import jaxx.runtime.validator.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -13,10 +32,6 @@
import javax.swing.JComponent;
import javax.swing.RowSorter;
import javax.swing.SortOrder;
-import jaxx.runtime.validator.swing.SwingValidatorMessageTableMouseListener;
-import jaxx.runtime.validator.swing.SwingValidatorMessageListMouseListener;
-import jaxx.runtime.validator.swing.SwingValidatorMessage;
-import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer;
import static org.nuiton.i18n.I18n.n_;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing.ui;
import jaxx.runtime.validator.BeanValidatorEvent;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing.ui;
import org.jdesktop.jxlayer.JXLayer;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing.ui;
import org.jdesktop.jxlayer.JXLayer;
Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.swing.ui;
import jaxx.runtime.validator.BeanValidatorScope;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime;
import org.junit.Assert;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.context;
import jaxx.runtime.context.DefaultApplicationContext.AutoLoad;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.context;
import jaxx.runtime.JAXXContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
import java.util.ArrayList;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
import jaxx.runtime.decorator.JXPathDecorator.Context;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.decorator;
import org.junit.After;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.swing.navigation;
import jaxx.runtime.context.DefaultJAXXContext;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import java.util.List;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import java.beans.PropertyChangeListener;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator;
import java.util.List;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
/**
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import jaxx.runtime.validator.field.ValidatorBean.ValidatorBeanEntry;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import jaxx.runtime.validator.field.ValidatorBean.ValidatorBeanEntry;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.beans.PropertyChangeListener;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
/** @author chemit */
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.io.File;
Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java
===================================================================
--- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package jaxx.runtime.validator.field;
import java.beans.PropertyChangeListener;
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
* Tony Chemit, Gabriel Landais
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* ##% Copyright (C) 2007, 2008 Code Lutin, Tony Chemit
*
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
* Tony Chemit, Gabriel Landais
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
* Tony Chemit, Gabriel Landais
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
* Tony Chemit, Gabriel Landais
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
* Tony Chemit
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
* Tony Chemit
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/*
* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
* Tony Chemit
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java
===================================================================
--- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Action
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
/**
* ##% Copyright (C) 2008 Code Lutin, Tony Chemit
* This program is free software; you
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing.editor;
@@ -465,4 +467,4 @@
}
return acceptNull;
}
-}
\ No newline at end of file
+}
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing.editor;
@@ -219,4 +221,4 @@
}
return mutator;
}
-}
\ No newline at end of file
+}
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/*
-* *##% jaxx-runtime-swing-widget
+* *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%* */
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%* */
package jaxx.runtime.swing.editor.config;
import jaxx.runtime.swing.editor.config.model.ConfigTableModel;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/*
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%* */
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%* */
package jaxx.runtime.swing.editor.config;
import static org.nuiton.i18n.I18n._;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing.editor.config;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing.editor.config.model;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing.editor.config.model;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing.editor.config.model;
Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java
===================================================================
--- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,5 +1,6 @@
/**
- * *##% jaxx-runtime-swing-widget
+ * *##%
+ * JAXX Widgets
* Copyright (C) 2008 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
*/
package jaxx.runtime.swing.editor.config.model;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,21 +1,21 @@
-/* *##%
- * Copyright (C) 2007
- * JaxxPlugin, Code Lutin
+/* *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 CodeLutin
*
- * 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 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 Public License for more details.
+ * GNU General Lesser 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.
- *##%*/
+ * 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>.
+ * ##%*/
package org.nuiton.jaxx.plugin;
import org.apache.maven.project.MavenProject;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,21 +1,21 @@
-/* *##%
- * Copyright (C) 2007
- * JaxxPlugin, Code Lutin
+/* *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 CodeLutin
*
- * 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 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 Public License for more details.
+ * GNU General Lesser 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.
- *##%*/
+ * 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>.
+ * ##%*/
package org.nuiton.jaxx.plugin;
import com.sun.java.help.search.Indexer;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,21 +1,21 @@
-/* *##%
- * Copyright (C) 2007
- * JaxxPlugin, Code Lutin
+/* *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 CodeLutin
*
- * 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 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 Public License for more details.
+ * GNU General Lesser 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.
- *##%*/
+ * 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>.
+ * ##%*/
package org.nuiton.jaxx.plugin;
import java.util.List;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import java.util.ArrayList;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import java.io.File;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import org.junit.Test;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import jaxx.runtime.Base64Coder;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import org.junit.Test;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import jaxx.runtime.context.DefaultJAXXContext;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import org.apache.maven.plugin.MojoExecutionException;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import org.junit.Test;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import org.apache.maven.plugin.MojoExecutionException;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import org.junit.Test;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import jaxx.runtime.context.DefaultJAXXContext;
Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java
===================================================================
--- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java 2009-10-26 19:11:57 UTC (rev 1601)
+++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java 2009-10-26 19:13:36 UTC (rev 1602)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * JAXX Maven plugin
+ * Copyright (C) 2008 - 2009 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>.
+ * ##%*
+ */
package org.nuiton.jaxx.plugin;
import org.junit.Assert;
1
0
r1601 - in branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo: . component/jaxx component/jaxx/editor component/jaxx/navigation component/jaxx/navigation/content component/jaxx/navigation/item component/swing feature/databinding feature/validation fun
by tchemit@users.nuiton.org 26 Oct '09
by tchemit@users.nuiton.org 26 Oct '09
26 Oct '09
Author: tchemit
Date: 2009-10-26 20:11:57 +0100 (Mon, 26 Oct 2009)
New Revision: 1601
Modified:
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx
branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx
Log:
update jaxx files license header
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -115,4 +115,4 @@
<tab title='Sources'>
<JTabbedPane id='sourceTabs' tabPlacement='{JTabbedPane.BOTTOM}'/>
</tab>
-</JTabbedPane>
\ No newline at end of file
+</JTabbedPane>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -107,4 +107,4 @@
<jaxx.runtime.swing.StatusMessagePanel id='p' constraints='BorderLayout.SOUTH'/>
</JPanel>
-</JFrame>
\ No newline at end of file
+</JFrame>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,94 +18,94 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-
-<jaxx.demo.DemoPanel>
- <jaxx.runtime.swing.BlockingLayerUI id='layerUI'
- blockIcon='{SwingUtil.createImageIcon("action-block.png")}'
- acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}'
- useIcon='true'
- blockingColor='{new Color(50,50,50)}'
- acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L;
- @Override
- public void actionPerformed(ActionEvent e) {
- accept(e, "from icon of layer");
- }
- }}' />
- <jaxx.runtime.swing.BlockingLayerUI2 id='layerUI2'
- blockIcon='{SwingUtil.createImageIcon("action-block.png")}'
- acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}'
- acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L;
- @Override
- public void actionPerformed(ActionEvent e) {
- accept(e, "from icon of layer");
- }
- }}' />
- <script><![CDATA[
-import jaxx.runtime.SwingUtil;
-
-void $afterCompleteSetup() {
- for (JComponent boxed : SwingUtil.getLayeredComponents(this)) {
- if (boxed == d) {
- SwingUtil.getLayer(boxed).setUI(layerUI2);
- continue;
- }
-
- jaxx.runtime.swing.BlockingLayerUI ui = layerUI.clone();
- if ( boxed == c) {
- ui.setBlock(true);
- }
- SwingUtil.getLayer(boxed).setUI(ui);
- }
-}
-
-public void setLayer(boolean active) {
- for (JComponent boxed : SwingUtil.getLayeredComponents(this)) {
- if (boxed == d) {
- continue;
- }
- jaxx.runtime.swing.BlockingLayerUI ui = (jaxx.runtime.swing.BlockingLayerUI)SwingUtil.getLayer(boxed).getUI();
- if ( boxed == c) {
- ui.setBlock(active);
- }
- ui.setUseIcon(active);
- }
-}
-
-protected void accept(ActionEvent e, String suffix) {
- JButton source = (JButton) e.getSource();
- String clickedMessage = (String) source.getClientProperty("clickedText");
- String msg = "'" + source.getText() + "' clicked - " + suffix + " : " + clickedMessage;
- ((DefaultListModel)messages.getModel()).addElement(msg);
-}]]>
- </script>
- <Table id='demoPanel' fill='both' weightx='1'>
- <row>
- <cell>
- <JCheckBox id='toggle' selected='true'
- text='{toggle.isSelected() ? "Active layer" : "No layer"}'
- onActionPerformed='setLayer(toggle.isSelected());'/>
- </cell>
- </row>
- <row>
- <cell weighty='0.5'>
- <JPanel layout='{new GridLayout(1,3,3,3)}'>
- <JButton text='button A' decorator='boxed' _clickedText='"button A was clicked"'
- onActionPerformed='accept(event, "from button (no layer)")'/>
- <JButton text='button B' decorator='boxed' _clickedText='"button B was clicked"'
- onActionPerformed='accept(event, "from button (no layer)")'/>
- <JButton id='c' text='button C (full block)' decorator='boxed' _clickedText='"button C was clicked"'
- onActionPerformed='accept(event, "from button (no layer)");'/>
- <JButton id='d' text='button D (full block 2)' decorator='boxed' _clickedText='"button D was clicked"'
- onActionPerformed='accept(event, "from button (no layer)");'/>
- </JPanel>
- </cell>
- </row>
- <row>
- <cell weighty='0.5'>
- <JScrollPane>
- <JList id='messages' model='{new DefaultListModel()}'/>
- </JScrollPane>
- </cell>
- </row>
- </Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+
+<jaxx.demo.DemoPanel>
+ <jaxx.runtime.swing.BlockingLayerUI id='layerUI'
+ blockIcon='{SwingUtil.createImageIcon("action-block.png")}'
+ acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}'
+ useIcon='true'
+ blockingColor='{new Color(50,50,50)}'
+ acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L;
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ accept(e, "from icon of layer");
+ }
+ }}' />
+ <jaxx.runtime.swing.BlockingLayerUI2 id='layerUI2'
+ blockIcon='{SwingUtil.createImageIcon("action-block.png")}'
+ acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}'
+ acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L;
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ accept(e, "from icon of layer");
+ }
+ }}' />
+ <script><![CDATA[
+import jaxx.runtime.SwingUtil;
+
+void $afterCompleteSetup() {
+ for (JComponent boxed : SwingUtil.getLayeredComponents(this)) {
+ if (boxed == d) {
+ SwingUtil.getLayer(boxed).setUI(layerUI2);
+ continue;
+ }
+
+ jaxx.runtime.swing.BlockingLayerUI ui = layerUI.clone();
+ if ( boxed == c) {
+ ui.setBlock(true);
+ }
+ SwingUtil.getLayer(boxed).setUI(ui);
+ }
+}
+
+public void setLayer(boolean active) {
+ for (JComponent boxed : SwingUtil.getLayeredComponents(this)) {
+ if (boxed == d) {
+ continue;
+ }
+ jaxx.runtime.swing.BlockingLayerUI ui = (jaxx.runtime.swing.BlockingLayerUI)SwingUtil.getLayer(boxed).getUI();
+ if ( boxed == c) {
+ ui.setBlock(active);
+ }
+ ui.setUseIcon(active);
+ }
+}
+
+protected void accept(ActionEvent e, String suffix) {
+ JButton source = (JButton) e.getSource();
+ String clickedMessage = (String) source.getClientProperty("clickedText");
+ String msg = "'" + source.getText() + "' clicked - " + suffix + " : " + clickedMessage;
+ ((DefaultListModel)messages.getModel()).addElement(msg);
+}]]>
+ </script>
+ <Table id='demoPanel' fill='both' weightx='1'>
+ <row>
+ <cell>
+ <JCheckBox id='toggle' selected='true'
+ text='{toggle.isSelected() ? "Active layer" : "No layer"}'
+ onActionPerformed='setLayer(toggle.isSelected());'/>
+ </cell>
+ </row>
+ <row>
+ <cell weighty='0.5'>
+ <JPanel layout='{new GridLayout(1,3,3,3)}'>
+ <JButton text='button A' decorator='boxed' _clickedText='"button A was clicked"'
+ onActionPerformed='accept(event, "from button (no layer)")'/>
+ <JButton text='button B' decorator='boxed' _clickedText='"button B was clicked"'
+ onActionPerformed='accept(event, "from button (no layer)")'/>
+ <JButton id='c' text='button C (full block)' decorator='boxed' _clickedText='"button C was clicked"'
+ onActionPerformed='accept(event, "from button (no layer)");'/>
+ <JButton id='d' text='button D (full block 2)' decorator='boxed' _clickedText='"button D was clicked"'
+ onActionPerformed='accept(event, "from button (no layer)");'/>
+ </JPanel>
+ </cell>
+ </row>
+ <row>
+ <cell weighty='0.5'>
+ <JScrollPane>
+ <JList id='messages' model='{new DefaultListModel()}'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,14 +18,14 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <JPanel id='demoPanel' layout='{new BorderLayout()}'>
- <JPanel layout='{new GridLayout(0,1)}' constraints='BorderLayout.CENTER'>
- <JButton text='Fool me once'
- onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on you!")'/>
- <JButton text='Fool me twice'
- onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on ...")'/>
- </JPanel>
- <jaxx.runtime.swing.StatusMessagePanel id='p' constraints='BorderLayout.SOUTH'/>
- </JPanel>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <JPanel id='demoPanel' layout='{new BorderLayout()}'>
+ <JPanel layout='{new GridLayout(0,1)}' constraints='BorderLayout.CENTER'>
+ <JButton text='Fool me once'
+ onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on you!")'/>
+ <JButton text='Fool me twice'
+ onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on ...")'/>
+ </JPanel>
+ <jaxx.runtime.swing.StatusMessagePanel id='p' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,38 +18,38 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-
-<jaxx.demo.DemoPanel>
- <Table id='demoPanel' fill='both'>
- <row>
- <cell>
- <JLabel text='Locale editor:' labelFor='{localeEditor}'/>
- </cell>
-
- <cell>
- <LocaleEditor id='localeEditor'/>
- </cell>
- </row>
- <row>
- <cell>
- <JLabel text='EnumEditor (language) :' labelFor='{languageEditor}'/>
- </cell>
- <cell>
- <EnumEditor id='languageEditor' constructorParams='org.nuiton.i18n.LanguageEnum.class'/>
- </cell>
- </row>
- <row>
- <cell>
- <JLabel text='EnumEditor (country) :' labelFor='{countryEditor}'/>
- </cell>
- <cell>
- <EnumEditor id='countryEditor' constructorParams='org.nuiton.i18n.CountryEnum.class'/>
- </cell>
- </row>
- <row>
- <cell columns="2">
- <JTextArea text='{"locale : "+ localeEditor.getSelectedItem() + "\nlanguage : "+ languageEditor.getSelectedItem() + "\ncountry : " + countryEditor.getSelectedItem()}'/>
- </cell>
- </row>
- </Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+
+<jaxx.demo.DemoPanel>
+ <Table id='demoPanel' fill='both'>
+ <row>
+ <cell>
+ <JLabel text='Locale editor:' labelFor='{localeEditor}'/>
+ </cell>
+
+ <cell>
+ <LocaleEditor id='localeEditor'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text='EnumEditor (language) :' labelFor='{languageEditor}'/>
+ </cell>
+ <cell>
+ <EnumEditor id='languageEditor' constructorParams='org.nuiton.i18n.LanguageEnum.class'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text='EnumEditor (country) :' labelFor='{countryEditor}'/>
+ </cell>
+ <cell>
+ <EnumEditor id='countryEditor' constructorParams='org.nuiton.i18n.CountryEnum.class'/>
+ </cell>
+ </row>
+ <row>
+ <cell columns="2">
+ <JTextArea text='{"locale : "+ localeEditor.getSelectedItem() + "\nlanguage : "+ languageEditor.getSelectedItem() + "\ncountry : " + countryEditor.getSelectedItem()}'/>
+ </cell>
+ </row>
+ </Table>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -83,4 +83,4 @@
</cell>
</row>
</Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -74,4 +74,4 @@
</JScrollPane>
</JSplitPane>
-</ContentUI>
\ No newline at end of file
+</ContentUI>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -67,4 +67,4 @@
</JPanel>
</JToolBar>
-</ContentUI>
\ No newline at end of file
+</ContentUI>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUI.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -49,4 +49,4 @@
}
]]>
</script>
-</JPanel>
\ No newline at end of file
+</JPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -74,4 +74,4 @@
</JScrollPane>
</JSplitPane>
-</ContentUI>
\ No newline at end of file
+</ContentUI>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -67,4 +67,4 @@
</JPanel>
</JToolBar>
-</ContentUI>
\ No newline at end of file
+</ContentUI>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -63,4 +63,4 @@
</ItemNavigationCardPanel>
</JSplitPane>
</JPanel>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,32 +18,32 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <style>
- JButton.fancy {
- foreground: blue;
- font-face: Arial;
- font-size: 18;
- }
-
- JButton.fancy:mouseover {
- foreground: red;
- font-style: italic;
- }
- </style>
-
- <script>
- public void buttonClicked(JButton button) {
- JOptionPane.showMessageDialog(this, button.getText() + " clicked!", "onActionPerformed",
- JOptionPane.INFORMATION_MESSAGE);
- }
- </script>
-
- <javax.swing.ImageIcon id='pencil' constructorParams='getClass().getResource("/jaxx/demo/images/pencil_black.gif")'/>
-
- <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <JButton text='Simple Button' onActionPerformed='buttonClicked((JButton) event.getSource())'/>
- <JButton text='Fancy Button' styleClass='fancy' icon='{pencil}'
- onActionPerformed='buttonClicked((JButton) event.getSource())'/>
- </VBox>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <style>
+ JButton.fancy {
+ foreground: blue;
+ font-face: Arial;
+ font-size: 18;
+ }
+
+ JButton.fancy:mouseover {
+ foreground: red;
+ font-style: italic;
+ }
+ </style>
+
+ <script>
+ public void buttonClicked(JButton button) {
+ JOptionPane.showMessageDialog(this, button.getText() + " clicked!", "onActionPerformed",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ </script>
+
+ <javax.swing.ImageIcon id='pencil' constructorParams='getClass().getResource("/jaxx/demo/images/pencil_black.gif")'/>
+
+ <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <JButton text='Simple Button' onActionPerformed='buttonClicked((JButton) event.getSource())'/>
+ <JButton text='Fancy Button' styleClass='fancy' icon='{pencil}'
+ onActionPerformed='buttonClicked((JButton) event.getSource())'/>
+ </VBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,41 +18,41 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <script><![CDATA[
- public String getText(boolean bold, boolean italic, boolean underline) {
- String text ="Sample Text";
- if (bold)
- text = "<b>" + text + "</b>";
- if (italic)
- text = "<i>" + text + "</i>";
- if (underline)
- text = "<u>" + text + "</u>";
- return "<html>" + text;
- }
- ]]></script>
-
- <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <Table anchor='west'>
- <row>
- <cell>
- <JCheckBox id='bold' text='Bold' mnemonic='B'/>
- </cell>
- <cell rows='3'>
- <JLabel font='{new Font("Arial", 0, 18)}'
- text='{getText(bold.isSelected(), italic.isSelected(), underline.isSelected())}'/>
- </cell>
- </row>
- <row>
- <cell>
- <JCheckBox id='italic' text='Italic' mnemonic='I'/>
- </cell>
- </row>
- <row>
- <cell>
- <JCheckBox id='underline' text='Underline' mnemonic='U'/>
- </cell>
- </row>
- </Table>
- </VBox>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <script><![CDATA[
+ public String getText(boolean bold, boolean italic, boolean underline) {
+ String text ="Sample Text";
+ if (bold)
+ text = "<b>" + text + "</b>";
+ if (italic)
+ text = "<i>" + text + "</i>";
+ if (underline)
+ text = "<u>" + text + "</u>";
+ return "<html>" + text;
+ }
+ ]]></script>
+
+ <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <Table anchor='west'>
+ <row>
+ <cell>
+ <JCheckBox id='bold' text='Bold' mnemonic='B'/>
+ </cell>
+ <cell rows='3'>
+ <JLabel font='{new Font("Arial", 0, 18)}'
+ text='{getText(bold.isSelected(), italic.isSelected(), underline.isSelected())}'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JCheckBox id='italic' text='Italic' mnemonic='I'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JCheckBox id='underline' text='Underline' mnemonic='U'/>
+ </cell>
+ </row>
+ </Table>
+ </VBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,62 +18,62 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<JMenuItemDemo>
- <style>
- .form {
- enabled: { enabledCheckBox.isSelected() };
- editable: { editableCheckBox.isSelected() };
- }
- </style>
-
- <JMenuBar id='menuBar'>
- <JMenu text='View'>
- <JCheckBoxMenuItem id='enabledCheckBox' text='Enabled' selected='true'/>
- <JCheckBoxMenuItem id='editableCheckBox' text='Editable' selected='true'/>
- </JMenu>
- </JMenuBar>
-
- <Table id='framePanel' anchor='northwest'>
- <row>
- <cell>
- <JLabel text='First Name:' displayedMnemonic='F' labelFor='{firstName}'/>
- </cell>
-
- <cell weightx='1' fill='horizontal'>
- <JTextField id='firstName' styleClass="form"/>
- </cell>
- </row>
-
- <row>
- <cell>
- <JLabel text='Last Name:' displayedMnemonic='L' labelFor='{lastName}'/>
- </cell>
-
- <cell fill='horizontal'>
- <JTextField id='lastName' styleClass="form"/>
- </cell>
- </row>
-
- <row>
- <cell>
- <JLabel text='Email Address:' displayedMnemonic='E' labelFor='{email}'/>
- </cell>
-
- <cell fill='horizontal'>
- <JTextField id='email' styleClass="form"/>
- </cell>
- </row>
-
- <row>
- <cell>
- <JLabel text='Comments:' displayedMnemonic='C' labelFor='{comments}'/>
- </cell>
-
- <cell weightx='1' weighty='1' fill='both'>
- <JScrollPane width='150' height='75'>
- <JTextArea id='comments' styleClass="form"/>
- </JScrollPane>
- </cell>
- </row>
- </Table>
-</JMenuItemDemo>
\ No newline at end of file
+<JMenuItemDemo>
+ <style>
+ .form {
+ enabled: { enabledCheckBox.isSelected() };
+ editable: { editableCheckBox.isSelected() };
+ }
+ </style>
+
+ <JMenuBar id='menuBar'>
+ <JMenu text='View'>
+ <JCheckBoxMenuItem id='enabledCheckBox' text='Enabled' selected='true'/>
+ <JCheckBoxMenuItem id='editableCheckBox' text='Editable' selected='true'/>
+ </JMenu>
+ </JMenuBar>
+
+ <Table id='framePanel' anchor='northwest'>
+ <row>
+ <cell>
+ <JLabel text='First Name:' displayedMnemonic='F' labelFor='{firstName}'/>
+ </cell>
+
+ <cell weightx='1' fill='horizontal'>
+ <JTextField id='firstName' styleClass="form"/>
+ </cell>
+ </row>
+
+ <row>
+ <cell>
+ <JLabel text='Last Name:' displayedMnemonic='L' labelFor='{lastName}'/>
+ </cell>
+
+ <cell fill='horizontal'>
+ <JTextField id='lastName' styleClass="form"/>
+ </cell>
+ </row>
+
+ <row>
+ <cell>
+ <JLabel text='Email Address:' displayedMnemonic='E' labelFor='{email}'/>
+ </cell>
+
+ <cell fill='horizontal'>
+ <JTextField id='email' styleClass="form"/>
+ </cell>
+ </row>
+
+ <row>
+ <cell>
+ <JLabel text='Comments:' displayedMnemonic='C' labelFor='{comments}'/>
+ </cell>
+
+ <cell weightx='1' weighty='1' fill='both'>
+ <JScrollPane width='150' height='75'>
+ <JTextArea id='comments' styleClass="form"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+</JMenuItemDemo>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -62,4 +62,4 @@
</cell>
</row>
</Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,82 +18,82 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <script>
- String username;
- String password;
-
- private class OKAction extends javax.swing.AbstractAction {
- public OKAction() {
- putValue(NAME, "OK");
- }
-
-
- public void actionPerformed(ActionEvent e) {
- username = usernameField.getText();
- password = new String(passwordField.getPassword());
- dialog.dispose();
- }
- }
-
-
- private class CancelAction extends javax.swing.AbstractAction {
- public CancelAction() {
- putValue(NAME, "Cancel");
- }
-
-
- public void actionPerformed(ActionEvent e) {
- dialog.dispose();
- }
- }
- {
- JRootPane rootPane = dialog.getRootPane();
- rootPane.setDefaultButton(ok);
- rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "cancel");
- rootPane.getActionMap().put("cancel", new CancelAction());
- }
- </script>
-
- <JDialog title='Sign on' id='dialog' modal='true' onWindowOpened='dialog.setLocationRelativeTo(demoPanel);
- passwordField.setText("");'>
- <Table>
- <row>
- <cell>
- <JLabel text='Username:' displayedMnemonic='U' labelFor='{usernameField}'/>
- </cell>
-
- <cell>
- <JTextField id='usernameField'/>
- </cell>
- </row>
-
- <row>
- <cell>
- <JLabel text='Password:' displayedMnemonic='P' labelFor='{passwordField}'/>
- </cell>
-
- <cell>
- <JPasswordField id='passwordField'/>
- </cell>
- </row>
-
- <row>
- <cell columns='2'>
- <JPanel layout='{new GridLayout(1, 0, 6, 6)}'>
- <JButton id='ok' text='OK' action='{new OKAction()}'/>
- <JButton text='Cancel' action='{new CancelAction()}'/>
- </JPanel>
- </cell>
- </row>
- </Table>
- </JDialog>
-
- <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <JButton text='Show password dialog' onActionPerformed='dialog.setVisible(true)'/>
- <VBox>
- <JLabel text='{username != null ? "Username: " + username : ""}'/>
- <JLabel text='{password != null ? "Password: " + password : ""}'/>
- </VBox>
- </VBox>
-</jaxx.demo.DemoPanel>
+<jaxx.demo.DemoPanel>
+ <script>
+ String username;
+ String password;
+
+ private class OKAction extends javax.swing.AbstractAction {
+ public OKAction() {
+ putValue(NAME, "OK");
+ }
+
+
+ public void actionPerformed(ActionEvent e) {
+ username = usernameField.getText();
+ password = new String(passwordField.getPassword());
+ dialog.dispose();
+ }
+ }
+
+
+ private class CancelAction extends javax.swing.AbstractAction {
+ public CancelAction() {
+ putValue(NAME, "Cancel");
+ }
+
+
+ public void actionPerformed(ActionEvent e) {
+ dialog.dispose();
+ }
+ }
+ {
+ JRootPane rootPane = dialog.getRootPane();
+ rootPane.setDefaultButton(ok);
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "cancel");
+ rootPane.getActionMap().put("cancel", new CancelAction());
+ }
+ </script>
+
+ <JDialog title='Sign on' id='dialog' modal='true' onWindowOpened='dialog.setLocationRelativeTo(demoPanel);
+ passwordField.setText("");'>
+ <Table>
+ <row>
+ <cell>
+ <JLabel text='Username:' displayedMnemonic='U' labelFor='{usernameField}'/>
+ </cell>
+
+ <cell>
+ <JTextField id='usernameField'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell>
+ <JLabel text='Password:' displayedMnemonic='P' labelFor='{passwordField}'/>
+ </cell>
+
+ <cell>
+ <JPasswordField id='passwordField'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1, 0, 6, 6)}'>
+ <JButton id='ok' text='OK' action='{new OKAction()}'/>
+ <JButton text='Cancel' action='{new CancelAction()}'/>
+ </JPanel>
+ </cell>
+ </row>
+ </Table>
+ </JDialog>
+
+ <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <JButton text='Show password dialog' onActionPerformed='dialog.setVisible(true)'/>
+ <VBox>
+ <JLabel text='{username != null ? "Username: " + username : ""}'/>
+ <JLabel text='{password != null ? "Password: " + password : ""}'/>
+ </VBox>
+ </VBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -76,4 +76,4 @@
</cell>
</row>
</Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -41,4 +41,4 @@
</JInternalFrame>
</JDesktopPane>
</JPanel>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,13 +18,13 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <HBox>
- <JLabel text='Password:' displayedMnemonic='P' labelFor='{password}'/>
- <JPasswordField id='password'/>
- </HBox>
-
- <JLabel text='You entered: {new String(password.getPassword())}'/>
- </VBox>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <HBox>
+ <JLabel text='Password:' displayedMnemonic='P' labelFor='{password}'/>
+ <JPasswordField id='password'/>
+ </HBox>
+
+ <JLabel text='You entered: {new String(password.getPassword())}'/>
+ </VBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,80 +18,80 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <script><![CDATA[
- import javax.swing.Timer;
-
- int red = 0;
- int green = 0;
- int blue = 0;
- int speed = 2;
- int redDirection = 1;
- int greenDirection = 1;
- int blueDirection = 1;
-
- Timer redTimer = new Timer(5, new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- red = Math.max(0, Math.min(255, red + speed * redDirection));
- if (red == 0 || red == 255)
- redDirection = -redDirection;
- }
- });
-
- Timer greenTimer = new Timer(50, new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- green = Math.max(0, Math.min(255, green + speed * greenDirection));
- if (green == 0 || green == 255)
- greenDirection = -greenDirection;
- }
- });
-
- Timer blueTimer = new Timer(500, new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- blue = Math.max(0, Math.min(255, blue + speed * blueDirection));
- if (blue == 0 || blue == 255)
- blueDirection = -blueDirection;
- }
- });
-
- redTimer.start();
- greenTimer.start();
- blueTimer.start();
- ]]></script>
-
- <Table insets='6' id='demoPanel'>
- <row>
- <cell columns='3'>
- <JLabel text='Welcome to the JAXX framework!' font='{UIManager.getFont("Label.font").deriveFont(18f)}'
- foreground='{new Color(red, green, blue)}'/>
- </cell>
- </row>
-
- <row>
- <cell columns='3' fill='horizontal'>
- <JProgressBar foreground='{new Color(red, 0, 0)}' value='{red}' maximum='255'/>
- </cell>
- </row>
-
- <row>
- <cell columns='3' fill='horizontal'>
- <JProgressBar foreground='{new Color(0, green, 0)}' value='{green}' maximum='255'/>
- </cell>
- </row>
-
- <row>
- <cell columns='3' fill='horizontal'>
- <JProgressBar foreground='{new Color(0, 0, blue)}' value='{blue}' maximum='255'/>
- </cell>
- </row>
-
- <row>
- <cell weightx='1' anchor='east'>
- <JButton text='Start' onActionPerformed='redTimer.start(); greenTimer.start(); blueTimer.start()'/>
- </cell>
- <cell>
- <JButton text='Stop' onActionPerformed='redTimer.stop(); greenTimer.stop(); blueTimer.stop()'/>
- </cell>
- </row>
- </Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <script><![CDATA[
+ import javax.swing.Timer;
+
+ int red = 0;
+ int green = 0;
+ int blue = 0;
+ int speed = 2;
+ int redDirection = 1;
+ int greenDirection = 1;
+ int blueDirection = 1;
+
+ Timer redTimer = new Timer(5, new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ red = Math.max(0, Math.min(255, red + speed * redDirection));
+ if (red == 0 || red == 255)
+ redDirection = -redDirection;
+ }
+ });
+
+ Timer greenTimer = new Timer(50, new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ green = Math.max(0, Math.min(255, green + speed * greenDirection));
+ if (green == 0 || green == 255)
+ greenDirection = -greenDirection;
+ }
+ });
+
+ Timer blueTimer = new Timer(500, new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ blue = Math.max(0, Math.min(255, blue + speed * blueDirection));
+ if (blue == 0 || blue == 255)
+ blueDirection = -blueDirection;
+ }
+ });
+
+ redTimer.start();
+ greenTimer.start();
+ blueTimer.start();
+ ]]></script>
+
+ <Table insets='6' id='demoPanel'>
+ <row>
+ <cell columns='3'>
+ <JLabel text='Welcome to the JAXX framework!' font='{UIManager.getFont("Label.font").deriveFont(18f)}'
+ foreground='{new Color(red, green, blue)}'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell columns='3' fill='horizontal'>
+ <JProgressBar foreground='{new Color(red, 0, 0)}' value='{red}' maximum='255'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell columns='3' fill='horizontal'>
+ <JProgressBar foreground='{new Color(0, green, 0)}' value='{green}' maximum='255'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell columns='3' fill='horizontal'>
+ <JProgressBar foreground='{new Color(0, 0, blue)}' value='{blue}' maximum='255'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell weightx='1' anchor='east'>
+ <JButton text='Start' onActionPerformed='redTimer.start(); greenTimer.start(); blueTimer.start()'/>
+ </cell>
+ <cell>
+ <JButton text='Stop' onActionPerformed='redTimer.stop(); greenTimer.stop(); blueTimer.stop()'/>
+ </cell>
+ </row>
+ </Table>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,14 +18,14 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <VBox>
- <JRadioButton text='Animal' value='Lynx.jpg' buttonGroup='radioButtons' selected='true'/>
- <JRadioButton text='Vegetable' buttonGroup='radioButtons' value='Tomato.jpg'/>
- <JRadioButton text='Mineral' buttonGroup='radioButtons' value='Amethyst.jpg'/>
- </VBox>
-
- <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/" + radioButtons.getSelectedValue()))}'/>
- </HBox>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <VBox>
+ <JRadioButton text='Animal' value='Lynx.jpg' buttonGroup='radioButtons' selected='true'/>
+ <JRadioButton text='Vegetable' buttonGroup='radioButtons' value='Tomato.jpg'/>
+ <JRadioButton text='Mineral' buttonGroup='radioButtons' value='Amethyst.jpg'/>
+ </VBox>
+
+ <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/" + radioButtons.getSelectedValue()))}'/>
+ </HBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,17 +18,17 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<JMenuItemDemo>
- <JMenuBar id='menuBar'>
- <JMenu text='Font size'>
- <JRadioButtonMenuItem text='10' value='{new Integer(10)}' buttonGroup='fontSize'/>
- <JRadioButtonMenuItem text='12' value='{new Integer(12)}' buttonGroup='fontSize' selected='true'/>
- <JRadioButtonMenuItem text='14' value='{new Integer(14)}' buttonGroup='fontSize'/>
- <JRadioButtonMenuItem text='18' value='{new Integer(18)}' buttonGroup='fontSize'/>
- <JRadioButtonMenuItem text='24' value='{new Integer(24)}' buttonGroup='fontSize'/>
- </JMenu>
- </JMenuBar>
-
- <JLabel id='demoMessage' text='Font size: {fontSize.getSelectedValue()}' horizontalAlignment='center'
- font='{UIManager.getFont("Label.font").deriveFont(fontSize.getSelectedValue() != null ? (float) ((Integer) fontSize.getSelectedValue()).intValue() : 12)}'/>
-</JMenuItemDemo>
\ No newline at end of file
+<JMenuItemDemo>
+ <JMenuBar id='menuBar'>
+ <JMenu text='Font size'>
+ <JRadioButtonMenuItem text='10' value='{new Integer(10)}' buttonGroup='fontSize'/>
+ <JRadioButtonMenuItem text='12' value='{new Integer(12)}' buttonGroup='fontSize' selected='true'/>
+ <JRadioButtonMenuItem text='14' value='{new Integer(14)}' buttonGroup='fontSize'/>
+ <JRadioButtonMenuItem text='18' value='{new Integer(18)}' buttonGroup='fontSize'/>
+ <JRadioButtonMenuItem text='24' value='{new Integer(24)}' buttonGroup='fontSize'/>
+ </JMenu>
+ </JMenuBar>
+
+ <JLabel id='demoMessage' text='Font size: {fontSize.getSelectedValue()}' horizontalAlignment='center'
+ font='{UIManager.getFont("Label.font").deriveFont(fontSize.getSelectedValue() != null ? (float) ((Integer) fontSize.getSelectedValue()).intValue() : 12)}'/>
+</JMenuItemDemo>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,15 +18,15 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <VBox>
- <JSlider id='red' maximum='255' value='200'/>
- <JSlider id='green' maximum='255' value='180'/>
- <JSlider id='blue' maximum='255' value='240'/>
- </VBox>
-
- <JPanel border='{BorderFactory.createEtchedBorder()}' width='64' height='64'
- background='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/>
- </HBox>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <VBox>
+ <JSlider id='red' maximum='255' value='200'/>
+ <JSlider id='green' maximum='255' value='180'/>
+ <JSlider id='blue' maximum='255' value='240'/>
+ </VBox>
+
+ <JPanel border='{BorderFactory.createEtchedBorder()}' width='64' height='64'
+ background='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/>
+ </HBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,16 +18,16 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <JLabel text='Spacing:' displayedMnemonic='S' labelFor='{spinner}'/>
-
- <JSpinner minimum='0' maximum='50' id='spinner'/>
-
- <VBox spacing='{((Integer) spinner.getValue()).intValue()}'>
- <JLabel text='Use the spinner to'/>
- <JLabel text='adjust the spacing'/>
- <JLabel text='between these lines'/>
- </VBox>
- </HBox>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <JLabel text='Spacing:' displayedMnemonic='S' labelFor='{spinner}'/>
+
+ <JSpinner minimum='0' maximum='50' id='spinner'/>
+
+ <VBox spacing='{((Integer) spinner.getValue()).intValue()}'>
+ <JLabel text='Use the spinner to'/>
+ <JLabel text='adjust the spacing'/>
+ <JLabel text='between these lines'/>
+ </VBox>
+ </HBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,16 +18,16 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <JPanel id='demoPanel' layout='{new BorderLayout()}'>
- <JSplitPane>
- <JScrollPane>
- <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Amethyst.jpg"))}'/>
- </JScrollPane>
-
- <JScrollPane>
- <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Lynx.jpg"))}'/>
- </JScrollPane>
- </JSplitPane>
- </JPanel>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <JPanel id='demoPanel' layout='{new BorderLayout()}'>
+ <JSplitPane>
+ <JScrollPane>
+ <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Amethyst.jpg"))}'/>
+ </JScrollPane>
+
+ <JScrollPane>
+ <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Lynx.jpg"))}'/>
+ </JScrollPane>
+ </JSplitPane>
+ </JPanel>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,36 +18,36 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <Table id='demoPanel' anchor='northwest'>
- <row>
- <cell>
- <JLabel text='Normal text:' displayedMnemonic='N' labelFor='{textArea}'/>
- </cell>
-
- <cell weightx='1' fill='both'>
- <JScrollPane height='120'>
- <JTextArea id='textArea' text='Try typing some text here.'/>
- </JScrollPane>
- </cell>
- </row>
-
- <row>
- <cell>
- <JLabel text='Upper case text:'/>
- </cell>
-
- <cell weightx='1' fill='both'>
- <JScrollPane height='120'>
- <JTextArea editable='false' background='{null}' text='{textArea.getText().toUpperCase()}'/>
- </JScrollPane>
- </cell>
- </row>
-
- <row>
- <cell weighty='1'>
- <JPanel/>
- </cell>
- </row>
- </Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <Table id='demoPanel' anchor='northwest'>
+ <row>
+ <cell>
+ <JLabel text='Normal text:' displayedMnemonic='N' labelFor='{textArea}'/>
+ </cell>
+
+ <cell weightx='1' fill='both'>
+ <JScrollPane height='120'>
+ <JTextArea id='textArea' text='Try typing some text here.'/>
+ </JScrollPane>
+ </cell>
+ </row>
+
+ <row>
+ <cell>
+ <JLabel text='Upper case text:'/>
+ </cell>
+
+ <cell weightx='1' fill='both'>
+ <JScrollPane height='120'>
+ <JTextArea editable='false' background='{null}' text='{textArea.getText().toUpperCase()}'/>
+ </JScrollPane>
+ </cell>
+ </row>
+
+ <row>
+ <cell weighty='1'>
+ <JPanel/>
+ </cell>
+ </row>
+ </Table>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,25 +18,25 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <JPanel id='demoPanel'>
- <Table>
- <row>
- <cell>
- <JLabel text='Your name:' displayedMnemonic='n' labelFor='{textField}'/>
- </cell>
-
- <cell>
- <JTextField id='textField'/>
- </cell>
- </row>
-
- <row>
- <cell columns='2'>
- <JButton text='Greet'
- onActionPerformed='JOptionPane.showMessageDialog(demoPanel, "Hello, " + textField.getText() + "!")'/>
- </cell>
- </row>
- </Table>
- </JPanel>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <JPanel id='demoPanel'>
+ <Table>
+ <row>
+ <cell>
+ <JLabel text='Your name:' displayedMnemonic='n' labelFor='{textField}'/>
+ </cell>
+
+ <cell>
+ <JTextField id='textField'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell columns='2'>
+ <JButton text='Greet'
+ onActionPerformed='JOptionPane.showMessageDialog(demoPanel, "Hello, " + textField.getText() + "!")'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,12 +18,12 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
- <JToggleButton text='1' id='one'/>
- <JToggleButton text='2' id='two'/>
- <JToggleButton text='3' id='three'/>
-
- <JLabel text='Total: {(one.isSelected() ? 1 : 0) + (two.isSelected() ? 2 : 0) + (three.isSelected() ? 3 : 0)}'/>
- </HBox>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'>
+ <JToggleButton text='1' id='one'/>
+ <JToggleButton text='2' id='two'/>
+ <JToggleButton text='3' id='three'/>
+
+ <JLabel text='Total: {(one.isSelected() ? 1 : 0) + (two.isSelected() ? 2 : 0) + (three.isSelected() ? 3 : 0)}'/>
+ </HBox>
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -112,4 +112,4 @@
</cell>
</row>
</Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -18,15 +18,15 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
##%*
-->
-<jaxx.demo.DemoPanel>
- <script>int count;</script>
- <JPanel id='demoPanel'>
- <JTextField text='{count}' constraints='BorderLayout.NORTH'/>
- <HBox constraints='BorderLayout.SOUTH'>
- <JButton text='Dec (-)' onActionPerformed='count--'/>
- <JButton text='Reset' onActionPerformed='count = 0'/>
- <JButton text='Inc (+)' onActionPerformed='count++'/>
- </HBox>
- </JPanel>
-
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+<jaxx.demo.DemoPanel>
+ <script>int count;</script>
+ <JPanel id='demoPanel'>
+ <JTextField text='{count}' constraints='BorderLayout.NORTH'/>
+ <HBox constraints='BorderLayout.SOUTH'>
+ <JButton text='Dec (-)' onActionPerformed='count--'/>
+ <JButton text='Reset' onActionPerformed='count = 0'/>
+ <JButton text='Inc (+)' onActionPerformed='count++'/>
+ </HBox>
+ </JPanel>
+
+</jaxx.demo.DemoPanel>
Modified: branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx
===================================================================
--- branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx 2009-10-26 19:08:21 UTC (rev 1600)
+++ branches/jaxx-2.X/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx 2009-10-26 19:11:57 UTC (rev 1601)
@@ -1,6 +1,6 @@
<!--
*##%
- jaxx-demo
+ JAXX Demo
Copyright (C) 2008 - 2009 CodeLutin
This program is free software: you can redistribute it and/or modify
@@ -109,4 +109,4 @@
</cell>
</row>
</Table>
-</jaxx.demo.DemoPanel>
\ No newline at end of file
+</jaxx.demo.DemoPanel>
1
0