This is an automated email from the git hooks/post-receive script. New commit to annotated tag v2.0.0-beta-1 in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git commit c9ccdc2cccb135412543975b7a25aaf59c0ef2cc Author: Tony Chemit <chemit@codelutin.com> Date: Fri Oct 23 16:42:17 2009 +0000 - add a contract NavigationContentUI and use it in NavigationTreeHandler --- .../swing/navigation/NavigationContentUI.java | 29 ++++++++++++++++++++++ .../swing/navigation/NavigationTreeHandler.java | 6 +++++ 2 files changed, 35 insertions(+) diff --git a/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java b/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java new file mode 100644 index 0000000..a4a02e2 --- /dev/null +++ b/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java @@ -0,0 +1,29 @@ +package jaxx.runtime.swing.navigation; + +/** + * Basic contract on a content UI. + * + * @author chemit + * @since 2.0.0 + */ +public interface NavigationContentUI { + + /** + * Init the ui just before been opened by the method + * {@link NavigationTreeHandler#openUI(java.awt.Component, jaxx.runtime.swing.navigation.NavigationTreeNode)}. + * + * @param node the selected node associated to the ui + * @throws Exception + * @see NavigationTreeHandler#openUI(java.awt.Component, jaxx.runtime.swing.navigation.NavigationTreeNode) + */ + void openUI(NavigationTreeNode node) throws Exception; + + /** + * Clean the ui after been closed by the method {@link NavigationTreeHandler#closeUI(java.awt.Component)}. + * + * @param node the selected node associated to the ui + * @throws Exception + * @see NavigationTreeHandler#closeUI(java.awt.Component) + */ + void closeUI(NavigationTreeNode node) throws Exception; +} diff --git a/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java b/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java index 1a79868..89afc9c 100644 --- a/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java +++ b/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java @@ -170,6 +170,9 @@ public abstract class NavigationTreeHandler extends DefaultTreeSelectionModel { // can not changed current node return; } + if (component instanceof NavigationContentUI) { + ((NavigationContentUI) component).closeUI((NavigationTreeNode) path.getLastPathComponent()); + } } catch (Exception ex) { treateError(ex); return; @@ -217,6 +220,9 @@ public abstract class NavigationTreeHandler extends DefaultTreeSelectionModel { helper.setSelectedNode(ctxt, node); // really open the ui associated with the selected node + if (newUI instanceof NavigationContentUI) { + ((NavigationContentUI) newUI).openUI(node); + } openUI(newUI, node); } catch (Exception e) { -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.