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
February 2010
- 3 participants
- 23 discussions
r1741 - in trunk: jaxx-demo/src/main/java/jaxx/demo jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation jaxx-runtime/src/main/java/jaxx/runtime jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation
by sletellier@users.nuiton.org 15 Feb '10
by sletellier@users.nuiton.org 15 Feb '10
15 Feb '10
Author: sletellier
Date: 2010-02-15 17:29:38 +0100 (Mon, 15 Feb 2010)
New Revision: 1741
Removed:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java
Modified:
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java
Log:
Final implementation of NavigationTreeTable :
- remove hack
- NavigationTreeHandler is a TreeSelectionListener and TreeSelectionModel
- adding expandTreeTable and addExpendOnClickListener method for JXTreeTable in swingUtil
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -42,7 +42,6 @@
import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.ErrorDialogUI;
import jaxx.runtime.swing.navigation.*;
-import jaxx.runtime.swing.navigation.NavigationInstanciationStrategy;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.nuiton.i18n.I18n.n_;
@@ -149,7 +148,7 @@
handler = new NavigationTreeHandlerWithCardLayout(
getPrefix(),
context,
- NavigationInstanciationStrategy.PER_UI_TYPE) {
+ NavigationTreeHandler.Strategy.PER_UI_TYPE) {
private static final long serialVersionUID = 1L;
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-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -27,7 +27,6 @@
import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.ErrorDialogUI;
import jaxx.runtime.swing.navigation.*;
-import jaxx.runtime.swing.navigation.NavigationInstanciationStrategy;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -123,7 +122,7 @@
handler = new NavigationTreeHandlerWithCardLayout(
getPrefix(),
context,
- NavigationInstanciationStrategy.PER_UI_TYPE) {
+ NavigationTreeHandler.Strategy.PER_UI_TYPE) {
private static final long serialVersionUID = 1L;
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -36,7 +36,7 @@
import java.io.InputStream;
import java.util.List;
import javax.swing.*;
-import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.*;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
@@ -55,12 +55,11 @@
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Properties;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.TreeSelectionListener;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
+import jaxx.runtime.swing.navigation.NavigationTreeNode;
import jaxx.runtime.swing.renderer.BooleanCellRenderer;
import jaxx.runtime.swing.renderer.EmptyNumberTableCellRenderer;
import jaxx.runtime.swing.renderer.EnumTableCellRenderer;
@@ -70,6 +69,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.jxlayer.JXLayer;
+import org.jdesktop.swingx.JXTreeTable;
/**
* The runtime swing util class with some nice stuff.
@@ -793,6 +793,26 @@
}
/**
+ * Expand all childs of a tree table.
+ *
+ * FIXME : Voir pour enlever le copier coller
+ *
+ * @param treeTable the tree to expand
+ */
+ public static void expandTreeTable(final JXTreeTable treeTable) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ int i = 0;
+ while (i < treeTable.getRowCount()) {
+ treeTable.expandRow(i++);
+ }
+ }
+ });
+ }
+
+ /**
* Add a listener of tree selection model to expand a new selected node
* when it is selected.
*
@@ -826,6 +846,41 @@
}
/**
+ * Add a listener of tree table selection model to expand a new selected node
+ * when it is selected.
+ *
+ * FIXME : Voir pour enlever le copier coller
+ *
+ * @param treeTable the tree to treate
+ */
+ public static void addExpandOnClickListener(final JXTreeTable treeTable) {
+
+ treeTable.addTreeSelectionListener(new TreeSelectionListener() {
+
+ @Override
+ public void valueChanged(final TreeSelectionEvent e) {
+ TreeNode node = (TreeNode) e.getPath().getLastPathComponent();
+ if (node != null && !node.isLeaf()) {
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ for (TreePath path : e.getPaths()) {
+ if (e.isAddedPath(path) && !treeTable.isExpanded(path)) {
+ log.info("expand node [" + path + "]");
+ // will expand the node
+ treeTable.expandPath(path);
+ }
+ }
+ }
+ });
+ }
+ }
+ });
+ }
+
+ /**
* Set the width of the given component
*
* @param component the component to resize
Deleted: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -1,45 +0,0 @@
-/*
- * *##%
- * JAXX Runtime
- * Copyright (C) 2008 - 2009 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * ##%*
- */
-package jaxx.runtime.swing.navigation;
-
-import jaxx.runtime.JAXXContext;
-
-/**
- * Interface to create an handler of a navigation tree.
- *
- * @author sletellier
- * @since 2.0.0
- */
-public interface NavigationHandler {
-
- /**
- * To get the context will be used by handler
- * @return {@link JAXXContext} to use
- */
- public JAXXContext getContext();
-
- /**
- * To get helper will be used by handler
- * @return {@link NavigationTreeContextHelper} to use
- */
- public NavigationTreeContextHelper getContextHelper();
-
-}
Deleted: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -1,33 +0,0 @@
-package jaxx.runtime.swing.navigation;
-
-/**
- * Strategy of instanciation of ui.
- * <p/>
- * For a given {@code node}, the method {@link #getId(jaxx.runtime.swing.navigation.NavigationTreeNode)}
- * returns the id of ui to use.
- */
-public enum NavigationInstanciationStrategy {
-
- /**
- * instanciate a ui for a node
- */
- PER_NODE {
-
- @Override
- public String getId(NavigationTreeNode node) {
- return node.getFullPath();
- }
- },
- /**
- * instanciate only one a ui for a type,nodes will share the instanciation
- */
- PER_UI_TYPE {
-
- @Override
- public String getId(NavigationTreeNode node) {
- return node.getUIClass().getName();
- }
- };
-
- public abstract String getId(NavigationTreeNode node);
-}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -66,7 +66,7 @@
protected JAXXContextEntryDef<Object> selectedBeanContextEntry;
protected JAXXContextEntryDef<NavigationTreeNode> selectedNodeContextEntry;
protected JAXXContextEntryDef<NavigationModel> modelContextEntry;
- protected JAXXContextEntryDef<NavigationHandler> handlerContextEntry;
+ protected JAXXContextEntryDef<NavigationTreeHandler> handlerContextEntry;
protected JAXXContextEntryDef<JTree> treeContextEntry;
protected JAXXContextEntryDef<JXTreeTable> treeTableContextEntry;
// protected JAXXContextEntryDef<Component> selectedUIContextEntry;
@@ -76,7 +76,7 @@
treeContextEntry = JAXXUtil.newContextEntryDef(prefix + "-tree", JTree.class);
treeTableContextEntry = JAXXUtil.newContextEntryDef(prefix + "-tree-table", JXTreeTable.class);
modelContextEntry = JAXXUtil.newContextEntryDef(prefix + "-model", NavigationModel.class);
- handlerContextEntry = JAXXUtil.newContextEntryDef(prefix + "-handler", NavigationHandler.class);
+ handlerContextEntry = JAXXUtil.newContextEntryDef(prefix + "-handler", NavigationTreeHandler.class);
selectedBeanContextEntry = JAXXUtil.newContextEntryDef(prefix + "-selected-bean", Object.class);
selectedNodeContextEntry = JAXXUtil.newContextEntryDef(prefix + "-selected-node", NavigationTreeNode.class);
selectedPathContextEntry = JAXXUtil.newContextEntryDef(prefix + "-selected-path", String.class);
@@ -111,14 +111,8 @@
return null;
}
- /**
- * @deprecated please use {@link #getHandler(JAXXContext)}, will be remove soon
- * @param context
- * @return handler
- */
- @Deprecated
- public NavigationHandler getTreeHandler(JAXXContext context) {
- NavigationHandler r = getTreeHandlerContextEntry().getContextValue(context);
+ public NavigationTreeHandler getTreeHandler(JAXXContext context) {
+ NavigationTreeHandler r = getTreeHandlerContextEntry().getContextValue(context);
return r;
}
@@ -164,20 +158,10 @@
getTreeTableContextEntry().setContextValue(context, treeTable);
}
- /**
- * @deprecated please use {@link #setHandler(JAXXContext, NavigationHandler)}, will be remove soon
- * @param context
- * @param handler
- */
- @Deprecated
- public void setTreeHandler(JAXXContext context, NavigationHandler handler) {
+ public void setTreeHandler(JAXXContext context, NavigationTreeHandler handler) {
getTreeHandlerContextEntry().setContextValue(context, handler);
}
- public void setHandler(JAXXContext context, NavigationHandler handler) {
- getHandlerContextEntry().setContextValue(context, handler);
- }
-
public void setSelectedPath(JAXXContext context, String path) {
if (path == null) {
getSelectedPathContextEntry().removeContextValue(context);
@@ -214,15 +198,10 @@
return modelContextEntry;
}
- @Deprecated
- protected JAXXContextEntryDef<NavigationHandler> getTreeHandlerContextEntry() {
+ protected JAXXContextEntryDef<NavigationTreeHandler> getTreeHandlerContextEntry() {
return handlerContextEntry;
}
- public JAXXContextEntryDef<NavigationHandler> getHandlerContextEntry() {
- return handlerContextEntry;
- }
-
protected JAXXContextEntryDef<Object> getSelectedBeanContextEntry() {
return selectedBeanContextEntry;
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -42,7 +42,7 @@
* @author tony
* @since 1.7.2
*/
-public abstract class NavigationTreeHandler extends DefaultTreeSelectionModel implements NavigationHandler{
+public abstract class NavigationTreeHandler extends DefaultTreeSelectionModel implements TreeSelectionListener{
private static final long serialVersionUID = 1L;
/**
@@ -51,13 +51,44 @@
static private final Log log = LogFactory.getLog(NavigationTreeHandler.class);
/**
+ * Strategy of instanciation of ui.
+ * <p/>
+ * For a given {@code node}, the method {@link #getId(NavigationTreeNode)}
+ * returns the id of ui to use.
+ */
+ public enum Strategy {
+
+ /**
+ * instanciate a ui for a node
+ */
+ PER_NODE {
+
+ @Override
+ public String getId(NavigationTreeNode node) {
+ return node.getFullPath();
+ }
+ },
+ /**
+ * instanciate only one a ui for a type,nodes will share the instanciation
+ */
+ PER_UI_TYPE {
+
+ @Override
+ public String getId(NavigationTreeNode node) {
+ return node.getUIClass().getName();
+ }
+ };
+
+ public abstract String getId(NavigationTreeNode node);
+ }
+ /**
* UI which contains navigation tree
*/
protected JAXXContext context;
/**
* UI Instanciation strategy
*/
- protected NavigationInstanciationStrategy strategy;
+ protected Strategy strategy;
/**
* JAXXContext access helper.
@@ -66,22 +97,25 @@
*/
protected NavigationTreeContextHelper contextHelper;
- protected NavigationTreeHandler(String contextPrefix, JAXXObject context, NavigationInstanciationStrategy strategy) {
+ protected NavigationTreeHandler(String contextPrefix, JAXXObject context, Strategy strategy) {
this.contextHelper = new NavigationTreeContextHelper(contextPrefix);
this.context = context;
this.strategy = strategy;
- addTreeSelectionListener(new TreeSelectionListener() {
+ addTreeSelectionListener(this);
+ }
- @Override
- public void valueChanged(TreeSelectionEvent event) {
- if (event.getOldLeadSelectionPath() != null && event.getOldLeadSelectionPath().equals(event.getPath())) {
- // do not treate this if no path changed
- return;
- }
- NavigationTreeNode node = (NavigationTreeNode) event.getPath().getLastPathComponent();
- selectNodeUI(node);
- }
- });
+ @Override
+ public void valueChanged(TreeSelectionEvent event) {
+ if (log.isDebugEnabled()){
+ log.debug("Value changed for path : " + event.getPath());
+ log.debug("Old lead selection path : " + event.getOldLeadSelectionPath());
+ }
+ if (event.getOldLeadSelectionPath() != null && event.getOldLeadSelectionPath().equals(event.getPath())) {
+ // do not treate this if no path changed
+ return;
+ }
+ NavigationTreeNode node = (NavigationTreeNode) event.getPath().getLastPathComponent();
+ selectNodeUI(node);
}
/**
@@ -133,16 +167,10 @@
*/
protected abstract void treateError(Exception e);
- /**
- * {@see NavigationHandler#getContext()
- **/
public JAXXContext getContext() {
return context;
}
- /**
- * {@see NavigationHandler#getContextHelper()
- **/
public NavigationTreeContextHelper getContextHelper() {
return contextHelper;
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -61,7 +61,7 @@
*/
protected abstract CardLayout2 getContentLayout();
- public NavigationTreeHandlerWithCardLayout(String contextPrefix, JAXXObject context, NavigationInstanciationStrategy strategy) {
+ public NavigationTreeHandlerWithCardLayout(String contextPrefix, JAXXObject context, Strategy strategy) {
super(contextPrefix, context, strategy);
if (getContentContainer() == null) {
throw new IllegalArgumentException("could not have a null 'contentContainer' in ui " + context);
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -62,7 +62,7 @@
* @param context the context to associate with fresh handler
* @return the new handler
*/
- public abstract NavigationHandler createTreeHandler(JAXXObject context);
+ public abstract NavigationTreeHandler createTreeHandler(JAXXObject context);
public NavigationTreeHelper(String contextPrefix) {
super(contextPrefix);
@@ -141,7 +141,15 @@
log.debug(node);
}
TreePath path = new TreePath(navigationModel.getPathToRoot(node));
- JTree tree = getSafeTree(context);
+ JTree tree = getTree(context);
+ if (tree == null){
+ // FIXME : Refactor in other helper ?
+ // If its JXTreeTable
+ JXTreeTable treeTable = getSafeTreeTable(context);
+ treeTable.getTreeSelectionModel().setSelectionPath(path);
+ treeTable.scrollPathToVisible(path);
+ return;
+ }
tree.setSelectionPath(path);
tree.scrollPathToVisible(path);
}
Deleted: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -1,253 +0,0 @@
-/*
- * *##%
- * JAXX Runtime
- * Copyright (C) 2008 - 2009 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * ##%*
- */
-package jaxx.runtime.swing.navigation;
-
-import jaxx.runtime.JAXXAction;
-import jaxx.runtime.JAXXContext;
-import jaxx.runtime.JAXXObject;
-import jaxx.runtime.context.JAXXInitialContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.*;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-import java.awt.*;
-
-/**
- * The handler of a navigation tree table.
- *
- * This is also the selection model to use, since we must check before moving
- * from a node we can not just listen selection model changed, we must control
- * it.
- *
- * TODO : Chercher une solution pour limiter le copier/coller.... @see {NavigationTreeHandler}
- *
- * @author sletellier
- * @since 2.0.0
- */
-public abstract class NavigationTreeTableHandler extends DefaultListSelectionModel implements NavigationHandler {
-
- private static final long serialVersionUID = 1L;
- /**
- * Logger
- */
- static private final Log log = LogFactory.getLog(NavigationTreeTableHandler.class);
-
- /**
- * UI which contains navigation tree
- */
- protected JAXXContext context;
- /**
- * UI Instanciation strategy
- */
- protected NavigationInstanciationStrategy strategy;
- /**
- * JAXXContext access helper.
- *
- * @since 1.7.2
- */
- protected NavigationTreeContextHelper contextHelper;
-
- protected NavigationTreeTableHandler(String contextPrefix, final JAXXObject context, NavigationInstanciationStrategy strategy, TreeSelectionModel selectModel) {
- this.contextHelper = new NavigationTreeContextHelper(contextPrefix);
- this.context = context;
- this.strategy = strategy;
- addListSelectionListener(new ListSelectionListener(){
- @Override
- public void valueChanged(ListSelectionEvent event) {
- log.info("Value changed old : " + event.getFirstIndex() + " last " + event.getLastIndex() + " source " + event.getSource());
- if (event.getSource() == null || !event.getValueIsAdjusting()) {
- // do not treate this if no path changed
- return;
- }
-
- // FIXME : event.getSource devrais retourner le navigationTreeNode....
- NavigationTreeNode node = (NavigationTreeNode) contextHelper.getTreeTable(context).getModel().getValueAt(event.getLastIndex(), 0);
- selectNodeUI(node);
- }
- });
- }
-
- /**
- * @return le modèle de navigation associé
- */
- protected abstract NavigationModel getNavigationTreeModel();
-
- /**
- * @return le composent actuellement visible associé au noeud courant ou
- * au noeud précédent lors d'un changement de noeud.
- */
- protected abstract Component getCurrentUI();
-
- /**
- * @param node le noeud associé à l'ui à retrouver
- * @return l'ui associé au novueau noeud sélectionné
- */
- protected abstract Component getUI(NavigationTreeNode node);
-
- /**
- * @param component le composent actuellement visible
- * @return <code>true</code> si le composent a bien été fermé, <code>false</code> sinon
- * @throws Exception if any
- */
- protected abstract boolean closeUI(Component component) throws Exception;
-
- /**
- * Instancie une nouvelle ui associé à un noeud de l'arbre de navigation
- *
- * @param node le noeud associé à l'ui à créer
- * @return la nouvelle ui associée au noeud
- * @throws Exception if any
- */
- protected abstract Component createUI(NavigationTreeNode node) throws Exception;
-
- /**
- * Ouvre l'ui associée au noeud sélectionné dans l'arbre de navigation.
- *
- * @param newUI l'ui associé au noeud sélectionné à ouvrir
- * @param node le node de l'ui a ouvrir
- * @throws Exception if any
- */
- protected abstract void openUI(Component newUI, NavigationTreeNode node) throws Exception;
-
- /**
- * Traitement des exceptions.
- *
- * @param e l'erreur recontrée (ou null si pas d"erreur)
- */
- protected abstract void treateError(Exception e);
-
- /**
- * @see NavigationHandler#getContext()
- */
- public JAXXContext getContext() {
- return context;
- }
-
- /**
- * @see NavigationHandler#getContextHelper()
- */
- public NavigationTreeContextHelper getContextHelper() {
- return contextHelper;
- }
-
- protected void selectNodeUI(NavigationTreeNode node) {
-
- try {
-
- String path = node.getFullPath();
-
- if (log.isTraceEnabled()) {
- log.trace(path);
- }
-
- Component newUI = getUI(node);
-
- // now, we are free to open the ui associated with the selected node in navigation
-
- // get the bean associated with the node
- Object data = getNavigationTreeModel().getBean(path);
-
- // save it in context (must be done before init ui)
- addSelectedBeanInContext(node, data);
-
- if (newUI == null) {
-
- // a new ui instance is required
- newUI = createUI(node);
- }
-
- JAXXContext ctxt = getContext();
- NavigationTreeContextHelper helper = getContextHelper();
-
- // save in context current node context path
- helper.setSelectedPath(ctxt, node.getFullPath());
-
- // save in context current node
- helper.setSelectedNode(ctxt, node);
-
- // save in context current ui
-// helper.setSelectedUI(ctxt, newUI);
-
- // really open the ui associated with the selected node
- // init ui before to be visible
- if (newUI instanceof NavigationContentUI) {
- ((NavigationContentUI) newUI).openUI(node);
- }
-
- // set ui in content
- openUI(newUI, node);
-
- } catch (Exception e) {
- // remove data from context
-
- // if any error, go back to previvous node
- treateError(e);
- }
- }
-
- /**
- * Prepare le context a utiliser pour initialiser une nouvelle ui.
- *
- * @param node le noeud associé à l'ui à créer
- * @return le context à utiliser pour instancier l'ui
- * @throws Exception if any
- */
- protected JAXXContext createUIContext(NavigationTreeNode node) throws Exception {
-
- if (node.getUIHandlerClass() == null) {
- if (log.isWarnEnabled()) {
- log.warn("no action associated with ui " + node.getUIClass());
- }
- // no action associated, just
- return getContext();
- }
-
- JAXXAction action = node.getUIHandlerClass().newInstance();
-
- // init context with
- JAXXInitialContext uiContext = action.init(getContext());
- return uiContext;
- }
-
- protected void addSelectedBeanInContext(NavigationTreeNode node, Object data) {
-
- if (log.isDebugEnabled()) {
- log.debug("find data for contextPath <" + node.getFullPath() + "> : " + (data == null ? null : data.getClass()));
- }
- JAXXContext ctxt = getContext();
- NavigationTreeContextHelper helper = getContextHelper();
-
- // remove previous selected bean
- //TODO-TC-20091004 should have an automatic clean context method while
- helper.setSelectedBean(ctxt, null);
-
- if (data != null) {
-
- helper.setSelectedBean(ctxt, data);
- }
- }
-}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java 2010-02-15 12:35:35 UTC (rev 1740)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java 2010-02-15 16:29:38 UTC (rev 1741)
@@ -103,8 +103,8 @@
* nodesWereRemoved to create the appropriate event. This is the preferred
* way to remove a node as it handles the event creation for you.
*/
- public void removeNodeFromParent(MutableTreeNode node) {
- MutableTreeTableNode parent = (MutableTreeTableNode) node.getParent();
+ public void removeNodeFromParent(NavigationTreeNode node) {
+ NavigationTreeTableNode parent = (NavigationTreeTableNode)node.getParent();
if (parent == null) {
throw new IllegalArgumentException("node does not have a parent.");
1
0
r1740 - in trunk: jaxx-demo/src/main/java/jaxx/demo jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation jaxx-demo/src/main/resources/i18n jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation
by sletellier@users.nuiton.org 15 Feb '10
by sletellier@users.nuiton.org 15 Feb '10
15 Feb '10
Author: sletellier
Date: 2010-02-15 13:35:35 +0100 (Mon, 15 Feb 2010)
New Revision: 1740
Added:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java
Modified:
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java
trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java
Log:
Refactor Stratgie inner class to NavigationInstanciationStrategy class
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-02-12 18:49:48 UTC (rev 1739)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-02-15 12:35:35 UTC (rev 1740)
@@ -42,7 +42,7 @@
import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.ErrorDialogUI;
import jaxx.runtime.swing.navigation.*;
-import jaxx.runtime.swing.navigation.NavigationTreeHandler.Strategy;
+import jaxx.runtime.swing.navigation.NavigationInstanciationStrategy;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.nuiton.i18n.I18n.n_;
@@ -149,7 +149,7 @@
handler = new NavigationTreeHandlerWithCardLayout(
getPrefix(),
context,
- Strategy.PER_UI_TYPE) {
+ NavigationInstanciationStrategy.PER_UI_TYPE) {
private static final long serialVersionUID = 1L;
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-02-12 18:49:48 UTC (rev 1739)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/FullNavigationTreeHelper.java 2010-02-15 12:35:35 UTC (rev 1740)
@@ -26,11 +26,8 @@
import jaxx.runtime.context.JAXXContextEntryDef;
import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.ErrorDialogUI;
-import jaxx.runtime.swing.navigation.NavigationTreeHandler;
-import jaxx.runtime.swing.navigation.NavigationTreeHandler.Strategy;
-import jaxx.runtime.swing.navigation.NavigationTreeHandlerWithCardLayout;
-import jaxx.runtime.swing.navigation.NavigationTreeHelper;
-import jaxx.runtime.swing.navigation.NavigationTreeModel;
+import jaxx.runtime.swing.navigation.*;
+import jaxx.runtime.swing.navigation.NavigationInstanciationStrategy;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -126,7 +123,7 @@
handler = new NavigationTreeHandlerWithCardLayout(
getPrefix(),
context,
- Strategy.PER_UI_TYPE) {
+ NavigationInstanciationStrategy.PER_UI_TYPE) {
private static final long serialVersionUID = 1L;
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-02-12 18:49:48 UTC (rev 1739)
+++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2010-02-15 12:35:35 UTC (rev 1740)
@@ -20,7 +20,7 @@
Blue=Bleu
Blue\:=bleu \:
Bold=En gras
-Button\ label\:=Libell\u00e9 de l'action
+Button\ label\:=Libell\u00E9 de l'action
C=C
CE=CE
Cancel=Annuler
@@ -34,12 +34,12 @@
Editable=Editable
Email\ Address\:=Courriel
Email\:=Courriel
-Enabled=Activ\u00e9
+Enabled=Activ\u00E9
EnumEditor\ (country)\ \:=Editeur de pays
EnumEditor\ (language)\ \:=Editeur de langue
Fancy\ Button=Bouton 'Fancy'
-First\ Name\:=Pr\u00e9nom
-FirstName\:=Pr\u00e9nom \:
+First\ Name\:=Pr\u00E9nom
+FirstName\:=Pr\u00E9nom \:
Font\ size=Taille de la police
Font\ size\:\ =
Fool\ me\ once=
@@ -48,7 +48,7 @@
Green\:=Vert \:
Greet=
Help=
-Inc\ (+)=Incr\u00e9menter (+)
+Inc\ (+)=Incr\u00E9menter (+)
Italic=Italique
JAXX\ Demo=
JMenu\ demo=
@@ -69,26 +69,26 @@
Red\:=rouge \:
Reset=Reinitialiser
Show\ Background=Voir le fond
-Show\ password\ dialog=Voir l'\u00e9diteur de mot de passe
+Show\ password\ dialog=Voir l'\u00E9diteur de mot de passe
Sign\ on=Signer
Simple\ Button=Bouton simple
Size\:=Taille \:
Sources=Sources
Spacing\:=Espacement \:
-Start=D\u00e9marrer
-Stop=Arr\u00eater
-Supported\ Swing\ components\:=Composants Swing support\u00e9s
+Start=D\u00E9marrer
+Stop=Arr\u00EAter
+Supported\ Swing\ components\:=Composants Swing support\u00E9s
Text2\:=Text 2
Text\:=Texte \:
Total\:\ =
-Underline=soulign\u00e9
+Underline=soulign\u00E9
Upper\ case\ text\:=Texte en majuscule
Use\ the\ spinner\ to=Utiliser la jauge pour
Username\:=Utilisateur \:
-Vegetable=L\u00e9gumes
+Vegetable=L\u00E9gumes
View=Vue
Welcome\ to\ the\ JAXX\ framework\!=Bienvenu dans le framework JAXX
-Working\ directory\:=R\u00e9pertoire de travail
+Working\ directory\:=R\u00E9pertoire de travail
Yellow=Jaune
You\ entered\:\ =
Your\ name\:=Votre nom \:
@@ -98,8 +98,8 @@
between\ these\ lines=
button\ A=Bouton A
button\ B=Bouton B
-button\ C\ (full\ block)=Bouton C (blocage compl\u00eat)
-button\ D\ (full\ block\ 2)=Bouton D (blocage compl\u00eat)
+button\ C\ (full\ block)=Bouton C (blocage compl\u00EAt)
+button\ D\ (full\ block\ 2)=Bouton D (blocage compl\u00EAt)
cancel=Annuler
close=Fermer
close2=Fermer 2
@@ -143,12 +143,12 @@
jaxxdemo.action.configuration.tip=Modifier la configuration
jaxxdemo.action.exit=Quitter
jaxxdemo.action.exit.tip=Quitter JAXX Demo
-jaxxdemo.action.fullscreen=Plein \u00e9cran
-jaxxdemo.action.fullscreen.tip=Passer en mode pleine \u00e9cran
+jaxxdemo.action.fullscreen=Plein \u00E9cran
+jaxxdemo.action.fullscreen.tip=Passer en mode pleine \u00E9cran
jaxxdemo.action.help=Aide
jaxxdemo.action.help.tip=Affichier l'aide
-jaxxdemo.action.locale.fr=Fran\u00e7ais
-jaxxdemo.action.locale.fr.tip=Changer la langue en fran\u00e7ais
+jaxxdemo.action.locale.fr=Fran\u00E7ais
+jaxxdemo.action.locale.fr.tip=Changer la langue en fran\u00E7ais
jaxxdemo.action.locale.uk=Anglais
jaxxdemo.action.locale.uk.tip=Changer la langue en anglais
jaxxdemo.action.normalscreen=Ecran normal
@@ -156,43 +156,43 @@
jaxxdemo.action.remove=
jaxxdemo.action.show=
jaxxdemo.action.site=Site internet
-jaxxdemo.action.site.tip=Acc\u00e9der au site de l'application sur internet
-jaxxdemo.config.category.directories=R\u00e9pertoires
-jaxxdemo.config.category.directories.description=R\u00e9pertoires de l'application
+jaxxdemo.action.site.tip=Acc\u00E9der au site de l'application sur internet
+jaxxdemo.config.category.directories=R\u00E9pertoires
+jaxxdemo.config.category.directories.description=R\u00E9pertoires de l'application
jaxxdemo.config.category.other=Autre
jaxxdemo.config.category.other.description=Autres options
jaxxdemo.config.configFileName.description=Le nom du fichier de configuration
-jaxxdemo.config.ui.demo.path=Chemin de la d\u00e9mo par d\u00e9faut
-jaxxdemo.config.ui.fontSize=La taille de la police \u00e0 utiliser pour visualiser dans les sources
-jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine \u00e9cran
-jaxxdemo.config.ui.locale=La langue utilis\u00e9e par l'application
+jaxxdemo.config.ui.demo.path=Chemin de la d\u00E9mo par d\u00E9faut
+jaxxdemo.config.ui.fontSize=La taille de la police \u00E0 utiliser pour visualiser dans les sources
+jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine \u00E9cran
+jaxxdemo.config.ui.locale=La langue utilis\u00E9e par l'application
jaxxdemo.i18neditor.configuration=Configuration
jaxxdemo.i18neditor.popupBorderText=Titre de la popup
-jaxxdemo.i18neditor.selected.locale=Langue s\u00e9lectionn\u00e9e
+jaxxdemo.i18neditor.selected.locale=Langue s\u00E9lectionn\u00E9e
jaxxdemo.i18neditor.showIcon=Afficher les icones
jaxxdemo.i18neditor.showPopupIcon=Afficher les icones dans la popup
jaxxdemo.i18neditor.showPopupText=Afficher les textes dans la popup
jaxxdemo.i18neditor.showText=Afficher le text
-jaxxdemo.init.closed=JAXX Demo a \u00e9t\u00e9 ferm\u00e9 \u00e0 %1$s
-jaxxdemo.init.context.done=Initialisation du contexte termin\u00e9e en %1$s.
-jaxxdemo.init.ui.done=Initialisation de l'interface graphique termin\u00e9e.
+jaxxdemo.init.closed=JAXX Demo a \u00E9t\u00E9 ferm\u00E9 \u00E0 %1$s
+jaxxdemo.init.context.done=Initialisation du contexte termin\u00E9e en %1$s.
+jaxxdemo.init.ui.done=Initialisation de l'interface graphique termin\u00E9e.
jaxxdemo.menu.file=Fichier
jaxxdemo.menu.file.locale=Langues
jaxxdemo.menu.help=Aide
-jaxxdemo.message.config.loaded=Configuration de JAXX Demo v. %1$s charg\u00e9e.
-jaxxdemo.message.goto.site=Acc\u00e9der au site de JAXX Demo (%1$s)
+jaxxdemo.message.config.loaded=Configuration de JAXX Demo v. %1$s charg\u00E9e.
+jaxxdemo.message.goto.site=Acc\u00E9der au site de JAXX Demo (%1$s)
jaxxdemo.navigation.actor.title=
jaxxdemo.navigation.actors.title=
jaxxdemo.navigation.movie.title=
jaxxdemo.navigation.movies.title=
jaxxdemo.numbereditor.autoPopup=Affichage automatique popup
jaxxdemo.numbereditor.configuration=Configuration
-jaxxdemo.numbereditor.model=R\u00e9sultat
-jaxxdemo.numbereditor.model.float=Valeur d\u00e9cimale \: %1$s
-jaxxdemo.numbereditor.model.int=Valeur enti\u00e8re \: %1$s
+jaxxdemo.numbereditor.model=R\u00E9sultat
+jaxxdemo.numbereditor.model.float=Valeur d\u00E9cimale \: %1$s
+jaxxdemo.numbereditor.model.int=Valeur enti\u00E8re \: %1$s
jaxxdemo.numbereditor.showPopupButton=Afficher le boutton de popup
jaxxdemo.numbereditor.showReset=Afficher le boutton de reset
-jaxxdemo.numbereditor.useFloat=Utiliser les d\u00e9cimales
+jaxxdemo.numbereditor.useFloat=Utiliser les d\u00E9cimales
jaxxdemo.numbereditor.useSign=Utiliser le signe
jaxxdemo.title.about=A propos de JAXX Demo...
jaxxdemo.tree.component.jaxx=Composants JAXX
@@ -204,13 +204,13 @@
jaxxdemo.tree.component.swing.form.text=Texte
jaxxdemo.tree.component.swing.layout=Layouts
jaxxdemo.tree.component.swing.menu=Menus
-jaxxdemo.tree.component.swing.window=Fen\u00eatres
-jaxxdemo.tree.feature=Fonctionnalit\u00e9s
+jaxxdemo.tree.component.swing.window=Fen\u00EAtres
+jaxxdemo.tree.feature=Fonctionnalit\u00E9s
jaxxdemo.tree.features.databinding=Data binding
jaxxdemo.tree.features.validation=Validation
jaxxdemo.tree.fun=Fun
-jaxxdemo.warning.nimbus.landf=Le look and Feel Nimbus n'a pas \u00e9t\u00e9 trouv\u00e9, il faut au moins la version 1.6u10 de java.
-jaxxdemo.warning.no.ui=Aucun environnement graphique d\u00e9tect\u00e9
+jaxxdemo.warning.nimbus.landf=Le look and Feel Nimbus n'a pas \u00E9t\u00E9 trouv\u00E9, il faut au moins la version 1.6u10 de java.
+jaxxdemo.warning.no.ui=Aucun environnement graphique d\u00E9tect\u00E9
model0.f0=
model0.f1=
model0.file...=
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java 2010-02-12 18:49:48 UTC (rev 1739)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java 2010-02-15 12:35:35 UTC (rev 1740)
@@ -31,38 +31,6 @@
public interface NavigationHandler {
/**
- * Strategy of instanciation of ui.
- * <p/>
- * For a given {@code node}, the method {@link #getId(NavigationTreeNode)}
- * returns the id of ui to use.
- */
- public enum Strategy {
-
- /**
- * instanciate a ui for a node
- */
- PER_NODE {
-
- @Override
- public String getId(NavigationTreeNode node) {
- return node.getFullPath();
- }
- },
- /**
- * instanciate only one a ui for a type,nodes will share the instanciation
- */
- PER_UI_TYPE {
-
- @Override
- public String getId(NavigationTreeNode node) {
- return node.getUIClass().getName();
- }
- };
-
- public abstract String getId(NavigationTreeNode node);
- }
-
- /**
* To get the context will be used by handler
* @return {@link JAXXContext} to use
*/
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationInstanciationStrategy.java 2010-02-15 12:35:35 UTC (rev 1740)
@@ -0,0 +1,33 @@
+package jaxx.runtime.swing.navigation;
+
+/**
+ * Strategy of instanciation of ui.
+ * <p/>
+ * For a given {@code node}, the method {@link #getId(jaxx.runtime.swing.navigation.NavigationTreeNode)}
+ * returns the id of ui to use.
+ */
+public enum NavigationInstanciationStrategy {
+
+ /**
+ * instanciate a ui for a node
+ */
+ PER_NODE {
+
+ @Override
+ public String getId(NavigationTreeNode node) {
+ return node.getFullPath();
+ }
+ },
+ /**
+ * instanciate only one a ui for a type,nodes will share the instanciation
+ */
+ PER_UI_TYPE {
+
+ @Override
+ public String getId(NavigationTreeNode node) {
+ return node.getUIClass().getName();
+ }
+ };
+
+ public abstract String getId(NavigationTreeNode node);
+}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2010-02-12 18:49:48 UTC (rev 1739)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2010-02-15 12:35:35 UTC (rev 1740)
@@ -57,7 +57,8 @@
/**
* UI Instanciation strategy
*/
- protected Strategy strategy;
+ protected NavigationInstanciationStrategy strategy;
+
/**
* JAXXContext access helper.
*
@@ -65,7 +66,7 @@
*/
protected NavigationTreeContextHelper contextHelper;
- protected NavigationTreeHandler(String contextPrefix, JAXXObject context, Strategy strategy) {
+ protected NavigationTreeHandler(String contextPrefix, JAXXObject context, NavigationInstanciationStrategy strategy) {
this.contextHelper = new NavigationTreeContextHelper(contextPrefix);
this.context = context;
this.strategy = strategy;
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2010-02-12 18:49:48 UTC (rev 1739)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2010-02-15 12:35:35 UTC (rev 1740)
@@ -61,7 +61,7 @@
*/
protected abstract CardLayout2 getContentLayout();
- public NavigationTreeHandlerWithCardLayout(String contextPrefix, JAXXObject context, Strategy strategy) {
+ public NavigationTreeHandlerWithCardLayout(String contextPrefix, JAXXObject context, NavigationInstanciationStrategy strategy) {
super(contextPrefix, context, strategy);
if (getContentContainer() == null) {
throw new IllegalArgumentException("could not have a null 'contentContainer' in ui " + context);
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java 2010-02-12 18:49:48 UTC (rev 1739)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java 2010-02-15 12:35:35 UTC (rev 1740)
@@ -63,7 +63,7 @@
/**
* UI Instanciation strategy
*/
- protected Strategy strategy;
+ protected NavigationInstanciationStrategy strategy;
/**
* JAXXContext access helper.
*
@@ -71,7 +71,7 @@
*/
protected NavigationTreeContextHelper contextHelper;
- protected NavigationTreeTableHandler(String contextPrefix, final JAXXObject context, Strategy strategy, TreeSelectionModel selectModel) {
+ protected NavigationTreeTableHandler(String contextPrefix, final JAXXObject context, NavigationInstanciationStrategy strategy, TreeSelectionModel selectModel) {
this.contextHelper = new NavigationTreeContextHelper(contextPrefix);
this.context = context;
this.strategy = strategy;
1
0
r1739 - in trunk: . jaxx-runtime jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation
by sletellier@users.nuiton.org 12 Feb '10
by sletellier@users.nuiton.org 12 Feb '10
12 Feb '10
Author: sletellier
Date: 2010-02-12 19:49:48 +0100 (Fri, 12 Feb 2010)
New Revision: 1739
Added:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModel.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModelBuilder.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModelBuilder.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableNode.java
Modified:
trunk/jaxx-runtime/pom.xml
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java
trunk/pom.xml
Log:
- Add SwingX dependency
- Add implementation to use JXTreeTable with helper using JXPath
- TODO : Fix hack to get selected value (in NavigationTreeTableHandler)
Modified: trunk/jaxx-runtime/pom.xml
===================================================================
--- trunk/jaxx-runtime/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
+++ trunk/jaxx-runtime/pom.xml 2010-02-12 18:49:48 UTC (rev 1739)
@@ -1,3 +1,4 @@
+
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -56,6 +57,13 @@
<artifactId>junit</artifactId>
</dependency>
+ <!-- pour utiliser JTreeTable -->
+
+ <dependency>
+ <groupId>org.swinglabs</groupId>
+ <artifactId>swingx</artifactId>
+ </dependency>
+
</dependencies>
<!-- ************************************************************* -->
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationHandler.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -0,0 +1,77 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package jaxx.runtime.swing.navigation;
+
+import jaxx.runtime.JAXXContext;
+
+/**
+ * Interface to create an handler of a navigation tree.
+ *
+ * @author sletellier
+ * @since 2.0.0
+ */
+public interface NavigationHandler {
+
+ /**
+ * Strategy of instanciation of ui.
+ * <p/>
+ * For a given {@code node}, the method {@link #getId(NavigationTreeNode)}
+ * returns the id of ui to use.
+ */
+ public enum Strategy {
+
+ /**
+ * instanciate a ui for a node
+ */
+ PER_NODE {
+
+ @Override
+ public String getId(NavigationTreeNode node) {
+ return node.getFullPath();
+ }
+ },
+ /**
+ * instanciate only one a ui for a type,nodes will share the instanciation
+ */
+ PER_UI_TYPE {
+
+ @Override
+ public String getId(NavigationTreeNode node) {
+ return node.getUIClass().getName();
+ }
+ };
+
+ public abstract String getId(NavigationTreeNode node);
+ }
+
+ /**
+ * To get the context will be used by handler
+ * @return {@link JAXXContext} to use
+ */
+ public JAXXContext getContext();
+
+ /**
+ * To get helper will be used by handler
+ * @return {@link NavigationTreeContextHelper} to use
+ */
+ public NavigationTreeContextHelper getContextHelper();
+
+}
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModel.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModel.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModel.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -0,0 +1,151 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package jaxx.runtime.swing.navigation;
+
+import jaxx.runtime.JAXXContext;
+import org.jdesktop.swingx.treetable.TreeTableNode;
+
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreeNode;
+import java.util.regex.Pattern;
+
+/**
+ * Interface to create model of the tree used for a navigation tree.
+ * <p/>
+ * Il est composé de {@link NavigationTreeNode}
+ *
+ * @author sletellier
+ * @since 2.0.0
+ */
+public interface NavigationModel {
+
+ public Object getRoot();
+
+ public TreeNode[] getPathToRoot(TreeNode aNode);
+
+ /**
+ * Search from the root node a node named by his fully path (concatenation of nodes
+ * {@link NavigationTreeNode#path} valued separated by dot.
+ * <p/>
+ * Example :
+ * <p/>
+ * <pre>$root.child1.leaf1</pre>
+ *
+ * @param path the fully path of the searched node.
+ * @return the node matching the fully context from the root node, or <code>null</code> if not find.
+ */
+ public NavigationTreeNode findNode(String path);
+
+ /**
+ * Apply first the regex pattern to obtain the searched node fi the given <code>regex</code> is not null.
+ * <p/>
+ * Search then from the root node a node named by his fully path (concatenation of nodes
+ * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
+ * <p/>
+ * <p/>
+ * Example :
+ * <p/>
+ * <pre>$root.child1.leaf1</pre>
+ *
+ * @param path the fully path of the searched node.
+ * @param regex a optional regex to apply to path before searching
+ * @return the node matching the fully context from the root node, or <code>null</code> if not found.
+ */
+ public NavigationTreeNode findNode(String path, String regex);
+
+ /**
+ * Apply first the regex pattern to obtain the searched node.
+ * <p/>
+ * Search then from the root node a node named by his fully path (concatenation of nodes
+ * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
+ * <p/>
+ * Example :
+ * <p/>
+ * <pre>$root.child1.leaf1</pre>
+ *
+ * @param path the fully path of the searched node.
+ * @param regex a optional regex to apply to path before searching
+ * @return the node matching the fully context from the root node, or <code>null</code> if not found.
+ */
+ public NavigationTreeNode findNode(String path, Pattern regex);
+
+ /**
+ * Search from a given root node a node named by his fully path (concatenation of nodes
+ * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
+ *
+ * @param root root node to be used
+ * @param path the fully path of the searched node.
+ * @return the node matching the fully context from the given root node, or <code>null</code> if not found.
+ */
+ public NavigationTreeNode findNode(NavigationTreeNode root, String path);
+
+ /**
+ * Apply first the regex pattern to obtain the searched node.
+ * <p/>
+ * Search then from a given root node a node named by his fully path (concatenation of nodes)
+ * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
+ *
+ * @param root root node to be used
+ * @param path the fully path of the searched node.
+ * @param regex a previous regex to apply to path : must have a matches
+ * @return the node matching the fully context from the given root node, or <code>null</code> if not found.
+ */
+ public NavigationTreeNode findNode(NavigationTreeNode root, String path, String regex);
+
+ /**
+ * Apply first the regex pattern to obtain the searched node.
+ * <p/>
+ * Search then from a given root node a node named by his fully path (concatenation of nodes
+ * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
+ *
+ * @param root root node to be used
+ * @param path the fully path of the searched node.
+ * @param regex a previous regex to apply to path : must have a matches
+ * @return the node matching the fully context from the given root node, or <code>null</code> if not found.
+ */
+ public NavigationTreeNode findNode(NavigationTreeNode root, String path, Pattern regex);
+
+ public JAXXContext getContext();
+
+ /**
+ * Obtain the associated bean value from context corresponding to node from given navigation path.
+ *
+ * @param navigationPath the current context path of the node
+ * @return the value associated in context with the given navigation path
+ */
+ public Object getBean(String navigationPath);
+
+ /**
+ * Obtain the associated bean value from context corresponding to node
+ *
+ * @param node the current node
+ * @return the value associated in context with the given node.
+ */
+ public Object getBean(NavigationTreeNode node);
+
+ public void nodeChanged(TreeNode node);
+
+ public void nodeStructureChanged(TreeNode node);
+
+ public void nodeChanged(TreeNode node, boolean deep);
+
+ public String getPathSeparator();
+}
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModelBuilder.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModelBuilder.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationModelBuilder.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -0,0 +1,95 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package jaxx.runtime.swing.navigation;
+
+import jaxx.runtime.JAXXAction;
+import jaxx.runtime.JAXXContext;
+import jaxx.runtime.JAXXObject;
+import jaxx.runtime.context.JAXXContextEntryDef;
+import jaxx.runtime.decorator.Decorator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Enumeration;
+
+/**
+ * Interface to create a builder, this object is design to build a {@link NavigationModel}.
+ *
+ * @author sletellier
+ * @since 2.0.0
+ */
+public interface NavigationModelBuilder {
+
+ public NavigationModel getModel();
+
+ public NavigationTreeNode buildEmptyRoot(JAXXContextEntryDef<?> entryDef, String contextName);
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, String libelle,
+ JAXXContextEntryDef<?> entryDef,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass);
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, String libelle,
+ JAXXContextEntryDef<?> entryDef,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass);
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, String libelle,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass);
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, Decorator<?> decorator,
+ JAXXContextEntryDef<?> entryDef,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass);
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, Decorator<?> decorator,
+ JAXXContextEntryDef<?> entryDef,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass);
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, Decorator<?> decorator,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass);
+
+ public NavigationTreeNode removeChildNode(NavigationTreeNode node);
+
+ public void addI18nNodeRenderer(NavigationTreeNode node, String libelle);
+
+ public void addDecoratorNodeRenderer(NavigationTreeNode node, Decorator<?> decorator);
+
+ public void addNodeJaxxClasses(
+ NavigationTreeNode node,
+ Class<? extends JAXXObject> uIClass,
+ Class<? extends JAXXAction> uIHandlerClass);
+
+ public void printModel(NavigationTreeNode node);
+}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2010-02-08 15:58:19 UTC (rev 1738)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -25,6 +25,7 @@
import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.context.JAXXContextEntryDef;
+import org.jdesktop.swingx.JXTreeTable;
/**
* To help getting and setting navigation tree objects from a {@link JAXXContext}.
@@ -64,16 +65,18 @@
protected JAXXContextEntryDef<String> selectedPathContextEntry;
protected JAXXContextEntryDef<Object> selectedBeanContextEntry;
protected JAXXContextEntryDef<NavigationTreeNode> selectedNodeContextEntry;
- protected JAXXContextEntryDef<NavigationTreeModel> treeModelContextEntry;
- protected JAXXContextEntryDef<NavigationTreeHandler> treeHandlerContextEntry;
+ protected JAXXContextEntryDef<NavigationModel> modelContextEntry;
+ protected JAXXContextEntryDef<NavigationHandler> handlerContextEntry;
protected JAXXContextEntryDef<JTree> treeContextEntry;
+ protected JAXXContextEntryDef<JXTreeTable> treeTableContextEntry;
// protected JAXXContextEntryDef<Component> selectedUIContextEntry;
public NavigationTreeContextHelper(String prefix) {
this.prefix = prefix;
treeContextEntry = JAXXUtil.newContextEntryDef(prefix + "-tree", JTree.class);
- treeModelContextEntry = JAXXUtil.newContextEntryDef(prefix + "-tree-model", NavigationTreeModel.class);
- treeHandlerContextEntry = JAXXUtil.newContextEntryDef(prefix + "-tree-handler", NavigationTreeHandler.class);
+ treeTableContextEntry = JAXXUtil.newContextEntryDef(prefix + "-tree-table", JXTreeTable.class);
+ modelContextEntry = JAXXUtil.newContextEntryDef(prefix + "-model", NavigationModel.class);
+ handlerContextEntry = JAXXUtil.newContextEntryDef(prefix + "-handler", NavigationHandler.class);
selectedBeanContextEntry = JAXXUtil.newContextEntryDef(prefix + "-selected-bean", Object.class);
selectedNodeContextEntry = JAXXUtil.newContextEntryDef(prefix + "-selected-node", NavigationTreeNode.class);
selectedPathContextEntry = JAXXUtil.newContextEntryDef(prefix + "-selected-path", String.class);
@@ -89,16 +92,36 @@
return r;
}
- public NavigationTreeModel getTreeModel(JAXXContext context) {
- NavigationTreeModel r = getTreeModelContextEntry().getContextValue(context);
+ public JXTreeTable getTreeTable(JAXXContext context) {
+ JXTreeTable r = getTreeTableContextEntry().getContextValue(context);
return r;
}
- public NavigationTreeHandler getTreeHandler(JAXXContext context) {
- NavigationTreeHandler r = getTreeHandlerContextEntry().getContextValue(context);
+ public NavigationModel getModel(JAXXContext context) {
+ NavigationModel r = getModelContextEntry().getContextValue(context);
return r;
}
+ @Deprecated
+ public NavigationTreeModel getTreeModel(JAXXContext context) {
+ NavigationModel r = getModelContextEntry().getContextValue(context);
+ if (r instanceof NavigationTreeModel){
+ return (NavigationTreeModel)r;
+ }
+ return null;
+ }
+
+ /**
+ * @deprecated please use {@link #getHandler(JAXXContext)}, will be remove soon
+ * @param context
+ * @return handler
+ */
+ @Deprecated
+ public NavigationHandler getTreeHandler(JAXXContext context) {
+ NavigationHandler r = getTreeHandlerContextEntry().getContextValue(context);
+ return r;
+ }
+
public String getSelectedPath(JAXXContext context) {
String r = getSelectedPathContextEntry().getContextValue(context);
return r;
@@ -119,18 +142,42 @@
// return r;
// }
- public void setTreeModel(JAXXContext context, NavigationTreeModel model) {
- getTreeModelContextEntry().setContextValue(context, model);
+ /**
+ * @deprecated please use {@link #setModel(JAXXContext, NavigationModel)}, will be remove soon
+ * @param context
+ * @param model
+ */
+ @Deprecated
+ public void setTreeModel(JAXXContext context, NavigationModel model) {
+ getModelContextEntry().setContextValue(context, model);
}
+ public void setModel(JAXXContext context, NavigationModel model) {
+ getModelContextEntry().setContextValue(context, model);
+ }
+
public void setTree(JAXXContext context, JTree tree) {
getTreeContextEntry().setContextValue(context, tree);
}
- public void setTreeHandler(JAXXContext context, NavigationTreeHandler handler) {
+ public void setTreeTable(JAXXContext context, JXTreeTable treeTable) {
+ getTreeTableContextEntry().setContextValue(context, treeTable);
+ }
+
+ /**
+ * @deprecated please use {@link #setHandler(JAXXContext, NavigationHandler)}, will be remove soon
+ * @param context
+ * @param handler
+ */
+ @Deprecated
+ public void setTreeHandler(JAXXContext context, NavigationHandler handler) {
getTreeHandlerContextEntry().setContextValue(context, handler);
}
+ public void setHandler(JAXXContext context, NavigationHandler handler) {
+ getHandlerContextEntry().setContextValue(context, handler);
+ }
+
public void setSelectedPath(JAXXContext context, String path) {
if (path == null) {
getSelectedPathContextEntry().removeContextValue(context);
@@ -163,14 +210,19 @@
// }
// }
- protected JAXXContextEntryDef<NavigationTreeModel> getTreeModelContextEntry() {
- return treeModelContextEntry;
+ protected JAXXContextEntryDef<NavigationModel> getModelContextEntry() {
+ return modelContextEntry;
}
- protected JAXXContextEntryDef<NavigationTreeHandler> getTreeHandlerContextEntry() {
- return treeHandlerContextEntry;
+ @Deprecated
+ protected JAXXContextEntryDef<NavigationHandler> getTreeHandlerContextEntry() {
+ return handlerContextEntry;
}
+ public JAXXContextEntryDef<NavigationHandler> getHandlerContextEntry() {
+ return handlerContextEntry;
+ }
+
protected JAXXContextEntryDef<Object> getSelectedBeanContextEntry() {
return selectedBeanContextEntry;
}
@@ -187,7 +239,13 @@
return treeContextEntry;
}
+ protected JAXXContextEntryDef<JXTreeTable> getTreeTableContextEntry() {
+ return treeTableContextEntry;
+ }
+
// public JAXXContextEntryDef<Component> getSelectedUIContextEntry() {
+
// return selectedUIContextEntry;
+
// }
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2010-02-08 15:58:19 UTC (rev 1738)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -42,7 +42,7 @@
* @author tony
* @since 1.7.2
*/
-public abstract class NavigationTreeHandler extends DefaultTreeSelectionModel {
+public abstract class NavigationTreeHandler extends DefaultTreeSelectionModel implements NavigationHandler{
private static final long serialVersionUID = 1L;
/**
@@ -50,37 +50,6 @@
*/
static private final Log log = LogFactory.getLog(NavigationTreeHandler.class);
- /**
- * Strategy of instanciation of ui.
- * <p/>
- * For a given {@code node}, the method {@link #getId(NavigationTreeNode)}
- * returns the id of ui to use.
- */
- public enum Strategy {
-
- /**
- * instanciate a ui for a node
- */
- PER_NODE {
-
- @Override
- public String getId(NavigationTreeNode node) {
- return node.getFullPath();
- }
- },
- /**
- * instanciate only one a ui for a type,nodes will share the instanciation
- */
- PER_UI_TYPE {
-
- @Override
- public String getId(NavigationTreeNode node) {
- return node.getUIClass().getName();
- }
- };
-
- public abstract String getId(NavigationTreeNode node);
- }
/**
* UI which contains navigation tree
*/
@@ -117,10 +86,10 @@
/**
* @return le modèle de navigation associé
*/
- protected abstract NavigationTreeModel getNavigationTreeModel();
+ protected abstract NavigationModel getNavigationTreeModel();
/**
- * @return le composent actuellement visible associé au noeud courant ou
+ * @return le composent actuellement visible associé au noeud courant ou
* au noeud précédent lors d'un changement de noeud.
*/
protected abstract Component getCurrentUI();
@@ -163,10 +132,16 @@
*/
protected abstract void treateError(Exception e);
+ /**
+ * {@see NavigationHandler#getContext()
+ **/
public JAXXContext getContext() {
return context;
}
+ /**
+ * {@see NavigationHandler#getContextHelper()
+ **/
public NavigationTreeContextHelper getContextHelper() {
return contextHelper;
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2010-02-08 15:58:19 UTC (rev 1738)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -24,11 +24,13 @@
import java.util.Enumeration;
import java.util.regex.Pattern;
import javax.swing.JTree;
+import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTreeTable;
/**
* Helper object associated to a given navigation tree system.
@@ -47,12 +49,12 @@
static private final Log log = LogFactory.getLog(NavigationTreeHelper.class);
/**
- * Create the tree model.
+ * Create the model.
*
* @param context the context to associate with fresh model
* @return the new model build with data from the given context
*/
- public abstract NavigationTreeModel createTreeModel(JAXXContext context);
+ public abstract NavigationModel createTreeModel(JAXXContext context);
/**
* Create the tree handler.
@@ -60,36 +62,36 @@
* @param context the context to associate with fresh handler
* @return the new handler
*/
- public abstract NavigationTreeHandler createTreeHandler(JAXXObject context);
+ public abstract NavigationHandler createTreeHandler(JAXXObject context);
public NavigationTreeHelper(String contextPrefix) {
super(contextPrefix);
}
public Object getContextValue(JAXXContext context, String path) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
- NavigationTreeModel treeModel = getSafeTreeModel(context);
+ NavigationModel treeModel = getSafeModel(context);
return treeModel.getBean(path);
}
public NavigationTreeNode findNode(JAXXContext context, String path) {
- NavigationTreeModel treeModel = getSafeTreeModel(context);
+ NavigationModel treeModel = getSafeModel(context);
return treeModel.findNode(path);
}
public NavigationTreeNode findNode(JAXXContext context, String path, String regex) {
- NavigationTreeModel treeModel = getSafeTreeModel(context);
+ NavigationModel treeModel = getSafeModel(context);
return treeModel.findNode(path, regex);
}
public NavigationTreeNode findNode(JAXXContext context, String path, Pattern regex) {
- NavigationTreeModel treeModel = getSafeTreeModel(context);
+ NavigationModel treeModel = getSafeModel(context);
return treeModel.findNode(path, regex);
}
public NavigationTreeNode findNode(JAXXContext context, String path, String regex, String suffix) {
- NavigationTreeModel treeModel = getSafeTreeModel(context);
+ NavigationModel treeModel = getSafeModel(context);
NavigationTreeNode navigationTreeNode = treeModel.findNode(path, regex);
if (navigationTreeNode != null && suffix != null) {
@@ -100,7 +102,7 @@
public NavigationTreeNode findNode(JAXXContext context, String path, Pattern regex, String suffix) {
- NavigationTreeModel treeModel = getSafeTreeModel(context);
+ NavigationModel treeModel = getSafeModel(context);
NavigationTreeNode navigationTreeNode = treeModel.findNode(path, regex);
if (navigationTreeNode != null && suffix != null) {
@@ -134,7 +136,7 @@
public void selectNode(JAXXContext context, NavigationTreeNode node) {
- NavigationTreeModel navigationModel = getSafeTreeModel(context);
+ NavigationModel navigationModel = getSafeModel(context);
if (log.isDebugEnabled()) {
log.debug(node);
}
@@ -224,7 +226,7 @@
* @param deep un flag pour activer la repainte de la descendance du noeud
*/
public void repaintNode(JAXXContext context, NavigationTreeNode node, boolean deep) {
- NavigationTreeModel navigationModel = getSafeTreeModel(context);
+ NavigationModel navigationModel = getSafeModel(context);
if (log.isDebugEnabled()) {
log.debug(node);
}
@@ -240,14 +242,26 @@
}
}
+ @Deprecated
public NavigationTreeModel getSafeTreeModel(JAXXContext context) throws NullPointerException {
- NavigationTreeModel treeModel = getTreeModel(context);
- if (treeModel == null) {
- throw new NullPointerException("could not find tree model with key " + getTreeModelContextEntry() + " in context " + context);
+ NavigationModel model = getModel(context);
+ if (model == null) {
+ throw new NullPointerException("could not find tree model with key " + getModelContextEntry() + " in context " + context);
}
- return treeModel;
+ if (model instanceof NavigationTreeModel){
+ return (NavigationTreeModel) model;
+ }
+ return null;
}
+ public NavigationModel getSafeModel(JAXXContext context) throws NullPointerException {
+ NavigationModel model = getModel(context);
+ if (model == null) {
+ throw new NullPointerException("could not find tree model with key " + getModelContextEntry() + " in context " + context);
+ }
+ return model;
+ }
+
public JTree getSafeTree(JAXXContext context) throws NullPointerException {
JTree tree = getTree(context);
if (tree == null) {
@@ -255,4 +269,12 @@
}
return tree;
}
+
+ public JXTreeTable getSafeTreeTable(JAXXContext context) throws NullPointerException {
+ JXTreeTable treeTable = getTreeTable(context);
+ if (treeTable == null) {
+ throw new NullPointerException("could not find tree with key " + getTreeTableContextEntry() + " in context " + context);
+ }
+ return treeTable;
+ }
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2010-02-08 15:58:19 UTC (rev 1738)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -39,7 +39,7 @@
* @author chemit
* @since 1.7.2
*/
-public class NavigationTreeModel extends DefaultTreeModel {
+public class NavigationTreeModel extends DefaultTreeModel implements NavigationModel{
static private final long serialVersionUID = 1L;
/**
@@ -64,100 +64,51 @@
this.context = context;
}
+ /**
+ * @see {NavigationModel#getRoot()}
+ */
@Override
public NavigationTreeNode getRoot() {
return (NavigationTreeNode) super.getRoot();
}
/**
- * Search from the root node a node named by his fully path (concatenation of nodes
- * {@link NavigationTreeNode#path} valued separated by dot.
- * <p/>
- * Example :
- * <p/>
- * <pre>$root.child1.leaf1</pre>
- *
- * @param path the fully path of the searched node.
- * @return the node matching the fully context from the root node, or <code>null</code> if not find.
+ * @see {NavigationModel#findNode(String)}
*/
public NavigationTreeNode findNode(String path) {
return findNode(getRoot(), path, (Pattern) null);
}
/**
- * Apply first the regex pattern to obtain the searched node fi the given <code>regex</code> is not null.
- * <p/>
- * Search then from the root node a node named by his fully path (concatenation of nodes
- * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
- * <p/>
- * <p/>
- * Example :
- * <p/>
- * <pre>$root.child1.leaf1</pre>
- *
- * @param path the fully path of the searched node.
- * @param regex a optional regex to apply to path before searching
- * @return the node matching the fully context from the root node, or <code>null</code> if not found.
+ * @see {NavigationModel#findNode(String, String)}
*/
public NavigationTreeNode findNode(String path, String regex) {
return findNode(getRoot(), path, regex);
}
/**
- * Apply first the regex pattern to obtain the searched node.
- * <p/>
- * Search then from the root node a node named by his fully path (concatenation of nodes
- * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
- * <p/>
- * Example :
- * <p/>
- * <pre>$root.child1.leaf1</pre>
- *
- * @param path the fully path of the searched node.
- * @param regex a optional regex to apply to path before searching
- * @return the node matching the fully context from the root node, or <code>null</code> if not found.
+ * @see {NavigationModel#findNode(String, Pattern)}
*/
public NavigationTreeNode findNode(String path, Pattern regex) {
return findNode(getRoot(), path, regex);
}
/**
- * Search from a given root node a node named by his fully path (concatenation of nodes
- * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
- *
- * @param root root node to be used
- * @param path the fully path of the searched node.
- * @return the node matching the fully context from the given root node, or <code>null</code> if not found.
+ * @see {NavigationModel#findNode(NavigationTreeNode, String)}
*/
public NavigationTreeNode findNode(NavigationTreeNode root, String path) {
return findNode(root, path, (Pattern) null);
}
/**
- * Apply first the regex pattern to obtain the searched node.
- * <p/>
- * Search then from a given root node a node named by his fully path (concatenation of nodes)
- * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
- *
- * @param root root node to be used
- * @param path the fully path of the searched node.
- * @param regex a previous regex to apply to path : must have a matches
- * @return the node matching the fully context from the given root node, or <code>null</code> if not found.
+ * @see {NavigationModel#findNode(NavigationTreeNode, String, String)}
*/
public NavigationTreeNode findNode(NavigationTreeNode root, String path, String regex) {
return findNode(root, path, regex == null ? null : Pattern.compile(regex));
}
/**
- * Apply first the regex pattern to obtain the searched node.
- * <p/>
- * Search then from a given root node a node named by his fully path (concatenation of nodes
- * {@link NavigationTreeNode#path} valued separated by {@link #pathSeparator}.
- *
- * @param root root node to be used
- * @param path the fully path of the searched node.
- * @param regex a previous regex to apply to path : must have a matches
- * @return the node matching the fully context from the given root node, or <code>null</code> if not found.
+ * @see {NavigationModel#findNode(NavigationTreeNode, String, Pattern)}
*/
public NavigationTreeNode findNode(NavigationTreeNode root, String path, Pattern regex) {
if (regex != null) {
@@ -186,15 +137,15 @@
return result;
}
+ /**
+ * @see {NavigationModel#getContext()}
+ */
public JAXXContext getContext() {
return context;
}
/**
- * Obtain the associated bean value from context corresponding to node from given navigation path.
- *
- * @param navigationPath the current context path of the node
- * @return the value associated in context with the given navigation path
+ * @see {NavigationModel#getBean(String)}
*/
public Object getBean(String navigationPath) {
Object result;
@@ -204,10 +155,7 @@
}
/**
- * Obtain the associated bean value from context corresponding to node
- *
- * @param node the current node
- * @return the value associated in context with the given node.
+ * @see {NavigationModel#getBean(NavigationTreeNode)}
*/
public Object getBean(NavigationTreeNode node) {
if (node == null) {
@@ -218,6 +166,9 @@
return node.getBean(getContext());
}
+ /**
+ * @see {NavigationModel#nodeChanged(TreeNode)}
+ */
@Override
public void nodeChanged(TreeNode node) {
nodeChanged(node, false);
@@ -226,6 +177,9 @@
}
}
+ /**
+ * @see {NavigationModel#nodeStructureChanged(TreeNode)}
+ */
@Override
public void nodeStructureChanged(TreeNode node) {
NavigationTreeNode n = (NavigationTreeNode) node;
@@ -237,6 +191,9 @@
}
}
+ /**
+ * @see {NavigationModel#nodeChanged(TreeNode, boolean)}
+ */
public void nodeChanged(TreeNode node, boolean deep) {
NavigationTreeNode n = (NavigationTreeNode) node;
@@ -264,6 +221,9 @@
}
}
+ /**
+ * @see {NavigationModel#getPathSeparator()}
+ */
public String getPathSeparator() {
return pathSeparator;
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java 2010-02-08 15:58:19 UTC (rev 1738)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -31,11 +31,13 @@
/**
* This object is design to build a {@link NavigationTreeModel}.
+ *
+ * @see NavigationModelBuilder
*
* @author chemit
* @since 17.2
*/
-public class NavigationTreeModelBuilder {
+public class NavigationTreeModelBuilder implements NavigationModelBuilder{
/**
* Logger
@@ -95,6 +97,7 @@
Class<? extends JAXXObject> uiClass,
Class<? extends JAXXAction> actionClass) {
NavigationTreeNode node = new NavigationTreeNode(model.pathSeparator, contextName, entryDef);
+ // TODO : Must be : NavigationTreeNode node = new NavigationTreeNode(model.pathSeparator, contextName, null, entryDef); ???
addI18nNodeRenderer(node, libelle);
addNodeJaxxClasses(node, uiClass, actionClass);
return addChildNode(parentNode, node);
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableHandler.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -0,0 +1,253 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package jaxx.runtime.swing.navigation;
+
+import jaxx.runtime.JAXXAction;
+import jaxx.runtime.JAXXContext;
+import jaxx.runtime.JAXXObject;
+import jaxx.runtime.context.JAXXInitialContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+import java.awt.*;
+
+/**
+ * The handler of a navigation tree table.
+ *
+ * This is also the selection model to use, since we must check before moving
+ * from a node we can not just listen selection model changed, we must control
+ * it.
+ *
+ * TODO : Chercher une solution pour limiter le copier/coller.... @see {NavigationTreeHandler}
+ *
+ * @author sletellier
+ * @since 2.0.0
+ */
+public abstract class NavigationTreeTableHandler extends DefaultListSelectionModel implements NavigationHandler {
+
+ private static final long serialVersionUID = 1L;
+ /**
+ * Logger
+ */
+ static private final Log log = LogFactory.getLog(NavigationTreeTableHandler.class);
+
+ /**
+ * UI which contains navigation tree
+ */
+ protected JAXXContext context;
+ /**
+ * UI Instanciation strategy
+ */
+ protected Strategy strategy;
+ /**
+ * JAXXContext access helper.
+ *
+ * @since 1.7.2
+ */
+ protected NavigationTreeContextHelper contextHelper;
+
+ protected NavigationTreeTableHandler(String contextPrefix, final JAXXObject context, Strategy strategy, TreeSelectionModel selectModel) {
+ this.contextHelper = new NavigationTreeContextHelper(contextPrefix);
+ this.context = context;
+ this.strategy = strategy;
+ addListSelectionListener(new ListSelectionListener(){
+ @Override
+ public void valueChanged(ListSelectionEvent event) {
+ log.info("Value changed old : " + event.getFirstIndex() + " last " + event.getLastIndex() + " source " + event.getSource());
+ if (event.getSource() == null || !event.getValueIsAdjusting()) {
+ // do not treate this if no path changed
+ return;
+ }
+
+ // FIXME : event.getSource devrais retourner le navigationTreeNode....
+ NavigationTreeNode node = (NavigationTreeNode) contextHelper.getTreeTable(context).getModel().getValueAt(event.getLastIndex(), 0);
+ selectNodeUI(node);
+ }
+ });
+ }
+
+ /**
+ * @return le modèle de navigation associé
+ */
+ protected abstract NavigationModel getNavigationTreeModel();
+
+ /**
+ * @return le composent actuellement visible associé au noeud courant ou
+ * au noeud précédent lors d'un changement de noeud.
+ */
+ protected abstract Component getCurrentUI();
+
+ /**
+ * @param node le noeud associé à l'ui à retrouver
+ * @return l'ui associé au novueau noeud sélectionné
+ */
+ protected abstract Component getUI(NavigationTreeNode node);
+
+ /**
+ * @param component le composent actuellement visible
+ * @return <code>true</code> si le composent a bien été fermé, <code>false</code> sinon
+ * @throws Exception if any
+ */
+ protected abstract boolean closeUI(Component component) throws Exception;
+
+ /**
+ * Instancie une nouvelle ui associé à un noeud de l'arbre de navigation
+ *
+ * @param node le noeud associé à l'ui à créer
+ * @return la nouvelle ui associée au noeud
+ * @throws Exception if any
+ */
+ protected abstract Component createUI(NavigationTreeNode node) throws Exception;
+
+ /**
+ * Ouvre l'ui associée au noeud sélectionné dans l'arbre de navigation.
+ *
+ * @param newUI l'ui associé au noeud sélectionné à ouvrir
+ * @param node le node de l'ui a ouvrir
+ * @throws Exception if any
+ */
+ protected abstract void openUI(Component newUI, NavigationTreeNode node) throws Exception;
+
+ /**
+ * Traitement des exceptions.
+ *
+ * @param e l'erreur recontrée (ou null si pas d"erreur)
+ */
+ protected abstract void treateError(Exception e);
+
+ /**
+ * @see NavigationHandler#getContext()
+ */
+ public JAXXContext getContext() {
+ return context;
+ }
+
+ /**
+ * @see NavigationHandler#getContextHelper()
+ */
+ public NavigationTreeContextHelper getContextHelper() {
+ return contextHelper;
+ }
+
+ protected void selectNodeUI(NavigationTreeNode node) {
+
+ try {
+
+ String path = node.getFullPath();
+
+ if (log.isTraceEnabled()) {
+ log.trace(path);
+ }
+
+ Component newUI = getUI(node);
+
+ // now, we are free to open the ui associated with the selected node in navigation
+
+ // get the bean associated with the node
+ Object data = getNavigationTreeModel().getBean(path);
+
+ // save it in context (must be done before init ui)
+ addSelectedBeanInContext(node, data);
+
+ if (newUI == null) {
+
+ // a new ui instance is required
+ newUI = createUI(node);
+ }
+
+ JAXXContext ctxt = getContext();
+ NavigationTreeContextHelper helper = getContextHelper();
+
+ // save in context current node context path
+ helper.setSelectedPath(ctxt, node.getFullPath());
+
+ // save in context current node
+ helper.setSelectedNode(ctxt, node);
+
+ // save in context current ui
+// helper.setSelectedUI(ctxt, newUI);
+
+ // really open the ui associated with the selected node
+ // init ui before to be visible
+ if (newUI instanceof NavigationContentUI) {
+ ((NavigationContentUI) newUI).openUI(node);
+ }
+
+ // set ui in content
+ openUI(newUI, node);
+
+ } catch (Exception e) {
+ // remove data from context
+
+ // if any error, go back to previvous node
+ treateError(e);
+ }
+ }
+
+ /**
+ * Prepare le context a utiliser pour initialiser une nouvelle ui.
+ *
+ * @param node le noeud associé à l'ui à créer
+ * @return le context à utiliser pour instancier l'ui
+ * @throws Exception if any
+ */
+ protected JAXXContext createUIContext(NavigationTreeNode node) throws Exception {
+
+ if (node.getUIHandlerClass() == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("no action associated with ui " + node.getUIClass());
+ }
+ // no action associated, just
+ return getContext();
+ }
+
+ JAXXAction action = node.getUIHandlerClass().newInstance();
+
+ // init context with
+ JAXXInitialContext uiContext = action.init(getContext());
+ return uiContext;
+ }
+
+ protected void addSelectedBeanInContext(NavigationTreeNode node, Object data) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("find data for contextPath <" + node.getFullPath() + "> : " + (data == null ? null : data.getClass()));
+ }
+ JAXXContext ctxt = getContext();
+ NavigationTreeContextHelper helper = getContextHelper();
+
+ // remove previous selected bean
+ //TODO-TC-20091004 should have an automatic clean context method while
+ helper.setSelectedBean(ctxt, null);
+
+ if (data != null) {
+
+ helper.setSelectedBean(ctxt, data);
+ }
+ }
+}
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModel.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -0,0 +1,314 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package jaxx.runtime.swing.navigation;
+
+import jaxx.runtime.JAXXContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.tree.TreeModelSupport;
+import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import org.jdesktop.swingx.treetable.MutableTreeTableNode;
+import org.jdesktop.swingx.treetable.TreeTableNode;
+
+import javax.swing.table.TableModel;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.MutableTreeNode;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Model of the tree used for a navigation tree table.
+ * <p/>
+ * Il est composé de {@link NavigationTreeNode}
+ *
+ * @author sletellier
+ * @since 2.0.0
+ */
+public class NavigationTreeTableModel extends DefaultTreeTableModel implements NavigationModel {
+
+ static private final long serialVersionUID = 1L;
+
+ /**
+ * Logger
+ */
+ static private final Log log = LogFactory.getLog(NavigationTreeTableModel.class);
+
+ /**
+ * The path separator used to build the {@link NavigationTreeNode#fullPath}.
+ *
+ * @see NavigationTreeNode#getNodePath()
+ * @see NavigationTreeNode#getFullPath()
+ */
+ protected final String pathSeparator;
+
+ /**
+ * Context to retrieve beans
+ */
+ private JAXXContext context;
+
+ protected List<String> columnsName;
+
+ public NavigationTreeTableModel(String pathSeparator, JAXXContext context, List<String> columnsName) {
+ super(null);
+ this.pathSeparator = pathSeparator;
+ this.context = context;
+ this.columnsName = columnsName;
+ }
+
+ /**
+ * @see NavigationModel#getRoot()
+ */
+ public NavigationTreeTableNode getRoot() {
+ return (NavigationTreeTableNode) super.root;
+ }
+
+ public TreeNode[] getPathToRoot(TreeNode aNode) {
+ if (aNode == null){
+ return null;
+ }
+ return super.getPathToRoot((TreeTableNode)aNode);
+
+ }
+
+ public void setRoot(NavigationTreeTableNode root) {
+ this.root = root;
+ getModelSupport().fireNewRoot();
+ }
+
+ /**
+ * Message this to remove node from its parent. This will message
+ * nodesWereRemoved to create the appropriate event. This is the preferred
+ * way to remove a node as it handles the event creation for you.
+ */
+ public void removeNodeFromParent(MutableTreeNode node) {
+ MutableTreeTableNode parent = (MutableTreeTableNode) node.getParent();
+
+ if (parent == null) {
+ throw new IllegalArgumentException("node does not have a parent.");
+ }
+
+ int index = parent.getIndex(node);
+ node.removeFromParent();
+
+ modelSupport.fireChildRemoved(new TreePath(getPathToRoot(parent)),
+ index, node);
+ }
+
+ /**
+ * @see NavigationModel#findNode(String)
+ */
+ public NavigationTreeNode findNode(String path) {
+ return findNode(getRoot(), path, (Pattern) null);
+ }
+
+ /**
+ * @see NavigationModel#findNode(String, String)
+ */
+ public NavigationTreeNode findNode(String path, String regex) {
+ return findNode(getRoot(), path, regex);
+ }
+
+ /**
+ * @see NavigationModel#findNode(String, Pattern)
+ */
+ public NavigationTreeNode findNode(String path, Pattern regex) {
+ return findNode(getRoot(), path, regex);
+ }
+
+ /**
+ * @see NavigationModel#findNode(NavigationTreeNode, String)
+ */
+ public NavigationTreeNode findNode(NavigationTreeNode root, String path) {
+ return findNode(root, path, (Pattern) null);
+ }
+
+ /**
+ * @see NavigationModel#findNode(NavigationTreeNode, String, String)
+ */
+ public NavigationTreeNode findNode(NavigationTreeNode root, String path, String regex) {
+ return findNode(root, path, regex == null ? null : Pattern.compile(regex));
+ }
+
+ /**
+ * @see NavigationModel#findNode(NavigationTreeNode, String, Pattern)
+ */
+ public NavigationTreeNode findNode(NavigationTreeNode root, String path, Pattern regex) {
+ if (regex != null) {
+ Matcher matcher = regex.matcher(path);
+ if (!matcher.matches() || matcher.groupCount() < 1) {
+ log.warn("no matching regex " + regex + " to " + path);
+ return null;
+ }
+ path = matcher.group(1);
+ if (log.isDebugEnabled()) {
+ log.debug("matching regex " + regex + " : " + path);
+ }
+ }
+ StringTokenizer stk = new StringTokenizer(path, pathSeparator);
+ NavigationTreeNode result = root;
+ // pas the first token (matches the root node)
+ if (root.isRoot() && stk.hasMoreTokens()) {
+ String rootPath = stk.nextToken();
+ if (!rootPath.equals(root.getNodePath())) {
+ return null;
+ }
+ }
+ while (stk.hasMoreTokens()) {
+ result = result.getChild(stk.nextToken());
+ }
+ return result;
+ }
+
+ /**
+ * @see NavigationModel#getContext()
+ */
+ public JAXXContext getContext() {
+ return context;
+ }
+
+ /**
+ * @see NavigationModel#getBean(String)
+ */
+ public Object getBean(String navigationPath) {
+ Object result;
+ NavigationTreeNode node = findNode(navigationPath, (Pattern) null);
+ result = getBean(node);
+ return result;
+ }
+
+ /**
+ * @see NavigationModel#getBean(NavigationTreeNode)
+ */
+ public Object getBean(NavigationTreeNode node) {
+ if (node == null) {
+ return null;
+ //fixme should throw a NPE exception
+ //throw new NullPointerException("node can not be null");
+ }
+ return node.getBean(getContext());
+ }
+
+
+ /**
+ * Accessor to tree model support.
+ *
+ * @return tree model support
+ */
+ protected TreeModelSupport getModelSupport() {
+ return modelSupport;
+ }
+
+ /**
+ * @see NavigationModel#nodeChanged(TreeNode)
+ */
+ public void nodeChanged(TreeNode node) {
+ if (node != null){
+ MutableTreeNode parent = (MutableTreeNode)node.getParent();
+ TreeNode[] treeNodes = getPathToRoot(parent);
+ if (treeNodes != null){
+ modelSupport.fireChildChanged(new TreePath(treeNodes), parent.getIndex(node), node);
+ } else {
+ log.error("[Node changed] Path to root is null !");
+ }
+ reload((NavigationTreeTableNode)node, true);
+ } else {
+ log.error("Node is null !");
+ }
+ }
+
+ /**
+ * @see NavigationModel#nodeStructureChanged(TreeNode)
+ */
+ public void nodeStructureChanged(TreeNode node) {
+ if (node != null){
+ MutableTreeNode parent = (MutableTreeNode)node.getParent();
+ TreeNode[] treeNodes = getPathToRoot(parent);
+ if (treeNodes != null){
+ modelSupport.fireTreeStructureChanged(new TreePath(treeNodes));
+ } else {
+ log.error("[Node structure changed] Path to root is null !");
+ }
+ reload((NavigationTreeTableNode)node, true);
+ } else {
+ log.error("Node is null !");
+ }
+ }
+
+ /**
+ * @see NavigationModel#nodeChanged(TreeNode, boolean)
+ */
+ public void nodeChanged(TreeNode node, boolean deep) {
+ if (node != null){
+ MutableTreeNode parent = (MutableTreeNode)node.getParent();
+ TreeNode[] treeNodes = getPathToRoot(parent);
+ if (treeNodes != null){
+ modelSupport.fireChildChanged(new TreePath(treeNodes), parent.getIndex(node), node);
+ } else {
+ log.error("[Node changed] Path to root is null !");
+ }
+ reload((NavigationTreeTableNode)node, deep);
+ } else {
+ log.error("Node is null !");
+ }
+ }
+
+ protected void reload(NavigationTreeTableNode node) {
+ reload(node, false);
+ }
+
+ protected void reload(NavigationTreeTableNode node, boolean deep) {
+ if (node == null) {
+ return;
+ }
+ node.reload(getContext());
+
+ if (deep) {
+ Enumeration<?> childs = node.children();
+ while (childs.hasMoreElements()) {
+ NavigationTreeTableNode o = (NavigationTreeTableNode) childs.nextElement();
+ reload(o, true);
+ }
+ }
+ }
+
+ /**
+ * @see NavigationModel#getPathSeparator()
+ */
+ public String getPathSeparator() {
+ return pathSeparator;
+ }
+
+ @Override
+ public int getColumnCount(){
+ return columnsName.size();
+ }
+
+ @Override
+ public String getColumnName(int column){
+ return columnsName.get(column);
+ }
+
+}
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModelBuilder.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModelBuilder.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableModelBuilder.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -0,0 +1,264 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package jaxx.runtime.swing.navigation;
+
+import jaxx.runtime.JAXXAction;
+import jaxx.runtime.JAXXContext;
+import jaxx.runtime.JAXXObject;
+import jaxx.runtime.context.JAXXContextEntryDef;
+import jaxx.runtime.decorator.Decorator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Enumeration;
+
+/**
+ * This object is design to build a {@link NavigationTreeTableModel}.
+ *
+ * @see NavigationModelBuilder
+ *
+ * @author sletellier
+ * @since 2.0.0
+ */
+public abstract class NavigationTreeTableModelBuilder implements NavigationModelBuilder{
+
+ /**
+ * Logger
+ */
+ static private final Log log = LogFactory.getLog(NavigationTreeModelBuilder.class);
+ /**
+ * The model dealed by the builder.
+ *
+ * <b>Note:</b> It is a good idea to keep only one instance of the model.
+ * If reset is required, should empty the model but not reinstanciate it.
+ */
+ protected NavigationTreeTableModel model;
+ /**
+ * default ui class to use if node does not define an ui class
+ */
+ protected Class<? extends JAXXObject> defaultUIClass;
+ /**
+ * [optional] default action class
+ */
+ protected Class<? extends JAXXAction> defaultUIHandlerClass;
+
+ public NavigationTreeTableModelBuilder(Class<? extends JAXXObject> defaultUIClass, Class<? extends JAXXAction> defaultUIHandlerClass, NavigationTreeTableModel model) {
+ this.defaultUIClass = defaultUIClass;
+ this.defaultUIHandlerClass = defaultUIHandlerClass;
+ this.model = model;
+ }
+
+ public NavigationTreeTableModel getModel() {
+ return model;
+ }
+
+ public NavigationTreeNode buildEmptyRoot(JAXXContextEntryDef<?> entryDef, String contextName) {
+ NavigationTreeTableNode node = createNavigationTreeTableNode(model.pathSeparator, contextName, entryDef, null);
+ addI18nNodeRenderer(node, "");
+ return addChildNode(null, node);
+ }
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, String libelle,
+ JAXXContextEntryDef<?> entryDef,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass) {
+ NavigationTreeTableNode node = createNavigationTreeTableNode(model.pathSeparator, contextName, entryDef, entryPath);
+ addI18nNodeRenderer(node, libelle);
+ addNodeJaxxClasses(node, uiClass, actionClass);
+ return addChildNode(parentNode, node);
+ }
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, String libelle,
+ JAXXContextEntryDef<?> entryDef,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass) {
+ NavigationTreeTableNode node = createNavigationTreeTableNode(model.pathSeparator, contextName, entryDef, null);
+ addI18nNodeRenderer(node, libelle);
+ addNodeJaxxClasses(node, uiClass, actionClass);
+ return addChildNode(parentNode, node);
+ }
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, String libelle,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass) {
+ NavigationTreeTableNode node = createNavigationTreeTableNode(model.pathSeparator, contextName, null, entryPath);
+ addI18nNodeRenderer(node, libelle);
+ addNodeJaxxClasses(node, uiClass, actionClass);
+ return addChildNode(parentNode, node);
+ }
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, Decorator<?> decorator,
+ JAXXContextEntryDef<?> entryDef,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass) {
+ NavigationTreeTableNode node = createNavigationTreeTableNode(model.pathSeparator, contextName, entryDef, entryPath);
+ addDecoratorNodeRenderer(node, decorator);
+ addNodeJaxxClasses(node, uiClass, actionClass);
+ return addChildNode(parentNode, node);
+ }
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, Decorator<?> decorator,
+ JAXXContextEntryDef<?> entryDef,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass) {
+ NavigationTreeTableNode node = createNavigationTreeTableNode(model.pathSeparator, contextName, entryDef, null);
+ addDecoratorNodeRenderer(node, decorator);
+ addNodeJaxxClasses(node, uiClass, actionClass);
+ return addChildNode(parentNode, node);
+ }
+
+ public NavigationTreeNode build(NavigationTreeNode parentNode, Decorator<?> decorator,
+ String entryPath,
+ String contextName,
+ Class<? extends JAXXObject> uiClass,
+ Class<? extends JAXXAction> actionClass) {
+ NavigationTreeTableNode node = createNavigationTreeTableNode(model.pathSeparator, contextName, null, entryPath);
+ addDecoratorNodeRenderer(node, decorator);
+ addNodeJaxxClasses(node, uiClass, actionClass);
+ return addChildNode(parentNode, node);
+ }
+
+ protected NavigationTreeNode addChildNode(NavigationTreeNode parentNode, NavigationTreeTableNode node) {
+
+ if (node.getUIClass() == null) {
+ // no ui is associated with this node, use the default one
+ node.setUIClass(defaultUIClass);
+ }
+
+ if (node.getUIHandlerClass() == null) {
+ // no ui handler associated with this node, use the default one
+ node.setUIHandlerClass(defaultUIHandlerClass);
+ }
+ if (parentNode == null) {
+ model.setRoot(node);
+ } else {
+ parentNode.add(node);
+ }
+ model.nodeStructureChanged(node);
+ return node;
+ }
+
+ public NavigationTreeNode removeChildNode(NavigationTreeNode node) {
+ NavigationTreeNode parentNode = node.getParent();
+ model.removeNodeFromParent(node);
+ return parentNode;
+ }
+
+ public void addI18nNodeRenderer(NavigationTreeNode node, String libelle) {
+ node.setRenderer(new NavigationTreeNodeRendererI18nImpl(libelle));
+ }
+
+ public void addDecoratorNodeRenderer(NavigationTreeNode node, Decorator<?> decorator) {
+ node.setRenderer(new NavigationTreeNodeRendererDecoratorImpl(decorator));
+ }
+
+ public void addNodeJaxxClasses(
+ NavigationTreeNode node,
+ Class<? extends JAXXObject> uIClass,
+ Class<? extends JAXXAction> uIHandlerClass) {
+ node.setUIClass(uIClass);
+ node.setUIHandlerClass(uIHandlerClass);
+ }
+
+ public void printModel(NavigationTreeNode node) {
+ if (node == null) {
+ return;
+ }
+ log.info("node " + node.getFullPath() + ", jxpath: " + node.getJaxxContextEntryPath() + ", entryContextDef: " + node.getJaxxContextEntryDef());
+ if (log.isDebugEnabled()) {
+ log.debug("node userObject" + node.getUserObject());
+ log.debug("value from node " + node.getBean(getModel().getContext()));
+ log.debug("value from model " + getModel().getBean(node));
+ }
+ Enumeration<?> children = node.children();
+ while (children.hasMoreElements()) {
+ printModel((NavigationTreeNode) children.nextElement());
+ }
+ }
+
+ // To create your own instance of NavigationTreeTableNode
+ public abstract NavigationTreeTableNode createNavigationTreeTableNode(String pathSeparator, String contextName, JAXXContextEntryDef<?> jaxxContextEntryDef, String jaxxContextEntryPath);
+
+ public static abstract class ChildBuilder<O> {
+
+ protected NavigationTreeModelBuilder builder;
+
+ protected ChildBuilder(NavigationTreeModelBuilder builder) {
+ this.builder = builder;
+ }
+
+ protected abstract void init(Class<? extends O> klass);
+
+ protected abstract Decorator<? extends O> getDecorator(O child);
+
+ protected abstract String getJXPath(O child);
+
+ protected abstract String getNavigationPath(O child);
+
+ public void build(NavigationTreeNode parent, boolean cacheValues, Class<? extends O> klass, java.util.Collection<? extends O> beans, Class<? extends JAXXObject> ui, Class<? extends JAXXAction> actionClass) {
+
+ if (beans == null || beans.isEmpty()) {
+ // no bean to treate
+ return;
+ }
+
+ init(klass);
+
+ NavigationTreeNode node;
+
+ for (O o : beans) {
+ node = builder.build(parent, getDecorator(o), getJXPath(o), getNavigationPath(o), ui, actionClass);
+ if (cacheValues) {
+ // cache the bean value to improve performance
+ node.setBean(o);
+ }
+ }
+ }
+
+ public void build(NavigationTreeNode parent, boolean cacheValues, Class<? extends O> klass, O[] beans, Class<? extends JAXXObject> ui, Class<? extends JAXXAction> actionClass) {
+
+ if (beans == null || beans.length == 0) {
+ // no bean to treate
+ return;
+ }
+
+ init(klass);
+
+ NavigationTreeNode node;
+
+ for (O o : beans) {
+ node = builder.build(parent, getDecorator(o), getJXPath(o), getNavigationPath(o), ui, actionClass);
+ if (cacheValues) {
+ // cache the bean value to improve performance
+ node.setBean(o);
+ }
+ }
+ }
+ }
+}
Added: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableNode.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableNode.java (rev 0)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeTableNode.java 2010-02-12 18:49:48 UTC (rev 1739)
@@ -0,0 +1,78 @@
+/*
+ * *##%
+ * JAXX Runtime
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package jaxx.runtime.swing.navigation;
+
+import jaxx.runtime.context.JAXXContextEntryDef;
+import org.jdesktop.swingx.treetable.TreeTableNode;
+
+import java.util.Enumeration;
+
+/**
+ * Node of the {@link NavigationTreeTableModel}.
+ *
+ * @see NavigationTreeNode
+ *
+ * @author sletellier
+ * @since 2.0.0
+ */
+public abstract class NavigationTreeTableNode extends NavigationTreeNode implements TreeTableNode{
+
+ public NavigationTreeTableNode(String pathSeparator, String navigationPath, Object jaxxContextEntryDef) {
+ super(pathSeparator, navigationPath, jaxxContextEntryDef);
+ }
+
+ public NavigationTreeTableNode(String pathSeparator, String navigationPath, JAXXContextEntryDef<?> jaxxContextEntryDef, String jaxxContextEntryPath) {
+ super(pathSeparator, navigationPath, jaxxContextEntryDef, jaxxContextEntryPath);
+ }
+
+ @Override
+ public NavigationTreeTableNode getChildAt(int index) {
+ return (NavigationTreeTableNode) super.getChildAt(index);
+ }
+
+ @Override
+ public NavigationTreeTableNode getParent() {
+ return (NavigationTreeTableNode) super.getParent();
+ }
+
+ /**
+ * @see NavigationTreeNode#getChild(String)
+ */
+ @Override
+ public NavigationTreeTableNode getChild(String path) {
+ Enumeration<?> childs = children();
+ while (childs.hasMoreElements()) {
+ NavigationTreeTableNode son = (NavigationTreeTableNode) childs.nextElement();
+ if (path.equals(son.getNodePath())) {
+ return son;
+ }
+ }
+ return null;
+ }
+
+ public abstract Object getValueAt(int column);
+
+ public abstract int getColumnCount();
+
+ public abstract boolean isEditable(int column);
+
+ public abstract void setValueAt(Object aValue, int column);
+}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
+++ trunk/pom.xml 2010-02-12 18:49:48 UTC (rev 1739)
@@ -249,6 +249,7 @@
<groupId>org.swinglabs</groupId>
<artifactId>swingx</artifactId>
<version>1.6</version>
+ <scope>compile</scope>
</dependency>
<!--dependency>
2
1
r1738 - in trunk: . jaxx-compiler jaxx-demo jaxx-runtime jaxx-swing-action jaxx-widgets maven-jaxx-plugin
by tchemit@users.nuiton.org 08 Feb '10
by tchemit@users.nuiton.org 08 Feb '10
08 Feb '10
Author: tchemit
Date: 2010-02-08 16:58:19 +0100 (Mon, 08 Feb 2010)
New Revision: 1738
Modified:
trunk/jaxx-compiler/pom.xml
trunk/jaxx-demo/pom.xml
trunk/jaxx-runtime/pom.xml
trunk/jaxx-swing-action/pom.xml
trunk/jaxx-widgets/pom.xml
trunk/maven-jaxx-plugin/pom.xml
trunk/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/jaxx-compiler/pom.xml
===================================================================
--- trunk/jaxx-compiler/pom.xml 2010-02-08 15:58:16 UTC (rev 1737)
+++ trunk/jaxx-compiler/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5</version>
+ <version>2.0.0-beta-6-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-demo/pom.xml
===================================================================
--- trunk/jaxx-demo/pom.xml 2010-02-08 15:58:16 UTC (rev 1737)
+++ trunk/jaxx-demo/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5</version>
+ <version>2.0.0-beta-6-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-runtime/pom.xml
===================================================================
--- trunk/jaxx-runtime/pom.xml 2010-02-08 15:58:16 UTC (rev 1737)
+++ trunk/jaxx-runtime/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5</version>
+ <version>2.0.0-beta-6-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-swing-action/pom.xml
===================================================================
--- trunk/jaxx-swing-action/pom.xml 2010-02-08 15:58:16 UTC (rev 1737)
+++ trunk/jaxx-swing-action/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
@@ -11,7 +11,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5</version>
+ <version>2.0.0-beta-6-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-widgets/pom.xml
===================================================================
--- trunk/jaxx-widgets/pom.xml 2010-02-08 15:58:16 UTC (rev 1737)
+++ trunk/jaxx-widgets/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5</version>
+ <version>2.0.0-beta-6-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/maven-jaxx-plugin/pom.xml
===================================================================
--- trunk/maven-jaxx-plugin/pom.xml 2010-02-08 15:58:16 UTC (rev 1737)
+++ trunk/maven-jaxx-plugin/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5</version>
+ <version>2.0.0-beta-6-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-02-08 15:58:16 UTC (rev 1737)
+++ trunk/pom.xml 2010-02-08 15:58:19 UTC (rev 1738)
@@ -14,7 +14,7 @@
</parent>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5</version>
+ <version>2.0.0-beta-6-SNAPSHOT</version>
<modules>
<module>jaxx-runtime</module>
@@ -413,9 +413,9 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jaxx/tags/jaxx-2.0.0-beta-5</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/jaxx/tags/jaxx-2.0.0-beta-5</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/jaxx/tags/jaxx-2.0.0-beta-5</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/jaxx/trunk</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/jaxx/trunk</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/jaxx/trunk</url>
</scm>
</project>
1
0
Author: tchemit
Date: 2010-02-08 16:58:16 +0100 (Mon, 08 Feb 2010)
New Revision: 1737
Added:
tags/jaxx-2.0.0-beta-5/
Log:
[maven-scm] copy for tag jaxx-2.0.0-beta-5
1
0
r1736 - in trunk: . jaxx-compiler jaxx-demo jaxx-runtime jaxx-swing-action jaxx-widgets maven-jaxx-plugin
by tchemit@users.nuiton.org 08 Feb '10
by tchemit@users.nuiton.org 08 Feb '10
08 Feb '10
Author: tchemit
Date: 2010-02-08 16:58:13 +0100 (Mon, 08 Feb 2010)
New Revision: 1736
Modified:
trunk/jaxx-compiler/pom.xml
trunk/jaxx-demo/pom.xml
trunk/jaxx-runtime/pom.xml
trunk/jaxx-swing-action/pom.xml
trunk/jaxx-widgets/pom.xml
trunk/maven-jaxx-plugin/pom.xml
trunk/pom.xml
Log:
[maven-release-plugin] prepare release jaxx-2.0.0-beta-5
Modified: trunk/jaxx-compiler/pom.xml
===================================================================
--- trunk/jaxx-compiler/pom.xml 2010-02-08 15:55:36 UTC (rev 1735)
+++ trunk/jaxx-compiler/pom.xml 2010-02-08 15:58:13 UTC (rev 1736)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5-SNAPSHOT</version>
+ <version>2.0.0-beta-5</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-demo/pom.xml
===================================================================
--- trunk/jaxx-demo/pom.xml 2010-02-08 15:55:36 UTC (rev 1735)
+++ trunk/jaxx-demo/pom.xml 2010-02-08 15:58:13 UTC (rev 1736)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5-SNAPSHOT</version>
+ <version>2.0.0-beta-5</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-runtime/pom.xml
===================================================================
--- trunk/jaxx-runtime/pom.xml 2010-02-08 15:55:36 UTC (rev 1735)
+++ trunk/jaxx-runtime/pom.xml 2010-02-08 15:58:13 UTC (rev 1736)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5-SNAPSHOT</version>
+ <version>2.0.0-beta-5</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-swing-action/pom.xml
===================================================================
--- trunk/jaxx-swing-action/pom.xml 2010-02-08 15:55:36 UTC (rev 1735)
+++ trunk/jaxx-swing-action/pom.xml 2010-02-08 15:58:13 UTC (rev 1736)
@@ -11,7 +11,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5-SNAPSHOT</version>
+ <version>2.0.0-beta-5</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/jaxx-widgets/pom.xml
===================================================================
--- trunk/jaxx-widgets/pom.xml 2010-02-08 15:55:36 UTC (rev 1735)
+++ trunk/jaxx-widgets/pom.xml 2010-02-08 15:58:13 UTC (rev 1736)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5-SNAPSHOT</version>
+ <version>2.0.0-beta-5</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/maven-jaxx-plugin/pom.xml
===================================================================
--- trunk/maven-jaxx-plugin/pom.xml 2010-02-08 15:55:36 UTC (rev 1735)
+++ trunk/maven-jaxx-plugin/pom.xml 2010-02-08 15:58:13 UTC (rev 1736)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5-SNAPSHOT</version>
+ <version>2.0.0-beta-5</version>
</parent>
<groupId>org.nuiton.jaxx</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-02-08 15:55:36 UTC (rev 1735)
+++ trunk/pom.xml 2010-02-08 15:58:13 UTC (rev 1736)
@@ -14,7 +14,7 @@
</parent>
<artifactId>jaxx</artifactId>
- <version>2.0.0-beta-5-SNAPSHOT</version>
+ <version>2.0.0-beta-5</version>
<modules>
<module>jaxx-runtime</module>
@@ -413,9 +413,9 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jaxx/trunk</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/jaxx/trunk</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/jaxx/trunk</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/jaxx/tags/jaxx-2.0.0-beta-5</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/jaxx/tags/jaxx-2.0.0-beta-5</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/jaxx/tags/jaxx-2.0.0-beta-5</url>
</scm>
</project>
1
0
r1735 - in trunk: jaxx-compiler/src/main/java/jaxx/compiler jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation jaxx-runtime/src/test/java/jaxx/runtime/validator/field jaxx-swing-action/src/main/java/org/nuiton/jaxx/action
by tchemit@users.nuiton.org 08 Feb '10
by tchemit@users.nuiton.org 08 Feb '10
08 Feb '10
Author: tchemit
Date: 2010-02-08 16:55:36 +0100 (Mon, 08 Feb 2010)
New Revision: 1735
Modified:
trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java
trunk/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java
trunk/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java
trunk/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java
trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java
Log:
fix javadoc
Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java
===================================================================
--- trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2010-02-08 15:54:46 UTC (rev 1734)
+++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2010-02-08 15:55:36 UTC (rev 1735)
@@ -1,23 +1,23 @@
-/*
- * *##%
- * JAXX Compiler
- * Copyright (C) 2008 - 2009 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * ##%*
- */
+/*
+ * *##%
+ * JAXX Compiler
+ * Copyright (C) 2008 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
package jaxx.compiler;
import org.apache.commons.lang.builder.ToStringBuilder;
@@ -27,7 +27,7 @@
import jaxx.runtime.JAXXContext;
/**
- * Options of the {@link JAXXCompiler} and {@link JAXXCompilerLaunchor}.
+ * Options of the {@link JAXXCompiler} and {@link JAXXEngine}.
*
*/
public class DefaultCompilerConfiguration implements CompilerConfiguration {
Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java
===================================================================
--- trunk/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java 2010-02-08 15:54:46 UTC (rev 1734)
+++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java 2010-02-08 15:55:36 UTC (rev 1735)
@@ -27,7 +27,7 @@
import java.util.List;
/**
- * I18n methods to add {@link org.nuiton.i18n.I18n#_(java.lang.String, java.lang.Object[])} method on some attributes.
+ * I18n methods to add {@link org.nuiton.i18n.I18n#_(String, Object...)} method on some attributes.
* <p/>
* Make sure to set an i18nable compiler to have his {@link CompilerConfiguration#isI18nable()} returning true.
*
Modified: trunk/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java
===================================================================
--- trunk/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java 2010-02-08 15:54:46 UTC (rev 1734)
+++ trunk/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java 2010-02-08 15:55:36 UTC (rev 1735)
@@ -102,7 +102,7 @@
}
/**
- * Test the {@link NavigationTreeModel#getJAXXContextValue(jaxx.runtime.JAXXContext, String)} with an entry point
+ * Test the {@link NavigationTreeModel#getBean(String)}} with an entry point
* as a bean.
* <p/>
* Tree is like this
@@ -222,7 +222,7 @@
}
/**
- * Test the {@link NavigationTreeModel#getJAXXContextValue(jaxx.runtime.JAXXContext, String)} with an entry point
+ * Test the {@link NavigationTreeModel#getBean(String)} with an entry point
* as a list.
* <p/>
* Tree is like this
Modified: trunk/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java
===================================================================
--- trunk/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java 2010-02-08 15:54:46 UTC (rev 1734)
+++ trunk/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java 2010-02-08 15:55:36 UTC (rev 1735)
@@ -18,10 +18,10 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* ##%*
*/
-package jaxx.runtime.validator.field;
+package jaxx.runtime.validator.field;
/**
- * Abstract class to test a specific validator for the {@link Validatorbean}.
+ * Abstract class to test a specific validator for the {@link ValidatorBean}.
*
* @author chemit
* @since 1.3
Modified: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java
===================================================================
--- trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java 2010-02-08 15:54:46 UTC (rev 1734)
+++ trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java 2010-02-08 15:55:36 UTC (rev 1735)
@@ -39,12 +39,12 @@
/**
* The contract to be realized to resolve an {@link MyAbstractAction} configuration.
* <p/>
- * Configuration is done by a Annotation of type {@link A} placed on the action class.
+ * Configuration is done by a Annotation of type {@code A} placed on the action class.
* <p/>
* If the instanciated action box the real action, we should always search on the boxed action.
* <p/>
* Moreover, a action can only be fired by a certain type of component (for example a Button or a ComboBox), the class
- * of the component type is given by the {@link C} class.
+ * of the component type is given by the {@code C} class.
*
* @param <A> type of annotation for config
* @param <C> type of component
1
0
Author: tchemit
Date: 2010-02-08 16:54:46 +0100 (Mon, 08 Feb 2010)
New Revision: 1734
Modified:
trunk/pom.xml
Log:
add checkstyle report
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-02-07 11:40:13 UTC (rev 1733)
+++ trunk/pom.xml 2010-02-08 15:54:46 UTC (rev 1734)
@@ -398,6 +398,15 @@
</build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version> 2.4</version>
+ </plugin>
+ </plugins>
+ </reporting>
+
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
1
0
r1733 - in trunk/jaxx-runtime/src/main/java/jaxx/runtime: decorator swing
by tchemit@users.nuiton.org 07 Feb '10
by tchemit@users.nuiton.org 07 Feb '10
07 Feb '10
Author: tchemit
Date: 2010-02-07 12:40:13 +0100 (Sun, 07 Feb 2010)
New Revision: 1733
Modified:
trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java
Log:
Anomalie #302: Fix NPE in Decorator sort when context data is null
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java 2010-02-01 01:40:24 UTC (rev 1732)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java 2010-02-07 11:40:13 UTC (rev 1733)
@@ -156,6 +156,15 @@
public int compare(O o1, O o2) {
Comparable<Comparable<?>> c1 = valueCache.get(o1);
Comparable<Comparable<?>> c2 = valueCache.get(o2);
+ if (c1 == null) {
+ if (c2 == null) {
+ return 0;
+ }
+ return 1;
+ }
+ if (c2 == null) {
+ return -1;
+ }
return c1.compareTo(c2);
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java 2010-02-01 01:40:24 UTC (rev 1732)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java 2010-02-07 11:40:13 UTC (rev 1733)
@@ -34,7 +34,7 @@
*/
public class OneClicListSelectionModel implements ListSelectionModel {
- /** to use log facility, just put in your code: log.info("..."); */
+ /** Logger */
static private Log log = LogFactory.getLog(OneClicListSelectionModel.class);
protected ListSelectionModel delegate;
protected final ListModel model;
1
0
Author: tchemit
Date: 2010-02-01 02:40:24 +0100 (Mon, 01 Feb 2010)
New Revision: 1732
Modified:
trunk/jaxx-demo/pom.xml
Log:
clean imports
Modified: trunk/jaxx-demo/pom.xml
===================================================================
--- trunk/jaxx-demo/pom.xml 2010-02-01 01:32:44 UTC (rev 1731)
+++ trunk/jaxx-demo/pom.xml 2010-02-01 01:40:24 UTC (rev 1732)
@@ -169,6 +169,7 @@
<groupId>org.nuiton.i18n</groupId>
<artifactId>maven-i18n-plugin</artifactId>
<configuration>
+ <treateDefaultEntry>true</treateDefaultEntry>
<entries>
<entry>
<basedir>${maven.gen.dir}/java/</basedir>
1
0