Author: tchemit Date: 2010-06-24 15:16:34 +0200 (Thu, 24 Jun 2010) New Revision: 1992 Url: http://nuiton.org/repositories/revision/jaxx/1992 Log: use new tree api for demo navigation Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTab.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/tree/ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNode.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNodeLoador.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoTreeHelper.java Removed: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/ Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSourcesHandler.java trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/AbstractContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/HidorButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BindingExtremeDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DefaultDemoUIModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DemoUIModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties trunk/jaxx-demo/src/main/resources/log4j.properties Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,20 +25,20 @@ package jaxx.demo; -import java.io.IOException; -import java.io.InputStream; -import java.beans.PropertyChangeListener; -import java.util.Locale; -import java.util.Properties; - -import jaxx.demo.component.jaxx.navigation.FullNavigationTreeDemo; +import jaxx.demo.component.jaxx.tree.JaxxTreeDemo; import jaxx.runtime.JAXXUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.nuiton.util.ApplicationConfig; import org.nuiton.util.Version; import org.nuiton.util.VersionUtil; + +import java.beans.PropertyChangeListener; +import java.io.IOException; +import java.io.InputStream; +import java.util.Locale; +import java.util.Properties; + import static org.nuiton.i18n.I18n._; /** @@ -51,10 +51,9 @@ */ public class DemoConfig extends ApplicationConfig { - /** - * to use log facility, just put in your code: log.info(\"...\"); - */ + /** to use log facility, just put in your code: log.info(\"...\"); */ static private Log log = LogFactory.getLog(DemoConfig.class); + /** * le fichier de configuration de l'application avec les informations sur * le projet (version, license,...) et la configuration des ui (icons, ...) @@ -62,7 +61,9 @@ public static final String APPLICATION_PROPERTIES = "/jaxx-demo.properties"; public static final String PROPERTY_FULLSCREEN = "fullscreen"; + public static final String PROPERTY_LOCALE = "locale"; + public static final String PROPERTY_FONT_SIZE = "fontSize"; public DemoConfig() { @@ -108,9 +109,7 @@ return "Version " + getVersion() + " Codelutin @ 2008-2009"; } - /** - * @return la version de l'application. - */ + /** @return la version de l'application. */ public Version getVersion() { Version option = getOption(Version.class, "version"); return option; @@ -195,6 +194,7 @@ ////////////////////////////////////////////////// // Toutes les options disponibles ////////////////////////////////////////////////// + public enum Option implements OptionDef { CONFIG_FILE( @@ -228,15 +228,21 @@ DEMO_PATH( "ui.demo.path", _("jaxxdemo.config.ui.demo.path"), - "$root/jaxxdemo.tree.component.jaxx/jaxxdemo.tree.component.jaxx.tree.navigation/" + FullNavigationTreeDemo.class.getSimpleName(), + "jaxxdemo.tree/jaxxdemo.tree.component.jaxx/jaxxdemo.tree.component.jaxx.tree/" + JaxxTreeDemo.class.getSimpleName(), String.class, false, true); + public final String key; + public final String description; + public String defaultValue; + public final Class<?> type; + public boolean _transient; + public boolean _final; Option(String key, @@ -265,12 +271,12 @@ @Override public void setTransient(boolean _transient) { - this._transient=_transient; + this._transient = _transient; } @Override public void setFinal(boolean _final) { - this._final=_final; + this._final = _final; } @Override Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -23,9 +23,9 @@ #L% --> -<JTabbedPane id='top'> +<JPanel id='top' abstract='true'> - <script><![CDATA[ + <script><![CDATA[ protected String[] getSources() { if (getClass() == DemoPanel.class) { @@ -49,31 +49,7 @@ public String getDemoTabTitle() { return getLabel() + " Demo"; } - -private void $afterCompleteSetup() { - SwingUtilities.invokeLater(new Runnable() { - - @Override - public void run() { - if (getSources().length == 0) { - top.remove(sourceTabs); - return; - } - sourceTabs.init(); - } - }); -} ]]> - </script> + </script> - <tab id='tabDemoPanel' title='{getDemoTabTitle()}'> - <JPanel id='demoPanel'/> - </tab> - - <tab id='tabDemoSources' title='Sources'> - <DemoSources id='sourceTabs' - sources='{java.util.Arrays.asList(getSources())}' - incomingClass='{getClass()}' - constructorParams='this'/> - </tab> -</JTabbedPane> \ No newline at end of file +</JPanel> \ No newline at end of file Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,7 +25,7 @@ <JPanel layout='{new BorderLayout()}'> - <script><![CDATA[ + <script><![CDATA[ import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; import jaxx.runtime.swing.FontSizor; @@ -54,45 +54,47 @@ editor.setCaretPosition(0); } ]]> - </script> + </script> - <DemoSourcesHandler id='handler'/> + <DemoSourcesHandler id='handler'/> - <Class id='incomingClass' javaBean='null'/> + <Class id='incomingClass' javaBean='null'/> - <String id='currentSource' javaBean='null'/> + <String id='currentSource' javaBean='null'/> - <java.util.List id='sources' genericType='String' javaBean='null'/> + <java.util.List id='sources' genericType='String' javaBean='null'/> - <JToolBar id='editorPaneHeader' - floatable='false' - borderPainted='false' - opaque='false' - constraints='BorderLayout.SOUTH'> + <JToolBar id='editorPaneHeader' + floatable='false' + borderPainted='false' + opaque='false' + constraints='BorderLayout.SOUTH'> - <JComboBox id='sourceTabs' - model='{new DefaultComboBoxModel()}' - onItemStateChanged='if(event.getStateChange() == ItemEvent.SELECTED) { updateSource(event); }'/> - <javax.swing.Box.Filler - constructorParams='SwingUtil.newMinDimension(), SwingUtil.newMinDimension(), SwingUtil.newMaxXDimension()'/> - <FontSizor id='fontSizor' opaque='false' showFontSize='true' fontSize='{getConfig().getFontSize()}'/> - <!--defaultFontSize='{getConfig().getFontSize()}' fontSize='{getConfig().getFontSize()}'/>--> - </JToolBar> + <JComboBox id='sourceTabs' + model='{new DefaultComboBoxModel()}' + onItemStateChanged='if(event.getStateChange() == ItemEvent.SELECTED) { updateSource(event); }'/> + <javax.swing.Box.Filler + constructorParams='SwingUtil.newMinDimension(), SwingUtil.newMinDimension(), SwingUtil.newMaxXDimension()'/> + <FontSizor id='fontSizor' opaque='false' showFontSize='true' + fontSize='{getConfig().getFontSize()}'/> + <!--defaultFontSize='{getConfig().getFontSize()}' fontSize='{getConfig().getFontSize()}'/>--> + </JToolBar> - <JScrollPane id='editorPane' columnHeaderView='{editorPaneHeader}' constraints='BorderLayout.CENTER'> - <RSyntaxTextArea id='editor' - font-size='{getConfig().getFontSize()}' - minimumSize="{jaxx.runtime.SwingUtil.newMinDimension()}" - textAntiAliasHint='{RenderingHints.KEY_ANTIALIASING.toString()}' - editable="false" - wrapStyleWord="false" - columns="80" - lineWrap="true"/> - <!--font-size='{updateSize(getFontSizor().getFontSize())}'--> - <!-- TC-20091221 : can not use binding since we want to do something after assigment... --> - <!--text='{handler.getSourceContent(DemoSources.this, getCurrentSource())}'--> - <!--syntaxEditingStyle='{handler.getSourceEditingStyle(DemoSources.this, getCurrentSource())}'--> - </JScrollPane> + <JScrollPane id='editorPane' columnHeaderView='{editorPaneHeader}' + constraints='BorderLayout.CENTER'> + <RSyntaxTextArea id='editor' + font-size='{getConfig().getFontSize()}' + minimumSize="{jaxx.runtime.SwingUtil.newMinDimension()}" + textAntiAliasHint='{RenderingHints.KEY_ANTIALIASING.toString()}' + editable="false" + wrapStyleWord="false" + columns="80" + lineWrap="true"/> + <!--font-size='{updateSize(getFontSizor().getFontSize())}'--> + <!-- TC-20091221 : can not use binding since we want to do something after assigment... --> + <!--text='{handler.getSourceContent(DemoSources.this, getCurrentSource())}'--> + <!--syntaxEditingStyle='{handler.getSourceEditingStyle(DemoSources.this, getCurrentSource())}'--> + </JScrollPane> </JPanel> \ No newline at end of file Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSourcesHandler.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSourcesHandler.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSourcesHandler.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -46,9 +46,7 @@ */ public class DemoSourcesHandler { - /** - * Logger - */ + /** Logger */ private static final Log log = LogFactory.getLog(DemoSourcesHandler.class); protected static Map<String, String> sourcesCache; Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTab.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTab.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTab.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -0,0 +1,64 @@ +<!-- + #%L + JAXX :: Demo + + $Id$ + $HeadURL$ + %% + Copyright (C) 2008 - 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + +<JTabbedPane id='top'> + + <script><![CDATA[ + +private boolean contextInitialized; + +public DemoTab(DemoUI ui, DemoPanel panel) { + JAXXUtil.initContext(this, ui); + setContextValue(panel, "content"); + contextInitialized = true; +} + +private void $afterCompleteSetup() { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + if (demoPanel.getSources().length == 0) { + top.remove(sourceTabs); + return; + } + sourceTabs.init(); + } + }); +} + ]]> + </script> + + <tab id='tabDemoPanel' title='{demoPanel.getDemoTabTitle()}'> + <DemoPanel id='demoPanel' initializer='getContextValue(DemoPanel.class, "content")'/> + </tab> + + <tab id='tabDemoSources' title='Sources'> + <DemoSources id='sourceTabs' + sources='{java.util.Arrays.asList(demoPanel.getSources())}' + incomingClass='{demoPanel.getClass()}' + constructorParams='demoPanel'/> + </tab> +</JTabbedPane> \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTab.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Deleted: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -1,238 +0,0 @@ -/* - * #%L - * JAXX :: Demo - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.demo; - -import jaxx.demo.component.jaxx.BoxedDecoratorDemo; -import jaxx.demo.component.jaxx.StatusMessagePanelDemo; -import jaxx.demo.component.jaxx.editor.ComboEditorDemo; -import jaxx.demo.component.jaxx.editor.I18nEditorDemo; -import jaxx.demo.component.jaxx.editor.NumberEditorDemo; -import jaxx.demo.component.jaxx.navigation.FullNavigationTreeDemo; -import jaxx.demo.component.jaxx.tree.JaxxTreeDemo; -import jaxx.demo.component.swing.*; -import jaxx.demo.feature.databinding.BeanDataBindingDemo; -import jaxx.demo.feature.databinding.BindingExtremeDemo; -import jaxx.demo.feature.validation.ValidationListDemo; -import jaxx.demo.feature.validation.ValidationTableDemo; -import jaxx.demo.fun.CalculatorDemo; -import jaxx.demo.fun.CounterDemo; -import jaxx.demo.fun.LabelStyleDemo; -import jaxx.runtime.JAXXContext; -import jaxx.runtime.JAXXObject; -import jaxx.runtime.JAXXUtil; -import jaxx.runtime.context.JAXXContextEntryDef; -import jaxx.runtime.swing.CardLayout2; -import jaxx.runtime.swing.ErrorDialogUI; -import jaxx.runtime.swing.navigation.handler.NavigationHandler; -import jaxx.runtime.swing.navigation.handler.NavigationTreeHandlerWithCardLayout; -import jaxx.runtime.swing.navigation.tree.NavigationTreeHelper; -import jaxx.runtime.swing.navigation.tree.NavigationTreeModel; -import jaxx.runtime.swing.navigation.tree.NavigationTreeModelBuilder; -import jaxx.runtime.swing.navigation.tree.NavigationTreeNode; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.swing.*; -import java.util.Stack; - -import static org.nuiton.i18n.I18n.n_; - -/** @author tchemit <chemit@codelutin.com> */ -public class DemoTreeHelper extends NavigationTreeHelper { - - static private final Log log = LogFactory.getLog(DemoTreeHelper.class); - - public DemoTreeHelper() { - super("demo"); - } - - @Override - public NavigationTreeModel createTreeModel(JAXXContext context) { - - if (log.isDebugEnabled()) { - log.debug("start creating demo model"); - } - - TreeModelBuilder builder = new TreeModelBuilder(context); - - builder.addText(n_("jaxxdemo.tree.component.swing")). - addText(n_("jaxxdemo.tree.component.swing.buttons")). - addDemo(JButtonDemo.class). - addDemo(JCheckBoxDemo.class). - addDemo(JRadioButtonDemo.class). - addDemo(JToggleButtonDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.component.swing.form")). - addText(n_("jaxxdemo.tree.component.swing.form.text")). - addDemo(JPasswordFieldDemo.class). - addDemo(JTextFieldDemo.class). - addDemo(JTextAreaDemo.class). - goUp(). - addDemo(JComboBoxDemo.class). - addDemo(JListDemo.class). - addDemo(JSliderDemo.class). - addDemo(JSpinnerDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.component.swing.layout")). - addDemo(JSplitPaneDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.component.swing.menu")). - addDemo(JMenuItemDemo.class). - addDemo(JCheckBoxMenuItemDemo.class). - addDemo(JRadioButtonMenuItemDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.component.swing.window")). - addDemo(JDialogDemo.class). - goUp(). - addDemo(JProgressBarDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.component.jaxx")). - addDemo(HidorButtonDemo.class). - addText(n_("jaxxdemo.tree.component.jaxx.editor")). - addDemo(NumberEditorDemo.class). - addDemo(ComboEditorDemo.class). - addDemo(I18nEditorDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.component.jaxx.tree.navigation")). - addDemo(FullNavigationTreeDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.component.jaxx.tree")). - addDemo(JaxxTreeDemo.class). - goUp(). - addDemo(BoxedDecoratorDemo.class). - addDemo(StatusMessagePanelDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.feature")). - addText(n_("jaxxdemo.tree.features.databinding")). - addDemo(BindingExtremeDemo.class). - addDemo(BeanDataBindingDemo.class). - goUp(). - addText(n_("jaxxdemo.tree.features.validation")). - addDemo(ValidationListDemo.class). - addDemo(ValidationTableDemo.class). - goUp(). - goUp(). - addText(n_("jaxxdemo.tree.fun")). - addDemo(LabelStyleDemo.class). - addDemo(CounterDemo.class). - addDemo(CalculatorDemo.class); - - NavigationTreeModel model = builder.getModel(); - - if (log.isDebugEnabled()) { - builder.printModel(model.getRoot()); - } - // save tree model in context - setModel(context, model); - return model; - } - - @Override - public NavigationHandler<NavigationTreeNode> createTreeHandler(JAXXObject context) { - - NavigationHandler<NavigationTreeNode> handler; - - handler = new NavigationTreeHandlerWithCardLayout<NavigationTreeNode>( - getPrefix(), - context, - NavigationHandler.Strategy.PER_UI_TYPE) { - - private static final long serialVersionUID = 1L; - - @Override - public NavigationTreeModel getNavigationTreeModel() { - return (NavigationTreeModel) getModel(getContext()); - } - - @Override - protected JPanel getContentContainer() { - return getContext().getContent(); - } - - @Override - protected CardLayout2 getContentLayout() { - return getContext().getContentLayout(); - } - - @Override - public void treateError(Exception e) { - ErrorDialogUI.showError(e); - } - - @Override - public DemoUI getContext() { - return (DemoUI) context; - } - }; - // on ne peut selectionner qu'un seul noeud a la fois - handler.setSelectionMode(NavigationHandler.SINGLE_TREE_SELECTION); - - // save handler in ui context - setTreeHandler(context, handler); - return handler; - } - - static class TreeModelBuilder extends NavigationTreeModelBuilder { - - /** la definition de l'unqiue object a partage */ - static private final JAXXContextEntryDef<DemoConfig> def = - JAXXUtil.newContextEntryDef(DemoConfig.class); - - /** la pile des noeuds parent */ - protected Stack<NavigationTreeNode> nodes; - - protected TreeModelBuilder(JAXXContext context) { - super("/", context, DemoPanel.class, null); - nodes = new Stack<NavigationTreeNode>(); - nodes.add(buildEmptyRoot(def, "$root")); - } - - protected TreeModelBuilder goUp() { - nodes.pop(); - return this; - } - - protected TreeModelBuilder addText(String label) { - NavigationTreeNode parentNode = nodes.peek(); - parentNode = build(parentNode, label, def, label, null, null); - if (log.isDebugEnabled()) { - log.debug(label + " [" + parentNode.getFullPath() + "]"); - } - nodes.push(parentNode); - return this; - } - - protected TreeModelBuilder addDemo(Class<? extends DemoPanel> demoClass) { - NavigationTreeNode parentNode = nodes.peek(); - String label = demoClass.getSimpleName(); - if (log.isDebugEnabled()) { - log.debug(label + " [" + parentNode.getFullPath() + "]"); - } - build(parentNode, label, def, label, demoClass, null); - return this; - } - } -} Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css 2010-06-24 13:16:34 UTC (rev 1992) @@ -74,8 +74,8 @@ toolTipText:"jaxxdemo.action.locale.fr.tip"; actionIcon:"i18n-fr"; enabled:{!acceptLocale(getConfig().getLocale(), "fr_FR")}; -mnemonic:F; -_help:{"ui.main.menu.file.locale.fr"}; + mnemonic:F; + _help:{"ui.main.menu.file.locale.fr"}; } #menuFileLanguageUK { @@ -83,8 +83,8 @@ toolTipText:"jaxxdemo.action.locale.uk.tip"; actionIcon:"i18n-uk"; enabled:{!acceptLocale(getConfig().getLocale(), "en_GB")}; -mnemonic:U; -_help:{"ui.main.menu.file.locale.uk"}; + mnemonic:U; + _help:{"ui.main.menu.file.locale.uk"}; } #menuFileFullscreen { @@ -93,7 +93,7 @@ actionIcon:"fullscreen"; mnemonic:P; visible:{!isUndecorated()}; -_help:{"ui.main.menu.file.fullscreen"}; + _help:{"ui.main.menu.file.fullscreen"}; } #menuFileNormalscreen { @@ -105,7 +105,7 @@ _help:{"ui.main.menu.file.leave-fullscreen"}; } -#menuFileExit{ +#menuFileExit { text:"jaxxdemo.action.exit"; toolTipText:"jaxxdemo.action.exit.tip"; actionIcon:"exit"; @@ -113,13 +113,13 @@ _help:{"ui.main.menu.file.exit"}; } -#menuHelp{ +#menuHelp { text:"jaxxdemo.menu.help"; mnemonic:e; _help:{"ui.main.menu.help"}; } -#menuHelpHelp{ +#menuHelpHelp { text:"jaxxdemo.action.help"; toolTipText:"jaxxdemo.action.help.tip"; actionIcon:"help"; @@ -127,7 +127,7 @@ _help:{"ui.main.menu.help.help"}; } -#menuHelpSite{ +#menuHelpSite { text:"jaxxdemo.action.site"; toolTipText:"jaxxdemo.action.site.tip"; actionIcon:"site"; @@ -135,7 +135,7 @@ _help:{"ui.main.menu.help.site"}; } -#menuHelpAbout{ +#menuHelpAbout { text:"jaxxdemo.action.about"; toolTipText:"jaxxdemo.action.about.tip"; actionIcon:"about"; @@ -143,39 +143,41 @@ _help:{"ui.main.menu.help.about"}; } -#showHelp{ +#showHelp { toolTipText:"jaxxdemo.action.showHelp.tip"; actionIcon:"show-help"; borderPainted:false; visible:true; } -#navigationPane{ +#navigationPane { border:{null}; -minimumSize:{new Dimension(230,0)}; -horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}; + minimumSize:{new Dimension(230,0)}; + horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}; } -#navigation{ +#navigation { rootVisible:false; showsRootHandles:false; largeModel:true; font-size:11; + model:{getTreeHelper().createTreeModel()}; + cellRenderer:{new DemoCellRenderer(getTreeHelper().getDataProvider())}; } -#splitpane{ +#splitpane { orientation:{JSplitPane.HORIZONTAL_SPLIT}; _help:{"ui.main.body.db"}; resizeWeight:1.0; } -#contentLayout{ +#contentLayout { useOnlyVisibleComponentDimension:true; } -#content{ +#content { layout:{contentLayout}; -_help:{"ui.main.body.db.view.content"}; + _help:{"ui.main.body.db.view.content"}; } /* #toolbar { Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -28,15 +28,28 @@ decorator='help' onWindowClosing='getHandler().close(mainFrame)'> - <!--<style source='DemoUI.css'/>--> + <import> + jaxx.demo.tree.*; + jaxx.runtime.swing.CardLayout2 + jaxx.runtime.swing.StatusMessagePanel - <jaxx.runtime.swing.CardLayout2 id='contentLayout'/> + java.util.Locale + </import> - <script><![CDATA[ -import jaxx.runtime.swing.navigation.*; -import java.util.Locale; + <CardLayout2 id='contentLayout'/> -public DemoConfig getConfig() { + <DemoConfig id='config' initializer='getContextValue(DemoConfig.class)'/> + + <DemoUIHandler id='handler' + initializer='getContextValue(DemoUIHandler.class)'/> + + <DemoTreeHelper id='treeHelper' + initializer='getContextValue(DemoTreeHelper.class)'/> + + + <script><![CDATA[ + +/*public DemoConfig getConfig() { return getContextValue(DemoConfig.class); } @@ -46,69 +59,64 @@ protected DemoTreeHelper getTreeHelper() { return getContextValue(DemoTreeHelper.class); -} +}*/ public boolean acceptLocale(Locale l, String expected) { return l !=null && l.toString().equals(expected); } private void $afterCompleteSetup() { - // share the tree - getTreeHelper().setTree(this, navigation); - // auto-expand node when selected - SwingUtil.addExpandOnClickListener(navigation); - + getHandler().initUI(this); } - ]]> - </script> + </script> - <JMenuBar id='menu'> + <JMenuBar id='menu'> - <JMenu id='menuFile'> - <JMenuItem id='menuFileConfiguration' - onActionPerformed="getHandler().showConfig(this)"/> - <JMenu id='menuFileLanguage'> - <JMenuItem id='menuFileLanguageFR' - onActionPerformed="getHandler().changeLanguage(this, Locale.FRANCE)"/> - <JMenuItem id='menuFileLanguageUK' - onActionPerformed="getHandler().changeLanguage(this, Locale.UK)"/> - </JMenu> - <JSeparator/> - <JMenuItem id='menuFileFullscreen' - onActionPerformed="getHandler().changeScreen(this, true)"/> - <JMenuItem id='menuFileNormalscreen' - onActionPerformed="getHandler().changeScreen(this, false)"/> - <JSeparator/> - <JMenuItem id='menuFileExit' - onActionPerformed="getHandler().close(this)"/> - </JMenu> + <JMenu id='menuFile'> + <JMenuItem id='menuFileConfiguration' + onActionPerformed="getHandler().showConfig(this)"/> + <JMenu id='menuFileLanguage'> + <JMenuItem id='menuFileLanguageFR' + onActionPerformed="getHandler().changeLanguage(this, Locale.FRANCE)"/> + <JMenuItem id='menuFileLanguageUK' + onActionPerformed="getHandler().changeLanguage(this, Locale.UK)"/> + </JMenu> + <JSeparator/> + <JMenuItem id='menuFileFullscreen' + onActionPerformed="getHandler().changeScreen(this, true)"/> + <JMenuItem id='menuFileNormalscreen' + onActionPerformed="getHandler().changeScreen(this, false)"/> + <JSeparator/> + <JMenuItem id='menuFileExit' + onActionPerformed="getHandler().close(this)"/> + </JMenu> - <JMenu id='menuHelp'> - <JMenuItem id='menuHelpHelp' - onActionPerformed="getHandler().showHelp(this, null)"/> - <JMenuItem id='menuHelpSite' - onActionPerformed="getHandler().gotoSite(this)"/> - <JMenuItem id='menuHelpAbout' - onActionPerformed="getHandler().showAbout(this)"/> - </JMenu> + <JMenu id='menuHelp'> + <JMenuItem id='menuHelpHelp' + onActionPerformed="getHandler().showHelp(this, null)"/> + <JMenuItem id='menuHelpSite' + onActionPerformed="getHandler().gotoSite(this)"/> + <JMenuItem id='menuHelpAbout' + onActionPerformed="getHandler().showAbout(this)"/> + </JMenu> - </JMenuBar> + </JMenuBar> - <JPanel id='mainPane' layout='{new BorderLayout()}'> + <JPanel id='mainPane' layout='{new BorderLayout()}'> - <JSplitPane id='splitPane' constraints='BorderLayout.CENTER'> - <JScrollPane id='navigationPane'> - <JTree id='navigation' - model='{getTreeHelper().createTreeModel(DemoUI.this)}' - selectionModel="{getTreeHelper().createTreeHandler(DemoUI.this)}"/> - </JScrollPane> + <JSplitPane id='splitPane' constraints='BorderLayout.CENTER'> + <JScrollPane id='navigationPane'> + <JTree id='navigation'/> + <!--model='{getTreeHelper().createTreeModel(DemoUI.this)}' + selectionModel="{getTreeHelper().createTreeHandler(DemoUI.this)}"/--> + </JScrollPane> - <JPanel id='content'/> - - </JSplitPane> - - <jaxx.runtime.swing.StatusMessagePanel id='p' constraints='BorderLayout.SOUTH'/> + <JPanel id='content'/> - </JPanel> + </JSplitPane> + + <StatusMessagePanel id='p' constraints='BorderLayout.SOUTH'/> + + </JPanel> </JFrame> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -44,6 +44,8 @@ */ package jaxx.demo; +import jaxx.demo.tree.DemoNode; +import jaxx.demo.tree.DemoTreeHelper; import jaxx.runtime.JAXXContext; import jaxx.runtime.JAXXUtil; import jaxx.runtime.SwingUtil; @@ -54,19 +56,27 @@ import jaxx.runtime.swing.AboutPanel; import jaxx.runtime.swing.ErrorDialogUI; import jaxx.runtime.swing.editor.config.ConfigUIHelper; -import jaxx.runtime.swing.navigation.tree.NavigationTreeNode; import jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.i18n.I18n; -import static org.nuiton.i18n.I18n._; -import static org.nuiton.i18n.I18n.n_; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.JTree; +import javax.swing.SwingUtilities; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.TreePath; +import java.awt.Component; +import java.awt.Desktop; +import java.lang.reflect.Constructor; import java.net.URL; +import java.util.Arrays; import java.util.Locale; +import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.n_; + /** * Le handler de l'ui principale. * @@ -75,10 +85,9 @@ */ public class DemoUIHandler { //implements JAXXHelp { - /** - * to use log facility, just put in your code: log.info(\"...\"); - */ + /** to use log facility, just put in your code: log.info(\"...\"); */ static private Log log = LogFactory.getLog(DemoUIHandler.class); + static final JAXXContextEntryDef<DemoUI> MAIN_UI_ENTRY_DEF = JAXXUtil.newContextEntryDef("mainui", DemoUI.class); /** @@ -138,8 +147,90 @@ return ui; } - public void displayUI(final DemoUI ui, final String nodePath) { + public void initUI(final DemoUI ui) { + // Creation of selection listener to open ui when tree selection change + TreeSelectionListener listener = new TreeSelectionListener() { + @Override + public void valueChanged(TreeSelectionEvent event) { + TreePath path = event.getPath(); + DemoNode node = (DemoNode) path.getLastPathComponent(); + + if (log.isDebugEnabled()) { + log.debug("Select node " + node); + } + + if (node == null || node.isStringNode()) { + + // noeud de présentation, rien a faire + return; + } + showUI(ui, node.getInternalClass()); + } + }; + + JTree tree = ui.getNavigation(); + + ui.getTreeHelper().setTree(tree, true, listener); + + // auto-expand node when selected + SwingUtil.addExpandOnClickListener(tree); + + } + + protected void showUI(DemoUI ui, Class<?> type) { + + JPanel content = ui.getContent(); + + String constraints = type.getName(); + + log.info("Show for " + constraints); + + // Verify if instance is existing + DemoTab demoContent = getContentIfExist(ui, constraints); + + if (demoContent == null) { + + log.info("Will instanciate a new " + constraints); + try { + // Get constructor + Constructor<? extends DemoPanel> constructor = + (Constructor<? extends DemoPanel>) type.getConstructor(JAXXContext.class); + + + DemoPanel panel = constructor.newInstance(new JAXXInitialContext().add(ui.getDelegateContext())); + + log.info("Demo panel to use : " + panel); + + demoContent = new DemoTab(ui, panel); + + } catch (Exception eee) { + log.error(eee,eee); + ErrorDialogUI.showError(eee); + } + + // Add to content panel + content.add(demoContent, constraints); + } + + // show ui + ui.getContentLayout().show(content, constraints); + } + +// Get content if exist in content, else return null + + protected <E extends Component> E getContentIfExist(DemoUI ui, String constraints) { + if (log.isDebugEnabled()) { + log.debug("Get content if exist " + constraints); + } + if (!ui.getContentLayout().contains(constraints)) { + return null; + } + return (E) ui.getContentLayout().getComponent(ui.getContent(), constraints); + } + + public void displayUI(final DemoUI ui, final String[] nodePath) { + // expend all nodes of the demo tree SwingUtil.expandTree(ui.getNavigation()); @@ -148,17 +239,18 @@ @Override public void run() { - String path; + String[] path; if (nodePath == null) { // take first node - path = "$root/jaxxdemo.tree.component.swing"; + path = new String[]{"jaxxdemo.tree"}; } else { // take selected node path = nodePath; + } - log.info("node to re select " + path); + log.info("node to re select " + Arrays.toString(path)); // select node - ui.getTreeHelper().selectNode(ui, path); + ui.getTreeHelper().selectNode(path); // use best dimensions ui.getSplitPane().resetToPreferredSizes(); @@ -190,19 +282,16 @@ // scan main ui DemoUI ui = getUI(rootContext); - NavigationTreeNode node; - String nodePath = null; - + String[] node = null; if (ui != null) { ui.getConfig().removeJaxxPropertyChangeListener(); - node = ui.getTreeHelper().getSelectedNode(ui); + node = ui.getTreeHelper().getSelectedIds(); if (node != null) { - nodePath = node.getFullPath(); if (log.isDebugEnabled()) { - log.debug("selected node " + nodePath); + log.debug("selected node " + Arrays.toString(node)); } } @@ -217,7 +306,7 @@ ui = initUI(rootContext, config); - displayUI(ui, nodePath); + displayUI(ui, node); } /** @@ -303,25 +392,25 @@ ConfigUIHelper helper = new ConfigUIHelper(config); helper.registerCallBack("ui", - n_("demo.action.reload.ui"), - SwingUtil.createActionIcon("reload-ui"), - reloadUICallback); - + n_("demo.action.reload.ui"), + SwingUtil.createActionIcon("reload-ui"), + reloadUICallback); + helper.registerCallBack("application", - n_("demo.action.reload.application"), - SwingUtil.createActionIcon("reload-application"), - reloadApplicationCallback); + n_("demo.action.reload.application"), + SwingUtil.createActionIcon("reload-application"), + reloadApplicationCallback); // categorie repertoires helper.addCategory(n_("jaxxdemo.config.category.directories"), - n_("jaxxdemo.config.category.directories.description")); + n_("jaxxdemo.config.category.directories.description")); helper.addOption(DemoConfig.Option.CONFIG_FILE); // others helper.addCategory(n_("jaxxdemo.config.category.other"), - n_("jaxxdemo.config.category.other.description")); + n_("jaxxdemo.config.category.other.description")); helper.addOption(DemoConfig.Option.FULL_SCREEN); helper.setOptionPropertyName(DemoConfig.PROPERTY_FULLSCREEN); @@ -340,8 +429,8 @@ helper.displayUI(ui, false); } - // @Override public void showHelp(JAXXContext context, String helpId) { + log.info(context + " :: " + helpId); // DemoUI mainUI = getUI(context); // ObserveHelpBroker helpBroker = context.getContextValue(ObserveHelpBroker.class); // Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -27,6 +27,8 @@ import jaxx.demo.entities.Movie; import jaxx.demo.entities.People; +import jaxx.demo.tree.DemoDataProvider; +import jaxx.demo.tree.DemoTreeHelper; import jaxx.runtime.SwingUtil; import jaxx.runtime.context.DefaultApplicationContext; import jaxx.runtime.decorator.DecoratorProvider; @@ -34,26 +36,21 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.i18n.I18n; -import static org.nuiton.i18n.I18n._; - import org.nuiton.i18n.init.DefaultI18nInitializer; import org.nuiton.util.StringUtil; import java.util.Arrays; import java.util.Date; -/** - * @author tchemit <chemit@codelutin.com> - */ +import static org.nuiton.i18n.I18n._; + +/** @author tchemit <chemit@codelutin.com> */ public class RunDemo { - /** - * Logger - */ + /** Logger */ private static Log log = LogFactory.getLog(RunDemo.class); - /** - * The singleton instance of the main context - */ + + /** The singleton instance of the main context */ protected static DefaultApplicationContext context; public static void main(String[] args) { @@ -79,7 +76,7 @@ DefaultApplicationContext rootContext = init(); // share a tree helper - rootContext.setContextValue(new DemoTreeHelper()); + rootContext.setContextValue(new DemoTreeHelper(new DemoDataProvider())); // init config DemoConfig config = new DemoConfig(); @@ -140,7 +137,7 @@ log.info(_("jaxxdemo.init.ui.done")); - handler.displayUI(ui, config.getDemoPath()); + handler.displayUI(ui, config.getDemoPath().split("/")); } catch (Exception e) { log.error(e.getMessage(), e); Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,28 +24,28 @@ --> -<jaxx.demo.DemoPanel> - <jaxx.runtime.swing.BlockingLayerUI id='layerUI' - blockIcon='{SwingUtil.createImageIcon("action-block.png")}' - acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}' - useIcon='true' - blockingColor='{new Color(50,50,50)}' - acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L; +<jaxx.demo.DemoPanel> + <jaxx.runtime.swing.BlockingLayerUI id='layerUI' + blockIcon='{SwingUtil.createImageIcon("action-block.png")}' + acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}' + useIcon='true' + blockingColor='{new Color(50,50,50)}' + acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { accept(e, "from icon of layer"); } - }}' /> - <jaxx.runtime.swing.BlockingLayerUI2 id='layerUI2' - blockIcon='{SwingUtil.createImageIcon("action-block.png")}' - acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}' - acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L; + }}'/> + <jaxx.runtime.swing.BlockingLayerUI2 id='layerUI2' + blockIcon='{SwingUtil.createImageIcon("action-block.png")}' + acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}' + acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { accept(e, "from icon of layer"); } - }}' /> - <script><![CDATA[ + }}'/> + <script><![CDATA[ void $afterCompleteSetup() { for (JComponent boxed : SwingUtil.getLayeredComponents(this)) { @@ -81,35 +81,39 @@ String msg = "'" + source.getText() + "' clicked - " + suffix + " : " + clickedMessage; ((DefaultListModel)messages.getModel()).addElement(msg); }]]> - </script> - <Table id='demoPanel' fill='both' weightx='1'> - <row> - <cell> - <JCheckBox id='toggle' selected='true' - text='{toggle.isSelected() ? "Active layer" : "No layer"}' - onActionPerformed='setLayer(toggle.isSelected());'/> - </cell> - </row> - <row> - <cell weighty='0.5'> - <JPanel layout='{new GridLayout(1,3,3,3)}'> - <JButton text='button A' decorator='boxed' _clickedText='"button A was clicked"' - onActionPerformed='accept(event, "from button (no layer)")'/> - <JButton text='button B' decorator='boxed' _clickedText='"button B was clicked"' - onActionPerformed='accept(event, "from button (no layer)")'/> - <JButton id='c' text='button C (full block)' decorator='boxed' _clickedText='"button C was clicked"' - onActionPerformed='accept(event, "from button (no layer)");'/> - <JButton id='d' text='button D (full block 2)' decorator='boxed' _clickedText='"button D was clicked"' - onActionPerformed='accept(event, "from button (no layer)");'/> - </JPanel> - </cell> - </row> - <row> - <cell weighty='0.5'> - <JScrollPane> - <JList id='messages' model='{new DefaultListModel()}'/> - </JScrollPane> - </cell> - </row> - </Table> + </script> + <Table fill='both' weightx='1'> + <row> + <cell> + <JCheckBox id='toggle' selected='true' + text='{toggle.isSelected() ? "Active layer" : "No layer"}' + onActionPerformed='setLayer(toggle.isSelected());'/> + </cell> + </row> + <row> + <cell weighty='0.5'> + <JPanel layout='{new GridLayout(1,3,3,3)}'> + <JButton text='button A' decorator='boxed' + _clickedText='"button A was clicked"' + onActionPerformed='accept(event, "from button (no layer)")'/> + <JButton text='button B' decorator='boxed' + _clickedText='"button B was clicked"' + onActionPerformed='accept(event, "from button (no layer)")'/> + <JButton id='c' text='button C (full block)' decorator='boxed' + _clickedText='"button C was clicked"' + onActionPerformed='accept(event, "from button (no layer)");'/> + <JButton id='d' text='button D (full block 2)' decorator='boxed' + _clickedText='"button D was clicked"' + onActionPerformed='accept(event, "from button (no layer)");'/> + </JPanel> + </cell> + </row> + <row> + <cell weighty='0.5'> + <JScrollPane> + <JList id='messages' model='{new DefaultListModel()}'/> + </JScrollPane> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -23,14 +23,13 @@ #L% --> -<jaxx.demo.DemoPanel> - <JPanel id='demoPanel' layout='{new BorderLayout()}'> - <JPanel layout='{new GridLayout(0,1)}' constraints='BorderLayout.CENTER'> - <JButton text='Fool me once' - onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on you!")'/> - <JButton text='Fool me twice' - onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on ...")'/> - </JPanel> - <jaxx.runtime.swing.StatusMessagePanel id='p' constraints='BorderLayout.SOUTH'/> - </JPanel> +<jaxx.demo.DemoPanel layout='{new BorderLayout()}'> + <JPanel layout='{new GridLayout(0,1)}' constraints='BorderLayout.CENTER'> + <JButton text='Fool me once' + onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on you!")'/> + <JButton text='Fool me twice' + onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on ...")'/> + </JPanel> + <jaxx.runtime.swing.StatusMessagePanel id='p' + constraints='BorderLayout.SOUTH'/> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,36 +25,39 @@ <jaxx.demo.DemoPanel> - <Table id='demoPanel' fill='both'> - <row> - <cell> - <JLabel text='Locale editor:' labelFor='{localeEditor}'/> - </cell> + <Table fill='both'> + <row> + <cell> + <JLabel text='Locale editor:' labelFor='{localeEditor}'/> + </cell> - <cell> - <LocaleEditor id='localeEditor'/> - </cell> - </row> - <row> - <cell> - <JLabel text='EnumEditor (language) :' labelFor='{languageEditor}'/> - </cell> - <cell> - <EnumEditor id='languageEditor' constructorParams='org.nuiton.i18n.LanguageEnum.class'/> - </cell> - </row> - <row> - <cell> - <JLabel text='EnumEditor (country) :' labelFor='{countryEditor}'/> - </cell> - <cell> - <EnumEditor id='countryEditor' constructorParams='org.nuiton.i18n.CountryEnum.class'/> - </cell> - </row> - <row> - <cell columns="2"> - <JTextArea text='{"locale : "+ localeEditor.getSelectedItem() + "\nlanguage : "+ languageEditor.getSelectedItem() + "\ncountry : " + countryEditor.getSelectedItem()}'/> - </cell> - </row> - </Table> + <cell> + <LocaleEditor id='localeEditor'/> + </cell> + </row> + <row> + <cell> + <JLabel text='EnumEditor (language) :' labelFor='{languageEditor}'/> + </cell> + <cell> + <EnumEditor id='languageEditor' + constructorParams='org.nuiton.i18n.LanguageEnum.class'/> + </cell> + </row> + <row> + <cell> + <JLabel text='EnumEditor (country) :' labelFor='{countryEditor}'/> + </cell> + <cell> + <EnumEditor id='countryEditor' + constructorParams='org.nuiton.i18n.CountryEnum.class'/> + </cell> + </row> + <row> + <cell columns="2"> + <JTextArea + text='{"locale : "+ localeEditor.getSelectedItem() + "\nlanguage : "+ languageEditor.getSelectedItem() + "\ncountry : " + countryEditor.getSelectedItem()}'/> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,7 +25,7 @@ <jaxx.demo.DemoPanel> - <script><![CDATA[ + <script><![CDATA[ import jaxx.runtime.swing.editor.I18nEditor; import org.nuiton.i18n.I18n; import java.util.Arrays; @@ -37,55 +37,57 @@ return new TitledBorder(_(text)); } ]]> - </script> - <Table id='demoPanel' fill='both'> - <row> - <cell> - <JPanel border='{new TitledBorder(_("jaxxdemo.i18neditor.configuration"))}' - layout='{new GridLayout(0,1)}'> + </script> + <Table fill='both'> + <row> + <cell> + <JPanel + border='{new TitledBorder(_("jaxxdemo.i18neditor.configuration"))}' + layout='{new GridLayout(0,1)}'> - <JCheckBox id='showText' - text='jaxxdemo.i18neditor.showText' - selected='true'/> - - <JCheckBox id='showIcon' - text='jaxxdemo.i18neditor.showIcon' - selected='true'/> + <JCheckBox id='showText' + text='jaxxdemo.i18neditor.showText' + selected='true'/> - <JCheckBox id='showPopupText' - text='jaxxdemo.i18neditor.showPopupText' - selected='true'/> + <JCheckBox id='showIcon' + text='jaxxdemo.i18neditor.showIcon' + selected='true'/> - <JCheckBox id='showPopupIcon' - text='jaxxdemo.i18neditor.showPopupIcon' - selected='true'/> + <JCheckBox id='showPopupText' + text='jaxxdemo.i18neditor.showPopupText' + selected='true'/> - <JPanel> - <JLabel text='jaxxdemo.i18neditor.popupBorderText' - labelFor='{popupBorderText}'/> - <JTextField id='popupBorderText' - text='{_("i18neditor.popup.title")}'/> - </JPanel> - - </JPanel> - </cell> - </row> - <row> - <cell> - <I18nEditor id='editor' - showText='{showText.isSelected()}' - showIcon='{showIcon.isSelected()}' - showPopupText='{showPopupText.isSelected()}' - showPopupIcon='{showPopupIcon.isSelected()}' - popupBorder='{getPopupBorder(popupBorderText.getText())}' - locales='{Arrays.asList(I18n.getStore().getLocales())}'/> - </cell> - </row> - <row> - <cell> - <JLabel border='{new TitledBorder(_("jaxxdemo.i18neditor.selected.locale"))}' - text='{editor.getSelectedLocale().toString()}'/> - </cell> - </row> - </Table> + <JCheckBox id='showPopupIcon' + text='jaxxdemo.i18neditor.showPopupIcon' + selected='true'/> + + <JPanel> + <JLabel text='jaxxdemo.i18neditor.popupBorderText' + labelFor='{popupBorderText}'/> + <JTextField id='popupBorderText' + text='{_("i18neditor.popup.title")}'/> + </JPanel> + + </JPanel> + </cell> + </row> + <row> + <cell> + <I18nEditor id='editor' + showText='{showText.isSelected()}' + showIcon='{showIcon.isSelected()}' + showPopupText='{showPopupText.isSelected()}' + showPopupIcon='{showPopupIcon.isSelected()}' + popupBorder='{getPopupBorder(popupBorderText.getText())}' + locales='{Arrays.asList(I18n.getStore().getLocales())}'/> + </cell> + </row> + <row> + <cell> + <JLabel + border='{new TitledBorder(_("jaxxdemo.i18neditor.selected.locale"))}' + text='{editor.getSelectedLocale().toString()}'/> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,70 +25,73 @@ <jaxx.demo.DemoPanel> - <script><![CDATA[ + <script><![CDATA[ import jaxx.runtime.swing.editor.NumberEditor; void $afterCompleteSetup() { editor.init(); } ]]> - </script> + </script> - <!-- model --> - <NumberEditorDemoModel id='demoModel'/> + <!-- model --> + <NumberEditorDemoModel id='demoModel'/> - <Table id='demoPanel' insets='0' fill='both'> - <row> - <cell> - <JPanel border='{new TitledBorder(_("jaxxdemo.numbereditor.configuration"))}' - layout='{new GridLayout(0,1)}'> + <Table insets='0' fill='both'> + <row> + <cell> + <JPanel + border='{new TitledBorder(_("jaxxdemo.numbereditor.configuration"))}' + layout='{new GridLayout(0,1)}'> - <JCheckBox id='useFloat' - text='jaxxdemo.numbereditor.useFloat' - selected='true'/> + <JCheckBox id='useFloat' + text='jaxxdemo.numbereditor.useFloat' + selected='true'/> - <JCheckBox id='useSign' - text='jaxxdemo.numbereditor.useSign' - selected='true'/> + <JCheckBox id='useSign' + text='jaxxdemo.numbereditor.useSign' + selected='true'/> - <JCheckBox id='showPopupButton' - text='jaxxdemo.numbereditor.showPopupButton' - selected='true'/> + <JCheckBox id='showPopupButton' + text='jaxxdemo.numbereditor.showPopupButton' + selected='true'/> - <JCheckBox id='showResetButton' - text='jaxxdemo.numbereditor.showReset' - selected='true'/> + <JCheckBox id='showResetButton' + text='jaxxdemo.numbereditor.showReset' + selected='true'/> - <JCheckBox id='autoPopup' - text='jaxxdemo.numbereditor.autoPopup' - selected='false'/> + <JCheckBox id='autoPopup' + text='jaxxdemo.numbereditor.autoPopup' + selected='false'/> - </JPanel> - </cell> - </row> - <row> - <cell> - <NumberEditor id='editor' - constructorParams='this' - bean='{demoModel}' - property='{useFloat.isSelected() ? "floatProperty" : "integerProperty"}' - useFloat='{useFloat.isSelected()}' - useSign='{useSign.isSelected()}' - autoPopup='{autoPopup.isSelected()}' - showPopupButton='{showPopupButton.isSelected()}' - showReset='{showResetButton.isSelected()}' /> - </cell> - </row> - <row> - <cell> - <JPanel border='{new TitledBorder(_("jaxxdemo.numbereditor.model"))}' - layout='{new GridLayout(0,1)}'> - <JLabel text='{_("jaxxdemo.numbereditor.model.int", demoModel.getIntegerProperty())}'/> - <JLabel text='{_("jaxxdemo.numbereditor.model.float", demoModel.getFloatProperty())}'/> + </JPanel> + </cell> + </row> + <row> + <cell> + <NumberEditor id='editor' + constructorParams='this' + bean='{demoModel}' + property='{useFloat.isSelected() ? "floatProperty" : "integerProperty"}' + useFloat='{useFloat.isSelected()}' + useSign='{useSign.isSelected()}' + autoPopup='{autoPopup.isSelected()}' + showPopupButton='{showPopupButton.isSelected()}' + showReset='{showResetButton.isSelected()}'/> + </cell> + </row> + <row> + <cell> + <JPanel border='{new TitledBorder(_("jaxxdemo.numbereditor.model"))}' + layout='{new GridLayout(0,1)}'> + <JLabel + text='{_("jaxxdemo.numbereditor.model.int", demoModel.getIntegerProperty())}'/> + <JLabel + text='{_("jaxxdemo.numbereditor.model.float", demoModel.getFloatProperty())}'/> - </JPanel> - </cell> - </row> - </Table> + </JPanel> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -29,22 +29,26 @@ import java.beans.PropertyChangeSupport; /** - * * @author tchemit <chemit@codelutin.com> * @since 1.5 */ public class NumberEditorDemoModel { public static final String INTEGER_PROPERTY = "integerProperty"; + public static final String FLOAT_PROPERTY = "floatProperty"; + protected PropertyChangeSupport p; + protected int integerProperty; + protected float floatProperty; // protected int positifInteger; // protected int normalInteger; // protected float positifFloat; // protected float normalFloat; + public NumberEditorDemoModel() { p = new PropertyChangeSupport(this); } @@ -109,6 +113,7 @@ // this.positifInteger = positifInteger; // p.firePropertyChange("positifInteger", old, positifInteger); // } + public void addPropertyChangeListener(PropertyChangeListener listener) { p.addPropertyChangeListener(listener); } Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -22,7 +22,7 @@ #L% --> -<jaxx.demo.DemoPanel> +<jaxx.demo.DemoPanel layout='{new BorderLayout()}'> <import> jaxx.runtime.decorator.DecoratorProvider @@ -36,7 +36,7 @@ java.lang.reflect.Constructor jaxx.demo.component.jaxx.tree.content.AbstractContentUI </import> - + <CardLayout2 id='contentLayout'/> <script><![CDATA[ @@ -182,28 +182,24 @@ ]]> </script> - <JPanel id='demoPanel' layout='{new BorderLayout()}'> + <JSplitPane id='splitPane' + constraints='BorderLayout.CENTER' + oneTouchExpandable='true'> - <JSplitPane id='splitPane' - constraints='BorderLayout.CENTER' - oneTouchExpandable='true'> + <JScrollPane border='{null}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_NEVER}'> - <JScrollPane border='{null}' - horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' - verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_NEVER}'> + <JTree id="navigation" + font-size='11' + rootVisible='false' + showsRootHandles='false' + model='{helper.createTreeModel()}'/> - <JTree id="navigation" - font-size='11' - rootVisible='false' - showsRootHandles='false' - model='{helper.createTreeModel()}'/> + </JScrollPane> - </JScrollPane> + <JPanel id="content" layout="{contentLayout}"/> - <JPanel id="content" layout="{contentLayout}"/> + </JSplitPane> - </JSplitPane> - - </JPanel> - </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoCellRenderer.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -33,8 +33,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.swing.*; -import java.awt.*; +import javax.swing.JTree; +import java.awt.Component; /** * @author sletellier <letellier@codelutin.com> @@ -55,7 +55,7 @@ @Override public JaxxTreeDemoDataProvider getDataProvider() { - return (JaxxTreeDemoDataProvider)super.getDataProvider(); + return (JaxxTreeDemoDataProvider) super.getDataProvider(); } @Override @@ -74,7 +74,7 @@ if (editType.equals(People.class)) { toDecorate = getDataProvider().getPeople(id); - // Movie node + // Movie node } else if (editType.equals(Movie.class)) { toDecorate = getDataProvider().getMovie(id); } @@ -84,8 +84,8 @@ if (log.isDebugEnabled()) { log.debug("Compute text for node " + - node + " return " + - decorated); + node + " return " + + decorated); } return decorated; @@ -100,7 +100,7 @@ boolean hasFocus) { // get node - JaxxTreeDemoNode node = (JaxxTreeDemoNode)value; + JaxxTreeDemoNode node = (JaxxTreeDemoNode) value; // get text for node String text = getNodeText(node); Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoDataProvider.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -42,9 +42,7 @@ */ public class JaxxTreeDemoDataProvider implements DataProvider { - /** - * Logger - */ + /** Logger */ static private final Log log = LogFactory.getLog(JaxxTreeDemoDataProvider.class); protected Map<String, Movie> movies; @@ -83,15 +81,15 @@ return true; } - public Movie getMovie(String id){ + public Movie getMovie(String id) { return movies.get(id); } - public People getPeople(String id){ + public People getPeople(String id) { return peoples.get(id); } - public List<Movie> getMovies(){ + public List<Movie> getMovies() { return new ArrayList<Movie>(movies.values()); } @@ -99,11 +97,11 @@ return new ArrayList<People>(peoples.values()); } - public List<People> getPeoples(Movie m){ + public List<People> getPeoples(Movie m) { return m.getActors(); } - public List<People> getPeoples(String moviesId){ + public List<People> getPeoples(String moviesId) { if (log.isDebugEnabled()) { log.debug("Get people for movie " + moviesId); Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoHelper.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -41,6 +41,7 @@ public class JaxxTreeDemoHelper extends JaxxTreeHelper<JaxxTreeDemoNode> { public static String MOVIES_CATEGORY_NODE = "movies"; + public static String ACTORS_CATEGORY_NODE = "actors"; public JaxxTreeDemoHelper(JaxxTreeDemoDataProvider provider) { @@ -88,7 +89,7 @@ // Populate childs nodes root.populateChilds(model, getDataProvider()); - + return model; } } Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/JaxxTreeDemoNode.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -29,7 +29,6 @@ import jaxx.runtime.swing.tree.JaxxNodeChildLoador; /** - * * @author sletellier <letellier@codelutin.com> * @since 2.1 */ Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/AbstractContentUI.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/AbstractContentUI.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/AbstractContentUI.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -26,7 +26,7 @@ layout='{new BorderLayout()}' genericType='B extends Object'> - <script><![CDATA[ + <script><![CDATA[ import jaxx.demo.component.jaxx.tree.JaxxTreeDemoHelper; // Get helper in context @@ -38,5 +38,5 @@ public abstract void setData(B data); ]]> - </script> + </script> </JPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorContentUI.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -27,7 +27,7 @@ <import> jaxx.demo.entities.* </import> - <script><![CDATA[ + <script><![CDATA[ import jaxx.demo.entities.*; String getContent(People data) { @@ -45,33 +45,34 @@ ]]></script> - <JSplitPane id='splitPane' - orientation='{JSplitPane.VERTICAL_SPLIT}' - resizeWeight='0.5' - constraints='BorderLayout.CENTER' - oneTouchExpandable='true'> + <JSplitPane id='splitPane' + orientation='{JSplitPane.VERTICAL_SPLIT}' + resizeWeight='0.5' + constraints='BorderLayout.CENTER' + oneTouchExpandable='true'> - <People id='data' javaBean='null'/> + <People id='data' javaBean='null'/> - <JScrollPane border='{null}' - horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' - verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> + <JScrollPane border='{null}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> - <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.actor.title"))}' - editable='false' - font-size='11' - text='{getContent(getData())}'/> - </JScrollPane> + <JTextPane + border='{new TitledBorder(_("jaxxdemo.navigation.actor.title"))}' + editable='false' + font-size='11' + text='{getContent(getData())}'/> + </JScrollPane> - <JScrollPane border='{new TitledBorder("Picture")}' - horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}' - verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}' - minimumSize='{SwingUtil.newMinDimension()}'> + <JScrollPane border='{new TitledBorder("Picture")}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}' + minimumSize='{SwingUtil.newMinDimension()}'> - <JLabel horizontalAlignment='center' - icon='{getImage(getData())}'/> + <JLabel horizontalAlignment='center' + icon='{getImage(getData())}'/> - </JScrollPane> + </JScrollPane> - </JSplitPane> + </JSplitPane> </AbstractContentUI> \ No newline at end of file Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/ActorsContentUI.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,7 +24,7 @@ <AbstractContentUI superGenericType='java.util.List<People>'> - <script><![CDATA[ + <script><![CDATA[ import jaxx.demo.entities.*; import jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer; import jaxx.runtime.binding.SimpleJAXXObjectBinding; @@ -59,27 +59,30 @@ } ]]></script> - <java.util.List id='data' genericType='People' javaBean='null'/> + <java.util.List id='data' genericType='People' javaBean='null'/> - <JPanel layout='{new BorderLayout()}'> + <JPanel layout='{new BorderLayout()}'> - <JScrollPane border='{new TitledBorder(_("jaxxdemo.navigation.actors.title"))}' - constraints='BorderLayout.CENTER' - columnHeaderView='{toolbar}' - horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' - verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> - <JList id='list' model='{new DefaultListModel()}' - cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/> - </JScrollPane> - <JToolBar id='toolbar' constraints='BorderLayout.SOUTH' - floatable='false'> - <JPanel layout='{new GridLayout(1,0)}'> - <JButton text='jaxxdemo.action.show' enabled='{list.getSelectedIndex()!=-1}' - onActionPerformed='selectChild()'/> - <JButton text='jaxxdemo.action.add'/> - <JButton text='jaxxdemo.action.remove' enabled='{list.getSelectedIndex()!=-1}'/> - </JPanel> - </JToolBar> + <JScrollPane + border='{new TitledBorder(_("jaxxdemo.navigation.actors.title"))}' + constraints='BorderLayout.CENTER' + columnHeaderView='{toolbar}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> + <JList id='list' model='{new DefaultListModel()}' + cellRenderer='{getContextValue(DecoratorProviderListCellRenderer.class)}'/> + </JScrollPane> + <JToolBar id='toolbar' constraints='BorderLayout.SOUTH' + floatable='false'> + <JPanel layout='{new GridLayout(1,0)}'> + <JButton text='jaxxdemo.action.show' + enabled='{list.getSelectedIndex()!=-1}' + onActionPerformed='selectChild()'/> + <JButton text='jaxxdemo.action.add'/> + <JButton text='jaxxdemo.action.remove' + enabled='{list.getSelectedIndex()!=-1}'/> + </JPanel> + </JToolBar> - </JPanel> + </JPanel> </AbstractContentUI> \ No newline at end of file Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/content/MovieContentUI.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -23,8 +23,8 @@ --> <AbstractContentUI superGenericType='Movie'> - - <script><![CDATA[ + + <script><![CDATA[ import jaxx.demo.entities.*; String getContent(Movie data) { @@ -41,33 +41,34 @@ } ]]></script> - <JSplitPane id='splitPane' - orientation='{JSplitPane.VERTICAL_SPLIT}' - resizeWeight='0.5' - constraints='BorderLayout.CENTER' - oneTouchExpandable='true'> + <JSplitPane id='splitPane' + orientation='{JSplitPane.VERTICAL_SPLIT}' + resizeWeight='0.5' + constraints='BorderLayout.CENTER' + oneTouchExpandable='true'> - <Movie id='data' javaBean='null'/> + <Movie id='data' javaBean='null'/> - <JScrollPane border='{null}' - horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' - verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> + <JScrollPane border='{null}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> - <JTextPane border='{new TitledBorder(_("jaxxdemo.navigation.movie.title"))}' - editable='false' - font-size='11' - text='{getContent(getData())}'/> - </JScrollPane> + <JTextPane + border='{new TitledBorder(_("jaxxdemo.navigation.movie.title"))}' + editable='false' + font-size='11' + text='{getContent(getData())}'/> + </JScrollPane> - <JScrollPane border='{new TitledBorder("Picture")}' - horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}' - verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}' - minimumSize='{SwingUtil.newMinDimension()}'> + <JScrollPane border='{new TitledBorder("Picture")}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}' + minimumSize='{SwingUtil.newMinDimension()}'> - <JLabel horizontalAlignment='center' - icon='{getImage(getData())}'/> + <JLabel horizontalAlignment='center' + icon='{getImage(getData())}'/> - </JScrollPane> + </JScrollPane> - </JSplitPane> + </JSplitPane> </AbstractContentUI> \ No newline at end of file Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/ActorsNodeLoadors.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,8 +25,8 @@ package jaxx.demo.component.jaxx.tree.loadors; +import jaxx.demo.component.jaxx.tree.JaxxTreeDemoDataProvider; import jaxx.demo.component.jaxx.tree.JaxxTreeDemoNode; -import jaxx.demo.component.jaxx.tree.JaxxTreeDemoDataProvider; import jaxx.demo.entities.People; import jaxx.runtime.swing.tree.DataProvider; import jaxx.runtime.swing.tree.JaxxNodeChildLoador; @@ -45,8 +45,8 @@ @Override public List<People> getData(Class<?> parentClass, - String moviesId, - DataProvider dataProvider) throws Exception { + String moviesId, + DataProvider dataProvider) throws Exception { // Get people for parentId JaxxTreeDemoDataProvider provider = (JaxxTreeDemoDataProvider) dataProvider; Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/tree/loadors/MoviesNodeLoadors.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,9 +25,9 @@ package jaxx.demo.component.jaxx.tree.loadors; +import jaxx.demo.component.jaxx.tree.JaxxTreeDemoDataProvider; import jaxx.demo.component.jaxx.tree.JaxxTreeDemoHelper; import jaxx.demo.component.jaxx.tree.JaxxTreeDemoNode; -import jaxx.demo.component.jaxx.tree.JaxxTreeDemoDataProvider; import jaxx.demo.entities.Movie; import jaxx.runtime.swing.tree.DataProvider; import jaxx.runtime.swing.tree.JaxxNodeChildLoador; Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/HidorButtonDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/HidorButtonDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/HidorButtonDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -23,22 +23,23 @@ #L% --> -<jaxx.demo.DemoPanel> - <JPanel id='demoPanel' layout='{new GridLayout(0,1)}'> - <HBox horizontalAlignment='center' verticalAlignment='middle'> +<jaxx.demo.DemoPanel layout='{new GridLayout(0,1)}'> - <jaxx.runtime.swing.HidorButton target='{hidor1}' showText="show label1" hideText='hide label1' - targetVisible='{true}'/> + <HBox horizontalAlignment='center' verticalAlignment='middle'> - <JLabel id='hidor1' text='Label 1'/> - </HBox> - <HBox horizontalAlignment='center' verticalAlignment='middle'> + <jaxx.runtime.swing.HidorButton target='{hidor1}' showText="show label1" + hideText='hide label1' + targetVisible='{true}'/> - <jaxx.runtime.swing.HidorButton target='{hidor2}' showText="show label2" hideText='hide label2' - targetVisible='{false}'/> + <JLabel id='hidor1' text='Label 1'/> + </HBox> + <HBox horizontalAlignment='center' verticalAlignment='middle'> - <JLabel id='hidor2' text='Label 2'/> - </HBox> - </JPanel> + <jaxx.runtime.swing.HidorButton target='{hidor2}' showText="show label2" + hideText='hide label2' + targetVisible='{false}'/> + <JLabel id='hidor2' text='Label 2'/> + </HBox> + </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,31 +24,34 @@ --> <jaxx.demo.DemoPanel> - <style> - JButton.fancy { - foreground: blue; - font-face: Arial; - font-size: 18; - } + <style> + JButton.fancy { + foreground: blue; + font-face: Arial; + font-size: 18; + } - JButton.fancy:mouseover { - foreground: red; - font-style: italic; - } - </style> + JButton.fancy:mouseover { + foreground: red; + font-style: italic; + } + </style> - <script> - public void buttonClicked(JButton button) { - JOptionPane.showMessageDialog(this, button.getText() + " clicked!", "onActionPerformed", - JOptionPane.INFORMATION_MESSAGE); - } - </script> + <script> + public void buttonClicked(JButton button) { + JOptionPane.showMessageDialog(this, button.getText() + " clicked!", + "onActionPerformed", + JOptionPane.INFORMATION_MESSAGE); + } + </script> - <javax.swing.ImageIcon id='pencil' constructorParams='getClass().getResource("/jaxx/demo/images/pencil_black.gif")'/> + <javax.swing.ImageIcon id='pencil' + constructorParams='getClass().getResource("/jaxx/demo/images/pencil_black.gif")'/> - <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <JButton text='Simple Button' onActionPerformed='buttonClicked((JButton) event.getSource())'/> - <JButton text='Fancy Button' styleClass='fancy' icon='{pencil}' - onActionPerformed='buttonClicked((JButton) event.getSource())'/> - </VBox> + <VBox horizontalAlignment='center' verticalAlignment='middle'> + <JButton text='Simple Button' + onActionPerformed='buttonClicked((JButton) event.getSource())'/> + <JButton text='Fancy Button' styleClass='fancy' icon='{pencil}' + onActionPerformed='buttonClicked((JButton) event.getSource())'/> + </VBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,7 +24,7 @@ --> <jaxx.demo.DemoPanel> - <script><![CDATA[ + <script><![CDATA[ public String getText(boolean bold, boolean italic, boolean underline) { String text ="Sample Text"; if (bold) @@ -36,28 +36,27 @@ return "<html>" + text; } ]]></script> - - <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <Table anchor='west'> - <row> - <cell> - <JCheckBox id='bold' text='Bold' mnemonic='B'/> - </cell> - <cell rows='3'> - <JLabel font='{new Font("Arial", 0, 18)}' - text='{getText(bold.isSelected(), italic.isSelected(), underline.isSelected())}'/> - </cell> - </row> - <row> - <cell> - <JCheckBox id='italic' text='Italic' mnemonic='I'/> - </cell> - </row> - <row> - <cell> - <JCheckBox id='underline' text='Underline' mnemonic='U'/> - </cell> - </row> - </Table> - </VBox> + <VBox horizontalAlignment='center' verticalAlignment='middle'> + <Table anchor='west'> + <row> + <cell> + <JCheckBox id='bold' text='Bold' mnemonic='B'/> + </cell> + <cell rows='3'> + <JLabel font='{new Font("Arial", 0, 18)}' + text='{getText(bold.isSelected(), italic.isSelected(), underline.isSelected())}'/> + </cell> + </row> + <row> + <cell> + <JCheckBox id='italic' text='Italic' mnemonic='I'/> + </cell> + </row> + <row> + <cell> + <JCheckBox id='underline' text='Underline' mnemonic='U'/> + </cell> + </row> + </Table> + </VBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,61 +24,62 @@ --> <JMenuItemDemo> - <style> - .form { - enabled: { enabledCheckBox.isSelected() }; - editable: { editableCheckBox.isSelected() }; - } - </style> + <style> + .form { + enabled: { enabledCheckBox.isSelected() }; + editable: { editableCheckBox.isSelected() }; + } + </style> - <JMenuBar id='menuBar'> - <JMenu text='View'> - <JCheckBoxMenuItem id='enabledCheckBox' text='Enabled' selected='true'/> - <JCheckBoxMenuItem id='editableCheckBox' text='Editable' selected='true'/> - </JMenu> - </JMenuBar> + <JMenuBar id='menuBar'> + <JMenu text='View'> + <JCheckBoxMenuItem id='enabledCheckBox' text='Enabled' selected='true'/> + <JCheckBoxMenuItem id='editableCheckBox' text='Editable' selected='true'/> + </JMenu> + </JMenuBar> - <Table id='framePanel' anchor='northwest'> - <row> - <cell> - <JLabel text='First Name:' displayedMnemonic='F' labelFor='{firstName}'/> - </cell> + <Table id='framePanel' anchor='northwest'> + <row> + <cell> + <JLabel text='First Name:' displayedMnemonic='F' + labelFor='{firstName}'/> + </cell> - <cell weightx='1' fill='horizontal'> - <JTextField id='firstName' styleClass="form"/> - </cell> - </row> + <cell weightx='1' fill='horizontal'> + <JTextField id='firstName' styleClass="form"/> + </cell> + </row> - <row> - <cell> - <JLabel text='Last Name:' displayedMnemonic='L' labelFor='{lastName}'/> - </cell> + <row> + <cell> + <JLabel text='Last Name:' displayedMnemonic='L' labelFor='{lastName}'/> + </cell> - <cell fill='horizontal'> - <JTextField id='lastName' styleClass="form"/> - </cell> - </row> + <cell fill='horizontal'> + <JTextField id='lastName' styleClass="form"/> + </cell> + </row> - <row> - <cell> - <JLabel text='Email Address:' displayedMnemonic='E' labelFor='{email}'/> - </cell> + <row> + <cell> + <JLabel text='Email Address:' displayedMnemonic='E' labelFor='{email}'/> + </cell> - <cell fill='horizontal'> - <JTextField id='email' styleClass="form"/> - </cell> - </row> + <cell fill='horizontal'> + <JTextField id='email' styleClass="form"/> + </cell> + </row> - <row> - <cell> - <JLabel text='Comments:' displayedMnemonic='C' labelFor='{comments}'/> - </cell> + <row> + <cell> + <JLabel text='Comments:' displayedMnemonic='C' labelFor='{comments}'/> + </cell> - <cell weightx='1' weighty='1' fill='both'> - <JScrollPane width='150' height='75'> - <JTextArea id='comments' styleClass="form"/> - </JScrollPane> - </cell> - </row> - </Table> + <cell weightx='1' weighty='1' fill='both'> + <JScrollPane width='150' height='75'> + <JTextArea id='comments' styleClass="form"/> + </JScrollPane> + </cell> + </row> + </Table> </JMenuItemDemo> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,46 +25,46 @@ <jaxx.demo.DemoPanel> - <script><![CDATA[ + <script><![CDATA[ import static org.nuiton.i18n.I18n.n_; private void $afterCompleteSetup() { jaxxComboBox.setSelectedIndex(0); } ]]> - </script> - <Table id='demoPanel'> - <row> - <cell> - <JLabel text='Button label:'/> - </cell> + </script> + <Table> + <row> + <cell> + <JLabel text='Button label:'/> + </cell> - <cell> - <JAXXComboBox id='jaxxComboBox' editable='true'> - <item value='{_("OK")}' selected='true'/> - <item value='{_("Cancel")}'/> - <item value='{_("Help")}'/> - </JAXXComboBox> - </cell> + <cell> + <JAXXComboBox id='jaxxComboBox' editable='true'> + <item value='{_("OK")}' selected='true'/> + <item value='{_("Cancel")}'/> + <item value='{_("Help")}'/> + </JAXXComboBox> + </cell> - <cell> - <JButton text='{String.valueOf(jaxxComboBox.getSelectedItem())}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Button label:'/> - </cell> + <cell> + <JButton text='{String.valueOf(jaxxComboBox.getSelectedItem())}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Button label:'/> + </cell> - <cell> - <JComboBox id='comboBox' - editable='true' - model='{new DefaultComboBoxModel(new Object[]{n_("OK"),n_("Cancel"),n_("Help")})}'/> - </cell> + <cell> + <JComboBox id='comboBox' + editable='true' + model='{new DefaultComboBoxModel(new Object[]{n_("OK"),n_("Cancel"),n_("Help")})}'/> + </cell> - <cell> - <JButton text='{comboBox.getSelectedItem()+""}'/> - </cell> - </row> - </Table> + <cell> + <JButton text='{comboBox.getSelectedItem()+""}'/> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,81 +24,85 @@ --> <jaxx.demo.DemoPanel> - <script> - String username; - String password; + <script> + String username; + String password; - private class OKAction extends javax.swing.AbstractAction { - public OKAction() { - putValue(NAME, "OK"); - } + private class OKAction extends javax.swing.AbstractAction { + public OKAction() { + putValue(NAME, "OK"); + } + public void actionPerformed(ActionEvent e) { + username = usernameField.getText(); + password = new String(passwordField.getPassword()); + dialog.dispose(); + } + } - public void actionPerformed(ActionEvent e) { - username = usernameField.getText(); - password = new String(passwordField.getPassword()); - dialog.dispose(); - } - } + private class CancelAction extends javax.swing.AbstractAction { + public CancelAction() { + putValue(NAME, "Cancel"); + } - private class CancelAction extends javax.swing.AbstractAction { - public CancelAction() { - putValue(NAME, "Cancel"); - } + public void actionPerformed(ActionEvent e) { + dialog.dispose(); + } + } + { + JRootPane rootPane = dialog.getRootPane(); + rootPane.setDefaultButton(ok); + rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), + "cancel"); + rootPane.getActionMap().put("cancel", new CancelAction()); + } + </script> - public void actionPerformed(ActionEvent e) { - dialog.dispose(); - } - } - { - JRootPane rootPane = dialog.getRootPane(); - rootPane.setDefaultButton(ok); - rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "cancel"); - rootPane.getActionMap().put("cancel", new CancelAction()); - } - </script> + <VBox horizontalAlignment='center' verticalAlignment='middle'> + <JButton text='Show password dialog' + onActionPerformed='dialog.setVisible(true)'/> + <VBox> + <JLabel text='{username != null ? "Username: " + username : ""}'/> + <JLabel text='{password != null ? "Password: " + password : ""}'/> + </VBox> + </VBox> - <JDialog title='Sign on' id='dialog' modal='true' onWindowOpened='dialog.setLocationRelativeTo(demoPanel); + <JDialog title='Sign on' id='dialog' modal='true' onWindowOpened='dialog.setLocationRelativeTo(JDialogDemo.this); passwordField.setText("");'> - <Table> - <row> - <cell> - <JLabel text='Username:' displayedMnemonic='U' labelFor='{usernameField}'/> - </cell> + <Table> + <row> + <cell> + <JLabel text='Username:' displayedMnemonic='U' + labelFor='{usernameField}'/> + </cell> - <cell> - <JTextField id='usernameField'/> - </cell> - </row> + <cell> + <JTextField id='usernameField'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Password:' displayedMnemonic='P' labelFor='{passwordField}'/> - </cell> + <row> + <cell> + <JLabel text='Password:' displayedMnemonic='P' + labelFor='{passwordField}'/> + </cell> - <cell> - <JPasswordField id='passwordField'/> - </cell> - </row> + <cell> + <JPasswordField id='passwordField'/> + </cell> + </row> - <row> - <cell columns='2'> - <JPanel layout='{new GridLayout(1, 0, 6, 6)}'> - <JButton id='ok' text='OK' action='{new OKAction()}'/> - <JButton text='Cancel' action='{new CancelAction()}'/> - </JPanel> - </cell> - </row> - </Table> - </JDialog> + <row> + <cell columns='2'> + <JPanel layout='{new GridLayout(1, 0, 6, 6)}'> + <JButton id='ok' text='OK' action='{new OKAction()}'/> + <JButton text='Cancel' action='{new CancelAction()}'/> + </JPanel> + </cell> + </row> + </Table> + </JDialog> - <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <JButton text='Show password dialog' onActionPerformed='dialog.setVisible(true)'/> - <VBox> - <JLabel text='{username != null ? "Username: " + username : ""}'/> - <JLabel text='{password != null ? "Password: " + password : ""}'/> - </VBox> - </VBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,61 +24,61 @@ --> <jaxx.demo.DemoPanel> - <Table id='demoPanel'> - <row> - <cell> - <JLabel text='Supported Swing components:'/> - </cell> - </row> + <Table> + <row> + <cell> + <JLabel text='Supported Swing components:'/> + </cell> + </row> - <row> - <cell> - <JScrollPane> - <JAXXList> - <item value='JApplet'/> - <item value='JButton'/> - <item value='JCheckBox'/> - <item value='JCheckBoxMenuItem'/> - <item value='JColorChooser'/> - <item value='JComboBox'/> - <item value='JDesktopPane'/> - <item value='JDialog'/> - <item value='JEditorPane'/> - <item value='JFileChooser'/> - <item value='JFormattedTextField'/> - <item value='JFrame'/> - <item value='JInternalFrame'/> - <item value='JLabel'/> - <item value='JLayeredPane'/> - <item value='JList'/> - <item value='JMenu'/> - <item value='JMenuBar'/> - <item value='JMenuItem'/> - <item value='JOptionPane'/> - <item value='JPanel'/> - <item value='JPasswordField'/> - <item value='JPopupMenu'/> - <item value='JProgressBar'/> - <item value='JRadioButton'/> - <item value='JRadioButtonMenuItem'/> - <item value='JScrollBar'/> - <item value='JScrollPane'/> - <item value='JSeparator'/> - <item value='JSlider'/> - <item value='JSpinner'/> - <item value='JSplitPane'/> - <item value='JTabbedPane'/> - <item value='JTable'/> - <item value='JTextArea'/> - <item value='JTextField'/> - <item value='JTextPane'/> - <item value='JToggleButton'/> - <item value='JToolBar'/> - <item value='JTree'/> - <item value='JWindow'/> - </JAXXList> - </JScrollPane> - </cell> - </row> - </Table> + <row> + <cell> + <JScrollPane> + <JAXXList> + <item value='JApplet'/> + <item value='JButton'/> + <item value='JCheckBox'/> + <item value='JCheckBoxMenuItem'/> + <item value='JColorChooser'/> + <item value='JComboBox'/> + <item value='JDesktopPane'/> + <item value='JDialog'/> + <item value='JEditorPane'/> + <item value='JFileChooser'/> + <item value='JFormattedTextField'/> + <item value='JFrame'/> + <item value='JInternalFrame'/> + <item value='JLabel'/> + <item value='JLayeredPane'/> + <item value='JList'/> + <item value='JMenu'/> + <item value='JMenuBar'/> + <item value='JMenuItem'/> + <item value='JOptionPane'/> + <item value='JPanel'/> + <item value='JPasswordField'/> + <item value='JPopupMenu'/> + <item value='JProgressBar'/> + <item value='JRadioButton'/> + <item value='JRadioButtonMenuItem'/> + <item value='JScrollBar'/> + <item value='JScrollPane'/> + <item value='JSeparator'/> + <item value='JSlider'/> + <item value='JSpinner'/> + <item value='JSplitPane'/> + <item value='JTabbedPane'/> + <item value='JTable'/> + <item value='JTextArea'/> + <item value='JTextField'/> + <item value='JTextPane'/> + <item value='JToggleButton'/> + <item value='JToolBar'/> + <item value='JTree'/> + <item value='JWindow'/> + </JAXXList> + </JScrollPane> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,26 +24,25 @@ --> <jaxx.demo.DemoPanel> - <script> - void $afterCompleteSetup(){} - private void displayMessage() { - JOptionPane.showMessageDialog(demoPanel, "Menu item clicked"); - } - </script> + <script> + void $afterCompleteSetup(){} + </script> - <JPanel id='demoPanel'> - <JDesktopPane width='350' height='400' background='{null}'> - <JInternalFrame title='JMenu demo' width='300' height='250' resizable='true'> - <JMenuBar id='menuBar'> - <JMenu text='Demo'> - <JMenuItem text='Message Box' onActionPerformed='displayMessage()'/> - </JMenu> - </JMenuBar> + <JDesktopPane width='350' height='400' background='{null}'> + <JInternalFrame title='JMenu demo' width='300' height='250' + resizable='true'> + <JMenuBar id='menuBar'> + <JMenu text='Demo'> + <JMenuItem text='Message Box' + onActionPerformed='JOptionPane.showMessageDialog(this, "Menu item clicked")'/> + </JMenu> + </JMenuBar> - <JPanel id='framePanel'> - <JLabel text='JMenu demo' id='demoMessage' horizontalAlignment='center'/> - </JPanel> - </JInternalFrame> - </JDesktopPane> - </JPanel> + <JPanel id='framePanel'> + <JLabel text='JMenu demo' id='demoMessage' + horizontalAlignment='center'/> + </JPanel> + </JInternalFrame> + </JDesktopPane> + </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,12 +24,12 @@ --> <jaxx.demo.DemoPanel> - <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <HBox> - <JLabel text='Password:' displayedMnemonic='P' labelFor='{password}'/> - <JPasswordField id='password'/> - </HBox> + <VBox horizontalAlignment='center' verticalAlignment='middle'> + <HBox> + <JLabel text='Password:' displayedMnemonic='P' labelFor='{password}'/> + <JPasswordField id='password'/> + </HBox> - <JLabel text='You entered: {new String(password.getPassword())}'/> - </VBox> + <JLabel text='You entered: {new String(password.getPassword())}'/> + </VBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -23,8 +23,8 @@ #L% --> -<jaxx.demo.DemoPanel> - <script><![CDATA[ +<jaxx.demo.DemoPanel layout='{new BorderLayout()}'> + <script><![CDATA[ import javax.swing.Timer; int red = 0; @@ -64,39 +64,45 @@ blueTimer.start(); ]]></script> - <Table insets='6' id='demoPanel'> - <row> - <cell columns='3'> - <JLabel text='Welcome to the JAXX framework!' font='{UIManager.getFont("Label.font").deriveFont(18f)}' - foreground='{new Color(red, green, blue)}'/> - </cell> - </row> + <Table insets='6' constraints='BorderLayout.CENTER'> + <row> + <cell columns='3'> + <JLabel text='Welcome to the JAXX framework!' + font='{UIManager.getFont("Label.font").deriveFont(18f)}' + foreground='{new Color(red, green, blue)}'/> + </cell> + </row> - <row> - <cell columns='3' fill='horizontal'> - <JProgressBar foreground='{new Color(red, 0, 0)}' value='{red}' maximum='255'/> - </cell> - </row> + <row> + <cell columns='3' fill='horizontal'> + <JProgressBar foreground='{new Color(red, 0, 0)}' value='{red}' + maximum='255'/> + </cell> + </row> - <row> - <cell columns='3' fill='horizontal'> - <JProgressBar foreground='{new Color(0, green, 0)}' value='{green}' maximum='255'/> - </cell> - </row> + <row> + <cell columns='3' fill='horizontal'> + <JProgressBar foreground='{new Color(0, green, 0)}' value='{green}' + maximum='255'/> + </cell> + </row> - <row> - <cell columns='3' fill='horizontal'> - <JProgressBar foreground='{new Color(0, 0, blue)}' value='{blue}' maximum='255'/> - </cell> - </row> + <row> + <cell columns='3' fill='horizontal'> + <JProgressBar foreground='{new Color(0, 0, blue)}' value='{blue}' + maximum='255'/> + </cell> + </row> - <row> - <cell weightx='1' anchor='east'> - <JButton text='Start' onActionPerformed='redTimer.start(); greenTimer.start(); blueTimer.start()'/> - </cell> - <cell> - <JButton text='Stop' onActionPerformed='redTimer.stop(); greenTimer.stop(); blueTimer.stop()'/> - </cell> - </row> - </Table> + <row> + <cell weightx='1' anchor='east'> + <JButton text='Start' + onActionPerformed='redTimer.start(); greenTimer.start(); blueTimer.start()'/> + </cell> + <cell> + <JButton text='Stop' + onActionPerformed='redTimer.stop(); greenTimer.stop(); blueTimer.stop()'/> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,13 +24,17 @@ --> <jaxx.demo.DemoPanel> - <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <VBox> - <JRadioButton text='Animal' value='Lynx.jpg' buttonGroup='radioButtons' selected='true'/> - <JRadioButton text='Vegetable' buttonGroup='radioButtons' value='Tomato.jpg'/> - <JRadioButton text='Mineral' buttonGroup='radioButtons' value='Amethyst.jpg'/> - </VBox> + <HBox horizontalAlignment='center' verticalAlignment='middle'> + <VBox> + <JRadioButton text='Animal' value='Lynx.jpg' buttonGroup='radioButtons' + selected='true'/> + <JRadioButton text='Vegetable' buttonGroup='radioButtons' + value='Tomato.jpg'/> + <JRadioButton text='Mineral' buttonGroup='radioButtons' + value='Amethyst.jpg'/> + </VBox> - <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/" + radioButtons.getSelectedValue()))}'/> - </HBox> + <JLabel + icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/" + radioButtons.getSelectedValue()))}'/> + </HBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,24 +24,30 @@ --> <JMenuItemDemo> - <script><![CDATA[ + <script><![CDATA[ protected Font updateFont(Object selectedValue) { return UIManager.getFont("Label.font").deriveFont(selectedValue != null ? (float) ((Integer) selectedValue).intValue() : 12); } ]]> - </script> - <JMenuBar id='menuBar'> - <JMenu text='Font size'> - <JRadioButtonMenuItem text='10' value='{new Integer(10)}' buttonGroup='fontSize'/> - <JRadioButtonMenuItem text='12' value='{new Integer(12)}' buttonGroup='fontSize' selected='true'/> - <JRadioButtonMenuItem text='14' value='{new Integer(14)}' buttonGroup='fontSize'/> - <JRadioButtonMenuItem text='18' value='{new Integer(18)}' buttonGroup='fontSize'/> - <JRadioButtonMenuItem text='24' value='{new Integer(24)}' buttonGroup='fontSize'/> - </JMenu> - </JMenuBar> + </script> + <JMenuBar id='menuBar'> + <JMenu text='Font size'> + <JRadioButtonMenuItem text='10' value='{new Integer(10)}' + buttonGroup='fontSize'/> + <JRadioButtonMenuItem text='12' value='{new Integer(12)}' + buttonGroup='fontSize' selected='true'/> + <JRadioButtonMenuItem text='14' value='{new Integer(14)}' + buttonGroup='fontSize'/> + <JRadioButtonMenuItem text='18' value='{new Integer(18)}' + buttonGroup='fontSize'/> + <JRadioButtonMenuItem text='24' value='{new Integer(24)}' + buttonGroup='fontSize'/> + </JMenu> + </JMenuBar> - <JLabel id='demoMessage' text='Font size: {fontSize.getSelectedValue()}' horizontalAlignment='center' - font='{updateFont(fontSize.getSelectedValue())}'/> - <!--font='{UIManager.getFont("Label.font").deriveFont(fontSize.getSelectedValue() != null ? (float) ((Integer) fontSize.getSelectedValue()).intValue() : 12)}'/>--> + <JLabel id='demoMessage' text='Font size: {fontSize.getSelectedValue()}' + horizontalAlignment='center' + font='{updateFont(fontSize.getSelectedValue())}'/> + <!--font='{UIManager.getFont("Label.font").deriveFont(fontSize.getSelectedValue() != null ? (float) ((Integer) fontSize.getSelectedValue()).intValue() : 12)}'/>--> </JMenuItemDemo> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,14 +24,15 @@ --> <jaxx.demo.DemoPanel> - <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <VBox> - <JSlider id='red' maximum='255' value='200'/> - <JSlider id='green' maximum='255' value='180'/> - <JSlider id='blue' maximum='255' value='240'/> - </VBox> + <HBox horizontalAlignment='center' verticalAlignment='middle'> + <VBox> + <JSlider id='red' maximum='255' value='200'/> + <JSlider id='green' maximum='255' value='180'/> + <JSlider id='blue' maximum='255' value='240'/> + </VBox> - <JPanel border='{BorderFactory.createEtchedBorder()}' width='64' height='64' - background='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/> - </HBox> + <JPanel border='{BorderFactory.createEtchedBorder()}' width='64' + height='64' + background='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/> + </HBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,15 +24,13 @@ --> <jaxx.demo.DemoPanel> - <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <JLabel text='Spacing:' displayedMnemonic='S' labelFor='{spinner}'/> + <JLabel text='Spacing:' displayedMnemonic='S' labelFor='{spinner}'/> - <JSpinner minimum='0' maximum='50' id='spinner'/> + <JSpinner minimum='0' maximum='50' id='spinner'/> - <VBox spacing='{((Integer) spinner.getValue()).intValue()}'> - <JLabel text='Use the spinner to'/> - <JLabel text='adjust the spacing'/> - <JLabel text='between these lines'/> - </VBox> - </HBox> + <VBox spacing='{((Integer) spinner.getValue()).intValue()}'> + <JLabel text='Use the spinner to'/> + <JLabel text='adjust the spacing'/> + <JLabel text='between these lines'/> + </VBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,15 +24,15 @@ --> <jaxx.demo.DemoPanel> - <JPanel id='demoPanel' layout='{new BorderLayout()}'> - <JSplitPane> - <JScrollPane> - <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Amethyst.jpg"))}'/> - </JScrollPane> + <JSplitPane> + <JScrollPane> + <JLabel + icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Amethyst.jpg"))}'/> + </JScrollPane> - <JScrollPane> - <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Lynx.jpg"))}'/> - </JScrollPane> - </JSplitPane> - </JPanel> + <JScrollPane> + <JLabel + icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Lynx.jpg"))}'/> + </JScrollPane> + </JSplitPane> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,35 +24,37 @@ --> <jaxx.demo.DemoPanel> - <Table id='demoPanel' anchor='northwest'> - <row> - <cell> - <JLabel text='Normal text:' displayedMnemonic='N' labelFor='{textArea}'/> - </cell> + <Table anchor='northwest'> + <row> + <cell> + <JLabel text='Normal text:' displayedMnemonic='N' + labelFor='{textArea}'/> + </cell> - <cell weightx='1' fill='both'> - <JScrollPane height='120'> - <JTextArea id='textArea' text='Try typing some text here.'/> - </JScrollPane> - </cell> - </row> + <cell weightx='1' fill='both'> + <JScrollPane height='120'> + <JTextArea id='textArea' text='Try typing some text here.'/> + </JScrollPane> + </cell> + </row> - <row> - <cell> - <JLabel text='Upper case text:'/> - </cell> + <row> + <cell> + <JLabel text='Upper case text:'/> + </cell> - <cell weightx='1' fill='both'> - <JScrollPane height='120'> - <JTextArea editable='false' background='{null}' text='{textArea.getText().toUpperCase()}'/> - </JScrollPane> - </cell> - </row> + <cell weightx='1' fill='both'> + <JScrollPane height='120'> + <JTextArea editable='false' background='{null}' + text='{textArea.getText().toUpperCase()}'/> + </JScrollPane> + </cell> + </row> - <row> - <cell weighty='1'> - <JPanel/> - </cell> - </row> - </Table> + <row> + <cell weighty='1'> + <JPanel/> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,24 +24,22 @@ --> <jaxx.demo.DemoPanel> - <JPanel id='demoPanel'> - <Table> - <row> - <cell> - <JLabel text='Your name:' displayedMnemonic='n' labelFor='{textField}'/> - </cell> + <Table> + <row> + <cell> + <JLabel text='Your name:' displayedMnemonic='n' labelFor='{textField}'/> + </cell> - <cell> - <JTextField id='textField'/> - </cell> - </row> + <cell> + <JTextField id='textField'/> + </cell> + </row> - <row> - <cell columns='2'> - <JButton text='Greet' - onActionPerformed='JOptionPane.showMessageDialog(demoPanel, "Hello, " + textField.getText() + "!")'/> - </cell> - </row> - </Table> - </JPanel> + <row> + <cell columns='2'> + <JButton text='Greet' + onActionPerformed='JOptionPane.showMessageDialog(this, "Hello, " + textField.getText() + "!")'/> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,11 +24,12 @@ --> <jaxx.demo.DemoPanel> - <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> - <JToggleButton text='1' id='one'/> - <JToggleButton text='2' id='two'/> - <JToggleButton text='3' id='three'/> + <HBox horizontalAlignment='center' verticalAlignment='middle'> + <JToggleButton text='1' id='one'/> + <JToggleButton text='2' id='two'/> + <JToggleButton text='3' id='three'/> - <JLabel text='Total: {(one.isSelected() ? 1 : 0) + (two.isSelected() ? 2 : 0) + (three.isSelected() ? 3 : 0)}'/> - </HBox> + <JLabel + text='Total: {(one.isSelected() ? 1 : 0) + (two.isSelected() ? 2 : 0) + (three.isSelected() ? 3 : 0)}'/> + </HBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,7 +25,8 @@ package jaxx.demo.entities; -import java.beans.*; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; public class Model { Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,30 +25,34 @@ package jaxx.demo.entities; -import java.util.ArrayList; -import java.util.List; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; +import java.util.ArrayList; +import java.util.List; + /** - * * @author tchemit <chemit@codelutin.com> * @since 1.7.2 */ public class Movie { protected String id; + protected String title; + protected String image; + protected int year; + protected List<People> actors; - public Movie(String id, String title, int year,String image) { + public Movie(String id, String title, int year, String image) { this(); this.id = id; this.title = title; this.year = year; - this.image=image; + this.image = image; } public Movie() { Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -29,16 +29,19 @@ import org.apache.commons.lang.builder.ToStringStyle; /** - * * @author tchemit <chemit@codelutin.com> * @since 1.7.2 */ public class People { protected String id; + protected String image; + protected String firstName; + protected String lastName; + protected int age; public People(String id, String firstName, String lastName, int age, String image) { Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,23 +25,23 @@ <jaxx.demo.DemoPanel> - <!-- a full java bean property of the class --> - <Boolean id='editing' javaBean='false'/> + <!-- a full java bean property of the class --> + <Boolean id='editing' javaBean='false'/> - <!-- not full java bean property (must add script...) --> - <Boolean id='editing2' constructorParams='false'/> + <!-- not full java bean property (must add script...) --> + <Boolean id='editing2' constructorParams='false'/> - <String id='contentMessage' javaBean='"message..."'/> + <String id='contentMessage' javaBean='"message..."'/> - <script> - void $afterCompleteSetup(){} - public Boolean isEditing2() { return editing2; } + <script> + void $afterCompleteSetup(){} + public Boolean isEditing2() { return editing2; } - public void setEditing2(Boolean newValue) { - Boolean oldValue = this.editing2; - this.editing2 = newValue; - firePropertyChange("editing2", oldValue, newValue) ; - } - </script> + public void setEditing2(Boolean newValue) { + Boolean oldValue = this.editing2; + this.editing2 = newValue; + firePropertyChange("editing2", oldValue, newValue) ; + } + </script> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,54 +25,61 @@ <BaseBeanDataBinding> - <Boolean id='editing3' javaBean='true'/> - <script><![CDATA[ + <Boolean id='editing3' javaBean='true'/> + <script><![CDATA[ @Override protected String[] getSources() { return new String[]{ getDefaultSource(), "BaseBeanDataBinding.jaxx" }; } ]]> - </script> - <Table id='demoPanel'> - <row> - <cell columns='2'> - <JLabel text='{getContentMessage()}'/> - </cell> - </row> - <row> - <cell> - <JPanel> - <JButton visible='{!isEditing()}' text='edit' onActionPerformed='setEditing(true);'/> - <JButton visible='{isEditing()}' text='close' onActionPerformed='setEditing(false);'/> - </JPanel> - </cell> - <cell weightx='1' fill='both'> - <JTextField enabled='{isEditing()}' text='to edit'/> - </cell> - </row> - <row> - <cell> - <JPanel> - <JButton visible='{!isEditing2()}' text='edit2' onActionPerformed='setEditing2(true);'/> - <JButton visible='{isEditing2()}' text='close2' onActionPerformed='setEditing2(false);'/> - </JPanel> - </cell> - <cell weightx='1' fill='both'> - <JTextField enabled='{isEditing2()}' text="to edit 2"/> - </cell> - </row> - <row> - <cell> - <JPanel> - <JButton visible='{!isEditing3()}' text='edit3' onActionPerformed='setEditing3(true);'/> - <JButton visible='{isEditing3()}' text='close3' onActionPerformed='setEditing3(false);'/> - </JPanel> - </cell> - <cell weightx='1' fill='both'> - <JTextField id='edit3' enabled='{isEditing3()}' text="{getContentMessage()}" - onKeyReleased='setContentMessage(edit3.getText())'/> - </cell> - </row> - </Table> + </script> + <Table> + <row> + <cell columns='2'> + <JLabel text='{getContentMessage()}'/> + </cell> + </row> + <row> + <cell> + <JPanel> + <JButton visible='{!isEditing()}' text='edit' + onActionPerformed='setEditing(true);'/> + <JButton visible='{isEditing()}' text='close' + onActionPerformed='setEditing(false);'/> + </JPanel> + </cell> + <cell weightx='1' fill='both'> + <JTextField enabled='{isEditing()}' text='to edit'/> + </cell> + </row> + <row> + <cell> + <JPanel> + <JButton visible='{!isEditing2()}' text='edit2' + onActionPerformed='setEditing2(true);'/> + <JButton visible='{isEditing2()}' text='close2' + onActionPerformed='setEditing2(false);'/> + </JPanel> + </cell> + <cell weightx='1' fill='both'> + <JTextField enabled='{isEditing2()}' text="to edit 2"/> + </cell> + </row> + <row> + <cell> + <JPanel> + <JButton visible='{!isEditing3()}' text='edit3' + onActionPerformed='setEditing3(true);'/> + <JButton visible='{isEditing3()}' text='close3' + onActionPerformed='setEditing3(false);'/> + </JPanel> + </cell> + <cell weightx='1' fill='both'> + <JTextField id='edit3' enabled='{isEditing3()}' + text="{getContentMessage()}" + onKeyReleased='setContentMessage(edit3.getText())'/> + </cell> + </row> + </Table> </BaseBeanDataBinding> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BindingExtremeDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BindingExtremeDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BindingExtremeDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -26,15 +26,15 @@ <jaxx.demo.DemoPanel id='mainFrame' implements='DemoUIModel'> - <style> - JTextArea { editable:false; } + <style> + JTextArea { editable:false; } - JCheckBox { enabled:false; } + JCheckBox { enabled:false; } - .nobinding { background:{Color.GRAY}; } - </style> + .nobinding { background:{Color.GRAY}; } + </style> - <script><![CDATA[ + <script><![CDATA[ public JToggleButton getT3() { return t0; } private void $afterCompleteSetup() { @@ -60,189 +60,225 @@ return new String[]{ getDefaultSource(), "DemoUIModel.java", "DefaultDemoUIModel.java" }; } ]]> - </script> + </script> - <Boolean id='f0' javaBean='Boolean.FALSE'/> - <Boolean id='f1' javaBean='Boolean.FALSE'/> - <java.io.File id='file' javaBean='new java.io.File(".")'/> + <Boolean id='f0' javaBean='Boolean.FALSE'/> + <Boolean id='f1' javaBean='Boolean.FALSE'/> + <java.io.File id='file' javaBean='new java.io.File(".")'/> - <DefaultDemoUIModel id='model0' initializer='new DefaultDemoUIModel()'/> + <DefaultDemoUIModel id='model0' initializer='new DefaultDemoUIModel()'/> - <DemoUIModel id='model1' javaBean='new DefaultDemoUIModel()'/> + <DemoUIModel id='model1' javaBean='new DefaultDemoUIModel()'/> - <Table id='demoPanel' fill="both" constraints='BorderLayout.NORTH'> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JCheckBox id='cf0' selected='{isF0()}' text='isF0()'/> - <JCheckBox id='cf1' selected='{isF1()}' text='isF1()'/> - <JCheckBox id='cf0O1' selected='{isF0() || isF1()}' text='isF0() || isF1()'/> - <JCheckBox id='cf0A1' selected='{isF0() && isF1()}' text='isF0() && isF1()'/> - </JPanel> - </cell> - </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JCheckBox id='ct0' selected='{t0.isSelected()}' text='t0.isSelected()'/> - <JCheckBox id='ct1' selected='{t1.isSelected()}' text='t1.isSelected()'/> - <JCheckBox id='ct0O1' selected='{t0.isSelected() || t1.isSelected()}' - text='t0.isSelected() || t1.isSelected()'/> - <JCheckBox id='ct0A1' selected='{t0.isSelected() && t1.isSelected()}' - text='t0.isSelected() && t1.isSelected()'/> - </JPanel> - </cell> - </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JCheckBox id='cgett0' selected='{getT0().isSelected()}' text='getT0().isSelected()'/> - <JCheckBox id='cgett1' selected='{getT1().isSelected()}' text='getT1().isSelected()'/> - <JCheckBox id='cgett0O1' selected='{getT0().isSelected() || getT1().isSelected()}' - text='getT0().isSelected() || getT1().isSelected()'/> - <JCheckBox id='cgett0A1' selected='{getT0().isSelected() && getT1().isSelected()}' - text='getT0().isSelected() && getT1().isSelected()'/> - </JPanel> - </cell> - </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JTextArea id='cfile' border='{new TitledBorder("file.getAbsolutePath()")}' - text='{file.getAbsolutePath()}' visible='{!$bindings.containsKey("cfile.text")}' - styleClass="nobinding"/> - <JTextArea id='cgetfile' border='{new TitledBorder("getFile().getAbsolutePath()")}' - text='{getFile().getAbsolutePath()}' - visible='{$bindings.containsKey("cgetfile.text")}'/> - </JPanel> - </cell> - </row> - <row weightx='1'> - <cell> - <JToggleButton id='t0' text='f0' onActionPerformed='setF0(!f0)'/> - </cell> - <cell> - <JToggleButton id='t1' text='f1' onActionPerformed='setF1(!f1)' javaBean='new JToggleButton()'/> - </cell> - <cell> - <JButton text="file..." - onActionPerformed='setFile(org.nuiton.util.FileUtil.getFile(this, new String[0]))'/> - </cell> - </row> + <Table fill="both" constraints='BorderLayout.NORTH'> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JCheckBox id='cf0' selected='{isF0()}' text='isF0()'/> + <JCheckBox id='cf1' selected='{isF1()}' text='isF1()'/> + <JCheckBox id='cf0O1' selected='{isF0() || isF1()}' + text='isF0() || isF1()'/> + <JCheckBox id='cf0A1' selected='{isF0() && isF1()}' + text='isF0() && isF1()'/> + </JPanel> + </cell> + </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JCheckBox id='ct0' selected='{t0.isSelected()}' + text='t0.isSelected()'/> + <JCheckBox id='ct1' selected='{t1.isSelected()}' + text='t1.isSelected()'/> + <JCheckBox id='ct0O1' selected='{t0.isSelected() || t1.isSelected()}' + text='t0.isSelected() || t1.isSelected()'/> + <JCheckBox id='ct0A1' + selected='{t0.isSelected() && t1.isSelected()}' + text='t0.isSelected() && t1.isSelected()'/> + </JPanel> + </cell> + </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JCheckBox id='cgett0' selected='{getT0().isSelected()}' + text='getT0().isSelected()'/> + <JCheckBox id='cgett1' selected='{getT1().isSelected()}' + text='getT1().isSelected()'/> + <JCheckBox id='cgett0O1' + selected='{getT0().isSelected() || getT1().isSelected()}' + text='getT0().isSelected() || getT1().isSelected()'/> + <JCheckBox id='cgett0A1' + selected='{getT0().isSelected() && getT1().isSelected()}' + text='getT0().isSelected() && getT1().isSelected()'/> + </JPanel> + </cell> + </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JTextArea id='cfile' + border='{new TitledBorder("file.getAbsolutePath()")}' + text='{file.getAbsolutePath()}' + visible='{!$bindings.containsKey("cfile.text")}' + styleClass="nobinding"/> + <JTextArea id='cgetfile' + border='{new TitledBorder("getFile().getAbsolutePath()")}' + text='{getFile().getAbsolutePath()}' + visible='{$bindings.containsKey("cgetfile.text")}'/> + </JPanel> + </cell> + </row> + <row weightx='1'> + <cell> + <JToggleButton id='t0' text='f0' onActionPerformed='setF0(!f0)'/> + </cell> + <cell> + <JToggleButton id='t1' text='f1' onActionPerformed='setF1(!f1)' + javaBean='new JToggleButton()'/> + </cell> + <cell> + <JButton text="file..." + onActionPerformed='setFile(org.nuiton.util.FileUtil.getFile(this, new String[0]))'/> + </cell> + </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JCheckBox id='cmt0' selected='{model0.isF0()}' text='model0.isF0()'/> - <JCheckBox id='cmt1' selected='{model0.isF1()}' text='model0.isF1()'/> - <JCheckBox id='cmt0O1' selected='{model0.isF0() || model0.isF1()}' - text='model0.isF0() || model0.isF1()'/> - <JCheckBox id='cmt0A1' selected='{model0.isF0() && model0.isF1()}' - text='model0.isF0() && model0.isF1()'/> - </JPanel> - </cell> - </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JCheckBox id='cmgett0' selected='{getModel0().isF0()}' text='getModel0().isF0()'/> - <JCheckBox id='cmgett1' selected='{getModel0().isF1()}' text='getModel0().isF1()'/> - <JCheckBox id='cmgett0O1' selected='{getModel0().isF0() || getModel0().isF1()}' - text='getModel0().isF0() || getModel0().isF1()'/> - <JCheckBox id='cmgett0A1' selected='{getModel0().isF0() && getModel0().isF1()}' - text='getModel0().isF0() && getModel0().isF1()'/> - </JPanel> - </cell> - </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JTextArea id='cMfile' border='{new TitledBorder("model0.getFile().getAbsolutePath()")}' - text='{model0.getFile().getAbsolutePath()}' - visible='{$bindings.containsKey("cMfile.text")}'/> - <JTextArea id='cMgetfile' border='{new TitledBorder("getModel0().getFile().getAbsolutePath()")}' - text='{getModel0().getFile().getAbsolutePath()}' - visible='{$bindings.containsKey("cMgetfile.text")}'/> - </JPanel> - </cell> - </row> - <row> - <cell> - <JToggleButton id='Mt0' text='model0.f0' onActionPerformed='model0.setF0(!model0.isF0())'/> - </cell> - <cell> - <JToggleButton id='Mt1' text='model0.f1' onActionPerformed='model0.setF1(!model0.isF1())' - javaBean='new JToggleButton()'/> - </cell> - <cell> - <JButton text="model0.file..." - onActionPerformed='model0.setFile(org.nuiton.util.FileUtil.getFile(this,new String[0]))'/> - </cell> - </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JCheckBox id='cmt0' selected='{model0.isF0()}' text='model0.isF0()'/> + <JCheckBox id='cmt1' selected='{model0.isF1()}' text='model0.isF1()'/> + <JCheckBox id='cmt0O1' selected='{model0.isF0() || model0.isF1()}' + text='model0.isF0() || model0.isF1()'/> + <JCheckBox id='cmt0A1' + selected='{model0.isF0() && model0.isF1()}' + text='model0.isF0() && model0.isF1()'/> + </JPanel> + </cell> + </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JCheckBox id='cmgett0' selected='{getModel0().isF0()}' + text='getModel0().isF0()'/> + <JCheckBox id='cmgett1' selected='{getModel0().isF1()}' + text='getModel0().isF1()'/> + <JCheckBox id='cmgett0O1' + selected='{getModel0().isF0() || getModel0().isF1()}' + text='getModel0().isF0() || getModel0().isF1()'/> + <JCheckBox id='cmgett0A1' + selected='{getModel0().isF0() && getModel0().isF1()}' + text='getModel0().isF0() && getModel0().isF1()'/> + </JPanel> + </cell> + </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JTextArea id='cMfile' + border='{new TitledBorder("model0.getFile().getAbsolutePath()")}' + text='{model0.getFile().getAbsolutePath()}' + visible='{$bindings.containsKey("cMfile.text")}'/> + <JTextArea id='cMgetfile' + border='{new TitledBorder("getModel0().getFile().getAbsolutePath()")}' + text='{getModel0().getFile().getAbsolutePath()}' + visible='{$bindings.containsKey("cMgetfile.text")}'/> + </JPanel> + </cell> + </row> + <row> + <cell> + <JToggleButton id='Mt0' text='model0.f0' + onActionPerformed='model0.setF0(!model0.isF0())'/> + </cell> + <cell> + <JToggleButton id='Mt1' text='model0.f1' + onActionPerformed='model0.setF1(!model0.isF1())' + javaBean='new JToggleButton()'/> + </cell> + <cell> + <JButton text="model0.file..." + onActionPerformed='model0.setFile(org.nuiton.util.FileUtil.getFile(this,new String[0]))'/> + </cell> + </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JCheckBox id='cit0' selected='{((DemoUIModel)model1).isF0()}' text='model1.isF0()'/> - <JCheckBox id='cit1' selected='{((DemoUIModel)model1).isF1()}' text='model1.isF1()'/> - <JCheckBox id='cit0O1' selected='{((DemoUIModel)model1).isF0() || ((DemoUIModel)model1).isF1()}' - text='model1.isF0() || model1.isF1()'/> - <JCheckBox id='cit0A1' - selected='{((DemoUIModel)model1).isF0() && ((DemoUIModel)model1).isF1()}' - text='model1.isF0() && model1.isF1()'/> - </JPanel> - </cell> - </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JCheckBox id='cigett0' selected='{getModel1().isF0()}' text='getModel1().isF0()'/> - <JCheckBox id='cigett1' selected='{getModel1().isF1()}' text='getModel1().isF1()'/> - <JCheckBox id='cigett0O1' selected='{getModel1().isF0() || getModel1().isF1()}' - text='getModel1().isF0() || getModel1().isF1()'/> - <JCheckBox id='cigett0A1' selected='{getModel1().isF0() && getModel1().isF1()}' - text='getModel1().isF0() && getModel1().isF1()'/> - </JPanel> - </cell> - </row> - <row> - <cell columns="3"> - <JPanel layout="{new GridLayout(1,0)}"> - <JTextArea id='cIfile' border='{new TitledBorder("model1.getFile().getAbsolutePath()")}' - text='{model1.getFile().getAbsolutePath()}' - visible='{$bindings.containsKey("cIfile.text")}'/> - <JTextArea id='cIgetfile' border='{new TitledBorder("getModel1().getFile().getAbsolutePath()")}' - text='{getModel1().getFile().getAbsolutePath()}' - visible='{$bindings.containsKey("cIgetfile.text")}'/> - </JPanel> - </cell> - </row> - <row> - <cell> - <JToggleButton id='It0' text='model1.f0' onActionPerformed='model1.setF0(!model1.isF0())'/> - </cell> - <cell> - <JToggleButton id='It1' text='model1.f1' onActionPerformed='model1.setF1(!model1.isF1())' - javaBean='new JToggleButton()'/> - </cell> - <cell> - <JButton text="model1.file..." - onActionPerformed='model1.setFile(org.nuiton.util.FileUtil.getFile(this,new String[0]))'/> - </cell> - </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JCheckBox id='cit0' selected='{((DemoUIModel)model1).isF0()}' + text='model1.isF0()'/> + <JCheckBox id='cit1' selected='{((DemoUIModel)model1).isF1()}' + text='model1.isF1()'/> + <JCheckBox id='cit0O1' + selected='{((DemoUIModel)model1).isF0() || ((DemoUIModel)model1).isF1()}' + text='model1.isF0() || model1.isF1()'/> + <JCheckBox id='cit0A1' + selected='{((DemoUIModel)model1).isF0() && ((DemoUIModel)model1).isF1()}' + text='model1.isF0() && model1.isF1()'/> + </JPanel> + </cell> + </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JCheckBox id='cigett0' selected='{getModel1().isF0()}' + text='getModel1().isF0()'/> + <JCheckBox id='cigett1' selected='{getModel1().isF1()}' + text='getModel1().isF1()'/> + <JCheckBox id='cigett0O1' + selected='{getModel1().isF0() || getModel1().isF1()}' + text='getModel1().isF0() || getModel1().isF1()'/> + <JCheckBox id='cigett0A1' + selected='{getModel1().isF0() && getModel1().isF1()}' + text='getModel1().isF0() && getModel1().isF1()'/> + </JPanel> + </cell> + </row> + <row> + <cell columns="3"> + <JPanel layout="{new GridLayout(1,0)}"> + <JTextArea id='cIfile' + border='{new TitledBorder("model1.getFile().getAbsolutePath()")}' + text='{model1.getFile().getAbsolutePath()}' + visible='{$bindings.containsKey("cIfile.text")}'/> + <JTextArea id='cIgetfile' + border='{new TitledBorder("getModel1().getFile().getAbsolutePath()")}' + text='{getModel1().getFile().getAbsolutePath()}' + visible='{$bindings.containsKey("cIgetfile.text")}'/> + </JPanel> + </cell> + </row> + <row> + <cell> + <JToggleButton id='It0' text='model1.f0' + onActionPerformed='model1.setF0(!model1.isF0())'/> + </cell> + <cell> + <JToggleButton id='It1' text='model1.f1' + onActionPerformed='model1.setF1(!model1.isF1())' + javaBean='new JToggleButton()'/> + </cell> + <cell> + <JButton text="model1.file..." + onActionPerformed='model1.setFile(org.nuiton.util.FileUtil.getFile(this,new String[0]))'/> + </cell> + </row> - <row weighty="1"> - <cell columns="3"> - <JPanel layout="{new BorderLayout()}"> - <JTextArea id="bindingsLabel" editable='false' text='{$bindings.size() + " bindings."}'/> - <JScrollPane constraints='BorderLayout.CENTER' columnHeaderView='{bindingsLabel}'> - <JList id="bindings" model='{new DefaultListModel()}' font-size='10'/> - </JScrollPane> - </JPanel> - </cell> - </row> - </Table> + <row weighty="1"> + <cell columns="3"> + <JPanel layout="{new BorderLayout()}"> + <JTextArea id="bindingsLabel" editable='false' + text='{$bindings.size() + " bindings."}'/> + <JScrollPane constraints='BorderLayout.CENTER' + columnHeaderView='{bindingsLabel}'> + <JList id="bindings" model='{new DefaultListModel()}' + font-size='10'/> + </JScrollPane> + </JPanel> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DefaultDemoUIModel.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DefaultDemoUIModel.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DefaultDemoUIModel.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -45,16 +45,23 @@ protected File file; + protected File file1; + protected Boolean f1 = false; + protected Boolean f0 = false; protected JToggleButton t1; + protected JToggleButton t0; public static final String PROPERTY_T1 = "t1"; + public static final String PROPERTY_F1 = "f1"; + public static final String PROPERTY_F0 = "f0"; + public static final String PROPERTY_FILE = "file"; protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this); Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DemoUIModel.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DemoUIModel.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DemoUIModel.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,7 +24,7 @@ */ package jaxx.demo.feature.databinding; -import javax.swing.*; +import javax.swing.JToggleButton; import java.beans.PropertyChangeListener; import java.io.File; Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,9 +24,9 @@ --> <jaxx.demo.DemoPanel> - <style source="Validation.css"/> + <style source="Validation.css"/> - <script><![CDATA[ + <script><![CDATA[ import static org.nuiton.i18n.I18n.n_; import jaxx.demo.entities.*; import jaxx.runtime.validator.swing.SwingValidatorMessageListRenderer; @@ -43,321 +43,325 @@ }; } ]]> - </script> - <!-- models --> - <Model id='model1'/> - <Model id='model2'/> - <Identity id='identity'/> + </script> + <!-- models --> + <Model id='model1'/> + <Model id='model2'/> + <Identity id='identity'/> - <!-- errors model --> - <!-- Not existing :) --> - <!--jaxx.runtime.validator.gwt.GWTValidatorMessageListModel id='errors'--> - <SwingValidatorMessageListModel id='errors' - onContentsChanged='ok.setEnabled(errors.isEmpty())'/> + <!-- errors model --> + <!-- Not existing :) --> + <!--jaxx.runtime.validator.gwt.GWTValidatorMessageListModel id='errors'--> + <SwingValidatorMessageListModel id='errors' + onContentsChanged='ok.setEnabled(errors.isEmpty())'/> - <!-- validators --> - <BeanValidator id='validator' bean='model1' uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI"> - <field name="text"/> - <field name="text2"/> - <field name="ratio"/> - </BeanValidator> - <BeanValidator id='validator2' bean='model2' uiClass="jaxx.runtime.validator.swing.ui.IconValidationUI"> - <field name="text" component="_text"/> - <field name="text2" component="_text2"/> - <field name="ratio" component="_ratio"/> - </BeanValidator> - <BeanValidator id='validator3' autoField='true' bean='identity' - uiClass="jaxx.runtime.validator.swing.ui.TranslucentValidationUI"> - <field name="email" component="email2"/> - </BeanValidator> + <!-- validators --> + <BeanValidator id='validator' bean='model1' + uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI"> + <field name="text"/> + <field name="text2"/> + <field name="ratio"/> + </BeanValidator> + <BeanValidator id='validator2' bean='model2' + uiClass="jaxx.runtime.validator.swing.ui.IconValidationUI"> + <field name="text" component="_text"/> + <field name="text2" component="_text2"/> + <field name="ratio" component="_ratio"/> + </BeanValidator> + <BeanValidator id='validator3' autoField='true' bean='identity' + uiClass="jaxx.runtime.validator.swing.ui.TranslucentValidationUI"> + <field name="email" component="email2"/> + </BeanValidator> - <Table fill='both' id='demoPanel'> - <row> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Form")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JTextField id='text' text='{model1.getText()}' - _validatorLabel='{n_("form.text")}' - onKeyReleased='model1.setText(text.getText())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JTextField id='text2' text='{model1.getText2()}' - _validatorLabel='{n_("form.text2")}' - onKeyReleased='model1.setText2(text2.getText())'/> - </cell> - </row> + <Table fill='both'> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='text' text='{model1.getText()}' + _validatorLabel='{n_("form.text")}' + onKeyReleased='model1.setText(text.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='text2' text='{model1.getText2()}' + _validatorLabel='{n_("form.text2")}' + onKeyReleased='model1.setText2(text2.getText())'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JSlider id='ratio' minimum='0' maximum='100' - value='{model1.getRatio()}' - _validatorLabel='{n_("form.ratio")}' - onStateChanged='model1.setRatio(ratio.getValue())'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Model")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model1.getText()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model1.getText2()}'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='ratio' minimum='0' maximum='100' + value='{model1.getRatio()}' + _validatorLabel='{n_("form.ratio")}' + onStateChanged='model1.setRatio(ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText2()}'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JLabel text='{model1.getRatio()+""}'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> - <row> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Form2")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JTextField id='_text' text='{model2.getText()}' - _validatorLabel='{n_("form2.text")}' - onKeyReleased='model2.setText(_text.getText())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JTextField id='_text2' text='{model2.getText2()}' - _validatorLabel='{n_("form2.text2")}' - onKeyReleased='model2.setText2(_text2.getText())'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model1.getRatio()+""}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text' text='{model2.getText()}' + _validatorLabel='{n_("form2.text")}' + onKeyReleased='model2.setText(_text.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text2' text='{model2.getText2()}' + _validatorLabel='{n_("form2.text2")}' + onKeyReleased='model2.setText2(_text2.getText())'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JSlider id='_ratio' minimum='0' maximum='100' - value='{model2.getRatio()}' - _validatorLabel='{n_("form2.ratio")}' - onStateChanged='model2.setRatio(_ratio.getValue())'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Model2")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model2.getText()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model2.getText2()}'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='_ratio' minimum='0' maximum='100' + value='{model2.getRatio()}' + _validatorLabel='{n_("form2.ratio")}' + onStateChanged='model2.setRatio(_ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText2()}'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JLabel text='{model2.getRatio()+""}'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> - <row> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Identify Form")}' - layout='{new GridLayout()}' width='250' height='180'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='FirstName:'/> - </cell> - <cell weightx='1'> - <JTextField id='firstName' text='{identity.getFirstName()}' - onKeyReleased='identity.setFirstName(firstName.getText())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='LastName:'/> - </cell> - <cell weightx='1'> - <JTextField id='lastName' text='{identity.getLastName()}' - onKeyReleased='identity.setLastName(lastName.getText())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Email:'/> - </cell> - <cell weightx='1'> - <JTextField id='email2' text='{identity.getEmail()}' - onKeyReleased='identity.setEmail(email2.getText())'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model2.getRatio()+""}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identify Form")}' + layout='{new GridLayout()}' width='250' height='180'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JTextField id='firstName' text='{identity.getFirstName()}' + onKeyReleased='identity.setFirstName(firstName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JTextField id='lastName' text='{identity.getLastName()}' + onKeyReleased='identity.setLastName(lastName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JTextField id='email2' text='{identity.getEmail()}' + onKeyReleased='identity.setEmail(email2.getText())'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Age:'/> - </cell> - <cell> - <JSlider id='age' minimum='0' maximum='100' value='{identity.getAge()}' - onStateChanged='identity.setAge(age.getValue())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Config file :'/> - </cell> - <cell> - <JTextField id='config' text='{identity.getConfig()+""}' - onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Working directory:'/> - </cell> - <cell> - <JTextField id='dir' text='{identity.getDir()+""}' - onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Identity Model")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='FirstName:'/> - </cell> - <cell weightx='1'> - <JLabel text='{identity.getFirstName()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='LastName:'/> - </cell> - <cell weightx='1'> - <JLabel text='{identity.getLastName()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Email:'/> - </cell> - <cell weightx='1'> - <JLabel text='{identity.getEmail()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Age:'/> - </cell> - <cell> - <JLabel text='{identity.getAge()+""}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Config file:'/> - </cell> - <cell> - <JLabel text='{identity.getConfig()+""}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Directory file:'/> - </cell> - <cell> - <JLabel text='{identity.getDir()+""}'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> - <row> - <cell columns='2' fill="both"> - <JPanel border='{BorderFactory.createTitledBorder("Messages")}' layout='{new GridLayout()}' height='200' - width='500'> - <JScrollPane> - <JList id='errorList' model='{errors}' - cellRenderer='{new SwingValidatorMessageListRenderer()}'/> - </JScrollPane> - </JPanel> - </cell> - </row> - <row> - <cell columns='2' fill="both"> - <JPanel layout='{new GridLayout(1,2,0,0)}'> - <JButton id='cancel' text='cancel' - onActionPerformed='JOptionPane.showMessageDialog(this, cancel.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> - <JButton id='ok' text='valid' - onActionPerformed='JOptionPane.showMessageDialog(this, ok.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> - </JPanel> - </cell> - </row> - </Table> + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JSlider id='age' minimum='0' maximum='100' + value='{identity.getAge()}' + onStateChanged='identity.setAge(age.getValue())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file :'/> + </cell> + <cell> + <JTextField id='config' text='{identity.getConfig()+""}' + onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Working directory:'/> + </cell> + <cell> + <JTextField id='dir' text='{identity.getDir()+""}' + onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identity Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getFirstName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getLastName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getEmail()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JLabel text='{identity.getAge()+""}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file:'/> + </cell> + <cell> + <JLabel text='{identity.getConfig()+""}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Directory file:'/> + </cell> + <cell> + <JLabel text='{identity.getDir()+""}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel border='{BorderFactory.createTitledBorder("Messages")}' + layout='{new GridLayout()}' height='200' + width='500'> + <JScrollPane> + <JList id='errorList' model='{errors}' + cellRenderer='{new SwingValidatorMessageListRenderer()}'/> + </JScrollPane> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel layout='{new GridLayout(1,2,0,0)}'> + <JButton id='cancel' text='cancel' + onActionPerformed='JOptionPane.showMessageDialog(this, cancel.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + <JButton id='ok' text='valid' + onActionPerformed='JOptionPane.showMessageDialog(this, ok.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + </JPanel> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,9 +24,9 @@ --> <jaxx.demo.DemoPanel> - <style source="Validation.css"/> + <style source="Validation.css"/> - <script><![CDATA[ + <script><![CDATA[ import static org.nuiton.i18n.I18n.n_; import jaxx.demo.entities.*; import jaxx.runtime.validator.swing.SwingValidatorUtil; @@ -46,320 +46,326 @@ } ]]></script> - <!-- models --> - <Model id='model1'/> - <Model id='model2'/> - <Identity id='identity'/> + <!-- models --> + <Model id='model1'/> + <Model id='model2'/> + <Identity id='identity'/> - <!-- errors model --> - <SwingValidatorMessageTableModel id='errors2' - onTableChanged='ok.setEnabled(errors2.getRowCount()==0)'/> + <!-- errors model --> + <SwingValidatorMessageTableModel id='errors2' + onTableChanged='ok.setEnabled(errors2.getRowCount()==0)'/> - <!-- validators --> - <BeanValidator id='validator' bean='model1' uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI"> - <field name="text"/> - <field name="text2"/> - <field name="ratio"/> - </BeanValidator> - <BeanValidator id='validator2' bean='model2' uiClass="jaxx.runtime.validator.swing.ui.IconValidationUI"> - <field name="text" component="_text"/> - <field name="text2" component="_text2"/> - <field name="ratio" component="_ratio"/> - </BeanValidator> - <BeanValidator id='validator3' autoField='true' bean='identity' - uiClass="jaxx.runtime.validator.swing.ui.TranslucentValidationUI"> - <field name="email" component="email2"/> - </BeanValidator> - - <Table fill='both' id='demoPanel'> - <row> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Form")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JTextField id='text' text='{model1.getText()}' - onKeyReleased='model1.setText(text.getText())' - _validatorLabel='{n_("form.text")}' - /> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JTextField id='text2' text='{model1.getText2()}' - onKeyReleased='model1.setText2(text2.getText())' - _validatorLabel='{n_("form.text2")}' - /> - </cell> - </row> + <!-- validators --> + <BeanValidator id='validator' bean='model1' + uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI"> + <field name="text"/> + <field name="text2"/> + <field name="ratio"/> + </BeanValidator> + <BeanValidator id='validator2' bean='model2' + uiClass="jaxx.runtime.validator.swing.ui.IconValidationUI"> + <field name="text" component="_text"/> + <field name="text2" component="_text2"/> + <field name="ratio" component="_ratio"/> + </BeanValidator> + <BeanValidator id='validator3' autoField='true' bean='identity' + uiClass="jaxx.runtime.validator.swing.ui.TranslucentValidationUI"> + <field name="email" component="email2"/> + </BeanValidator> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JSlider id='ratio' minimum='0' maximum='100' - value='{model1.getRatio()}' - _validatorLabel='{n_("form.ratio")}' - onStateChanged='model1.setRatio(ratio.getValue())'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Model")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model1.getText()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model1.getText2()}'/> - </cell> - </row> + <Table fill='both'> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='text' text='{model1.getText()}' + onKeyReleased='model1.setText(text.getText())' + _validatorLabel='{n_("form.text")}' + /> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='text2' text='{model1.getText2()}' + onKeyReleased='model1.setText2(text2.getText())' + _validatorLabel='{n_("form.text2")}' + /> + </cell> + </row> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JLabel text='{model1.getRatio()+""}'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> - <row> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Form2")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JTextField id='_text' text='{model2.getText()}' - _validatorLabel='{n_("form2.text")}' - onKeyReleased='model2.setText(_text.getText())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JTextField id='_text2' text='{model2.getText2()}' - _validatorLabel='{n_("form2.text2")}' - onKeyReleased='model2.setText2(_text2.getText())'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='ratio' minimum='0' maximum='100' + value='{model1.getRatio()}' + _validatorLabel='{n_("form.ratio")}' + onStateChanged='model1.setRatio(ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText2()}'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JSlider id='_ratio' minimum='0' maximum='100' - value='{model2.getRatio()}' - _validatorLabel='{n_("form2.ratio")}' - onStateChanged='model2.setRatio(_ratio.getValue())'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Model2")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model2.getText()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Text2:'/> - </cell> - <cell weightx='1'> - <JLabel text='{model2.getText2()}'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model1.getRatio()+""}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text' text='{model2.getText()}' + _validatorLabel='{n_("form2.text")}' + onKeyReleased='model2.setText(_text.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text2' text='{model2.getText2()}' + _validatorLabel='{n_("form2.text2")}' + onKeyReleased='model2.setText2(_text2.getText())'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Ratio:'/> - </cell> - <cell> - <JLabel text='{model2.getRatio()+""}'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> - <row> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Identify Form")}' - layout='{new GridLayout()}' width='250' height='180'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='FirstName:'/> - </cell> - <cell weightx='1'> - <JTextField id='firstName' text='{identity.getFirstName()}' - onKeyReleased='identity.setFirstName(firstName.getText())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='LastName:'/> - </cell> - <cell weightx='1'> - <JTextField id='lastName' text='{identity.getLastName()}' - onKeyReleased='identity.setLastName(lastName.getText())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Email:'/> - </cell> - <cell weightx='1'> - <JTextField id='email2' text='{identity.getEmail()}' - onKeyReleased='identity.setEmail(email2.getText())'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='_ratio' minimum='0' maximum='100' + value='{model2.getRatio()}' + _validatorLabel='{n_("form2.ratio")}' + onStateChanged='model2.setRatio(_ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText2()}'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Age:'/> - </cell> - <cell> - <JSlider id='age' minimum='0' maximum='100' value='{identity.getAge()}' - onStateChanged='identity.setAge(age.getValue())'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Config file :'/> - </cell> - <cell> - <JTextField id='config' text='{identity.getConfig()+""}' - onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Working directory:'/> - </cell> - <cell> - <JTextField id='dir' text='{identity.getDir()+""}' - onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <JPanel border='{BorderFactory.createTitledBorder("Identity Model")}' - layout='{new GridLayout()}' width='250' height='120'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='FirstName:'/> - </cell> - <cell weightx='1'> - <JLabel text='{identity.getFirstName()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='LastName:'/> - </cell> - <cell weightx='1'> - <JLabel text='{identity.getLastName()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Email:'/> - </cell> - <cell weightx='1'> - <JLabel text='{identity.getEmail()}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Age:'/> - </cell> - <cell> - <JLabel text='{identity.getAge()+""}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Config file:'/> - </cell> - <cell> - <JLabel text='{identity.getConfig()+""}'/> - </cell> - </row> - <row> - <cell> - <JLabel text='Directory file:'/> - </cell> - <cell> - <JLabel text='{identity.getDir()+""}'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> - <row> - <cell columns='2' fill="both"> - <JPanel border='{BorderFactory.createTitledBorder("Messages")}' layout='{new GridLayout()}' height='200' - width='500'> - <JScrollPane columnHeaderView='{errorTable.getTableHeader()}'> - <JTable id='errorTable' model='{errors2}' rowSelectionAllowed='true' autoCreateRowSorter='true' - autoResizeMode='2' cellSelectionEnabled='false' selectionMode='0'/> - </JScrollPane> - </JPanel> - </cell> - </row> - <row> - <cell columns='2' fill="both"> - <JPanel layout='{new GridLayout(1,2,0,0)}'> - <JButton id='cancel' text='cancel' - onActionPerformed='JOptionPane.showMessageDialog(this, cancel.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> - <JButton id='ok' text='valid' - onActionPerformed='JOptionPane.showMessageDialog(this, ok.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> - </JPanel> - </cell> - </row> - </Table> + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model2.getRatio()+""}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identify Form")}' + layout='{new GridLayout()}' width='250' height='180'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JTextField id='firstName' text='{identity.getFirstName()}' + onKeyReleased='identity.setFirstName(firstName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JTextField id='lastName' text='{identity.getLastName()}' + onKeyReleased='identity.setLastName(lastName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JTextField id='email2' text='{identity.getEmail()}' + onKeyReleased='identity.setEmail(email2.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JSlider id='age' minimum='0' maximum='100' + value='{identity.getAge()}' + onStateChanged='identity.setAge(age.getValue())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file :'/> + </cell> + <cell> + <JTextField id='config' text='{identity.getConfig()+""}' + onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Working directory:'/> + </cell> + <cell> + <JTextField id='dir' text='{identity.getDir()+""}' + onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identity Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getFirstName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getLastName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getEmail()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JLabel text='{identity.getAge()+""}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file:'/> + </cell> + <cell> + <JLabel text='{identity.getConfig()+""}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Directory file:'/> + </cell> + <cell> + <JLabel text='{identity.getDir()+""}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel border='{BorderFactory.createTitledBorder("Messages")}' + layout='{new GridLayout()}' height='200' + width='500'> + <JScrollPane columnHeaderView='{errorTable.getTableHeader()}'> + <JTable id='errorTable' model='{errors2}' rowSelectionAllowed='true' + autoCreateRowSorter='true' + autoResizeMode='2' cellSelectionEnabled='false' + selectionMode='0'/> + </JScrollPane> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel layout='{new GridLayout(1,2,0,0)}'> + <JButton id='cancel' text='cancel' + onActionPerformed='JOptionPane.showMessageDialog(this, cancel.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + <JButton id='ok' text='valid' + onActionPerformed='JOptionPane.showMessageDialog(this, ok.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + </JPanel> + </cell> + </row> + </Table> + </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,8 +24,8 @@ --> <jaxx.demo.DemoPanel> - <!--<style source='CalculatorDemo.css'/>--> - <script><![CDATA[ + <!--<style source='CalculatorDemo.css'/>--> + <script><![CDATA[ plus.setText("+"); sign.setText("+/-"); @@ -34,87 +34,106 @@ return new String[]{ getDefaultSource(), "CalculatorDemo.css", "CalculatorEngine.java" }; } ]]> - </script> - <!-- use fully-qualified name just in case this is compiled into a different package --> - <CalculatorEngine id='engine'/> + </script> + <!-- use fully-qualified name just in case this is compiled into a different package --> + <CalculatorEngine id='engine'/> - <Table id='demoPanel' fill='both'> - <row> - <cell columns='4'> - <JLabel id='display' text='{engine.getDisplayText()}'/> - </cell> - </row> + <Table fill='both'> + <row> + <cell columns='4'> + <JLabel id='display' text='{engine.getDisplayText()}'/> + </cell> + </row> - <row> - <cell columns='2'> - <JButton id='c' text='C' onActionPerformed='engine.clear()' styleClass='clear'/> - </cell> - <cell> - <JButton id='ce' text='CE' onActionPerformed='engine.clearEntry()' styleClass='clear'/> - </cell> - <cell> - <JButton id='equals' text='=' onActionPerformed='engine.equal()' styleClass='operator'/> - </cell> - </row> + <row> + <cell columns='2'> + <JButton id='c' text='C' onActionPerformed='engine.clear()' + styleClass='clear'/> + </cell> + <cell> + <JButton id='ce' text='CE' onActionPerformed='engine.clearEntry()' + styleClass='clear'/> + </cell> + <cell> + <JButton id='equals' text='=' onActionPerformed='engine.equal()' + styleClass='operator'/> + </cell> + </row> - <row> - <cell> - <JButton id='d7' text='7' onActionPerformed='engine.digit(7)' styleClass='digit'/> - </cell> - <cell> - <JButton id='d8' text='8' onActionPerformed='engine.digit(8)' styleClass='digit'/> - </cell> - <cell> - <JButton id='d9' text='9' onActionPerformed='engine.digit(9)' styleClass='digit'/> - </cell> - <cell> - <JButton id='plus' onActionPerformed='engine.add()' styleClass='operator'/> - </cell> - </row> + <row> + <cell> + <JButton id='d7' text='7' onActionPerformed='engine.digit(7)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='d8' text='8' onActionPerformed='engine.digit(8)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='d9' text='9' onActionPerformed='engine.digit(9)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='plus' onActionPerformed='engine.add()' + styleClass='operator'/> + </cell> + </row> - <row> - <cell> - <JButton id='d4' text='4' onActionPerformed='engine.digit(4)' styleClass='digit'/> - </cell> - <cell> - <JButton id='d5' text='5' onActionPerformed='engine.digit(5)' styleClass='digit'/> - </cell> - <cell> - <JButton id='d6' text='6' onActionPerformed='engine.digit(6)' styleClass='digit'/> - </cell> - <cell> - <JButton id='subtract' text='-' onActionPerformed='engine.subtract()' styleClass='operator'/> - </cell> - </row> + <row> + <cell> + <JButton id='d4' text='4' onActionPerformed='engine.digit(4)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='d5' text='5' onActionPerformed='engine.digit(5)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='d6' text='6' onActionPerformed='engine.digit(6)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='subtract' text='-' onActionPerformed='engine.subtract()' + styleClass='operator'/> + </cell> + </row> - <row> - <cell> - <JButton id='d1' text='1' onActionPerformed='engine.digit(1)' styleClass='digit'/> - </cell> - <cell> - <JButton id='d2' text='2' onActionPerformed='engine.digit(2)' styleClass='digit'/> - </cell> - <cell> - <JButton id='d3' text='3' onActionPerformed='engine.digit(3)' styleClass='digit'/> - </cell> - <cell> - <JButton id='multiply' text='x' onActionPerformed='engine.multiply()' styleClass='operator'/> - </cell> - </row> + <row> + <cell> + <JButton id='d1' text='1' onActionPerformed='engine.digit(1)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='d2' text='2' onActionPerformed='engine.digit(2)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='d3' text='3' onActionPerformed='engine.digit(3)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='multiply' text='x' onActionPerformed='engine.multiply()' + styleClass='operator'/> + </cell> + </row> - <row> - <cell> - <JButton id='d0' text='0' onActionPerformed='engine.digit(0)' styleClass='digit'/> - </cell> - <cell> - <JButton id='sign' onActionPerformed='engine.toggleSign()' styleClass='operator'/> - </cell> - <cell> - <JButton id='dot' text='.' onActionPerformed='engine.dot()' styleClass='digit'/> - </cell> - <cell> - <JButton id='divide' text='÷' onActionPerformed='engine.divide()' styleClass='operator'/> - </cell> - </row> - </Table> + <row> + <cell> + <JButton id='d0' text='0' onActionPerformed='engine.digit(0)' + styleClass='digit'/> + </cell> + <cell> + <JButton id='sign' onActionPerformed='engine.toggleSign()' + styleClass='operator'/> + </cell> + <cell> + <JButton id='dot' text='.' onActionPerformed='engine.dot()' + styleClass='digit'/> + </cell> + <cell> + <JButton id='divide' text='÷' onActionPerformed='engine.divide()' + styleClass='operator'/> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -25,22 +25,31 @@ package jaxx.demo.fun; -import java.beans.*; -import java.math.*; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.math.BigDecimal; public class CalculatorEngine { public static final String DISPLAY_TEXT_PROPERTY = "displayText"; public static final int ADD = 0; + public static final int SUBTRACT = 1; + public static final int MULTIPLY = 2; + public static final int DIVIDE = 3; + public static final int RESULT = 4; private int operation = -1; + private boolean clear = true; // true to clear on next key + private String displayText = "0"; + private BigDecimal value; + private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,14 +24,11 @@ --> <jaxx.demo.DemoPanel> - <script>int count;</script> - <JPanel id='demoPanel'> - <JTextField text='{count+""}' constraints='BorderLayout.NORTH'/> - <HBox constraints='BorderLayout.SOUTH'> - <JButton text='Dec (-)' onActionPerformed='count--'/> - <JButton text='Reset' onActionPerformed='count = 0'/> - <JButton text='Inc (+)' onActionPerformed='count++'/> - </HBox> - </JPanel> - + <script>int count;</script> + <JTextField text='{count+""}' constraints='BorderLayout.NORTH'/> + <HBox constraints='BorderLayout.SOUTH'> + <JButton text='Dec (-)' onActionPerformed='count--'/> + <JButton text='Reset' onActionPerformed='count = 0'/> + <JButton text='Inc (+)' onActionPerformed='count++'/> + </HBox> </jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx 2010-06-24 13:16:34 UTC (rev 1992) @@ -24,94 +24,104 @@ --> <jaxx.demo.DemoPanel> - <!--<style source="LabelStyleDemo.css"/>--> - <script><![CDATA[ + <!--<style source="LabelStyleDemo.css"/>--> + <script><![CDATA[ @Override protected String[] getSources() { return new String[]{ getDefaultSource(), "LabelStyleDemo.css" }; } ]]> - </script> - <Table id='demoPanel' anchor='north' fill='both'> - <row> - <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> - <Table anchor='west' fill='both'> - <row> - <cell> - <JLabel text='Text:'/> - </cell> - <cell weightx='1'> - <JTextField id='text' text='Data Binding'/> - </cell> - </row> + </script> + <Table id='demoPanel' anchor='north' fill='both'> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='text' text='Data Binding'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Red:'/> - </cell> - <cell> - <JSlider id='red' value='128' maximum='255' styleClass='color'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Red:'/> + </cell> + <cell> + <JSlider id='red' value='128' maximum='255' styleClass='color'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Green:'/> - </cell> - <cell> - <JSlider id='green' value='0' maximum='255' styleClass='color'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Green:'/> + </cell> + <cell> + <JSlider id='green' value='0' maximum='255' styleClass='color'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Blue:'/> - </cell> - <cell> - <JSlider id='blue' value='255' maximum='255' styleClass='color'/> - </cell> - </row> + <row> + <cell> + <JLabel text='Blue:'/> + </cell> + <cell> + <JSlider id='blue' value='255' maximum='255' styleClass='color'/> + </cell> + </row> - <row> - <cell> - <JLabel text='Size:'/> - </cell> - <cell> - <JSlider id='dummySize' value='36' minimum='6' maximum='60'/> - </cell> - </row> - - <row> - <cell columns='2' fill='both' weighty='1'> - <JPanel border='{BorderFactory.createTitledBorder("Preview")}' - height='90' - layout='{new BorderLayout()}'> - <VBox background='{(Color)( backgroundCheckbox.isSelected() ? backgroundColor.getSelectedValue() : null)}' - margin='0' - horizontalAlignment='center' - verticalAlignment='middle'> - <JLabel text='{text.getText()}' font-size='{dummySize.getValue()}' - foreground='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/> - </VBox> - </JPanel> - </cell> - </row> - </Table> + <row> + <cell> + <JLabel text='Size:'/> </cell> + <cell> + <JSlider id='dummySize' value='36' minimum='6' maximum='60'/> + </cell> + </row> - <cell> - <VBox spacing='0' border='{BorderFactory.createTitledBorder("Background")}'> - <JCheckBox id='backgroundCheckbox' text='Show Background'/> - <JRadioButton text='Red' buttonGroup='backgroundColor' value='{Color.RED}' selected='true'/> - <JRadioButton text='Orange' buttonGroup='backgroundColor' value='{Color.ORANGE}'/> - <JRadioButton text='Yellow' buttonGroup='backgroundColor' value='{Color.YELLOW}'/> - <JRadioButton text='Green' buttonGroup='backgroundColor' value='{Color.GREEN}'/> - <JRadioButton text='Cyan' buttonGroup='backgroundColor' value='{Color.CYAN}'/> - <JRadioButton text='Blue' buttonGroup='backgroundColor' value='{Color.BLUE}'/> - <JRadioButton text='Purple' buttonGroup='backgroundColor' value='{new Color(160, 30, 255)}'/> + <row> + <cell columns='2' fill='both' weighty='1'> + <JPanel border='{BorderFactory.createTitledBorder("Preview")}' + height='90' + layout='{new BorderLayout()}'> + <VBox + background='{(Color)( backgroundCheckbox.isSelected() ? backgroundColor.getSelectedValue() : null)}' + margin='0' + horizontalAlignment='center' + verticalAlignment='middle'> + <JLabel text='{text.getText()}' + font-size='{dummySize.getValue()}' + foreground='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/> </VBox> + </JPanel> </cell> - </row> - </Table> + </row> + </Table> + </cell> + + <cell> + <VBox spacing='0' + border='{BorderFactory.createTitledBorder("Background")}'> + <JCheckBox id='backgroundCheckbox' text='Show Background'/> + <JRadioButton text='Red' buttonGroup='backgroundColor' + value='{Color.RED}' selected='true'/> + <JRadioButton text='Orange' buttonGroup='backgroundColor' + value='{Color.ORANGE}'/> + <JRadioButton text='Yellow' buttonGroup='backgroundColor' + value='{Color.YELLOW}'/> + <JRadioButton text='Green' buttonGroup='backgroundColor' + value='{Color.GREEN}'/> + <JRadioButton text='Cyan' buttonGroup='backgroundColor' + value='{Color.CYAN}'/> + <JRadioButton text='Blue' buttonGroup='backgroundColor' + value='{Color.BLUE}'/> + <JRadioButton text='Purple' buttonGroup='backgroundColor' + value='{new Color(160, 30, 255)}'/> + </VBox> + </cell> + </row> + </Table> </jaxx.demo.DemoPanel> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -0,0 +1,107 @@ +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.demo.tree; + +import jaxx.demo.component.jaxx.tree.JaxxTreeDemoDataProvider; +import jaxx.runtime.swing.tree.AbstractJaxxTreeCellRenderer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.swing.JTree; +import java.awt.Component; + +import static org.nuiton.i18n.I18n._; + +/** + * @author sletellier <letellier@codelutin.com> + * @since 2.1 + */ +public class DemoCellRenderer extends AbstractJaxxTreeCellRenderer<DemoNode> { + + /** Logger */ + protected static final Log log = + LogFactory.getLog(DemoCellRenderer.class); + + + public DemoCellRenderer(DemoDataProvider provider) { + setDataProvider(provider); + } + + @Override + public JaxxTreeDemoDataProvider getDataProvider() { + return (JaxxTreeDemoDataProvider) super.getDataProvider(); + } + + @Override + protected String computeNodeText(DemoNode node) { + + if (node == null) { + return ""; + } + + + String toDecorate; + + String id = node.getId(); + + if (node.isStringNode()) { + + // String node + toDecorate = _(id); + } else { + + // Demo node + toDecorate = id; + } + + if (log.isDebugEnabled()) { + log.debug("Compute text for node " + node + + " (" + node.getInternalClass() + ") = " + toDecorate); + } + + return toDecorate; + } + + @Override + public Component getTreeCellRendererComponent(JTree tree, + Object value, + boolean sel, + boolean expanded, + boolean leaf, int row, + boolean hasFocus) { + + // get node + DemoNode node = (DemoNode) value; + + // get text for node + String text = getNodeText(node); + + // Render node + return super.getTreeCellRendererComponent(tree, text, sel, + expanded, leaf, + row, hasFocus); + } +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -0,0 +1,197 @@ +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.demo.tree; + +import jaxx.demo.component.jaxx.BoxedDecoratorDemo; +import jaxx.demo.component.jaxx.StatusMessagePanelDemo; +import jaxx.demo.component.jaxx.editor.ComboEditorDemo; +import jaxx.demo.component.jaxx.editor.I18nEditorDemo; +import jaxx.demo.component.jaxx.editor.NumberEditorDemo; +import jaxx.demo.component.jaxx.tree.JaxxTreeDemo; +import jaxx.demo.component.swing.HidorButtonDemo; +import jaxx.demo.component.swing.JButtonDemo; +import jaxx.demo.component.swing.JCheckBoxDemo; +import jaxx.demo.component.swing.JCheckBoxMenuItemDemo; +import jaxx.demo.component.swing.JComboBoxDemo; +import jaxx.demo.component.swing.JDialogDemo; +import jaxx.demo.component.swing.JListDemo; +import jaxx.demo.component.swing.JMenuItemDemo; +import jaxx.demo.component.swing.JPasswordFieldDemo; +import jaxx.demo.component.swing.JProgressBarDemo; +import jaxx.demo.component.swing.JRadioButtonDemo; +import jaxx.demo.component.swing.JRadioButtonMenuItemDemo; +import jaxx.demo.component.swing.JSliderDemo; +import jaxx.demo.component.swing.JSpinnerDemo; +import jaxx.demo.component.swing.JSplitPaneDemo; +import jaxx.demo.component.swing.JTextAreaDemo; +import jaxx.demo.component.swing.JTextFieldDemo; +import jaxx.demo.component.swing.JToggleButtonDemo; +import jaxx.demo.feature.databinding.BeanDataBindingDemo; +import jaxx.demo.feature.databinding.BindingExtremeDemo; +import jaxx.demo.feature.validation.ValidationListDemo; +import jaxx.demo.feature.validation.ValidationTableDemo; +import jaxx.demo.fun.CalculatorDemo; +import jaxx.demo.fun.CounterDemo; +import jaxx.demo.fun.LabelStyleDemo; +import jaxx.runtime.swing.tree.DataProvider; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.nuiton.i18n.I18n.n_; + +/** + * Data provider of the navigation tree. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.1 + */ +public class DemoDataProvider implements DataProvider { + + /** Logger */ + static private final Log log = LogFactory.getLog(DemoDataProvider.class); + + /** mapping of demo per package */ + protected Map<String, List<Object>> mapping; + + public DemoDataProvider() { + + mapping = new HashMap<String, List<Object>>(); + + log.info("for " + this); + + addMapping("jaxxdemo.tree", + n_("jaxxdemo.tree.component.swing"), + n_("jaxxdemo.tree.component.jaxx"), + n_("jaxxdemo.tree.feature"), + n_("jaxxdemo.tree.fun") + ); + + addMapping(n_("jaxxdemo.tree.component.swing"), + n_("jaxxdemo.tree.component.swing.buttons"), + n_("jaxxdemo.tree.component.swing.form"), + n_("jaxxdemo.tree.component.swing.layout"), + n_("jaxxdemo.tree.component.swing.menu"), + n_("jaxxdemo.tree.component.swing.window"), + JProgressBarDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.swing.buttons"), + JButtonDemo.class, + JCheckBoxDemo.class, + JRadioButtonDemo.class, + JToggleButtonDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.swing.form"), + n_("jaxxdemo.tree.component.swing.form.text"), + JComboBoxDemo.class, + JListDemo.class, + JSliderDemo.class, + JSpinnerDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.swing.form.text"), + JPasswordFieldDemo.class, + JTextFieldDemo.class, + JTextAreaDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.swing.layout"), + JSplitPaneDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.swing.menu"), + JMenuItemDemo.class, + JCheckBoxMenuItemDemo.class, + JRadioButtonMenuItemDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.swing.window"), + JDialogDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.jaxx"), + HidorButtonDemo.class, + n_("jaxxdemo.tree.component.jaxx.editor"), + n_("jaxxdemo.tree.component.jaxx.tree"), + StatusMessagePanelDemo.class, + BoxedDecoratorDemo.class + ); + + addMapping(n_("jaxxdemo.tree.component.jaxx.editor"), + NumberEditorDemo.class, + ComboEditorDemo.class, + I18nEditorDemo.class + ); + addMapping(n_("jaxxdemo.tree.component.jaxx.tree"), + JaxxTreeDemo.class + ); + + addMapping(n_("jaxxdemo.tree.feature"), + n_("jaxxdemo.tree.feature.databinding"), + n_("jaxxdemo.tree.feature.validation") + ); + + addMapping(n_("jaxxdemo.tree.feature.databinding"), + BindingExtremeDemo.class, + BeanDataBindingDemo.class + ); + + addMapping(n_("jaxxdemo.tree.feature.validation"), + ValidationListDemo.class, + ValidationTableDemo.class + ); + addMapping(n_("jaxxdemo.tree.fun"), + LabelStyleDemo.class, + CounterDemo.class, + CalculatorDemo.class + ); + } + + protected void addMapping(String packageName, Object... classes) { + List<Object> list = Arrays.asList(classes); + if (log.isInfoEnabled()) { + log.info("Adding mapping [" + packageName + "] : " + list); + } + mapping.put(packageName, list); + } + + @Override + public boolean isEnabled() { + return true; + } + + public List<Object> getImplementations(String packageName) { + return mapping.get(packageName); + } + + +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNode.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNode.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNode.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -0,0 +1,65 @@ +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.demo.tree; + +import jaxx.runtime.swing.tree.JaxxNode; + +/** + * Basic node of the demo. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.1 + */ +public class DemoNode extends JaxxNode<DemoNode> { + + private static final long serialVersionUID = 1L; + + public DemoNode(String id) { + super(String.class, id, null, DemoTreeHelper.getChildLoador(DemoNodeLoador.class)); + } + + @Override + public DemoNode getContainerNode() { + if (isStringNode()) { + // on est sur un noeud de type String, donc on regarde sur le parent + return this; + } + + // fallback (should never comme here since root is Stringnode) + if (isRoot()) { + // si on arrive sur le root, quelque chose ne va pas, + // on bloque par null, a defaut de declancher une exception + return null; + } + + // cas final : sur un noeud de donnee + classe interne de donnee + return getParent().getContainerNode(); + } + + public DemoNode(Class<?> internalClass) { + super(internalClass, internalClass.getSimpleName(), null, null); + } +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNode.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNodeLoador.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNodeLoador.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNodeLoador.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -0,0 +1,77 @@ +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.demo.tree; + +import jaxx.runtime.swing.tree.DataProvider; +import jaxx.runtime.swing.tree.JaxxNodeChildLoador; + +import java.util.List; + +/** + * @author tchemit <tchemit@codelutin.com> + * @since 2.1 + */ +public class DemoNodeLoador extends JaxxNodeChildLoador<Object, DemoNode> { + + private static final long serialVersionUID = 1L; + + public DemoNodeLoador() { + super(Object.class); + } + + @Override + public List<Object> getData(Class<?> parentClass, + String packageName, + DataProvider dataProvider) throws Exception { + + DemoDataProvider provider = (DemoDataProvider) dataProvider; + List<Object> implementations = provider.getImplementations(packageName); + return implementations; + } + + @Override + public DemoNode createNode(Object data) { + + DemoNode node = null; + + if (data instanceof String) { + // package node + node = new DemoNode((String) data); + } + + if (data instanceof Class<?>) { + // demo node + node = new DemoNode((Class<?>) data); + } + + if (node == null) { + throw new IllegalArgumentException("Data [" + data + "] can not be use to build a node"); + } + + + return node; + } +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNodeLoador.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoTreeHelper.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoTreeHelper.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoTreeHelper.java 2010-06-24 13:16:34 UTC (rev 1992) @@ -0,0 +1,61 @@ +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.demo.tree; + +import jaxx.runtime.swing.tree.JaxxTreeHelper; + +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeModel; + +/** + * @author sletellier <letellier@codelutin.com> + * @since 2.1 + */ +public class DemoTreeHelper extends JaxxTreeHelper<DemoNode> { + + public DemoTreeHelper(DemoDataProvider provider) { + setDataProvider(provider); + } + + @Override + public DemoDataProvider getDataProvider() { + return (DemoDataProvider) super.getDataProvider(); + } + + public TreeModel createTreeModel() { + + // Create root static node + DemoNode root = new DemoNode("jaxxdemo.tree"); + + // Create model + DefaultTreeModel model = createModel(root); + + // load all nodes of model + loadAllNodes(model, root, getDataProvider()); + + return model; + } +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoTreeHelper.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2010-06-24 13:16:34 UTC (rev 1992) @@ -207,8 +207,8 @@ jaxxdemo.tree.component.swing.menu=Menus jaxxdemo.tree.component.swing.window=windows jaxxdemo.tree.feature=Features -jaxxdemo.tree.features.databinding=Data Binding -jaxxdemo.tree.features.validation=Validation +jaxxdemo.tree.feature.databinding=Data Binding +jaxxdemo.tree.feature.validation=Validation jaxxdemo.tree.fun=Fun jaxxdemo.warning.nimbus.landf=Could not init nymbus look and feel, you need at leasr version 1.6u10 of java. jaxxdemo.warning.no.ui=No ui environnement detected Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2010-06-24 13:16:34 UTC (rev 1992) @@ -207,8 +207,8 @@ jaxxdemo.tree.component.swing.menu=Menus 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.feature.databinding=Data binding +jaxxdemo.tree.feature.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 Modified: trunk/jaxx-demo/src/main/resources/log4j.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/log4j.properties 2010-06-24 08:22:21 UTC (rev 1991) +++ trunk/jaxx-demo/src/main/resources/log4j.properties 2010-06-24 13:16:34 UTC (rev 1992) @@ -6,6 +6,8 @@ log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n log4j.logger.jaxx.demo=INFO +log4j.logger.jaxx.demo.tree=DEBUG +log4j.logger.jaxx.runtime.swing.tree=DEBUG #log4j.logger.jaxx.demo.component.jaxx.tree=DEBUG #log4j.logger.jaxx.demo.config.DemoConfig=DEBUG log4j.logger.jaxx.runtime.swing.editor.config=INFO