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
June 2010
- 2 participants
- 74 discussions
12 Jun '10
Author: tchemit
Date: 2010-06-12 16:22:33 +0200 (Sat, 12 Jun 2010)
New Revision: 1965
Url: http://nuiton.org/repositories/revision/jaxx/1965
Log:
use nuiton-utils 1.3.1 +update headers
Modified:
trunk/pom.xml
trunk/src/site/rst/contractProgramming.rst
trunk/src/site/rst/javaBeans.rst
trunk/src/site/rst/tutos/css.rst
trunk/src/site/rst/tutos/data-binding.rst
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-06-11 09:02:58 UTC (rev 1964)
+++ trunk/pom.xml 2010-06-12 14:22:33 UTC (rev 1965)
@@ -393,7 +393,7 @@
<!-- pour un muli module on doit fixer le projectId -->
<projectId>jaxx</projectId>
- <lutinutil.version>1.3.1-SNAPSHOT</lutinutil.version>
+ <lutinutil.version>1.3.1</lutinutil.version>
<i18n.version>1.2.2</i18n.version>
Modified: trunk/src/site/rst/contractProgramming.rst
===================================================================
--- trunk/src/site/rst/contractProgramming.rst 2010-06-11 09:02:58 UTC (rev 1964)
+++ trunk/src/site/rst/contractProgramming.rst 2010-06-12 14:22:33 UTC (rev 1965)
@@ -1,3 +1,27 @@
+.. -
+.. * #%L
+.. * JAXX
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2008 - 2010 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
=========================
Programmation par contrat
=========================
Modified: trunk/src/site/rst/javaBeans.rst
===================================================================
--- trunk/src/site/rst/javaBeans.rst 2010-06-11 09:02:58 UTC (rev 1964)
+++ trunk/src/site/rst/javaBeans.rst 2010-06-12 14:22:33 UTC (rev 1965)
@@ -1,3 +1,27 @@
+.. -
+.. * #%L
+.. * JAXX
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2008 - 2010 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
------------------------------------
Utilisation des java beans dans JAXX
------------------------------------
Modified: trunk/src/site/rst/tutos/css.rst
===================================================================
--- trunk/src/site/rst/tutos/css.rst 2010-06-11 09:02:58 UTC (rev 1964)
+++ trunk/src/site/rst/tutos/css.rst 2010-06-12 14:22:33 UTC (rev 1965)
@@ -1,23 +1,23 @@
.. -
.. * #%L
.. * JAXX
-.. *
+.. *
.. * $Id$
.. * $HeadURL$
.. * %%
.. * Copyright (C) 2008 - 2010 CodeLutin
.. * %%
.. * This program is free software: you can redistribute it and/or modify
-.. * it under the terms of the GNU Lesser General Public License as
-.. * published by the Free Software Foundation, either version 3 of the
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
.. * License, or (at your option) any later version.
-.. *
+.. *
.. * This program is distributed in the hope that it will be useful,
.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.. * GNU General Lesser Public License for more details.
-.. *
-.. * You should have received a copy of the GNU General Lesser Public
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
.. * License along with this program. If not, see
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
@@ -135,4 +135,4 @@
.. _ce lien: ../jaxx-tutorial-css/jnlp/launch.jnlp
-.. _webstart: ../jaxx-tutorial-css/jnlp-report.html
\ No newline at end of file
+.. _webstart: ../jaxx-tutorial-css/jnlp-report.html
Modified: trunk/src/site/rst/tutos/data-binding.rst
===================================================================
--- trunk/src/site/rst/tutos/data-binding.rst 2010-06-11 09:02:58 UTC (rev 1964)
+++ trunk/src/site/rst/tutos/data-binding.rst 2010-06-12 14:22:33 UTC (rev 1965)
@@ -1,23 +1,23 @@
.. -
.. * #%L
.. * JAXX
-.. *
+.. *
.. * $Id$
.. * $HeadURL$
.. * %%
.. * Copyright (C) 2008 - 2010 CodeLutin
.. * %%
.. * This program is free software: you can redistribute it and/or modify
-.. * it under the terms of the GNU Lesser General Public License as
-.. * published by the Free Software Foundation, either version 3 of the
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
.. * License, or (at your option) any later version.
-.. *
+.. *
.. * This program is distributed in the hope that it will be useful,
.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.. * GNU General Lesser Public License for more details.
-.. *
-.. * You should have received a copy of the GNU General Lesser Public
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
.. * License along with this program. If not, see
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
@@ -127,4 +127,4 @@
.. _ce lien: ../jaxx-tutorial-databinding/jnlp/launch.jnlp
-.. _webstart: ../jaxx-tutorial-databinding/jnlp-report.html
\ No newline at end of file
+.. _webstart: ../jaxx-tutorial-databinding/jnlp-report.html
1
0
r1964 - trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree
by tchemit@users.nuiton.org 11 Jun '10
by tchemit@users.nuiton.org 11 Jun '10
11 Jun '10
Author: tchemit
Date: 2010-06-11 11:02:58 +0200 (Fri, 11 Jun 2010)
New Revision: 1964
Url: http://nuiton.org/repositories/revision/jaxx/1964
Log:
if selection is empty, do nothing
Modified:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxTreeHelper.java
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxTreeHelper.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxTreeHelper.java 2010-06-10 10:34:17 UTC (rev 1963)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxTreeHelper.java 2010-06-11 09:02:58 UTC (rev 1964)
@@ -38,6 +38,7 @@
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -88,6 +89,10 @@
@Override
public void valueChanged(TreeSelectionEvent e) {
+ TreeSelectionModel source = (TreeSelectionModel) e.getSource();
+ if (source.isSelectionEmpty()) {
+ return;
+ }
if (e.getPath() == null) {
return;
}
1
0
r1963 - in trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree: . loadors
by sletellier@users.nuiton.org 10 Jun '10
by sletellier@users.nuiton.org 10 Jun '10
10 Jun '10
Author: sletellier
Date: 2010-06-10 12:34:17 +0200 (Thu, 10 Jun 2010)
New Revision: 1963
Url: http://nuiton.org/repositories/revision/jaxx/1963
Log:
Add override method to renderer component
Modified:
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java 2010-06-10 10:32:59 UTC (rev 1962)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java 2010-06-10 10:34:17 UTC (rev 1963)
@@ -33,6 +33,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
+import java.awt.*;
+
/**
* @author sletellier <letellier(a)codelutin.com>
* @since 2.1
@@ -47,7 +50,7 @@
public JaxxTreeDemoCellRenderer(DecoratorProvider decoratorProvider, JaxxTreeDemoDataProvider provider) {
super.setDataProvider(provider);
- this.decoratorProvider = decoratorProvider;;
+ this.decoratorProvider = decoratorProvider;
}
@Override
@@ -87,4 +90,24 @@
return decorated;
}
+
+ @Override
+ public Component getTreeCellRendererComponent(JTree tree,
+ Object value,
+ boolean sel,
+ boolean expanded,
+ boolean leaf, int row,
+ boolean hasFocus) {
+
+ // get node
+ JaxxTreeDemoNode node = (JaxxTreeDemoNode)value;
+
+ // get text for node
+ String text = getNodeText(node);
+
+ // Render node
+ return super.getTreeCellRendererComponent(tree, text, sel,
+ expanded, leaf,
+ row, hasFocus);
+ }
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java 2010-06-10 10:32:59 UTC (rev 1962)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java 2010-06-10 10:34:17 UTC (rev 1963)
@@ -69,7 +69,7 @@
);
// Create clients category node
- JaxxTreeDemoNode ActorsCategoryNode = new JaxxTreeDemoNode(
+ JaxxTreeDemoNode actorsCategoryNode = new JaxxTreeDemoNode(
String.class,
n_(JaxxTreeDemoHelper.ACTORS_CATEGORY_NODE),
null,
@@ -77,7 +77,7 @@
);
// Add actors nodes to movies node
- moviesNode.add(ActorsCategoryNode);
+ moviesNode.add(actorsCategoryNode);
return moviesNode;
}
1
0
r1962 - trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree
by sletellier@users.nuiton.org 10 Jun '10
by sletellier@users.nuiton.org 10 Jun '10
10 Jun '10
Author: sletellier
Date: 2010-06-10 12:32:59 +0200 (Thu, 10 Jun 2010)
New Revision: 1962
Url: http://nuiton.org/repositories/revision/jaxx/1962
Log:
Remove comment
Modified:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java 2010-06-10 10:09:43 UTC (rev 1961)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java 2010-06-10 10:32:59 UTC (rev 1962)
@@ -119,24 +119,4 @@
return text;
}
-
-// @Override
-// public Component getTreeCellRendererComponent(JTree tree,
-// Object value,
-// boolean sel,
-// boolean expanded,
-// boolean leaf, int row,
-// boolean hasFocus) {
-//
-// // get node
-// N node = (N)value;
-//
-// // get text for node
-// String text = getNodeText(node);
-//
-// // Render node
-// return super.getTreeCellRendererComponent(tree, text, sel,
-// expanded, leaf,
-// row, hasFocus);
-// }
}
1
0
r1961 - trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree
by tchemit@users.nuiton.org 10 Jun '10
by tchemit@users.nuiton.org 10 Jun '10
10 Jun '10
Author: tchemit
Date: 2010-06-10 12:09:43 +0200 (Thu, 10 Jun 2010)
New Revision: 1961
Url: http://nuiton.org/repositories/revision/jaxx/1961
Log:
revert renderer default method
Modified:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java 2010-06-09 13:08:53 UTC (rev 1960)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java 2010-06-10 10:09:43 UTC (rev 1961)
@@ -27,9 +27,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer;
-import java.awt.*;
import java.util.HashMap;
import java.util.Map;
@@ -122,23 +120,23 @@
return text;
}
- @Override
- public Component getTreeCellRendererComponent(JTree tree,
- Object value,
- boolean sel,
- boolean expanded,
- boolean leaf, int row,
- boolean hasFocus) {
-
- // get node
- N node = (N)value;
-
- // get text for node
- String text = getNodeText(node);
-
- // Render node
- return super.getTreeCellRendererComponent(tree, text, sel,
- expanded, leaf,
- row, hasFocus);
- }
+// @Override
+// public Component getTreeCellRendererComponent(JTree tree,
+// Object value,
+// boolean sel,
+// boolean expanded,
+// boolean leaf, int row,
+// boolean hasFocus) {
+//
+// // get node
+// N node = (N)value;
+//
+// // get text for node
+// String text = getNodeText(node);
+//
+// // Render node
+// return super.getTreeCellRendererComponent(tree, text, sel,
+// expanded, leaf,
+// row, hasFocus);
+// }
}
1
0
r1960 - in trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree: . content loadors
by sletellier@users.nuiton.org 09 Jun '10
by sletellier@users.nuiton.org 09 Jun '10
09 Jun '10
Author: sletellier
Date: 2010-06-09 15:08:53 +0200 (Wed, 09 Jun 2010)
New Revision: 1960
Url: http://nuiton.org/repositories/revision/jaxx/1960
Log:
- Update headers
- Add comments
- Refactor ui comportement
Added:
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ContentUI.jaxx
Modified:
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,29 +1,27 @@
<!--
#%L
JAXX :: Demo
-
$Id: FullNavigationTreeDemo.jaxx 1861 2010-04-29 14:16:39Z tchemit $
$HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
%%
Copyright (C) 2008 - 2010 CodeLutin
%%
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation, either version 3 of the
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.
-
- You should have received a copy of the GNU General Lesser Public
+
+ You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
-
<jaxx.demo.DemoPanel>
<CardLayout2 id='contentLayout'/>
@@ -38,6 +36,8 @@
import jaxx.demo.entities.Movie;
import jaxx.demo.entities.People;
import javax.swing.tree.TreePath;
+import java.lang.reflect.Constructor;
+import jaxx.demo.component.jaxx.tree.content.ContentUI;
private JaxxTreeDemoDataProvider dataProvider = new JaxxTreeDemoDataProvider();
private JaxxTreeDemoHelper helper = new JaxxTreeDemoHelper(dataProvider);
@@ -56,6 +56,7 @@
private void $afterCompleteSetup() {
setContextValue(helper);
+ // Creation of selection listener to open ui when tree selection change
TreeSelectionListener selectionListener = new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent event) {
@@ -76,8 +77,11 @@
// Register decorator
DecoratorProvider decoratorProvider = getContextValue(DecoratorProvider.class);
+
+ // Attach renderer
navigation.setCellRenderer(new JaxxTreeDemoCellRenderer(decoratorProvider, dataProvider));
+ // Register tree
helper.setTree(navigation, true, selectionListener);
SwingUtilities.invokeLater(new Runnable() {
@@ -108,56 +112,59 @@
// Actors categorie node
if (JaxxTreeDemoHelper.ACTORS_CATEGORY_NODE.equals(id)) {
- java.util.List<People> peopleList = dataProvider.getPeoples();
- ActorsContentUI ui = getContentIfExist(ActorsContentUI.class);
- String contentName = ActorsContentUI.class.getName();
- if (ui == null) {
- ui = new ActorsContentUI(this);
- content.add(ui, contentName);
- }
- ui.setData(peopleList);
- contentLayout.show(content, contentName);
+ java.util.List<People> peoples = dataProvider.getPeoples();
+ showUI(peoples, ActorsContentUI.class);
// Movies categorie node
} else if (JaxxTreeDemoHelper.MOVIES_CATEGORY_NODE.equals(id)) {
- java.util.List<Movie> movieList = dataProvider.getMovies();
- MoviesContentUI ui = getContentIfExist(MoviesContentUI.class);
- String contentName = MoviesContentUI.class.getName();
- if (ui == null) {
- ui = new MoviesContentUI(this);
- content.add(ui, contentName);
- }
- ui.setData(movieList);
- contentLayout.show(content, contentName);
+ java.util.List<Movie> movies = dataProvider.getMovies();
+ showUI(movies, MoviesContentUI.class);
}
// People node
} else if (editType.equals(People.class)) {
People people = dataProvider.getPeople(id);
+ showUI(people, ActorContentUI.class);
- ActorContentUI ui = getContentIfExist(ActorContentUI.class);
- String contentName = ActorContentUI.class.getName();
- if (ui == null) {
- ui = new ActorContentUI(this);
- content.add(ui, contentName);
- }
- ui.setData(people);
- contentLayout.show(content, contentName);
-
// Movie node
} else if (editType.equals(Movie.class)) {
Movie movie = dataProvider.getMovie(id);
+ showUI(movie, MovieContentUI.class);
+ }
+}
- MovieContentUI ui = getContentIfExist(MovieContentUI.class);
- String contentName = MovieContentUI.class.getName();
- if (ui == null) {
- ui = new MovieContentUI(this);
- content.add(ui, contentName);
+// Create by introspection content ui
+protected <B> void showUI(B bean, Class<? extends ContentUI> uiClass) {
+
+ // Verify if instance is existing
+ ContentUI ui = getContentIfExist(uiClass);
+
+ // Get layout identifier
+ String contentName = uiClass.getName();
+
+ if (ui == null) {
+ try {
+ // Get constructor
+ Constructor<? extends ContentUI> constructor =
+ uiClass.getConstructor(JAXXContext.class);
+
+ // Invoke instance creation
+ ui = constructor.newInstance(this);
+ } catch (Exception eee) {
+ log.error(eee);
+ ErrorDialogUI.showError(eee);
}
- ui.setData(movie);
- contentLayout.show(content, contentName);
+
+ // Add to content panel
+ content.add(ui, contentName);
}
+
+ // Attach bean
+ ui.setData(bean);
+
+ // show ui
+ contentLayout.show(content, contentName);
}
// Get content if exist in content, else return null
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,3 +1,28 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
package jaxx.demo.component.jaxx.tree;
import jaxx.demo.entities.Movie;
@@ -42,6 +67,7 @@
Object toDecorate = null;
+ // People node
if (editType.equals(People.class)) {
toDecorate = getDataProvider().getPeople(id);
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,3 +1,28 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
package jaxx.demo.component.jaxx.tree;
import jaxx.demo.entities.Movie;
@@ -80,7 +105,9 @@
public List<People> getPeoples(String moviesId){
- log.info("Get people for movie " + moviesId);
+ if (log.isDebugEnabled()) {
+ log.debug("Get people for movie " + moviesId);
+ }
return movies.get(moviesId).getActors();
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package jaxx.demo.component.jaxx.tree;
@@ -26,6 +50,7 @@
public TreeModel createTreeModel() {
+ // Create root static node
JaxxTreeDemoNode root = new JaxxTreeDemoNode(
String.class,
"Root node",
@@ -33,6 +58,7 @@
null
);
+ // Create movies category node
JaxxTreeDemoNode moviesCategoryNode = new JaxxTreeDemoNode(
String.class,
n_(MOVIES_CATEGORY_NODE),
@@ -40,6 +66,7 @@
new MoviesNodeLoadors()
);
+ // Create peoples category node
JaxxTreeDemoNode peoplesCategoryNode = new JaxxTreeDemoNode(
String.class,
n_(ACTORS_CATEGORY_NODE),
@@ -47,16 +74,21 @@
new ActorsNodeLoadors()
);
+ // Add to root
root.add(moviesCategoryNode);
root.add(peoplesCategoryNode);
+ // Create model
DefaultTreeModel model = getModel();
if (model == null) {
model = createModel(root);
} else {
model.setRoot(root);
}
+
+ // Populate childs nodes
root.populateChilds(model, getDataProvider());
+
return model;
}
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,3 +1,28 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
package jaxx.demo.component.jaxx.tree;
import jaxx.runtime.swing.tree.JaxxNode;
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,35 +1,29 @@
<!--
#%L
JAXX :: Demo
-
$Id: ActorContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
$HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
%%
Copyright (C) 2008 - 2010 CodeLutin
%%
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation, either version 3 of the
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.
-
- You should have received a copy of the GNU General Lesser Public
+
+ You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
+<ContentUI superGenericType='People'>
-<JSplitPane id='splitPane'
- orientation='{JSplitPane.VERTICAL_SPLIT}'
- resizeWeight='0.5'
- constraints='BorderLayout.CENTER'
- oneTouchExpandable='true'>
-
<script><![CDATA[
import jaxx.demo.entities.*;
@@ -48,25 +42,33 @@
]]></script>
- <People id='data' javaBean='null'/>
+ <JSplitPane id='splitPane'
+ orientation='{JSplitPane.VERTICAL_SPLIT}'
+ resizeWeight='0.5'
+ constraints='BorderLayout.CENTER'
+ oneTouchExpandable='true'>
- <JScrollPane border='{null}'
- horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
- verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.actor.title"))}'
- editable='false'
- font-size='11'
- text='{getContent(getData())}'/>
- </JScrollPane>
+ <People id='data' javaBean='null'/>
- <JScrollPane border='{new TitledBorder("Picture")}'
- horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}'
- verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'
- minimumSize='{SwingUtil.newMinDimension()}'>
+ <JScrollPane border='{null}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JLabel horizontalAlignment='center'
- icon='{getImage(getData())}'/>
+ <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.actor.title"))}'
+ editable='false'
+ font-size='11'
+ text='{getContent(getData())}'/>
+ </JScrollPane>
- </JScrollPane>
+ <JScrollPane border='{new TitledBorder("Picture")}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'
+ minimumSize='{SwingUtil.newMinDimension()}'>
-</JSplitPane>
+ <JLabel horizontalAlignment='center'
+ icon='{getImage(getData())}'/>
+
+ </JScrollPane>
+
+ </JSplitPane>
+</ContentUI>
\ No newline at end of file
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,29 +1,28 @@
<!--
#%L
JAXX :: Demo
-
$Id: ActorsContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
$HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
%%
Copyright (C) 2008 - 2010 CodeLutin
%%
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation, either version 3 of the
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.
-
- You should have received a copy of the GNU General Lesser Public
+
+ You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
-<JPanel layout='{new BorderLayout()}'>
+<ContentUI superGenericType='java.util.List<People>'>
<script><![CDATA[
import jaxx.demo.entities.*;
@@ -56,28 +55,31 @@
protected void selectChild() {
People selected = (People)list.getSelectedValue();
- getContextValue(JaxxTreeDemoHelper.class).selectNode(selected.getId());
+ getHelper().selectNode(selected.getId());
}
]]></script>
<java.util.List id='data' genericType='People' javaBean='null'/>
- <JScrollPane border='{new TitledBorder(_("jaxxdemo.navigation.actors.title"))}'
- constraints='BorderLayout.CENTER'
- columnHeaderView='{toolbar}'
- horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
- verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JList id='list' model='{new DefaultListModel()}'
- cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
- </JScrollPane>
- <JToolBar id='toolbar' constraints='BorderLayout.SOUTH'
- floatable='false'>
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
- onActionPerformed='selectChild()'/>
- <JButton text='jaxxdemo.action.add'/>
- <JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
- </JPanel>
- </JToolBar>
+ <JPanel layout='{new BorderLayout()}'>
-</JPanel>
+ <JScrollPane border='{new TitledBorder(_("jaxxdemo.navigation.actors.title"))}'
+ constraints='BorderLayout.CENTER'
+ columnHeaderView='{toolbar}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
+ <JList id='list' model='{new DefaultListModel()}'
+ cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
+ </JScrollPane>
+ <JToolBar id='toolbar' constraints='BorderLayout.SOUTH'
+ floatable='false'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
+ onActionPerformed='selectChild()'/>
+ <JButton text='jaxxdemo.action.add'/>
+ <JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
+ </JPanel>
+ </JToolBar>
+
+ </JPanel>
+</ContentUI>
\ No newline at end of file
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ContentUI.jaxx (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ContentUI.jaxx 2010-06-09 13:08:53 UTC (rev 1960)
@@ -0,0 +1,42 @@
+<!--
+ #%L
+ JAXX :: Demo
+ $Id: ContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
+ %%
+ Copyright (C) 2008 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<JPanel abstract='true'
+ layout='{new BorderLayout()}'
+ genericType='B extends Object'>
+
+ <script><![CDATA[
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoHelper;
+
+// Get helper in context
+JaxxTreeDemoHelper getHelper() {
+ return getContextValue(JaxxTreeDemoHelper.class);
+}
+
+public abstract B getData();
+
+public abstract void setData(B data);
+ ]]>
+ </script>
+</JPanel>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,34 +1,28 @@
<!--
#%L
JAXX :: Demo
-
$Id: MovieContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
$HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
%%
Copyright (C) 2008 - 2010 CodeLutin
%%
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation, either version 3 of the
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.
-
- You should have received a copy of the GNU General Lesser Public
+
+ You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
-
-<JSplitPane id='splitPane'
- orientation='{JSplitPane.VERTICAL_SPLIT}'
- resizeWeight='0.5'
- constraints='BorderLayout.CENTER'
- oneTouchExpandable='true'>
+<ContentUI superGenericType='Movie'>
<script><![CDATA[
import jaxx.demo.entities.*;
@@ -47,26 +41,33 @@
}
]]></script>
- <Movie id='data' javaBean='null'/>
+ <JSplitPane id='splitPane'
+ orientation='{JSplitPane.VERTICAL_SPLIT}'
+ resizeWeight='0.5'
+ constraints='BorderLayout.CENTER'
+ oneTouchExpandable='true'>
- <JScrollPane border='{null}'
- horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
- verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
-
- <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.movie.title"))}'
- editable='false'
- font-size='11'
- text='{getContent(getData())}'/>
- </JScrollPane>
+ <Movie id='data' javaBean='null'/>
- <JScrollPane border='{new TitledBorder("Picture")}'
- horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}'
- verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'
- minimumSize='{SwingUtil.newMinDimension()}'>
+ <JScrollPane border='{null}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JLabel horizontalAlignment='center'
- icon='{getImage(getData())}'/>
+ <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.movie.title"))}'
+ editable='false'
+ font-size='11'
+ text='{getContent(getData())}'/>
+ </JScrollPane>
- </JScrollPane>
+ <JScrollPane border='{new TitledBorder("Picture")}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'
+ minimumSize='{SwingUtil.newMinDimension()}'>
-</JSplitPane>
\ No newline at end of file
+ <JLabel horizontalAlignment='center'
+ icon='{getImage(getData())}'/>
+
+ </JScrollPane>
+
+ </JSplitPane>
+</ContentUI>
\ No newline at end of file
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,29 +1,28 @@
<!--
#%L
JAXX :: Demo
-
$Id: MoviesContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
$HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
%%
Copyright (C) 2008 - 2010 CodeLutin
%%
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation, either version 3 of the
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.
-
- You should have received a copy of the GNU General Lesser Public
+
+ You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
-<JPanel layout='{new BorderLayout()}'>
+<ContentUI superGenericType='java.util.List<Movie>'>
<script><![CDATA[
import jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer;
@@ -56,32 +55,35 @@
protected void selectChild() {
Movie selected = (Movie)list.getSelectedValue();
- getContextValue(JaxxTreeDemoHelper.class).selectNode(selected.getId());
+ getHelper().selectNode(selected.getId());
}
]]></script>
<java.util.List id='data' genericType='Movie' javaBean='null'/>
- <JScrollPane border='{new TitledBorder(_("jaxxdemo.navigation.movies.title"))}'
- constraints='BorderLayout.CENTER'
- columnHeaderView='{toolbar}'
- horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
- verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
+ <JPanel layout='{new BorderLayout()}'>
- <JList id='list' model='{new DefaultListModel()}'
- cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
+ <JScrollPane border='{new TitledBorder(_("jaxxdemo.navigation.movies.title"))}'
+ constraints='BorderLayout.CENTER'
+ columnHeaderView='{toolbar}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- </JScrollPane>
+ <JList id='list' model='{new DefaultListModel()}'
+ cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
- <JToolBar id='toolbar' opaque='false' constraints='BorderLayout.SOUTH'
- floatable='false'>
+ </JScrollPane>
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
- onActionPerformed='selectChild()'/>
- <JButton text='jaxxdemo.action.add'/>
- <JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
- </JPanel>
- </JToolBar>
+ <JToolBar id='toolbar' opaque='false' constraints='BorderLayout.SOUTH'
+ floatable='false'>
-</JPanel>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
+ onActionPerformed='selectChild()'/>
+ <JButton text='jaxxdemo.action.add'/>
+ <JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
+ </JPanel>
+ </JToolBar>
+
+ </JPanel>
+</ContentUI>
\ No newline at end of file
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,3 +1,28 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
package jaxx.demo.component.jaxx.tree.loadors;
import jaxx.demo.component.jaxx.tree.JaxxTreeDemoNode;
@@ -20,24 +45,27 @@
@Override
public List<People> getData(Class<?> parentClass,
- String parentId,
+ String moviesId,
DataProvider dataProvider) throws Exception {
// Get people for parentId
JaxxTreeDemoDataProvider provider = (JaxxTreeDemoDataProvider) dataProvider;
// If its not root
- if (parentId != null) {
- return provider.getPeoples(parentId);
+ if (moviesId != null) {
+
+ // Return peoples for movies id
+ return provider.getPeoples(moviesId);
}
+ // Return all peoples
return provider.getPeoples();
}
@Override
public JaxxTreeDemoNode createNode(JaxxTreeDemoNode parentNode, People data) {
- // Create actor nodes
+ // Create actor static nodes
JaxxTreeDemoNode actorsNode = new JaxxTreeDemoNode(
getBeanType(),
data.getId(),
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java 2010-06-09 10:15:46 UTC (rev 1959)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java 2010-06-09 13:08:53 UTC (rev 1960)
@@ -1,3 +1,28 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
package jaxx.demo.component.jaxx.tree.loadors;
import jaxx.demo.component.jaxx.tree.JaxxTreeDemoHelper;
@@ -27,13 +52,15 @@
DataProvider dataProvider) throws Exception {
JaxxTreeDemoDataProvider provider = (JaxxTreeDemoDataProvider) dataProvider;
+
+ // Return all movies
return provider.getMovies();
}
@Override
public JaxxTreeDemoNode createNode(JaxxTreeDemoNode parentNode, Movie data) {
- // Create movies nodes
+ // Create movies static nodes
JaxxTreeDemoNode moviesNode = new JaxxTreeDemoNode(
getBeanType(),
data.getId(),
@@ -49,7 +76,7 @@
new ActorsNodeLoadors()
);
- // Add to movies node
+ // Add actors nodes to movies node
moviesNode.add(ActorsCategoryNode);
return moviesNode;
1
0
r1959 - trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application
by tchemit@users.nuiton.org 09 Jun '10
by tchemit@users.nuiton.org 09 Jun '10
09 Jun '10
Author: tchemit
Date: 2010-06-09 12:15:46 +0200 (Wed, 09 Jun 2010)
New Revision: 1959
Url: http://nuiton.org/repositories/revision/jaxx/1959
Log:
use ReflectionUtil api to obtain method
Modified:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionExecutor.java
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionExecutor.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionExecutor.java 2010-06-08 17:36:46 UTC (rev 1958)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionExecutor.java 2010-06-09 10:15:46 UTC (rev 1959)
@@ -26,6 +26,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.ReflectUtil;
import javax.swing.SwingWorker;
import java.beans.PropertyChangeEvent;
@@ -232,31 +233,11 @@
// find method
Class<?> klass = methodContainer.getClass();
- Method mFound = null;
- for (Method m : klass.getDeclaredMethods()) {
- if (!methodName.equals(m.getName())) {
- continue;
- }
- //same method name
-
- Class<?>[] types = m.getParameterTypes();
- if (arguments.length != types.length) {
- continue;
- }
-
- // same number arguments
- mFound = m;
- break;
- }
- if (mFound == null) {
- throw new IllegalArgumentException(
- "could not find method " + methodName + " on type " +
- klass.getName());
- }
-
- //TODO Test arguments are on good type...
-
- final Method targetMethod = mFound;
+ final Method targetMethod= ReflectUtil.getDeclaredMethod(klass,
+ methodName,
+ true,
+ arguments
+ );
targetMethod.setAccessible(true);
Runnable result;
1
0
Author: sletellier
Date: 2010-06-08 19:36:46 +0200 (Tue, 08 Jun 2010)
New Revision: 1958
Url: http://nuiton.org/repositories/revision/jaxx/1958
Log:
- Refactors entities
- Add new tree API demo
Added:
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Identity.java
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java
trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/
trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-error-validation.xml
trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-info-validation.xml
trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-warning-validation.xml
trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-error-validation.xml
trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-info-validation.xml
trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-warning-validation.xml
Removed:
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/Movie.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/People.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java
trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/
Modified:
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java
trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeModelBuilder.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUIHandler.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx
trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties
trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties
trunk/jaxx-demo/src/main/resources/log4j.properties
trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -31,6 +31,7 @@
import jaxx.demo.component.jaxx.editor.I18nEditorDemo;
import jaxx.demo.component.jaxx.editor.NumberEditorDemo;
import jaxx.demo.component.jaxx.navigation.FullNavigationTreeDemo;
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemo;
import jaxx.demo.component.swing.*;
import jaxx.demo.feature.databinding.BeanDataBindingDemo;
import jaxx.demo.feature.databinding.BindingExtremeDemo;
@@ -45,7 +46,6 @@
import jaxx.runtime.context.JAXXContextEntryDef;
import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.ErrorDialogUI;
-import jaxx.runtime.swing.navigation.handler.AbstractNavigationHandler;
import jaxx.runtime.swing.navigation.handler.NavigationHandler;
import jaxx.runtime.swing.navigation.handler.NavigationTreeHandlerWithCardLayout;
import jaxx.runtime.swing.navigation.tree.NavigationTreeHelper;
@@ -119,6 +119,9 @@
addText(n_("jaxxdemo.tree.component.jaxx.tree.navigation")).
addDemo(FullNavigationTreeDemo.class).
goUp().
+ addText(n_("jaxxdemo.tree.component.jaxx.tree")).
+ addDemo(JaxxTreeDemo.class).
+ goUp().
addDemo(BoxedDecoratorDemo.class).
addDemo(StatusMessagePanelDemo.class).
goUp().
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -25,8 +25,8 @@
package jaxx.demo;
-import jaxx.demo.component.jaxx.navigation.Movie;
-import jaxx.demo.component.jaxx.navigation.People;
+import jaxx.demo.entities.Movie;
+import jaxx.demo.entities.People;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.context.DefaultApplicationContext;
import jaxx.runtime.decorator.DecoratorProvider;
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -25,6 +25,8 @@
package jaxx.demo.component.jaxx.navigation;
+import jaxx.demo.entities.Movie;
+import jaxx.demo.entities.People;
import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXObject;
import jaxx.runtime.JAXXUtil;
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeModelBuilder.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeModelBuilder.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeModelBuilder.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -25,6 +25,8 @@
package jaxx.demo.component.jaxx.navigation;
+import jaxx.demo.entities.Movie;
+import jaxx.demo.entities.People;
import jaxx.demo.component.jaxx.navigation.content.ActorContentUI;
import jaxx.demo.component.jaxx.navigation.content.ActorsContentUI;
import jaxx.demo.component.jaxx.navigation.content.MovieContentUI;
Deleted: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/Movie.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/Movie.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/Movie.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -1,133 +0,0 @@
-/*
- * #%L
- * JAXX :: Demo
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package jaxx.demo.component.jaxx.navigation;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-
-/**
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.7.2
- */
-public class Movie {
-
- protected String id;
- protected String title;
- protected String image;
- protected int year;
- protected List<People> actors;
-
- public Movie(String id, String title, int year,String image) {
- this();
- this.id = id;
- this.title = title;
- this.year = year;
- this.image=image;
- }
-
- public Movie() {
- actors = new ArrayList<People>();
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public List<People> getActors() {
- return actors;
- }
-
- public void setActors(List<People> actors) {
- this.actors = actors;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public int getYear() {
- return year;
- }
-
- public void setYear(int year) {
- this.year = year;
- }
-
- public String getImage() {
- return image;
- }
-
- public void setImage(String image) {
- this.image = image;
- }
-
- public void addActor(People actor) {
- actors.add(actor);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Movie other = (Movie) obj;
- if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- int hash = 5;
- hash = 41 * hash + (this.id != null ? this.id.hashCode() : 0);
- return hash;
- }
-
- @Override
- public String toString() {
- ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
- b.append("id", id);
- b.append("title", title);
- b.append("year", year);
- b.append("actors", actors);
- return b.toString();
- }
-}
Deleted: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/People.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/People.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/People.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -1,123 +0,0 @@
-/*
- * #%L
- * JAXX :: Demo
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package jaxx.demo.component.jaxx.navigation;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-
-/**
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.7.2
- */
-public class People {
-
- protected String id;
- protected String image;
- protected String firstName;
- protected String lastName;
- protected int age;
-
- public People(String id, String firstName, String lastName, int age, String image) {
- this.id = id;
- this.firstName = firstName;
- this.lastName = lastName;
- this.age = age;
- this.image = image;
- }
-
- public int getAge() {
- return age;
- }
-
- public void setAge(int age) {
- this.age = age;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public String getImage() {
- return image;
- }
-
- public void setImage(String image) {
- this.image = image;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final People other = (People) obj;
- if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
- return hash;
- }
-
- @Override
- public String toString() {
- ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
- b.append("id", id);
- b.append("firstName", firstName);
- b.append("lastName", lastName);
- b.append("age", age);
- return b.toString();
- }
-}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -28,6 +28,7 @@
<script><![CDATA[
import jaxx.runtime.swing.navigation.tree.NavigationTreeNode;
import jaxx.demo.component.jaxx.navigation.*;
+import jaxx.demo.entities.*;
@Override
public void openUI(NavigationTreeNode node) throws Exception {
@@ -48,8 +49,7 @@
ImageIcon getImage(People data) {
return data == null? null :SwingUtil.createIcon(data.getImage());
}
-]]>
- </script>
+]]></script>
<People id='data' javaBean='null'/>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ActorsContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -27,6 +27,7 @@
<script><![CDATA[
import jaxx.demo.component.jaxx.navigation.*;
+import jaxx.demo.entities.*;
import jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer;
import jaxx.runtime.swing.navigation.tree.NavigationTreeNode;
@@ -49,8 +50,7 @@
DefaultListModel model = (DefaultListModel) list.getModel();
model.removeAllElements();
}
- ]]>
- </script>
+ ]]></script>
<java.util.List id='data' genericType='People' javaBean='null'/>
@@ -59,12 +59,14 @@
columnHeaderView='{toolbar}'
horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JList id='list' model='{new DefaultListModel()}' cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
+ <JList id='list' model='{new DefaultListModel()}'
+ cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
</JScrollPane>
<JToolBar id='toolbar' constraints='BorderLayout.SOUTH'
floatable='false'>
<JPanel layout='{new GridLayout(1,0)}'>
- <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}' onActionPerformed='getHandler().selectChild(this, list.getSelectedIndex())'/>
+ <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
+ onActionPerformed='getHandler().selectChild(this, list.getSelectedIndex())'/>
<JButton text='jaxxdemo.action.add'/>
<JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
</JPanel>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUIHandler.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUIHandler.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/ContentUIHandler.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -26,9 +26,10 @@
package jaxx.demo.component.jaxx.navigation.content;
import java.util.List;
+
+import jaxx.demo.entities.Movie;
+import jaxx.demo.entities.People;
import jaxx.demo.component.jaxx.navigation.FullNavigationTreeHelper;
-import jaxx.demo.component.jaxx.navigation.Movie;
-import jaxx.demo.component.jaxx.navigation.People;
import jaxx.runtime.JAXXContext;
/**
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MovieContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -28,6 +28,7 @@
<script><![CDATA[
import jaxx.runtime.swing.navigation.tree.NavigationTreeNode;
import jaxx.demo.component.jaxx.navigation.*;
+import jaxx.demo.entities.*;
@Override
public void openUI(NavigationTreeNode node) throws Exception {
@@ -48,8 +49,7 @@
ImageIcon getImage(Movie data) {
return data == null? null :SwingUtil.createIcon(data.getImage());
}
-]]>
- </script>
+]]></script>
<Movie id='data' javaBean='null'/>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/content/MoviesContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -29,6 +29,7 @@
import jaxx.demo.component.jaxx.navigation.*;
import jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer;
import jaxx.runtime.swing.navigation.tree.NavigationTreeNode;
+import jaxx.demo.entities.*;
@Override
public void openUI(NavigationTreeNode node) throws Exception {
@@ -36,7 +37,7 @@
log.info("selected movies = "+ms.size());
setData(ms);
if (ms != null) {
- DefaultListModel model = (DefaultListModel) list.getModel();
+ DefaultListModel model = (DefaultListModel) list.getModel();
for (Movie m : ms) {
model.addElement(m);
}
@@ -49,8 +50,7 @@
DefaultListModel model = (DefaultListModel) list.getModel();
model.removeAllElements();
}
- ]]>
- </script>
+ ]]></script>
<java.util.List id='data' genericType='Movie' javaBean='null'/>
@@ -59,12 +59,14 @@
columnHeaderView='{toolbar}'
horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
- <JList id='list' model='{new DefaultListModel()}' cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
+ <JList id='list' model='{new DefaultListModel()}'
+ cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
</JScrollPane>
<JToolBar id='toolbar' opaque='false' constraints='BorderLayout.SOUTH'
floatable='false'>
<JPanel layout='{new GridLayout(1,0)}'>
- <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}' onActionPerformed='getHandler().selectChild(this, list.getSelectedIndex())'/>
+ <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
+ onActionPerformed='getHandler().selectChild(this, list.getSelectedIndex())'/>
<JButton text='jaxxdemo.action.add'/>
<JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
</JPanel>
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,201 @@
+<!--
+ #%L
+ JAXX :: Demo
+
+ $Id: FullNavigationTreeDemo.jaxx 1861 2010-04-29 14:16:39Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
+ %%
+ Copyright (C) 2008 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+
+<jaxx.demo.DemoPanel>
+
+ <CardLayout2 id='contentLayout'/>
+
+ <script><![CDATA[
+
+import jaxx.runtime.decorator.DecoratorProvider;
+import jaxx.demo.component.jaxx.tree.content.ActorContentUI;
+import jaxx.demo.component.jaxx.tree.content.ActorsContentUI;
+import jaxx.demo.component.jaxx.tree.content.MovieContentUI;
+import jaxx.demo.component.jaxx.tree.content.MoviesContentUI;
+import jaxx.demo.entities.Movie;
+import jaxx.demo.entities.People;
+import javax.swing.tree.TreePath;
+
+private JaxxTreeDemoDataProvider dataProvider = new JaxxTreeDemoDataProvider();
+private JaxxTreeDemoHelper helper = new JaxxTreeDemoHelper(dataProvider);
+
+@Override
+protected String[] getSources() {
+ return new String[]{ getDefaultSource(),
+ "JaxxTreeDemoHelper.java",
+ "JaxxTreeDemoNode.java",
+ "JaxxTreeDemoCellRenderer.java",
+ "JaxxTreeDemoDataProvider.java",
+ "loadors/ActorsNodeLoadors.java",
+ "loadors/MoviesNodeLoadors.java"};
+}
+
+private void $afterCompleteSetup() {
+ setContextValue(helper);
+
+ TreeSelectionListener selectionListener = new TreeSelectionListener() {
+ @Override
+ public void valueChanged(TreeSelectionEvent event) {
+ TreePath path = event.getPath();
+ JaxxTreeDemoNode node = (JaxxTreeDemoNode) path.getLastPathComponent();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Select node " + node);
+ }
+
+ // Do nothing for root
+ if (node.isRoot()) {
+ return;
+ }
+ openUI(node);
+ }
+ };
+
+ // Register decorator
+ DecoratorProvider decoratorProvider = getContextValue(DecoratorProvider.class);
+ navigation.setCellRenderer(new JaxxTreeDemoCellRenderer(decoratorProvider, dataProvider));
+
+ helper.setTree(navigation, true, selectionListener);
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ navigation.setSelectionInterval(0, 0);
+ splitPane.resetToPreferredSizes();
+ }
+ });
+
+ // expand the tree
+ SwingUtil.expandTree(navigation);
+
+ // auto-expand node when selected
+ SwingUtil.addExpandOnClickListener(navigation);
+}
+
+protected void openUI(JaxxTreeDemoNode node) {
+
+ // Get node type
+ Class<?> editType = node.getInternalClass();
+ String id = node.getId();
+
+ // If it's category node
+ if (editType.equals(String.class)) {
+
+ // Actors categorie node
+ if (JaxxTreeDemoHelper.ACTORS_CATEGORY_NODE.equals(id)) {
+
+ java.util.List<People> peopleList = dataProvider.getPeoples();
+ ActorsContentUI ui = getContentIfExist(ActorsContentUI.class);
+ String contentName = ActorsContentUI.class.getName();
+ if (ui == null) {
+ ui = new ActorsContentUI(this);
+ content.add(ui, contentName);
+ }
+ ui.setData(peopleList);
+ contentLayout.show(content, contentName);
+
+ // Movies categorie node
+ } else if (JaxxTreeDemoHelper.MOVIES_CATEGORY_NODE.equals(id)) {
+
+ java.util.List<Movie> movieList = dataProvider.getMovies();
+ MoviesContentUI ui = getContentIfExist(MoviesContentUI.class);
+ String contentName = MoviesContentUI.class.getName();
+ if (ui == null) {
+ ui = new MoviesContentUI(this);
+ content.add(ui, contentName);
+ }
+ ui.setData(movieList);
+ contentLayout.show(content, contentName);
+ }
+
+ // People node
+ } else if (editType.equals(People.class)) {
+ People people = dataProvider.getPeople(id);
+
+ ActorContentUI ui = getContentIfExist(ActorContentUI.class);
+ String contentName = ActorContentUI.class.getName();
+ if (ui == null) {
+ ui = new ActorContentUI(this);
+ content.add(ui, contentName);
+ }
+ ui.setData(people);
+ contentLayout.show(content, contentName);
+
+ // Movie node
+ } else if (editType.equals(Movie.class)) {
+ Movie movie = dataProvider.getMovie(id);
+
+ MovieContentUI ui = getContentIfExist(MovieContentUI.class);
+ String contentName = MovieContentUI.class.getName();
+ if (ui == null) {
+ ui = new MovieContentUI(this);
+ content.add(ui, contentName);
+ }
+ ui.setData(movie);
+ contentLayout.show(content, contentName);
+ }
+}
+
+// Get content if exist in content, else return null
+protected <E extends Component> E getContentIfExist(Class<E> uiClass) {
+ String contentName = uiClass.getName();
+ if (log.isDebugEnabled()) {
+ log.debug("Get content if exist " + contentName);
+ }
+ if (!contentLayout.contains(contentName)) {
+ return null;
+ }
+ return (E)contentLayout.getComponent(content, contentName);
+}
+ ]]>
+ </script>
+
+ <JPanel id='demoPanel' layout='{new BorderLayout()}'>
+
+ <JSplitPane id='splitPane'
+ constraints='BorderLayout.CENTER'
+ oneTouchExpandable='true'>
+
+ <JScrollPane border='{null}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_NEVER}'>
+
+ <JTree id="navigation"
+ font-size='11'
+ rootVisible='false'
+ showsRootHandles='false'
+ model='{helper.createTreeModel()}'/>
+
+ </JScrollPane>
+
+ <JPanel id="content" layout="{contentLayout}" />
+
+ </JSplitPane>
+
+ </JPanel>
+
+</jaxx.demo.DemoPanel>
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,64 @@
+package jaxx.demo.component.jaxx.tree;
+
+import jaxx.demo.entities.Movie;
+import jaxx.demo.entities.People;
+import jaxx.runtime.decorator.Decorator;
+import jaxx.runtime.decorator.DecoratorProvider;
+import jaxx.runtime.swing.tree.AbstractJaxxTreeCellRenderer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 2.1
+ */
+public class JaxxTreeDemoCellRenderer extends AbstractJaxxTreeCellRenderer<JaxxTreeDemoNode> {
+
+ /** Logger */
+ protected static final Log log =
+ LogFactory.getLog(JaxxTreeDemoCellRenderer.class);
+
+ protected DecoratorProvider decoratorProvider;
+
+ public JaxxTreeDemoCellRenderer(DecoratorProvider decoratorProvider, JaxxTreeDemoDataProvider provider) {
+ super.setDataProvider(provider);
+ this.decoratorProvider = decoratorProvider;;
+ }
+
+ @Override
+ public JaxxTreeDemoDataProvider getDataProvider() {
+ return (JaxxTreeDemoDataProvider)super.getDataProvider();
+ }
+
+ @Override
+ protected String computeNodeText(JaxxTreeDemoNode node) {
+
+ // Get node type
+ Class<?> editType = node.getInternalClass();
+ String id = node.getId();
+
+ // get decorator
+ Decorator<?> decorator = decoratorProvider.getDecorator(editType);
+
+ Object toDecorate = null;
+
+ if (editType.equals(People.class)) {
+ toDecorate = getDataProvider().getPeople(id);
+
+ // Movie node
+ } else if (editType.equals(Movie.class)) {
+ toDecorate = getDataProvider().getMovie(id);
+ }
+
+ // Get decorated value
+ String decorated = decorator.toString(toDecorate);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Compute text for node " +
+ node + " return " +
+ decorated);
+ }
+
+ return decorated;
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,87 @@
+package jaxx.demo.component.jaxx.tree;
+
+import jaxx.demo.entities.Movie;
+import jaxx.demo.entities.People;
+import jaxx.runtime.swing.tree.DataProvider;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 2.1
+ */
+public class JaxxTreeDemoDataProvider implements DataProvider {
+
+ /**
+ * Logger
+ */
+ static private final Log log = LogFactory.getLog(JaxxTreeDemoDataProvider.class);
+
+ protected Map<String, Movie> movies;
+
+ protected Map<String, People> peoples;
+
+ public JaxxTreeDemoDataProvider() {
+
+ movies = new HashMap<String, Movie>();
+ peoples = new HashMap<String, People>();
+
+ log.info("for " + this);
+ People a = new People("0", "Jack", "Black", 0, "/jaxx/demo/images/jack.jpg");
+ People a2 = new People("1", "Héctor", "Jiménez", 0, "/jaxx/demo/images/hector.jpg");
+ People a3 = new People("2", "Ana", "de la Reguera", 0, "/jaxx/demo/images/ana.jpg");
+
+ Movie m = new Movie("0", "Nacho libre", 1996, "/jaxx/demo/images/nacho.jpg");
+ m.addActor(a);
+ m.addActor(a2);
+ m.addActor(a3);
+
+ Movie m2 = new Movie("1", "Nacho 2", 2009, "/jaxx/demo/images/nacho2.png");
+ m2.addActor(a);
+ m2.addActor(a2);
+
+ movies.put(m.getId(), m);
+ movies.put(m2.getId(), m2);
+
+ peoples.put(a.getId(), a);
+ peoples.put(a2.getId(), a2);
+ peoples.put(a3.getId(), a3);
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return true;
+ }
+
+ public Movie getMovie(String id){
+ return movies.get(id);
+ }
+
+ public People getPeople(String id){
+ return peoples.get(id);
+ }
+
+ public List<Movie> getMovies(){
+ return new ArrayList<Movie>(movies.values());
+ }
+
+ public List<People> getPeoples() {
+ return new ArrayList<People>(peoples.values());
+ }
+
+ public List<People> getPeoples(Movie m){
+ return m.getActors();
+ }
+
+ public List<People> getPeoples(String moviesId){
+
+ log.info("Get people for movie " + moviesId);
+
+ return movies.get(moviesId).getActors();
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,62 @@
+
+package jaxx.demo.component.jaxx.tree;
+
+import jaxx.demo.component.jaxx.tree.loadors.ActorsNodeLoadors;
+import jaxx.demo.component.jaxx.tree.loadors.MoviesNodeLoadors;
+import jaxx.runtime.swing.tree.JaxxTreeHelper;
+
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeModel;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 2.1
+ */
+public class JaxxTreeDemoHelper extends JaxxTreeHelper<JaxxTreeDemoNode> {
+
+ public static String MOVIES_CATEGORY_NODE = "movies";
+ public static String ACTORS_CATEGORY_NODE = "actors";
+
+ public JaxxTreeDemoHelper(JaxxTreeDemoDataProvider provider) {
+ super();
+ setDataProvider(provider);
+ }
+
+ public TreeModel createTreeModel() {
+
+ JaxxTreeDemoNode root = new JaxxTreeDemoNode(
+ String.class,
+ "Root node",
+ null,
+ null
+ );
+
+ JaxxTreeDemoNode moviesCategoryNode = new JaxxTreeDemoNode(
+ String.class,
+ n_(MOVIES_CATEGORY_NODE),
+ null,
+ new MoviesNodeLoadors()
+ );
+
+ JaxxTreeDemoNode peoplesCategoryNode = new JaxxTreeDemoNode(
+ String.class,
+ n_(ACTORS_CATEGORY_NODE),
+ null,
+ new ActorsNodeLoadors()
+ );
+
+ root.add(moviesCategoryNode);
+ root.add(peoplesCategoryNode);
+
+ DefaultTreeModel model = getModel();
+ if (model == null) {
+ model = createModel(root);
+ } else {
+ model.setRoot(root);
+ }
+ root.populateChilds(model, getDataProvider());
+ return model;
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,20 @@
+package jaxx.demo.component.jaxx.tree;
+
+import jaxx.runtime.swing.tree.JaxxNode;
+import jaxx.runtime.swing.tree.JaxxNodeChildLoador;
+
+/**
+ *
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 2.1
+ */
+public class JaxxTreeDemoNode extends JaxxNode<JaxxTreeDemoNode> {
+
+ public JaxxTreeDemoNode(String id) {
+ super(id);
+ }
+
+ public JaxxTreeDemoNode(Class<?> internalClass, String id, String context, JaxxNodeChildLoador<?, JaxxTreeDemoNode> jaxxDemoNodeJaxxNodeChildLoador) {
+ super(internalClass, id, context, jaxxDemoNodeJaxxNodeChildLoador);
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,72 @@
+<!--
+ #%L
+ JAXX :: Demo
+
+ $Id: ActorContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
+ %%
+ Copyright (C) 2008 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+
+<JSplitPane id='splitPane'
+ orientation='{JSplitPane.VERTICAL_SPLIT}'
+ resizeWeight='0.5'
+ constraints='BorderLayout.CENTER'
+ oneTouchExpandable='true'>
+
+ <script><![CDATA[
+import jaxx.demo.entities.*;
+
+String getContent(People data) {
+ if (data == null) {
+ return "no content";
+ }
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(data);
+ return buffer.toString();
+}
+
+ImageIcon getImage(People data) {
+ return data == null? null :SwingUtil.createIcon(data.getImage());
+}
+
+]]></script>
+
+ <People id='data' javaBean='null'/>
+
+ <JScrollPane border='{null}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
+ <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.actor.title"))}'
+ editable='false'
+ font-size='11'
+ text='{getContent(getData())}'/>
+ </JScrollPane>
+
+ <JScrollPane border='{new TitledBorder("Picture")}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'
+ minimumSize='{SwingUtil.newMinDimension()}'>
+
+ <JLabel horizontalAlignment='center'
+ icon='{getImage(getData())}'/>
+
+ </JScrollPane>
+
+</JSplitPane>
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,83 @@
+<!--
+ #%L
+ JAXX :: Demo
+
+ $Id: ActorsContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
+ %%
+ Copyright (C) 2008 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<JPanel layout='{new BorderLayout()}'>
+
+ <script><![CDATA[
+import jaxx.demo.entities.*;
+import jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer;
+import jaxx.runtime.binding.SimpleJAXXObjectBinding;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoHelper;
+
+private void $afterCompleteSetup() {
+
+ addPropertyChangeListener(PROPERTY_DATA, new PropertyChangeListener(){
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ java.util.List<People> ps = getData();
+
+ if (ps != null) {
+ DefaultListModel model = (DefaultListModel) list.getModel();
+ for (People p : ps) {
+ model.addElement(p);
+ }
+ } else {
+ // clean list model
+ DefaultListModel model = (DefaultListModel) list.getModel();
+ model.removeAllElements();
+ }
+ }
+ });
+}
+
+protected void selectChild() {
+ People selected = (People)list.getSelectedValue();
+ getContextValue(JaxxTreeDemoHelper.class).selectNode(selected.getId());
+}
+ ]]></script>
+
+ <java.util.List id='data' genericType='People' javaBean='null'/>
+
+ <JScrollPane border='{new TitledBorder(_("jaxxdemo.navigation.actors.title"))}'
+ constraints='BorderLayout.CENTER'
+ columnHeaderView='{toolbar}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
+ <JList id='list' model='{new DefaultListModel()}'
+ cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
+ </JScrollPane>
+ <JToolBar id='toolbar' constraints='BorderLayout.SOUTH'
+ floatable='false'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
+ onActionPerformed='selectChild()'/>
+ <JButton text='jaxxdemo.action.add'/>
+ <JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
+ </JPanel>
+ </JToolBar>
+
+</JPanel>
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,72 @@
+<!--
+ #%L
+ JAXX :: Demo
+
+ $Id: MovieContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
+ %%
+ Copyright (C) 2008 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+
+<JSplitPane id='splitPane'
+ orientation='{JSplitPane.VERTICAL_SPLIT}'
+ resizeWeight='0.5'
+ constraints='BorderLayout.CENTER'
+ oneTouchExpandable='true'>
+
+ <script><![CDATA[
+import jaxx.demo.entities.*;
+
+String getContent(Movie data) {
+ if (data == null) {
+ return "no content";
+ }
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(data);
+ return buffer.toString();
+}
+
+ImageIcon getImage(Movie data) {
+ return data == null? null :SwingUtil.createIcon(data.getImage());
+}
+]]></script>
+
+ <Movie id='data' javaBean='null'/>
+
+ <JScrollPane border='{null}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
+
+ <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.movie.title"))}'
+ editable='false'
+ font-size='11'
+ text='{getContent(getData())}'/>
+ </JScrollPane>
+
+ <JScrollPane border='{new TitledBorder("Picture")}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'
+ minimumSize='{SwingUtil.newMinDimension()}'>
+
+ <JLabel horizontalAlignment='center'
+ icon='{getImage(getData())}'/>
+
+ </JScrollPane>
+
+</JSplitPane>
\ No newline at end of file
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MoviesContentUI.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,87 @@
+<!--
+ #%L
+ JAXX :: Demo
+
+ $Id: MoviesContentUI.jaxx 1861 2010-04-29 14:16:39Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
+ %%
+ Copyright (C) 2008 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<JPanel layout='{new BorderLayout()}'>
+
+ <script><![CDATA[
+import jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer;
+import jaxx.demo.entities.*;
+import jaxx.runtime.binding.SimpleJAXXObjectBinding;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoHelper;
+
+private void $afterCompleteSetup() {
+
+ addPropertyChangeListener(PROPERTY_DATA, new PropertyChangeListener(){
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ java.util.List<Movie> ms = getData();
+
+ if (ms != null) {
+ DefaultListModel model = (DefaultListModel) list.getModel();
+ for (Movie m : ms) {
+ model.addElement(m);
+ }
+ } else {
+ // clean list model
+ DefaultListModel model = (DefaultListModel) list.getModel();
+ model.removeAllElements();
+ }
+ }
+ });
+}
+
+protected void selectChild() {
+ Movie selected = (Movie)list.getSelectedValue();
+ getContextValue(JaxxTreeDemoHelper.class).selectNode(selected.getId());
+}
+ ]]></script>
+
+ <java.util.List id='data' genericType='Movie' javaBean='null'/>
+
+ <JScrollPane border='{new TitledBorder(_("jaxxdemo.navigation.movies.title"))}'
+ constraints='BorderLayout.CENTER'
+ columnHeaderView='{toolbar}'
+ horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
+ verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
+
+ <JList id='list' model='{new DefaultListModel()}'
+ cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/>
+
+ </JScrollPane>
+
+ <JToolBar id='toolbar' opaque='false' constraints='BorderLayout.SOUTH'
+ floatable='false'>
+
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}'
+ onActionPerformed='selectChild()'/>
+ <JButton text='jaxxdemo.action.add'/>
+ <JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/>
+ </JPanel>
+ </JToolBar>
+
+</JPanel>
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,50 @@
+package jaxx.demo.component.jaxx.tree.loadors;
+
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoNode;
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoDataProvider;
+import jaxx.demo.entities.People;
+import jaxx.runtime.swing.tree.DataProvider;
+import jaxx.runtime.swing.tree.JaxxNodeChildLoador;
+
+import java.util.List;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 2.1
+ */
+public class ActorsNodeLoadors extends JaxxNodeChildLoador<People, JaxxTreeDemoNode> {
+
+ public ActorsNodeLoadors() {
+ super(People.class);
+ }
+
+ @Override
+ public List<People> getData(Class<?> parentClass,
+ String parentId,
+ DataProvider dataProvider) throws Exception {
+
+ // Get people for parentId
+ JaxxTreeDemoDataProvider provider = (JaxxTreeDemoDataProvider) dataProvider;
+
+ // If its not root
+ if (parentId != null) {
+ return provider.getPeoples(parentId);
+ }
+
+ return provider.getPeoples();
+ }
+
+ @Override
+ public JaxxTreeDemoNode createNode(JaxxTreeDemoNode parentNode, People data) {
+
+ // Create actor nodes
+ JaxxTreeDemoNode actorsNode = new JaxxTreeDemoNode(
+ getBeanType(),
+ data.getId(),
+ null,
+ null
+ );
+
+ return actorsNode;
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,57 @@
+package jaxx.demo.component.jaxx.tree.loadors;
+
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoHelper;
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoNode;
+import jaxx.demo.component.jaxx.tree.JaxxTreeDemoDataProvider;
+import jaxx.demo.entities.Movie;
+import jaxx.runtime.swing.tree.DataProvider;
+import jaxx.runtime.swing.tree.JaxxNodeChildLoador;
+
+import java.util.List;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 2.1
+ */
+public class MoviesNodeLoadors extends JaxxNodeChildLoador<Movie, JaxxTreeDemoNode> {
+
+ public MoviesNodeLoadors() {
+ super(Movie.class);
+ }
+
+ @Override
+ public List<Movie> getData(Class<?> parentClass,
+ String parentId,
+ DataProvider dataProvider) throws Exception {
+
+ JaxxTreeDemoDataProvider provider = (JaxxTreeDemoDataProvider) dataProvider;
+ return provider.getMovies();
+ }
+
+ @Override
+ public JaxxTreeDemoNode createNode(JaxxTreeDemoNode parentNode, Movie data) {
+
+ // Create movies nodes
+ JaxxTreeDemoNode moviesNode = new JaxxTreeDemoNode(
+ getBeanType(),
+ data.getId(),
+ null,
+ null
+ );
+
+ // Create clients category node
+ JaxxTreeDemoNode ActorsCategoryNode = new JaxxTreeDemoNode(
+ String.class,
+ n_(JaxxTreeDemoHelper.ACTORS_CATEGORY_NODE),
+ null,
+ new ActorsNodeLoadors()
+ );
+
+ // Add to movies node
+ moviesNode.add(ActorsCategoryNode);
+
+ return moviesNode;
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Identity.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Identity.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Identity.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,128 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id: Identity.java 1847 2010-04-16 12:27:48Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/feat… $
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package jaxx.demo.entities;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+
+public class Identity {
+
+ protected String firstName = "";
+
+ protected String lastName = "";
+
+ protected String email = "dummy(a)codelutin.com";
+
+ protected int age = 51;
+
+ protected File config = new File("/tmp");
+
+ protected File dir = new File("/tmp");
+
+ PropertyChangeSupport p;
+
+ public Identity() {
+ 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 getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public File getConfig() {
+ return config;
+ }
+
+ public File getDir() {
+ return dir;
+ }
+
+ public void setFirstName(String firstName) {
+ String oldFirstName = this.firstName;
+ this.firstName = firstName;
+ p.firePropertyChange("firstName", oldFirstName, firstName);
+ }
+
+ public void setLastName(String lastName) {
+ String oldLastName = this.lastName;
+ this.lastName = lastName;
+ p.firePropertyChange("lastName", oldLastName, lastName);
+ }
+
+ public void setEmail(String email) {
+ String oldEmail = this.email;
+ this.email = email;
+ p.firePropertyChange("email", oldEmail, email);
+ }
+
+ public void setAge(int age) {
+ int oldAge = this.age;
+ this.age = age;
+ p.firePropertyChange("age", oldAge, age);
+ }
+
+ public void setConfig(File config) {
+ File oldConfig = this.config;
+ this.config = config;
+ p.firePropertyChange("config", oldConfig, config);
+ }
+
+ public void setDir(File dir) {
+ File oldDir = this.dir;
+ this.dir = dir;
+ p.firePropertyChange("dir", oldDir, dir);
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,91 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id: Model.java 1847 2010-04-16 12:27:48Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/enti… $
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package jaxx.demo.entities;
+
+import java.beans.*;
+
+public class Model {
+
+ protected String text = "text";
+
+ protected String text2 = "text2";
+
+ protected int ratio = 51;
+
+
+ PropertyChangeSupport p;
+
+ public Model() {
+ 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 String getText2() {
+ return text2;
+ }
+
+ public int getRatio() {
+ return ratio;
+ }
+
+ public void setText(String text) {
+ String oldText = this.text;
+ this.text = text;
+ p.firePropertyChange("text", oldText, text);
+ }
+
+ public void setText2(String text2) {
+ String oldText2 = this.text2;
+ this.text2 = text2;
+ p.firePropertyChange("text2", oldText2, text2);
+ }
+
+ public void setRatio(int ratio) {
+ int oldRatio = this.ratio;
+ this.ratio = ratio;
+ p.firePropertyChange("ratio", oldRatio, ratio);
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,133 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id: Movie.java 1847 2010-04-16 12:27:48Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/enti… $
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package jaxx.demo.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
+/**
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.7.2
+ */
+public class Movie {
+
+ protected String id;
+ protected String title;
+ protected String image;
+ protected int year;
+ protected List<People> actors;
+
+ public Movie(String id, String title, int year,String image) {
+ this();
+ this.id = id;
+ this.title = title;
+ this.year = year;
+ this.image=image;
+ }
+
+ public Movie() {
+ actors = new ArrayList<People>();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public List<People> getActors() {
+ return actors;
+ }
+
+ public void setActors(List<People> actors) {
+ this.actors = actors;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public int getYear() {
+ return year;
+ }
+
+ public void setYear(int year) {
+ this.year = year;
+ }
+
+ public String getImage() {
+ return image;
+ }
+
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ public void addActor(People actor) {
+ actors.add(actor);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Movie other = (Movie) obj;
+ if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 5;
+ hash = 41 * hash + (this.id != null ? this.id.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
+ b.append("id", id);
+ b.append("title", title);
+ b.append("year", year);
+ b.append("actors", actors);
+ return b.toString();
+ }
+}
Added: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java (rev 0)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,123 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ *
+ * $Id: People.java 1847 2010-04-16 12:27:48Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jaxx/trunk/jaxx-demo/src/main/java/jaxx/demo/comp… $
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package jaxx.demo.entities;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
+/**
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.7.2
+ */
+public class People {
+
+ protected String id;
+ protected String image;
+ protected String firstName;
+ protected String lastName;
+ protected int age;
+
+ public People(String id, String firstName, String lastName, int age, String image) {
+ this.id = id;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.age = age;
+ this.image = image;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getImage() {
+ return image;
+ }
+
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final People other = (People) obj;
+ if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
+ b.append("id", id);
+ b.append("firstName", firstName);
+ b.append("lastName", lastName);
+ b.append("age", age);
+ return b.toString();
+ }
+}
Deleted: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -1,128 +0,0 @@
-/*
- * #%L
- * JAXX :: Demo
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package jaxx.demo.feature.validation;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.File;
-
-public class Identity {
-
- protected String firstName = "";
-
- protected String lastName = "";
-
- protected String email = "dummy(a)codelutin.com";
-
- protected int age = 51;
-
- protected File config = new File("/tmp");
-
- protected File dir = new File("/tmp");
-
- PropertyChangeSupport p;
-
- public Identity() {
- 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 getFirstName() {
- return firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public String getEmail() {
- return email;
- }
-
- public int getAge() {
- return age;
- }
-
- public File getConfig() {
- return config;
- }
-
- public File getDir() {
- return dir;
- }
-
- public void setFirstName(String firstName) {
- String oldFirstName = this.firstName;
- this.firstName = firstName;
- p.firePropertyChange("firstName", oldFirstName, firstName);
- }
-
- public void setLastName(String lastName) {
- String oldLastName = this.lastName;
- this.lastName = lastName;
- p.firePropertyChange("lastName", oldLastName, lastName);
- }
-
- public void setEmail(String email) {
- String oldEmail = this.email;
- this.email = email;
- p.firePropertyChange("email", oldEmail, email);
- }
-
- public void setAge(int age) {
- int oldAge = this.age;
- this.age = age;
- p.firePropertyChange("age", oldAge, age);
- }
-
- public void setConfig(File config) {
- File oldConfig = this.config;
- this.config = config;
- p.firePropertyChange("config", oldConfig, config);
- }
-
- public void setDir(File dir) {
- File oldDir = this.dir;
- this.dir = dir;
- p.firePropertyChange("dir", oldDir, dir);
- }
-}
Deleted: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -1,91 +0,0 @@
-/*
- * #%L
- * JAXX :: Demo
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package jaxx.demo.feature.validation;
-
-import java.beans.*;
-
-public class Model {
-
- protected String text = "text";
-
- protected String text2 = "text2";
-
- protected int ratio = 51;
-
-
- PropertyChangeSupport p;
-
- public Model() {
- 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 String getText2() {
- return text2;
- }
-
- public int getRatio() {
- return ratio;
- }
-
- public void setText(String text) {
- String oldText = this.text;
- this.text = text;
- p.firePropertyChange("text", oldText, text);
- }
-
- public void setText2(String text2) {
- String oldText2 = this.text2;
- this.text2 = text2;
- p.firePropertyChange("text2", oldText2, text2);
- }
-
- public void setRatio(int ratio) {
- int oldRatio = this.ratio;
- this.ratio = ratio;
- p.firePropertyChange("ratio", oldRatio, ratio);
- }
-}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -28,6 +28,7 @@
<script><![CDATA[
import static org.nuiton.i18n.I18n.n_;
+import jaxx.demo.entities.*;
import jaxx.runtime.validator.swing.SwingValidatorMessageListRenderer;
import jaxx.runtime.validator.swing.SwingValidatorMessageListModel;
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2010-06-08 17:36:46 UTC (rev 1958)
@@ -28,6 +28,7 @@
<script><![CDATA[
import static org.nuiton.i18n.I18n.n_;
+import jaxx.demo.entities.*;
import jaxx.runtime.validator.swing.SwingValidatorUtil;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties
===================================================================
--- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2010-06-08 17:36:46 UTC (rev 1958)
@@ -197,6 +197,7 @@
jaxxdemo.title.about=About JAXXDemo...
jaxxdemo.tree.component.jaxx=JAXX Components
jaxxdemo.tree.component.jaxx.editor=Editors
+jaxxdemo.tree.component.jaxx.tree=Jaxx tree API
jaxxdemo.tree.component.jaxx.tree.navigation=Navigation trees
jaxxdemo.tree.component.swing=Swing Components
jaxxdemo.tree.component.swing.buttons=Buttons
Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties
===================================================================
--- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2010-06-08 17:36:46 UTC (rev 1958)
@@ -197,6 +197,7 @@
jaxxdemo.title.about=A propos de JAXX Demo...
jaxxdemo.tree.component.jaxx=Composants JAXX
jaxxdemo.tree.component.jaxx.editor=Editeurs
+jaxxdemo.tree.component.jaxx.tree=API JAXX pour les arbres
jaxxdemo.tree.component.jaxx.tree.navigation=Arbre de navigation
jaxxdemo.tree.component.swing=Composants Swing
jaxxdemo.tree.component.swing.buttons=Boutons
Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-error-validation.xml
===================================================================
--- trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-error-validation.xml (rev 0)
+++ trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-error-validation.xml 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,49 @@
+<!DOCTYPE validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+ <field name="firstName">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a firstName.</message>
+ </field-validator>
+ </field>
+ <field name="lastName">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a lastName.</message>
+ </field-validator>
+ </field>
+
+ <field name="email">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a value for email.</message>
+ </field-validator>
+ <field-validator type="email" short-circuit="true">
+ <message>Not a valid e-mail.</message>
+ </field-validator>
+ </field>
+
+ <field name="config">
+ <field-validator type="requiredFile" short-circuit="true">
+ <message>You must enter a value for config.</message>
+ </field-validator>
+ <field-validator type="existingFile" short-circuit="true">
+ <message>The configuration file ${config} does not exist.</message>
+ </field-validator>
+ </field>
+
+ <field name="dir">
+ <field-validator type="requiredFile" short-circuit="true">
+ <message>You must enter a value for dir.</message>
+ </field-validator>
+ <field-validator type="existingDirectory" short-circuit="true">
+ <message>The directory ${dir} does not exist.</message>
+ </field-validator>
+ </field>
+
+ <field name="age">
+ <field-validator type="int">
+ <param name="min">18</param>
+ <message>Your are too young (min ${min} )</message>
+ </field-validator>
+ </field>
+</validators>
\ No newline at end of file
Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-info-validation.xml
===================================================================
--- trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-info-validation.xml (rev 0)
+++ trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-info-validation.xml 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,49 @@
+<!DOCTYPE validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+ <!--field name="firstName">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a firstName.</message>
+ </field-validator>
+ </field>
+ <field name="lastName">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a lastName.</message>
+ </field-validator>
+ </field>
+
+ <field name="email">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a value for email.</message>
+ </field-validator>
+ <field-validator type="email" short-circuit="true">
+ <message>Not a valid e-mail.</message>
+ </field-validator>
+ </field>
+
+ <field name="config">
+ <field-validator type="requiredFile" short-circuit="true">
+ <message>You must enter a value for config.</message>
+ </field-validator>
+ <field-validator type="existingFile" short-circuit="true">
+ <message>The configuration file ${config} does not exist.</message>
+ </field-validator>
+ </field>
+
+ <field name="dir">
+ <field-validator type="requiredFile" short-circuit="true">
+ <message>You must enter a value for dir.</message>
+ </field-validator>
+ <field-validator type="existingDirectory" short-circuit="true">
+ <message>The directory ${dir} does not exist.</message>
+ </field-validator>
+ </field-->
+
+ <field name="age">
+ <field-validator type="int">
+ <param name="min">25</param>
+ <message>You are still young ( old ${min} ) </message>
+ </field-validator>
+ </field>
+</validators>
\ No newline at end of file
Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-warning-validation.xml
===================================================================
--- trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-warning-validation.xml (rev 0)
+++ trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-warning-validation.xml 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,49 @@
+<!DOCTYPE validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+ <!--field name="firstName">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a firstName.</message>
+ </field-validator>
+ </field>
+ <field name="lastName">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a lastName.</message>
+ </field-validator>
+ </field>
+
+ <field name="email">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a value for email.</message>
+ </field-validator>
+ <field-validator type="email" short-circuit="true">
+ <message>Not a valid e-mail.</message>
+ </field-validator>
+ </field>
+
+ <field name="config">
+ <field-validator type="requiredFile" short-circuit="true">
+ <message>You must enter a value for config.</message>
+ </field-validator>
+ <field-validator type="existingFile" short-circuit="true">
+ <message>The configuration file ${config} does not exist.</message>
+ </field-validator>
+ </field>
+
+ <field name="dir">
+ <field-validator type="requiredFile" short-circuit="true">
+ <message>You must enter a value for dir.</message>
+ </field-validator>
+ <field-validator type="existingDirectory" short-circuit="true">
+ <message>The directory ${dir} does not exist.</message>
+ </field-validator>
+ </field-->
+
+ <field name="age">
+ <field-validator type="int">
+ <param name="max">88</param>
+ <message>Info : Your are older than ${max} !</message>
+ </field-validator>
+ </field>
+</validators>
\ No newline at end of file
Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-error-validation.xml
===================================================================
--- trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-error-validation.xml (rev 0)
+++ trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-error-validation.xml 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,35 @@
+<!DOCTYPE validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+ <!-- Field Validators for email field -->
+ <field name="text">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a value for text.</message>
+ </field-validator>
+ </field>
+
+ <field name="text2">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a value for text2.</message>
+ </field-validator>
+ </field>
+
+ <field name="ratio">
+ <field-validator type="int">
+ <param name="min">20</param>
+ <param name="max">50</param>
+ <message>Ratio needs to be between ${min} and ${max}</message>
+ </field-validator>
+ </field>
+
+ <!-- Plain Validator 1 -->
+ <validator type="expression">
+ <param name="expression">text.startsWith("poussin")</param>
+ <message>Email not starts with poussin</message>
+ </validator>
+ <validator type="expression">
+ <param name="expression">text2.startsWith("chemit")</param>
+ <message>Email not starts with chemit</message>
+ </validator>
+</validators>
\ No newline at end of file
Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-info-validation.xml
===================================================================
--- trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-info-validation.xml (rev 0)
+++ trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-info-validation.xml 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,13 @@
+<!DOCTYPE validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+ <!-- Field Validators for email field -->
+ <field name="text">
+ <field-validator type="fieldexpression">
+ <param name="expression"><![CDATA[ text != null && text.length() > 10]]></param>
+ <message>Text should have more than 10 caracters</message>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-warning-validation.xml
===================================================================
--- trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-warning-validation.xml (rev 0)
+++ trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-warning-validation.xml 2010-06-08 17:36:46 UTC (rev 1958)
@@ -0,0 +1,18 @@
+<!DOCTYPE validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+ <!-- Field Validators for email field -->
+ <field name="text">
+ <field-validator type="email" short-circuit="true">
+ <message>Not a valid e-mail for text.</message>
+ </field-validator>
+ </field>
+
+ <field name="text2">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>You must enter a value for text2.</message>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Modified: trunk/jaxx-demo/src/main/resources/log4j.properties
===================================================================
--- trunk/jaxx-demo/src/main/resources/log4j.properties 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/main/resources/log4j.properties 2010-06-08 17:36:46 UTC (rev 1958)
@@ -6,6 +6,7 @@
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n
log4j.logger.jaxx.demo=INFO
+#log4j.logger.jaxx.demo.component.jaxx.tree=DEBUG
#log4j.logger.jaxx.demo.config.DemoConfig=DEBUG
log4j.logger.jaxx.runtime.swing.editor.config=INFO
#log4j.logger.jaxx.runtime.swing.editor.config.model.ConfigUIModelBuilder=DEBUG
Modified: trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java
===================================================================
--- trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java 2010-06-08 17:35:19 UTC (rev 1957)
+++ trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java 2010-06-08 17:36:46 UTC (rev 1958)
@@ -25,8 +25,9 @@
package jaxx.demo;
-import jaxx.demo.feature.validation.Model;
-import jaxx.demo.feature.validation.Identity;
+import jaxx.demo.entities.Identity;
+import jaxx.demo.entities.Model;
+
import java.io.File;
import java.util.Iterator;
import java.util.SortedSet;
1
0
r1957 - trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree
by sletellier@users.nuiton.org 08 Jun '10
by sletellier@users.nuiton.org 08 Jun '10
08 Jun '10
Author: sletellier
Date: 2010-06-08 19:35:19 +0200 (Tue, 08 Jun 2010)
New Revision: 1957
Url: http://nuiton.org/repositories/revision/jaxx/1957
Log:
Add default usage of AbstractJaxxTreeCellRenderer
Modified:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java 2010-06-08 13:35:14 UTC (rev 1956)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/AbstractJaxxTreeCellRenderer.java 2010-06-08 17:35:19 UTC (rev 1957)
@@ -27,7 +27,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer;
+import java.awt.*;
import java.util.HashMap;
import java.util.Map;
@@ -120,4 +122,23 @@
return text;
}
+ @Override
+ public Component getTreeCellRendererComponent(JTree tree,
+ Object value,
+ boolean sel,
+ boolean expanded,
+ boolean leaf, int row,
+ boolean hasFocus) {
+
+ // get node
+ N node = (N)value;
+
+ // get text for node
+ String text = getNodeText(node);
+
+ // Render node
+ return super.getTreeCellRendererComponent(tree, text, sel,
+ expanded, leaf,
+ row, hasFocus);
+ }
}
1
0
r1956 - trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree
by tchemit@users.nuiton.org 08 Jun '10
by tchemit@users.nuiton.org 08 Jun '10
08 Jun '10
Author: tchemit
Date: 2010-06-08 15:35:14 +0200 (Tue, 08 Jun 2010)
New Revision: 1956
Url: http://nuiton.org/repositories/revision/jaxx/1956
Log:
authorize to create childs when no parent is known
Modified:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java 2010-06-08 13:01:04 UTC (rev 1955)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java 2010-06-08 13:35:14 UTC (rev 1956)
@@ -89,21 +89,31 @@
N containerNode = parentNode.getContainerNode();
+ List<O> datas;
if (containerNode == null) {
+ // pas d'ancetre, il doit s'agir d'un premier neoud de données depuis le noeud root
+
+ // recuperation des objets fils (sans connaitre de parent)
+ datas = getData(null,
+ null,
+ source);
+
// on considere que le container est le parent
- containerNode = parentNode;
- }
+// containerNode = parentNode;
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("search data for " + containerNode.getInternalClass() +
+ " : " + containerNode.getId());
+ }
- if (log.isDebugEnabled()) {
- log.debug("search data for " + containerNode.getInternalClass() +
- " : " + containerNode.getId());
+ // recuperation des objets fils
+ datas = getData(containerNode.getInternalClass(),
+ containerNode.getId(),
+ source);
+
}
- // recuperation des objets fils
- List<O> datas = getData(containerNode.getInternalClass(),
- containerNode.getId(),
- source);
if (datas != null && !datas.isEmpty()) {
1
0